diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index d6028be81..6c0e12d8c 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb index ebe9e1c14..32869976f 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-kinetic-schemes.ipynb @@ -152,10 +152,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:24.854031Z", - "iopub.status.busy": "2024-08-05T09:19:24.853825Z", - "iopub.status.idle": "2024-08-05T09:19:25.664461Z", - "shell.execute_reply": "2024-08-05T09:19:25.663557Z" + "iopub.execute_input": "2024-08-05T13:00:05.207156Z", + "iopub.status.busy": "2024-08-05T13:00:05.206719Z", + "iopub.status.idle": "2024-08-05T13:00:05.998045Z", + "shell.execute_reply": "2024-08-05T13:00:05.997231Z" } }, "outputs": [], @@ -169,10 +169,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.667784Z", - "iopub.status.busy": "2024-08-05T09:19:25.667535Z", - "iopub.status.idle": "2024-08-05T09:19:25.698328Z", - "shell.execute_reply": "2024-08-05T09:19:25.697660Z" + "iopub.execute_input": "2024-08-05T13:00:06.001197Z", + "iopub.status.busy": "2024-08-05T13:00:06.000937Z", + "iopub.status.idle": "2024-08-05T13:00:06.030689Z", + "shell.execute_reply": "2024-08-05T13:00:06.030071Z" } }, "outputs": [], @@ -277,10 +277,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.701473Z", - "iopub.status.busy": "2024-08-05T09:19:25.701139Z", - "iopub.status.idle": "2024-08-05T09:19:25.706208Z", - "shell.execute_reply": "2024-08-05T09:19:25.705520Z" + "iopub.execute_input": "2024-08-05T13:00:06.033465Z", + "iopub.status.busy": "2024-08-05T13:00:06.033068Z", + "iopub.status.idle": "2024-08-05T13:00:06.037918Z", + "shell.execute_reply": "2024-08-05T13:00:06.037262Z" } }, "outputs": [ @@ -323,10 +323,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.738836Z", - "iopub.status.busy": "2024-08-05T09:19:25.738306Z", - "iopub.status.idle": "2024-08-05T09:19:25.742826Z", - "shell.execute_reply": "2024-08-05T09:19:25.742072Z" + "iopub.execute_input": "2024-08-05T13:00:06.068233Z", + "iopub.status.busy": "2024-08-05T13:00:06.067667Z", + "iopub.status.idle": "2024-08-05T13:00:06.071834Z", + "shell.execute_reply": "2024-08-05T13:00:06.071214Z" } }, "outputs": [ @@ -367,10 +367,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.745547Z", - "iopub.status.busy": "2024-08-05T09:19:25.745105Z", - "iopub.status.idle": "2024-08-05T09:19:25.749286Z", - "shell.execute_reply": "2024-08-05T09:19:25.748587Z" + "iopub.execute_input": "2024-08-05T13:00:06.074312Z", + "iopub.status.busy": "2024-08-05T13:00:06.073932Z", + "iopub.status.idle": "2024-08-05T13:00:06.077466Z", + "shell.execute_reply": "2024-08-05T13:00:06.076809Z" }, "scrolled": true }, @@ -412,10 +412,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.751821Z", - "iopub.status.busy": "2024-08-05T09:19:25.751393Z", - "iopub.status.idle": "2024-08-05T09:19:25.755554Z", - "shell.execute_reply": "2024-08-05T09:19:25.754848Z" + "iopub.execute_input": "2024-08-05T13:00:06.079992Z", + "iopub.status.busy": "2024-08-05T13:00:06.079615Z", + "iopub.status.idle": "2024-08-05T13:00:06.083269Z", + "shell.execute_reply": "2024-08-05T13:00:06.082610Z" }, "scrolled": true }, @@ -459,10 +459,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.758084Z", - "iopub.status.busy": "2024-08-05T09:19:25.757692Z", - "iopub.status.idle": "2024-08-05T09:19:25.762620Z", - "shell.execute_reply": "2024-08-05T09:19:25.761948Z" + "iopub.execute_input": "2024-08-05T13:00:06.085636Z", + "iopub.status.busy": "2024-08-05T13:00:06.085293Z", + "iopub.status.idle": "2024-08-05T13:00:06.089631Z", + "shell.execute_reply": "2024-08-05T13:00:06.088981Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb index 24cc8950d..fa4fa6b28 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-python-tutorial.ipynb @@ -30,10 +30,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:30.917463Z", - "iopub.status.busy": "2024-08-05T09:19:30.917267Z", - "iopub.status.idle": "2024-08-05T09:19:31.708403Z", - "shell.execute_reply": "2024-08-05T09:19:31.707646Z" + "iopub.execute_input": "2024-08-05T13:00:14.487341Z", + "iopub.status.busy": "2024-08-05T13:00:14.487142Z", + "iopub.status.idle": "2024-08-05T13:00:15.298221Z", + "shell.execute_reply": "2024-08-05T13:00:15.297480Z" } }, "outputs": [], @@ -63,10 +63,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.711418Z", - "iopub.status.busy": "2024-08-05T09:19:31.711208Z", - "iopub.status.idle": "2024-08-05T09:19:31.738887Z", - "shell.execute_reply": "2024-08-05T09:19:31.738200Z" + "iopub.execute_input": "2024-08-05T13:00:15.301364Z", + "iopub.status.busy": "2024-08-05T13:00:15.301141Z", + "iopub.status.idle": "2024-08-05T13:00:15.328742Z", + "shell.execute_reply": "2024-08-05T13:00:15.328119Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.741646Z", - "iopub.status.busy": "2024-08-05T09:19:31.741435Z", - "iopub.status.idle": "2024-08-05T09:19:31.745187Z", - "shell.execute_reply": "2024-08-05T09:19:31.744554Z" + "iopub.execute_input": "2024-08-05T13:00:15.331289Z", + "iopub.status.busy": "2024-08-05T13:00:15.331077Z", + "iopub.status.idle": "2024-08-05T13:00:15.334589Z", + "shell.execute_reply": "2024-08-05T13:00:15.333995Z" } }, "outputs": [], @@ -152,10 +152,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.747667Z", - "iopub.status.busy": "2024-08-05T09:19:31.747282Z", - "iopub.status.idle": "2024-08-05T09:19:31.751249Z", - "shell.execute_reply": "2024-08-05T09:19:31.750710Z" + "iopub.execute_input": "2024-08-05T13:00:15.336984Z", + "iopub.status.busy": "2024-08-05T13:00:15.336787Z", + "iopub.status.idle": "2024-08-05T13:00:15.340434Z", + "shell.execute_reply": "2024-08-05T13:00:15.339834Z" } }, "outputs": [], @@ -183,10 +183,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.753638Z", - "iopub.status.busy": "2024-08-05T09:19:31.753438Z", - "iopub.status.idle": "2024-08-05T09:19:31.757028Z", - "shell.execute_reply": "2024-08-05T09:19:31.756380Z" + "iopub.execute_input": "2024-08-05T13:00:15.342731Z", + "iopub.status.busy": "2024-08-05T13:00:15.342539Z", + "iopub.status.idle": "2024-08-05T13:00:15.346563Z", + "shell.execute_reply": "2024-08-05T13:00:15.345829Z" } }, "outputs": [ @@ -235,10 +235,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.759477Z", - "iopub.status.busy": "2024-08-05T09:19:31.759267Z", - "iopub.status.idle": "2024-08-05T09:19:31.763225Z", - "shell.execute_reply": "2024-08-05T09:19:31.762696Z" + "iopub.execute_input": "2024-08-05T13:00:15.349102Z", + "iopub.status.busy": "2024-08-05T13:00:15.348729Z", + "iopub.status.idle": "2024-08-05T13:00:15.352622Z", + "shell.execute_reply": "2024-08-05T13:00:15.351985Z" } }, "outputs": [], @@ -260,10 +260,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.765583Z", - "iopub.status.busy": "2024-08-05T09:19:31.765208Z", - "iopub.status.idle": "2024-08-05T09:19:31.769169Z", - "shell.execute_reply": "2024-08-05T09:19:31.768513Z" + "iopub.execute_input": "2024-08-05T13:00:15.354937Z", + "iopub.status.busy": "2024-08-05T13:00:15.354599Z", + "iopub.status.idle": "2024-08-05T13:00:15.358158Z", + "shell.execute_reply": "2024-08-05T13:00:15.357542Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.771749Z", - "iopub.status.busy": "2024-08-05T09:19:31.771367Z", - "iopub.status.idle": "2024-08-05T09:19:31.778514Z", - "shell.execute_reply": "2024-08-05T09:19:31.777844Z" + "iopub.execute_input": "2024-08-05T13:00:15.360796Z", + "iopub.status.busy": "2024-08-05T13:00:15.360318Z", + "iopub.status.idle": "2024-08-05T13:00:15.367442Z", + "shell.execute_reply": "2024-08-05T13:00:15.366819Z" } }, "outputs": [ @@ -365,10 +365,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.781202Z", - "iopub.status.busy": "2024-08-05T09:19:31.780724Z", - "iopub.status.idle": "2024-08-05T09:19:31.785005Z", - "shell.execute_reply": "2024-08-05T09:19:31.784385Z" + "iopub.execute_input": "2024-08-05T13:00:15.370051Z", + "iopub.status.busy": "2024-08-05T13:00:15.369621Z", + "iopub.status.idle": "2024-08-05T13:00:15.373853Z", + "shell.execute_reply": "2024-08-05T13:00:15.373208Z" } }, "outputs": [ @@ -416,10 +416,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.787563Z", - "iopub.status.busy": "2024-08-05T09:19:31.787104Z", - "iopub.status.idle": "2024-08-05T09:19:31.790414Z", - "shell.execute_reply": "2024-08-05T09:19:31.789794Z" + "iopub.execute_input": "2024-08-05T13:00:15.376377Z", + "iopub.status.busy": "2024-08-05T13:00:15.375996Z", + "iopub.status.idle": "2024-08-05T13:00:15.379267Z", + "shell.execute_reply": "2024-08-05T13:00:15.378630Z" } }, "outputs": [], @@ -441,10 +441,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.793044Z", - "iopub.status.busy": "2024-08-05T09:19:31.792647Z", - "iopub.status.idle": "2024-08-05T09:19:31.796750Z", - "shell.execute_reply": "2024-08-05T09:19:31.796120Z" + "iopub.execute_input": "2024-08-05T13:00:15.381504Z", + "iopub.status.busy": "2024-08-05T13:00:15.381311Z", + "iopub.status.idle": "2024-08-05T13:00:15.385236Z", + "shell.execute_reply": "2024-08-05T13:00:15.384551Z" } }, "outputs": [ @@ -510,10 +510,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.799301Z", - "iopub.status.busy": "2024-08-05T09:19:31.798859Z", - "iopub.status.idle": "2024-08-05T09:19:31.802217Z", - "shell.execute_reply": "2024-08-05T09:19:31.801590Z" + "iopub.execute_input": "2024-08-05T13:00:15.387895Z", + "iopub.status.busy": "2024-08-05T13:00:15.387348Z", + "iopub.status.idle": "2024-08-05T13:00:15.390860Z", + "shell.execute_reply": "2024-08-05T13:00:15.390195Z" } }, "outputs": [ @@ -548,10 +548,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.804676Z", - "iopub.status.busy": "2024-08-05T09:19:31.804296Z", - "iopub.status.idle": "2024-08-05T09:19:31.807879Z", - "shell.execute_reply": "2024-08-05T09:19:31.807222Z" + "iopub.execute_input": "2024-08-05T13:00:15.393439Z", + "iopub.status.busy": "2024-08-05T13:00:15.392982Z", + "iopub.status.idle": "2024-08-05T13:00:15.396756Z", + "shell.execute_reply": "2024-08-05T13:00:15.396096Z" } }, "outputs": [ @@ -584,10 +584,10 @@ "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.810336Z", - "iopub.status.busy": "2024-08-05T09:19:31.809964Z", - "iopub.status.idle": "2024-08-05T09:19:31.813798Z", - "shell.execute_reply": "2024-08-05T09:19:31.813141Z" + "iopub.execute_input": "2024-08-05T13:00:15.399205Z", + "iopub.status.busy": "2024-08-05T13:00:15.398835Z", + "iopub.status.idle": "2024-08-05T13:00:15.402355Z", + "shell.execute_reply": "2024-08-05T13:00:15.401708Z" } }, "outputs": [ @@ -622,10 +622,10 @@ "execution_count": 15, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.816274Z", - "iopub.status.busy": "2024-08-05T09:19:31.815904Z", - "iopub.status.idle": "2024-08-05T09:19:31.820176Z", - "shell.execute_reply": "2024-08-05T09:19:31.819511Z" + "iopub.execute_input": "2024-08-05T13:00:15.404813Z", + "iopub.status.busy": "2024-08-05T13:00:15.404433Z", + "iopub.status.idle": "2024-08-05T13:00:15.408690Z", + "shell.execute_reply": "2024-08-05T13:00:15.408022Z" } }, "outputs": [ @@ -669,10 +669,10 @@ "execution_count": 16, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.822760Z", - "iopub.status.busy": "2024-08-05T09:19:31.822364Z", - "iopub.status.idle": "2024-08-05T09:19:31.827686Z", - "shell.execute_reply": "2024-08-05T09:19:31.827014Z" + "iopub.execute_input": "2024-08-05T13:00:15.411106Z", + "iopub.status.busy": "2024-08-05T13:00:15.410729Z", + "iopub.status.idle": "2024-08-05T13:00:15.416191Z", + "shell.execute_reply": "2024-08-05T13:00:15.415515Z" } }, "outputs": [ @@ -733,10 +733,10 @@ "execution_count": 17, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.830165Z", - "iopub.status.busy": "2024-08-05T09:19:31.829804Z", - "iopub.status.idle": "2024-08-05T09:19:31.833290Z", - "shell.execute_reply": "2024-08-05T09:19:31.832717Z" + "iopub.execute_input": "2024-08-05T13:00:15.418685Z", + "iopub.status.busy": "2024-08-05T13:00:15.418209Z", + "iopub.status.idle": "2024-08-05T13:00:15.421811Z", + "shell.execute_reply": "2024-08-05T13:00:15.421187Z" } }, "outputs": [], @@ -761,10 +761,10 @@ "execution_count": 18, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.835773Z", - "iopub.status.busy": "2024-08-05T09:19:31.835400Z", - "iopub.status.idle": "2024-08-05T09:19:31.845296Z", - "shell.execute_reply": "2024-08-05T09:19:31.844728Z" + "iopub.execute_input": "2024-08-05T13:00:15.424371Z", + "iopub.status.busy": "2024-08-05T13:00:15.423878Z", + "iopub.status.idle": "2024-08-05T13:00:15.433825Z", + "shell.execute_reply": "2024-08-05T13:00:15.433167Z" } }, "outputs": [], @@ -857,10 +857,10 @@ "execution_count": 19, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.847748Z", - "iopub.status.busy": "2024-08-05T09:19:31.847373Z", - "iopub.status.idle": "2024-08-05T09:19:31.851034Z", - "shell.execute_reply": "2024-08-05T09:19:31.850359Z" + "iopub.execute_input": "2024-08-05T13:00:15.436178Z", + "iopub.status.busy": "2024-08-05T13:00:15.435790Z", + "iopub.status.idle": "2024-08-05T13:00:15.439606Z", + "shell.execute_reply": "2024-08-05T13:00:15.438881Z" } }, "outputs": [ @@ -897,10 +897,10 @@ "execution_count": 20, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.853476Z", - "iopub.status.busy": "2024-08-05T09:19:31.853120Z", - "iopub.status.idle": "2024-08-05T09:19:31.858668Z", - "shell.execute_reply": "2024-08-05T09:19:31.858023Z" + "iopub.execute_input": "2024-08-05T13:00:15.443857Z", + "iopub.status.busy": "2024-08-05T13:00:15.443365Z", + "iopub.status.idle": "2024-08-05T13:00:15.450980Z", + "shell.execute_reply": "2024-08-05T13:00:15.450310Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb index 8455efb98..e537d8ab6 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-conductance.ipynb @@ -86,10 +86,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:34.408897Z", - "iopub.status.busy": "2024-08-05T09:19:34.408323Z", - "iopub.status.idle": "2024-08-05T09:19:35.221263Z", - "shell.execute_reply": "2024-08-05T09:19:35.220525Z" + "iopub.execute_input": "2024-08-05T13:00:17.732429Z", + "iopub.status.busy": "2024-08-05T13:00:17.731865Z", + "iopub.status.idle": "2024-08-05T13:00:18.516407Z", + "shell.execute_reply": "2024-08-05T13:00:18.515514Z" } }, "outputs": [], @@ -103,10 +103,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.224606Z", - "iopub.status.busy": "2024-08-05T09:19:35.224076Z", - "iopub.status.idle": "2024-08-05T09:19:35.254587Z", - "shell.execute_reply": "2024-08-05T09:19:35.253917Z" + "iopub.execute_input": "2024-08-05T13:00:18.520023Z", + "iopub.status.busy": "2024-08-05T13:00:18.519534Z", + "iopub.status.idle": "2024-08-05T13:00:18.548622Z", + "shell.execute_reply": "2024-08-05T13:00:18.548004Z" } }, "outputs": [], @@ -149,10 +149,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.257869Z", - "iopub.status.busy": "2024-08-05T09:19:35.257411Z", - "iopub.status.idle": "2024-08-05T09:19:35.536999Z", - "shell.execute_reply": "2024-08-05T09:19:35.536228Z" + "iopub.execute_input": "2024-08-05T13:00:18.551383Z", + "iopub.status.busy": "2024-08-05T13:00:18.551051Z", + "iopub.status.idle": "2024-08-05T13:00:18.818114Z", + "shell.execute_reply": "2024-08-05T13:00:18.817415Z" } }, "outputs": [ @@ -196,10 +196,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.539853Z", - "iopub.status.busy": "2024-08-05T09:19:35.539373Z", - "iopub.status.idle": "2024-08-05T09:19:35.676095Z", - "shell.execute_reply": "2024-08-05T09:19:35.675338Z" + "iopub.execute_input": "2024-08-05T13:00:18.820743Z", + "iopub.status.busy": "2024-08-05T13:00:18.820494Z", + "iopub.status.idle": "2024-08-05T13:00:18.948186Z", + "shell.execute_reply": "2024-08-05T13:00:18.947520Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.679025Z", - "iopub.status.busy": "2024-08-05T09:19:35.678577Z", - "iopub.status.idle": "2024-08-05T09:19:35.687471Z", - "shell.execute_reply": "2024-08-05T09:19:35.686804Z" + "iopub.execute_input": "2024-08-05T13:00:18.950670Z", + "iopub.status.busy": "2024-08-05T13:00:18.950464Z", + "iopub.status.idle": "2024-08-05T13:00:18.958371Z", + "shell.execute_reply": "2024-08-05T13:00:18.957726Z" } }, "outputs": [ @@ -290,10 +290,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.690070Z", - "iopub.status.busy": "2024-08-05T09:19:35.689656Z", - "iopub.status.idle": "2024-08-05T09:19:35.707917Z", - "shell.execute_reply": "2024-08-05T09:19:35.707186Z" + "iopub.execute_input": "2024-08-05T13:00:18.960878Z", + "iopub.status.busy": "2024-08-05T13:00:18.960411Z", + "iopub.status.idle": "2024-08-05T13:00:18.977638Z", + "shell.execute_reply": "2024-08-05T13:00:18.976978Z" } }, "outputs": [ @@ -337,10 +337,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.710653Z", - "iopub.status.busy": "2024-08-05T09:19:35.710283Z", - "iopub.status.idle": "2024-08-05T09:19:35.829542Z", - "shell.execute_reply": "2024-08-05T09:19:35.828878Z" + "iopub.execute_input": "2024-08-05T13:00:18.980144Z", + "iopub.status.busy": "2024-08-05T13:00:18.979921Z", + "iopub.status.idle": "2024-08-05T13:00:19.097696Z", + "shell.execute_reply": "2024-08-05T13:00:19.097006Z" } }, "outputs": [ @@ -400,10 +400,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.832468Z", - "iopub.status.busy": "2024-08-05T09:19:35.831927Z", - "iopub.status.idle": "2024-08-05T09:19:35.927721Z", - "shell.execute_reply": "2024-08-05T09:19:35.927002Z" + "iopub.execute_input": "2024-08-05T13:00:19.100317Z", + "iopub.status.busy": "2024-08-05T13:00:19.100085Z", + "iopub.status.idle": "2024-08-05T13:00:19.197073Z", + "shell.execute_reply": "2024-08-05T13:00:19.196420Z" } }, "outputs": [ @@ -456,10 +456,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.930541Z", - "iopub.status.busy": "2024-08-05T09:19:35.930115Z", - "iopub.status.idle": "2024-08-05T09:19:36.005078Z", - "shell.execute_reply": "2024-08-05T09:19:36.004472Z" + "iopub.execute_input": "2024-08-05T13:00:19.199593Z", + "iopub.status.busy": "2024-08-05T13:00:19.199386Z", + "iopub.status.idle": "2024-08-05T13:00:19.272768Z", + "shell.execute_reply": "2024-08-05T13:00:19.272196Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb index 008a858d2..e121d6a4b 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-cnexp.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:37.761250Z", - "iopub.status.busy": "2024-08-05T09:19:37.761039Z", - "iopub.status.idle": "2024-08-05T09:19:38.578177Z", - "shell.execute_reply": "2024-08-05T09:19:38.577429Z" + "iopub.execute_input": "2024-08-05T13:00:21.030329Z", + "iopub.status.busy": "2024-08-05T13:00:21.030121Z", + "iopub.status.idle": "2024-08-05T13:00:21.816269Z", + "shell.execute_reply": "2024-08-05T13:00:21.815448Z" } }, "outputs": [], @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:38.581282Z", - "iopub.status.busy": "2024-08-05T09:19:38.581062Z", - "iopub.status.idle": "2024-08-05T09:19:38.612569Z", - "shell.execute_reply": "2024-08-05T09:19:38.611770Z" + "iopub.execute_input": "2024-08-05T13:00:21.819446Z", + "iopub.status.busy": "2024-08-05T13:00:21.818998Z", + "iopub.status.idle": "2024-08-05T13:00:21.849421Z", + "shell.execute_reply": "2024-08-05T13:00:21.848813Z" } }, "outputs": [], @@ -123,10 +123,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:38.615893Z", - "iopub.status.busy": "2024-08-05T09:19:38.615383Z", - "iopub.status.idle": "2024-08-05T09:19:39.040748Z", - "shell.execute_reply": "2024-08-05T09:19:39.040056Z" + "iopub.execute_input": "2024-08-05T13:00:21.852405Z", + "iopub.status.busy": "2024-08-05T13:00:21.852007Z", + "iopub.status.idle": "2024-08-05T13:00:22.268695Z", + "shell.execute_reply": "2024-08-05T13:00:22.267930Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.043694Z", - "iopub.status.busy": "2024-08-05T09:19:39.043240Z", - "iopub.status.idle": "2024-08-05T09:19:39.156181Z", - "shell.execute_reply": "2024-08-05T09:19:39.155532Z" + "iopub.execute_input": "2024-08-05T13:00:22.271479Z", + "iopub.status.busy": "2024-08-05T13:00:22.271027Z", + "iopub.status.idle": "2024-08-05T13:00:22.381942Z", + "shell.execute_reply": "2024-08-05T13:00:22.381287Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.159015Z", - "iopub.status.busy": "2024-08-05T09:19:39.158543Z", - "iopub.status.idle": "2024-08-05T09:19:39.364077Z", - "shell.execute_reply": "2024-08-05T09:19:39.363312Z" + "iopub.execute_input": "2024-08-05T13:00:22.384666Z", + "iopub.status.busy": "2024-08-05T13:00:22.384261Z", + "iopub.status.idle": "2024-08-05T13:00:22.581630Z", + "shell.execute_reply": "2024-08-05T13:00:22.581015Z" } }, "outputs": [ @@ -255,10 +255,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.367226Z", - "iopub.status.busy": "2024-08-05T09:19:39.366787Z", - "iopub.status.idle": "2024-08-05T09:19:39.530219Z", - "shell.execute_reply": "2024-08-05T09:19:39.529605Z" + "iopub.execute_input": "2024-08-05T13:00:22.584204Z", + "iopub.status.busy": "2024-08-05T13:00:22.584008Z", + "iopub.status.idle": "2024-08-05T13:00:22.741564Z", + "shell.execute_reply": "2024-08-05T13:00:22.740923Z" } }, "outputs": [ @@ -303,10 +303,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.533016Z", - "iopub.status.busy": "2024-08-05T09:19:39.532579Z", - "iopub.status.idle": "2024-08-05T09:19:41.315831Z", - "shell.execute_reply": "2024-08-05T09:19:41.315194Z" + "iopub.execute_input": "2024-08-05T13:00:22.743985Z", + "iopub.status.busy": "2024-08-05T13:00:22.743751Z", + "iopub.status.idle": "2024-08-05T13:00:24.479162Z", + "shell.execute_reply": "2024-08-05T13:00:24.478426Z" } }, "outputs": [ @@ -351,10 +351,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:41.318625Z", - "iopub.status.busy": "2024-08-05T09:19:41.318189Z", - "iopub.status.idle": "2024-08-05T09:19:43.603212Z", - "shell.execute_reply": "2024-08-05T09:19:43.602443Z" + "iopub.execute_input": "2024-08-05T13:00:24.482135Z", + "iopub.status.busy": "2024-08-05T13:00:24.481706Z", + "iopub.status.idle": "2024-08-05T13:00:26.705583Z", + "shell.execute_reply": "2024-08-05T13:00:26.704962Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb index fb4a0b5a7..5478db967 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-derivimplicit.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:45.286448Z", - "iopub.status.busy": "2024-08-05T09:19:45.286248Z", - "iopub.status.idle": "2024-08-05T09:19:46.091235Z", - "shell.execute_reply": "2024-08-05T09:19:46.090411Z" + "iopub.execute_input": "2024-08-05T13:00:28.305100Z", + "iopub.status.busy": "2024-08-05T13:00:28.304921Z", + "iopub.status.idle": "2024-08-05T13:00:29.088827Z", + "shell.execute_reply": "2024-08-05T13:00:29.087910Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:46.094598Z", - "iopub.status.busy": "2024-08-05T09:19:46.094132Z", - "iopub.status.idle": "2024-08-05T09:19:46.124082Z", - "shell.execute_reply": "2024-08-05T09:19:46.123429Z" + "iopub.execute_input": "2024-08-05T13:00:29.091946Z", + "iopub.status.busy": "2024-08-05T13:00:29.091718Z", + "iopub.status.idle": "2024-08-05T13:00:29.121288Z", + "shell.execute_reply": "2024-08-05T13:00:29.120676Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:46.127164Z", - "iopub.status.busy": "2024-08-05T09:19:46.126946Z", - "iopub.status.idle": "2024-08-05T09:19:46.602187Z", - "shell.execute_reply": "2024-08-05T09:19:46.601442Z" + "iopub.execute_input": "2024-08-05T13:00:29.124041Z", + "iopub.status.busy": "2024-08-05T13:00:29.123611Z", + "iopub.status.idle": "2024-08-05T13:00:29.578470Z", + "shell.execute_reply": "2024-08-05T13:00:29.577720Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:46.604907Z", - "iopub.status.busy": "2024-08-05T09:19:46.604598Z", - "iopub.status.idle": "2024-08-05T09:19:46.824549Z", - "shell.execute_reply": "2024-08-05T09:19:46.823808Z" + "iopub.execute_input": "2024-08-05T13:00:29.581294Z", + "iopub.status.busy": "2024-08-05T13:00:29.580732Z", + "iopub.status.idle": "2024-08-05T13:00:29.795330Z", + "shell.execute_reply": "2024-08-05T13:00:29.794753Z" } }, "outputs": [ diff --git a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb index d3f4b875c..54d620981 100644 --- a/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb +++ b/.doctrees/nbsphinx/notebooks/nmodl-sympy-solver-sparse.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:48.184794Z", - "iopub.status.busy": "2024-08-05T09:19:48.184608Z", - "iopub.status.idle": "2024-08-05T09:19:48.989321Z", - "shell.execute_reply": "2024-08-05T09:19:48.988497Z" + "iopub.execute_input": "2024-08-05T13:00:31.089995Z", + "iopub.status.busy": "2024-08-05T13:00:31.089800Z", + "iopub.status.idle": "2024-08-05T13:00:31.879477Z", + "shell.execute_reply": "2024-08-05T13:00:31.878674Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:48.992355Z", - "iopub.status.busy": "2024-08-05T09:19:48.992138Z", - "iopub.status.idle": "2024-08-05T09:19:49.022388Z", - "shell.execute_reply": "2024-08-05T09:19:49.021711Z" + "iopub.execute_input": "2024-08-05T13:00:31.882712Z", + "iopub.status.busy": "2024-08-05T13:00:31.882287Z", + "iopub.status.idle": "2024-08-05T13:00:31.912473Z", + "shell.execute_reply": "2024-08-05T13:00:31.911826Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:49.025536Z", - "iopub.status.busy": "2024-08-05T09:19:49.025302Z", - "iopub.status.idle": "2024-08-05T09:19:49.497323Z", - "shell.execute_reply": "2024-08-05T09:19:49.496568Z" + "iopub.execute_input": "2024-08-05T13:00:31.915393Z", + "iopub.status.busy": "2024-08-05T13:00:31.914998Z", + "iopub.status.idle": "2024-08-05T13:00:32.368165Z", + "shell.execute_reply": "2024-08-05T13:00:32.367377Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:49.499967Z", - "iopub.status.busy": "2024-08-05T09:19:49.499697Z", - "iopub.status.idle": "2024-08-05T09:19:49.720159Z", - "shell.execute_reply": "2024-08-05T09:19:49.719409Z" + "iopub.execute_input": "2024-08-05T13:00:32.370926Z", + "iopub.status.busy": "2024-08-05T13:00:32.370467Z", + "iopub.status.idle": "2024-08-05T13:00:32.585200Z", + "shell.execute_reply": "2024-08-05T13:00:32.584577Z" } }, "outputs": [ diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html index 9fa3514f4..867319993 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html @@ -204,7 +204,7 @@ print_fast_imem_calculation() overridenmodl::codegen::CodegenAccVisitorprotectedvirtual print_first_pointer_var_index_getter()nmodl::codegen::CodegenCoreneuronCppVisitorprotected print_first_random_var_index_getter()nmodl::codegen::CodegenCoreneuronCppVisitorprotected - print_function(const ast::FunctionBlock &node) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual + print_function(const ast::FunctionBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual print_function_declaration(const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={ CppObjectSpecifier::Inline})nmodl::codegen::CodegenCppVisitor print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual @@ -277,7 +277,7 @@ print_nrn_state() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual print_num_variable_getter()nmodl::codegen::CodegenCoreneuronCppVisitorprotected print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected - print_procedure(const ast::ProcedureBlock &node) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual + print_procedure(const ast::ProcedureBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_rhs_d_shadow_variables() overridenmodl::codegen::CodegenAccVisitorprotectedvirtual print_sdlists_init(bool print_initializers) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual print_send_event_move()nmodl::codegen::CodegenCoreneuronCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html index c4ea374f4..4795fa3ce 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html @@ -257,12 +257,6 @@ void print_function_procedure_helper (const ast::Block &node) override  Common helper function to help printing function or procedure blocks. More...
  -void print_procedure (const ast::ProcedureBlock &node) override - Print NMODL procedure in target backend code. More...
-  -void print_function (const ast::FunctionBlock &node) override - Print NMODL function in target backend code. More...
-  void print_function_tables (const ast::FunctionTableBlock &node)  Print NMODL function_table in target backend code. More...
  @@ -629,6 +623,12 @@ virtual void print_function_call (const ast::FunctionCall &node)  Print call to internal or external function. More...
  +void print_procedure (const ast::ProcedureBlock &node) + Print NMODL procedure in target backend code. More...
+  +void print_function (const ast::FunctionBlock &node) + Print NMODL function in target backend code. More...
+  void rename_function_arguments ()  Rename function/procedure arguments that conflict with default arguments. More...
  diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html index efe1c1192..e6bc99c7b 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html @@ -204,7 +204,7 @@ print_fast_imem_calculation() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual print_first_pointer_var_index_getter()nmodl::codegen::CodegenCoreneuronCppVisitorprotected print_first_random_var_index_getter()nmodl::codegen::CodegenCoreneuronCppVisitorprotected - print_function(const ast::FunctionBlock &node) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual + print_function(const ast::FunctionBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual print_function_declaration(const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={ CppObjectSpecifier::Inline})nmodl::codegen::CodegenCppVisitor print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual @@ -277,7 +277,7 @@ print_nrn_state() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual print_num_variable_getter()nmodl::codegen::CodegenCoreneuronCppVisitorprotected print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected - print_procedure(const ast::ProcedureBlock &node) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual + print_procedure(const ast::ProcedureBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_rhs_d_shadow_variables()nmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual print_sdlists_init(bool print_initializers) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual print_send_event_move()nmodl::codegen::CodegenCoreneuronCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html index b82933573..31c20fcfc 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html @@ -653,12 +653,6 @@ void print_function_procedure_helper (const ast::Block &node) override  Common helper function to help printing function or procedure blocks. More...
  -void print_procedure (const ast::ProcedureBlock &node) override - Print NMODL procedure in target backend code. More...
-  -void print_function (const ast::FunctionBlock &node) override - Print NMODL function in target backend code. More...
-  void print_function_tables (const ast::FunctionTableBlock &node)  Print NMODL function_table in target backend code. More...
  @@ -1037,6 +1031,12 @@ virtual void print_function_call (const ast::FunctionCall &node)  Print call to internal or external function. More...
  +void print_procedure (const ast::ProcedureBlock &node) + Print NMODL procedure in target backend code. More...
+  +void print_function (const ast::FunctionBlock &node) + Print NMODL function in target backend code. More...
+  void rename_function_arguments ()  Rename function/procedure arguments that conflict with default arguments. More...
  @@ -1288,7 +1288,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 517 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 492 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1320,7 +1320,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 503 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 478 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1378,7 +1378,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 664 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 639 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1513,7 +1513,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 553 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 528 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1552,7 +1552,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 558 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 533 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1603,7 +1603,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 841 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 816 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1634,7 +1634,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1063 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1038 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1671,7 +1671,7 @@

-

Definition at line 1670 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1645 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1721,7 +1721,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 895 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 870 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1771,7 +1771,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 885 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 860 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1829,7 +1829,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 859 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 834 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1861,7 +1861,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 528 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 503 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1894,7 +1894,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 536 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 511 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1962,7 +1962,7 @@

Returns
The target code string
-

Definition at line 2421 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2396 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2024,7 +2024,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 576 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 551 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2056,7 +2056,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 588 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 563 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2339,7 +2339,7 @@

Definition at line 1985 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1960 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2455,7 +2455,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3054 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3029 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2484,7 +2484,7 @@

Definition at line 2984 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2959 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2515,7 +2515,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3023 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2998 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2544,7 +2544,7 @@

Definition at line 979 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 954 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2582,7 +2582,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2995 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2970 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2651,7 +2651,7 @@

Todo:
Data is not derived.

Need to add instance into instance struct? data used here is wrong in AoS because as in original implementation, data is not incremented every iteration for AoS. May be better to derive actual variable names? [resolved now?] slist needs to added as local variable

-

Definition at line 2632 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2607 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2775,7 +2775,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2911 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2886 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2804,7 +2804,7 @@

Definition at line 710 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 685 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2833,45 +2833,7 @@

Definition at line 718 of file codegen_coreneuron_cpp_visitor.cpp.

- - - - -

◆ print_function()

- -
-
- - - - - -
- - - - - - - - -
void nmodl::codegen::CodegenCoreneuronCppVisitor::print_function (const ast::FunctionBlocknode)
-
-overrideprotectedvirtual
-
- -

Print NMODL function in target backend code.

-
Parameters
- - -
node
-
-
- -

Implements nmodl::codegen::CodegenCppVisitor.

- -

Definition at line 452 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 693 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3032,7 +2994,7 @@

Definition at line 472 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 447 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3063,7 +3025,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3014 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2989 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3092,7 +3054,7 @@

Definition at line 2426 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2401 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3141,7 +3103,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1859 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1834 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3203,7 +3165,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 1644 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1619 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3235,7 +3197,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1238 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1213 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3266,7 +3228,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2977 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2952 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3303,7 +3265,7 @@

Definition at line 1809 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1784 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3459,7 +3421,7 @@

Definition at line 1686 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1661 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3495,7 +3457,7 @@

Definition at line 1622 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1597 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3524,7 +3486,7 @@

Definition at line 1592 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1567 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3555,7 +3517,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1639 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1614 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3653,7 +3615,7 @@

Definition at line 750 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 725 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3695,7 +3657,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1091 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1066 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3733,7 +3695,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1550 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1525 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3773,7 +3735,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1345 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1320 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3802,7 +3764,7 @@

Definition at line 759 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 734 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3864,7 +3826,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 770 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 745 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3895,7 +3857,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 776 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 751 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3933,7 +3895,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2316 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2291 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3962,7 +3924,7 @@

Definition at line 2368 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2343 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4062,7 +4024,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2289 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2264 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4091,7 +4053,7 @@

Definition at line 2591 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2566 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4120,7 +4082,7 @@

Definition at line 739 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 714 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4156,7 +4118,7 @@

Definition at line 2447 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2422 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4203,7 +4165,7 @@

Definition at line 2206 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2181 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4232,7 +4194,7 @@

Definition at line 2532 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2507 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4261,7 +4223,7 @@

Definition at line 2435 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2410 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4290,7 +4252,7 @@

Definition at line 2442 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2417 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4413,7 +4375,7 @@

Definition at line 2505 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2480 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4445,7 +4407,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 2493 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2468 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4477,7 +4439,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 2498 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2473 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4515,7 +4477,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2257 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2232 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4546,7 +4508,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 2721 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2696 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4577,7 +4539,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2063 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2038 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4608,7 +4570,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2039 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2014 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4639,7 +4601,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2940 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2915 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4678,7 +4640,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2804 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2779 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4716,7 +4678,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2875 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2850 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4810,7 +4772,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2841 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2816 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4849,7 +4811,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2786 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2761 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4880,7 +4842,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2051 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2026 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4916,7 +4878,7 @@

Definition at line 1910 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1885 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4948,7 +4910,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2731 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2706 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4977,45 +4939,7 @@

Definition at line 726 of file codegen_coreneuron_cpp_visitor.cpp.

- - - - -

◆ print_procedure()

- -
-
- - - - - -
- - - - - - - - -
void nmodl::codegen::CodegenCoreneuronCppVisitor::print_procedure (const ast::ProcedureBlocknode)
-
-overrideprotectedvirtual
-
- -

Print NMODL procedure in target backend code.

-
Parameters
- - -
node
-
-
- -

Implements nmodl::codegen::CodegenCppVisitor.

- -

Definition at line 447 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 701 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5076,7 +5000,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1012 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 987 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5105,7 +5029,7 @@

Definition at line 2400 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2375 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5134,7 +5058,7 @@

Definition at line 1649 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1624 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5165,7 +5089,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 968 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 943 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5200,7 +5124,7 @@

Definition at line 792 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 767 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5229,7 +5153,7 @@

Definition at line 1487 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1462 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5289,7 +5213,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3002 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2977 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5321,7 +5245,7 @@

Todo:
Similar to neuron/coreneuron we are using first watch and ignoring rest.
-

Definition at line 2076 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2051 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5352,7 +5276,7 @@

Todo:
Similar to print_watch_activate, we are using only first watch.

need to verify with neuron/coreneuron about rest.

-

Definition at line 2124 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2099 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5393,7 +5317,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 626 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 601 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5462,7 +5386,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 645 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 620 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5501,7 +5425,7 @@

Returns
The possibly replace variable name

if function is defined the same mod file then the arguments must contain mechanism instance as well.

-

Definition at line 597 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 572 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5564,7 +5488,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3085 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3060 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5596,7 +5520,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3093 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3068 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5628,7 +5552,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3131 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3106 of file codegen_coreneuron_cpp_visitor.cpp.

diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js index 4457639a8..25947e3c3 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js @@ -44,7 +44,6 @@ var classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor = [ "print_fast_imem_calculation", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c", null ], [ "print_first_pointer_var_index_getter", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e", null ], [ "print_first_random_var_index_getter", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8", null ], - [ "print_function", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7", null ], [ "print_function_or_procedure", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab530015ada1f6f6299b526a32e277a0c", null ], [ "print_function_procedure_helper", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5be32556e7bb7fd48b1bdb71d75fe5bb", null ], [ "print_function_prototypes", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4dd6948c9064a446dc45cf6f4d463975", null ], @@ -108,7 +107,6 @@ var classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor = [ "print_nrn_init", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2998645f8c5bf76da0389299d033afe0", null ], [ "print_nrn_state", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a38c76390b1d1c0a5cf1fe8df3f27fb57", null ], [ "print_num_variable_getter", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e", null ], - [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8", null ], [ "print_rhs_d_shadow_variables", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137", null ], [ "print_sdlists_init", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42", null ], [ "print_send_event_move", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6", null ], diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html index bf7e40444..a2ac48db7 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html @@ -183,7 +183,7 @@ print_data_structures(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual print_eigen_linear_solver(const std::string &float_type, int N)nmodl::codegen::CodegenCppVisitorprotected print_fast_imem_calculation()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual - print_function(const ast::FunctionBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual + print_function(const ast::FunctionBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual print_function_declaration(const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={ CppObjectSpecifier::Inline})nmodl::codegen::CodegenCppVisitor print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual @@ -218,7 +218,7 @@ print_nrn_destructor()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual print_nrn_state()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected - print_procedure(const ast::ProcedureBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual + print_procedure(const ast::ProcedureBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_sdlists_init(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual print_standard_includes()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)nmodl::codegen::CodegenCppVisitorprotected diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html index 7c054d5b5..f9b6faf7d 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html @@ -703,12 +703,12 @@ virtual void print_function_procedure_helper (const ast::Block &node)=0  Common helper function to help printing function or procedure blocks. More...
  -virtual void print_procedure (const ast::ProcedureBlock &node)=0 - Print NMODL procedure in target backend code. More...
-  -virtual void print_function (const ast::FunctionBlock &node)=0 - Print NMODL function in target backend code. More...
-  +void print_procedure (const ast::ProcedureBlock &node) + Print NMODL procedure in target backend code. More...
+  +void print_function (const ast::FunctionBlock &node) + Print NMODL function in target backend code. More...
+  void rename_function_arguments ()  Rename function/procedure arguments that conflict with default arguments. More...
  @@ -1516,7 +1516,7 @@

Returns
return a tuple <true, array_length> if variable is an array otherwise <false, 0>
-

Definition at line 1622 of file codegen_cpp_visitor.cpp.

+

Definition at line 1647 of file codegen_cpp_visitor.cpp.

@@ -1544,7 +1544,7 @@

-

Definition at line 1364 of file codegen_cpp_visitor.cpp.

+

Definition at line 1389 of file codegen_cpp_visitor.cpp.

@@ -2014,7 +2014,7 @@

Returns
A vector of float variables
-

Definition at line 1161 of file codegen_cpp_visitor.cpp.

+

Definition at line 1186 of file codegen_cpp_visitor.cpp.

@@ -2088,7 +2088,7 @@

Note
Variables for watch statements : there is one extra variable used in coreneuron compared to actual watch statements for compatibility with neuron (which uses one extra Datum variable)
-

Definition at line 1228 of file codegen_cpp_visitor.cpp.

+

Definition at line 1253 of file codegen_cpp_visitor.cpp.

@@ -2108,7 +2108,7 @@

-

Definition at line 1597 of file codegen_cpp_visitor.cpp.

+

Definition at line 1622 of file codegen_cpp_visitor.cpp.

@@ -2166,7 +2166,7 @@

-

Definition at line 1609 of file codegen_cpp_visitor.cpp.

+

Definition at line 1634 of file codegen_cpp_visitor.cpp.

@@ -2741,7 +2741,7 @@

Returns
True if operator() is const else False
-

Definition at line 611 of file codegen_cpp_visitor.cpp.

+

Definition at line 636 of file codegen_cpp_visitor.cpp.

@@ -3637,7 +3637,7 @@

Definition at line 720 of file codegen_cpp_visitor.cpp.

+

Definition at line 745 of file codegen_cpp_visitor.cpp.

@@ -3670,8 +3670,8 @@

-

◆ print_function()

+ +

◆ print_function()

@@ -3893,7 +3893,7 @@

Definition at line 654 of file codegen_cpp_visitor.cpp.

+

Definition at line 679 of file codegen_cpp_visitor.cpp.

@@ -3922,7 +3922,7 @@

Definition at line 647 of file codegen_cpp_visitor.cpp.

+

Definition at line 672 of file codegen_cpp_visitor.cpp.

@@ -4206,7 +4206,7 @@

Definition at line 515 of file codegen_cpp_visitor.cpp.

+

Definition at line 540 of file codegen_cpp_visitor.cpp.

@@ -4471,7 +4471,7 @@

static const double PI = 3.14159;
static const double R = 8.3145;
-

Definition at line 766 of file codegen_cpp_visitor.cpp.

+

Definition at line 791 of file codegen_cpp_visitor.cpp.

@@ -4785,12 +4785,12 @@

Definition at line 508 of file codegen_cpp_visitor.cpp.

+

Definition at line 533 of file codegen_cpp_visitor.cpp.

- -

◆ print_procedure()

+ +

◆ print_procedure()

@@ -4934,7 +4934,7 @@

Definition at line 553 of file codegen_cpp_visitor.cpp.

+

Definition at line 578 of file codegen_cpp_visitor.cpp.

@@ -4962,7 +4962,7 @@

Definition at line 1502 of file codegen_cpp_visitor.cpp.

+

Definition at line 1527 of file codegen_cpp_visitor.cpp.

@@ -4990,7 +4990,7 @@

Definition at line 1393 of file codegen_cpp_visitor.cpp.

+

Definition at line 1418 of file codegen_cpp_visitor.cpp.

@@ -5236,7 +5236,7 @@

Todo:
Issue with verbatim renaming.

e.g. pattern.mod has info struct with index variable. If we use "index" instead of "indexes" as default argument then during verbatim replacement we don't know the index is which one. This is because verbatim renaming pass has already stripped out prefixes from the text.

-

Definition at line 592 of file codegen_cpp_visitor.cpp.

+

Definition at line 617 of file codegen_cpp_visitor.cpp.

@@ -5259,7 +5259,7 @@

Definition at line 1338 of file codegen_cpp_visitor.cpp.

+

Definition at line 1363 of file codegen_cpp_visitor.cpp.

@@ -5457,7 +5457,7 @@

Definition at line 1085 of file codegen_cpp_visitor.cpp.

+

Definition at line 1110 of file codegen_cpp_visitor.cpp.

@@ -5489,7 +5489,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 932 of file codegen_cpp_visitor.cpp.

+

Definition at line 957 of file codegen_cpp_visitor.cpp.

@@ -5521,7 +5521,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 950 of file codegen_cpp_visitor.cpp.

+

Definition at line 975 of file codegen_cpp_visitor.cpp.

@@ -5553,7 +5553,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 811 of file codegen_cpp_visitor.cpp.

+

Definition at line 836 of file codegen_cpp_visitor.cpp.

@@ -5585,7 +5585,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 806 of file codegen_cpp_visitor.cpp.

+

Definition at line 831 of file codegen_cpp_visitor.cpp.

@@ -5617,7 +5617,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 1055 of file codegen_cpp_visitor.cpp.

+

Definition at line 1080 of file codegen_cpp_visitor.cpp.

@@ -5649,7 +5649,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 1027 of file codegen_cpp_visitor.cpp.

+

Definition at line 1052 of file codegen_cpp_visitor.cpp.

@@ -5681,7 +5681,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 882 of file codegen_cpp_visitor.cpp.

+

Definition at line 907 of file codegen_cpp_visitor.cpp.

@@ -5713,7 +5713,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 890 of file codegen_cpp_visitor.cpp.

+

Definition at line 915 of file codegen_cpp_visitor.cpp.

@@ -5745,7 +5745,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 801 of file codegen_cpp_visitor.cpp.

+

Definition at line 826 of file codegen_cpp_visitor.cpp.

@@ -5777,7 +5777,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 904 of file codegen_cpp_visitor.cpp.

+

Definition at line 929 of file codegen_cpp_visitor.cpp.

@@ -5809,7 +5809,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 970 of file codegen_cpp_visitor.cpp.

+

Definition at line 995 of file codegen_cpp_visitor.cpp.

@@ -5841,7 +5841,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 869 of file codegen_cpp_visitor.cpp.

+

Definition at line 894 of file codegen_cpp_visitor.cpp.

@@ -5873,7 +5873,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 853 of file codegen_cpp_visitor.cpp.

+

Definition at line 878 of file codegen_cpp_visitor.cpp.

@@ -5905,7 +5905,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 795 of file codegen_cpp_visitor.cpp.

+

Definition at line 820 of file codegen_cpp_visitor.cpp.

@@ -5937,7 +5937,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 863 of file codegen_cpp_visitor.cpp.

+

Definition at line 888 of file codegen_cpp_visitor.cpp.

@@ -5969,7 +5969,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 1004 of file codegen_cpp_visitor.cpp.

+

Definition at line 1029 of file codegen_cpp_visitor.cpp.

@@ -6001,7 +6001,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 1011 of file codegen_cpp_visitor.cpp.

+

Definition at line 1036 of file codegen_cpp_visitor.cpp.

@@ -6033,7 +6033,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 816 of file codegen_cpp_visitor.cpp.

+

Definition at line 841 of file codegen_cpp_visitor.cpp.

@@ -6065,7 +6065,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 925 of file codegen_cpp_visitor.cpp.

+

Definition at line 950 of file codegen_cpp_visitor.cpp.

@@ -6097,7 +6097,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 826 of file codegen_cpp_visitor.cpp.

+

Definition at line 851 of file codegen_cpp_visitor.cpp.

@@ -6135,7 +6135,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 1387 of file codegen_cpp_visitor.cpp.

+

Definition at line 1412 of file codegen_cpp_visitor.cpp.

@@ -6167,7 +6167,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 996 of file codegen_cpp_visitor.cpp.

+

Definition at line 1021 of file codegen_cpp_visitor.cpp.

@@ -6199,7 +6199,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 1016 of file codegen_cpp_visitor.cpp.

+

Definition at line 1041 of file codegen_cpp_visitor.cpp.

@@ -6230,7 +6230,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 965 of file codegen_cpp_visitor.cpp.

+

Definition at line 990 of file codegen_cpp_visitor.cpp.

@@ -6262,7 +6262,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 786 of file codegen_cpp_visitor.cpp.

+

Definition at line 811 of file codegen_cpp_visitor.cpp.

@@ -6294,7 +6294,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 955 of file codegen_cpp_visitor.cpp.

+

Definition at line 980 of file codegen_cpp_visitor.cpp.

@@ -6326,7 +6326,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 821 of file codegen_cpp_visitor.cpp.

+

Definition at line 846 of file codegen_cpp_visitor.cpp.

@@ -6358,7 +6358,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 991 of file codegen_cpp_visitor.cpp.

+

Definition at line 1016 of file codegen_cpp_visitor.cpp.

@@ -6389,7 +6389,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 834 of file codegen_cpp_visitor.cpp.

+

Definition at line 859 of file codegen_cpp_visitor.cpp.

@@ -6421,7 +6421,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 975 of file codegen_cpp_visitor.cpp.

+

Definition at line 1000 of file codegen_cpp_visitor.cpp.

@@ -6453,7 +6453,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 896 of file codegen_cpp_visitor.cpp.

+

Definition at line 921 of file codegen_cpp_visitor.cpp.

diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js index bb6a0db5c..b28bcf0c3 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js @@ -76,7 +76,7 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "print_data_structures", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acbb83079b063cd6b48e07030b1f5df84", null ], [ "print_eigen_linear_solver", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a74fd9098a04a59ba0f11c17d0e51a876", null ], [ "print_fast_imem_calculation", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34492b32e18b9fbfd3ba01ba8ad85eb5", null ], - [ "print_function", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34", null ], + [ "print_function", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec5684647e34e9f3381635ab50ce4ed0", null ], [ "print_function_call", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad63b4318b5abd6b8c224fab70fe61081", null ], [ "print_function_declaration", "group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160", null ], [ "print_function_or_procedure", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9ec8d64ef0941d98af29b31060155c0b", null ], @@ -111,7 +111,7 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "print_nrn_destructor", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a481001b393776c233ccdc069916d2d7c", null ], [ "print_nrn_state", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2453a1be52f39c3fa9bab2603f1f4773", null ], [ "print_prcellstate_macros", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a522261006f1cc94869ef15cd26b739da", null ], - [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff", null ], + [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a60bf374a3063ccd280e46b7af0e48645", null ], [ "print_sdlists_init", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34ae139e68f31b69fa73c9a84c2197e8", null ], [ "print_standard_includes", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6131bec61397f01d9739e694c57afdbf", null ], [ "print_statement_block", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b912ad6d9a4f6d8e4c1bb16f2c95fbf", null ], diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html index d8c647d8c..638c36d1b 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_helper_visitor.html @@ -1025,7 +1025,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 788 of file codegen_helper_visitor.cpp.

+

Definition at line 786 of file codegen_helper_visitor.cpp.

@@ -1089,7 +1089,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 784 of file codegen_helper_visitor.cpp.

+

Definition at line 782 of file codegen_helper_visitor.cpp.

diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html index de9b85639..357db5395 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html @@ -191,7 +191,7 @@ print_data_structures(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual print_eigen_linear_solver(const std::string &float_type, int N)nmodl::codegen::CodegenCppVisitorprotected print_fast_imem_calculation() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual - print_function(const ast::FunctionBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual + print_function(const ast::FunctionBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual print_function_declaration(const T &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &={ CppObjectSpecifier::Inline})nmodl::codegen::CodegenCppVisitor print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual @@ -243,7 +243,7 @@ print_nrn_state() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual print_point_process_function_definitions()nmodl::codegen::CodegenNeuronCppVisitorprotected print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected - print_procedure(const ast::ProcedureBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual + print_procedure(const ast::ProcedureBlock &node)nmodl::codegen::CodegenCppVisitorprotected print_sdlists_init(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual print_setdata_functions()nmodl::codegen::CodegenNeuronCppVisitorprotected print_standard_includes() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html index 39d3ac416..550568c63 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html @@ -599,12 +599,6 @@ void print_function_procedure_helper (const ast::Block &node) override  Common helper function to help printing function or procedure blocks. More...
  -void print_procedure (const ast::ProcedureBlock &node) override - Print NMODL procedure in target backend code. More...
-  -void print_function (const ast::FunctionBlock &node) override - Print NMODL function in target backend code. More...
-  void print_hoc_py_wrapper_function_body (const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)   void print_hoc_py_wrapper_function_definitions () @@ -912,6 +906,12 @@ virtual void print_function_call (const ast::FunctionCall &node)  Print call to internal or external function. More...
  +void print_procedure (const ast::ProcedureBlock &node) + Print NMODL procedure in target backend code. More...
+  +void print_function (const ast::FunctionBlock &node) + Print NMODL function in target backend code. More...
+  void rename_function_arguments ()  Rename function/procedure arguments that conflict with default arguments. More...
  @@ -1168,7 +1168,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 443 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 419 of file codegen_neuron_cpp_visitor.cpp.

@@ -1200,7 +1200,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 435 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 411 of file codegen_neuron_cpp_visitor.cpp.

@@ -1257,7 +1257,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 549 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 525 of file codegen_neuron_cpp_visitor.cpp.

@@ -1393,7 +1393,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 471 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 447 of file codegen_neuron_cpp_visitor.cpp.

@@ -1433,7 +1433,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 477 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 453 of file codegen_neuron_cpp_visitor.cpp.

@@ -1485,7 +1485,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 576 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 552 of file codegen_neuron_cpp_visitor.cpp.

@@ -1516,7 +1516,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 800 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 776 of file codegen_neuron_cpp_visitor.cpp.

@@ -1566,7 +1566,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 651 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 627 of file codegen_neuron_cpp_visitor.cpp.

@@ -1616,7 +1616,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 641 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 617 of file codegen_neuron_cpp_visitor.cpp.

@@ -1646,7 +1646,7 @@

Definition at line 507 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 483 of file codegen_neuron_cpp_visitor.cpp.

@@ -1676,7 +1676,7 @@

Definition at line 513 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 489 of file codegen_neuron_cpp_visitor.cpp.

@@ -1734,7 +1734,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 592 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 568 of file codegen_neuron_cpp_visitor.cpp.

@@ -1766,7 +1766,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 449 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 425 of file codegen_neuron_cpp_visitor.cpp.

@@ -1798,7 +1798,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 455 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 431 of file codegen_neuron_cpp_visitor.cpp.

@@ -1825,7 +1825,7 @@

-

Definition at line 1752 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1728 of file codegen_neuron_cpp_visitor.cpp.

@@ -1852,7 +1852,7 @@

-

Definition at line 1757 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1733 of file codegen_neuron_cpp_visitor.cpp.

@@ -1884,7 +1884,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 484 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 460 of file codegen_neuron_cpp_visitor.cpp.

@@ -1916,7 +1916,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 490 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 466 of file codegen_neuron_cpp_visitor.cpp.

@@ -2118,7 +2118,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2081 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2057 of file codegen_neuron_cpp_visitor.cpp.

@@ -2150,7 +2150,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2064 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2040 of file codegen_neuron_cpp_visitor.cpp.

@@ -2188,7 +2188,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2032 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2008 of file codegen_neuron_cpp_visitor.cpp.

@@ -2220,45 +2220,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1906 of file codegen_neuron_cpp_visitor.cpp.

- - - - -

◆ print_function()

- -
-
- - - - - -
- - - - - - - - -
void nmodl::codegen::CodegenNeuronCppVisitor::print_function (const ast::FunctionBlocknode)
-
-overrideprotectedvirtual
-
- -

Print NMODL function in target backend code.

-
Parameters
- - -
node
-
-
- -

Implements nmodl::codegen::CodegenCppVisitor.

- -

Definition at line 299 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1882 of file codegen_neuron_cpp_visitor.cpp.

@@ -2416,7 +2378,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2054 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2030 of file codegen_neuron_cpp_visitor.cpp.

@@ -2464,7 +2426,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1489 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1465 of file codegen_neuron_cpp_visitor.cpp.

@@ -2493,7 +2455,7 @@

Definition at line 1976 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1952 of file codegen_neuron_cpp_visitor.cpp.

@@ -2522,7 +2484,7 @@

Definition at line 973 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 949 of file codegen_neuron_cpp_visitor.cpp.

@@ -2553,7 +2515,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 986 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 962 of file codegen_neuron_cpp_visitor.cpp.

@@ -2584,7 +2546,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1958 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1934 of file codegen_neuron_cpp_visitor.cpp.

@@ -2622,7 +2584,7 @@

-

Definition at line 318 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 294 of file codegen_neuron_cpp_visitor.cpp.

@@ -2649,7 +2611,7 @@

-

Definition at line 419 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 395 of file codegen_neuron_cpp_visitor.cpp.

@@ -2679,7 +2641,7 @@

Definition at line 1467 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1443 of file codegen_neuron_cpp_visitor.cpp.

@@ -2708,7 +2670,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2102 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2078 of file codegen_neuron_cpp_visitor.cpp.

@@ -2737,7 +2699,7 @@

Definition at line 1968 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1944 of file codegen_neuron_cpp_visitor.cpp.

@@ -2766,7 +2728,7 @@

Definition at line 1351 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1327 of file codegen_neuron_cpp_visitor.cpp.

@@ -2795,7 +2757,7 @@

Definition at line 1416 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1392 of file codegen_neuron_cpp_visitor.cpp.

@@ -2834,7 +2796,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 807 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 783 of file codegen_neuron_cpp_visitor.cpp.

@@ -2872,7 +2834,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1312 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1288 of file codegen_neuron_cpp_visitor.cpp.

@@ -2910,7 +2872,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1103 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1079 of file codegen_neuron_cpp_visitor.cpp.

@@ -2940,7 +2902,7 @@

Definition at line 1993 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1969 of file codegen_neuron_cpp_visitor.cpp.

@@ -2971,7 +2933,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 539 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 515 of file codegen_neuron_cpp_visitor.cpp.

@@ -3002,7 +2964,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 545 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 521 of file codegen_neuron_cpp_visitor.cpp.

@@ -3040,7 +3002,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2145 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2121 of file codegen_neuron_cpp_visitor.cpp.

@@ -3078,7 +3040,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2132 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2108 of file codegen_neuron_cpp_visitor.cpp.

@@ -3107,7 +3069,7 @@

Definition at line 2183 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2159 of file codegen_neuron_cpp_visitor.cpp.

@@ -3172,7 +3134,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2107 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2083 of file codegen_neuron_cpp_visitor.cpp.

@@ -3202,7 +3164,7 @@

Definition at line 1305 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1281 of file codegen_neuron_cpp_visitor.cpp.

@@ -3231,7 +3193,7 @@

Definition at line 748 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 724 of file codegen_neuron_cpp_visitor.cpp.

@@ -3259,7 +3221,7 @@

Definition at line 1402 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1378 of file codegen_neuron_cpp_visitor.cpp.

@@ -3292,7 +3254,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1578 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1554 of file codegen_neuron_cpp_visitor.cpp.

@@ -3324,7 +3286,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1566 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1542 of file codegen_neuron_cpp_visitor.cpp.

@@ -3356,7 +3318,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1912 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1888 of file codegen_neuron_cpp_visitor.cpp.

@@ -3396,7 +3358,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1799 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1775 of file codegen_neuron_cpp_visitor.cpp.

@@ -3435,7 +3397,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1873 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1849 of file codegen_neuron_cpp_visitor.cpp.

@@ -3468,7 +3430,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1838 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1814 of file codegen_neuron_cpp_visitor.cpp.

@@ -3508,7 +3470,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1780 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1756 of file codegen_neuron_cpp_visitor.cpp.

@@ -3540,7 +3502,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1572 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1548 of file codegen_neuron_cpp_visitor.cpp.

@@ -3576,7 +3538,7 @@

Definition at line 1512 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1488 of file codegen_neuron_cpp_visitor.cpp.

@@ -3605,7 +3567,7 @@

Definition at line 1532 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1508 of file codegen_neuron_cpp_visitor.cpp.

@@ -3638,7 +3600,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1702 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1678 of file codegen_neuron_cpp_visitor.cpp.

@@ -3669,44 +3631,6 @@

Definition at line 97 of file codegen_neuron_cpp_visitor.cpp.

- - - -

◆ print_procedure()

- -
-
- - - - - -
- - - - - - - - -
void nmodl::codegen::CodegenNeuronCppVisitor::print_procedure (const ast::ProcedureBlocknode)
-
-overrideprotectedvirtual
-
- -

Print NMODL procedure in target backend code.

-
Parameters
- - -
node
-
-
- -

Implements nmodl::codegen::CodegenCppVisitor.

- -

Definition at line 294 of file codegen_neuron_cpp_visitor.cpp.

-
@@ -3740,7 +3664,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 759 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 735 of file codegen_neuron_cpp_visitor.cpp.

@@ -3800,7 +3724,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 732 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 708 of file codegen_neuron_cpp_visitor.cpp.

@@ -3829,7 +3753,7 @@

Definition at line 1271 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1247 of file codegen_neuron_cpp_visitor.cpp.

@@ -3851,7 +3775,7 @@

Definition at line 1435 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 1411 of file codegen_neuron_cpp_visitor.cpp.

@@ -3882,7 +3806,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2042 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2018 of file codegen_neuron_cpp_visitor.cpp.

@@ -3922,7 +3846,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 496 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 472 of file codegen_neuron_cpp_visitor.cpp.

@@ -3952,7 +3876,7 @@

Definition at line 522 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 498 of file codegen_neuron_cpp_visitor.cpp.

@@ -3982,7 +3906,7 @@

Definition at line 528 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 504 of file codegen_neuron_cpp_visitor.cpp.

@@ -4014,7 +3938,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 502 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 478 of file codegen_neuron_cpp_visitor.cpp.

@@ -4121,7 +4045,7 @@

Definition at line 620 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 596 of file codegen_neuron_cpp_visitor.cpp.

@@ -4153,7 +4077,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 2226 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 2202 of file codegen_neuron_cpp_visitor.cpp.

diff --git a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js index ae5b6a3c4..94622a555 100644 --- a/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js +++ b/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js @@ -30,7 +30,6 @@ var classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor = [ "print_compute_functions", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a94f4993226aa53f6095ad4a44fe47420", null ], [ "print_data_structures", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aeb0635e7e6e488519882d930401b5c2b", null ], [ "print_fast_imem_calculation", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f", null ], - [ "print_function", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb", null ], [ "print_function_or_procedure", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c240b7ccb8aa19ad0cfca2e57fd8496", null ], [ "print_function_procedure_helper", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6a5224b66dde062241120381b3cb8df", null ], [ "print_function_prototypes", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7f941bd8151d12ef887be3670dec264e", null ], @@ -73,7 +72,6 @@ var classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor = [ "print_nrn_jacob", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acc60913cbeb34f75a125224f6a3a79bd", null ], [ "print_nrn_state", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a24c55a8420d179cbbd7bc6968f3c12e3", null ], [ "print_point_process_function_definitions", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aba63d80e4b1b15280a92ea120bc6160c", null ], - [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622", null ], [ "print_sdlists_init", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a", null ], [ "print_setdata_functions", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c15974d73972df388dc1133fdfa406", null ], [ "print_standard_includes", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a75551174c0c66124b0096de40ca20cbf", null ], diff --git a/doxygen/codegen__acc__visitor_8cpp_source.html b/doxygen/codegen__acc__visitor_8cpp_source.html index a851ad8dc..654666d33 100644 --- a/doxygen/codegen__acc__visitor_8cpp_source.html +++ b/doxygen/codegen__acc__visitor_8cpp_source.html @@ -500,7 +500,7 @@
@ NetReceive
net_receive block
bool point_process
if mod file is point process
void print_dt_update_to_device() const override
update dt from host to device
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
void print_global_variable_device_update_annotation() override
update global variable from host to the device
bool electrode_current
if electrode current specified
void print_kernel_data_present_annotation_block_end() override
end of annotation like "acc enter data"
diff --git a/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html b/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html index b3c79be0a..914b63e99 100644 --- a/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html +++ b/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html @@ -452,820 +452,802 @@
356 
357 
358  /**
-
359  * Print NMODL procedure in target backend code
+
359  * Print NMODL function_table in target backend code
360  * \param node
361  */
-
362  void print_procedure(const ast::ProcedureBlock& node) override;
+
363 
-
364 
-
365  /**
-
366  * Print NMODL function in target backend code
-
367  * \param node
-
368  */
-
369  void print_function(const ast::FunctionBlock& node) override;
-
370 
+
364 
+
365  /****************************************************************************************/
+
366  /* Code-specific helper routines */
+
367  /****************************************************************************************/
+
368 
+
369  void add_variable_tqitem(std::vector<IndexVariableInfo>& variables) override;
+
370  void add_variable_point_process(std::vector<IndexVariableInfo>& variables) override;
371 
372  /**
-
373  * Print NMODL function_table in target backend code
-
374  * \param node
+
373  * Arguments for functions that are defined and used internally.
+
374  * \return the method arguments
375  */
- +
376  std::string internal_method_arguments() override;
377 
-
378 
-
379  /****************************************************************************************/
-
380  /* Code-specific helper routines */
-
381  /****************************************************************************************/
-
382 
-
383  void add_variable_tqitem(std::vector<IndexVariableInfo>& variables) override;
-
384  void add_variable_point_process(std::vector<IndexVariableInfo>& variables) override;
+
378 
+
379  /**
+
380  * Parameters for internally defined functions
+
381  * \return the method parameters
+
382  */
+ +
384 
385 
386  /**
-
387  * Arguments for functions that are defined and used internally.
-
388  * \return the method arguments
+
387  * Arguments for external functions called from generated code
+
388  * \return A string representing the arguments passed to an external function
389  */
-
390  std::string internal_method_arguments() override;
+
390  const std::string external_method_arguments() noexcept override;
391 
392 
393  /**
-
394  * Parameters for internally defined functions
-
395  * \return the method parameters
-
396  */
- -
398 
-
399 
-
400  /**
-
401  * Arguments for external functions called from generated code
-
402  * \return A string representing the arguments passed to an external function
-
403  */
-
404  const std::string external_method_arguments() noexcept override;
-
405 
-
406 
-
407  /**
-
408  * Parameters for functions in generated code that are called back from external code
-
409  *
-
410  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
-
411  * calling convention. This method generates the string representing the function parameters for
-
412  * these externally called functions.
-
413  * \param table
-
414  * \return A ParamVector representing the parameters of the function
-
415  */
-
416  const ParamVector external_method_parameters(bool table = false) noexcept override;
-
417 
-
418 
-
419  /**
-
420  * Arguments for "_threadargs_" macro in neuron implementation
+
394  * Parameters for functions in generated code that are called back from external code
+
395  *
+
396  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
+
397  * calling convention. This method generates the string representing the function parameters for
+
398  * these externally called functions.
+
399  * \param table
+
400  * \return A ParamVector representing the parameters of the function
+
401  */
+
402  const ParamVector external_method_parameters(bool table = false) noexcept override;
+
403 
+
404 
+
405  /**
+
406  * Arguments for "_threadargs_" macro in neuron implementation
+
407  */
+
408  std::string nrn_thread_arguments() const override;
+
409 
+
410 
+
411  /**
+
412  * Arguments for "_threadargs_" macro in neuron implementation
+
413  */
+
414  std::string nrn_thread_internal_arguments() override;
+
415 
+
416 
+
417  /**
+
418  * Replace commonly used verbatim variables
+
419  * \param name A variable name to be checked and possibly updated
+
420  * \return The possibly replace variable name
421  */
-
422  std::string nrn_thread_arguments() const override;
+
422  std::string replace_if_verbatim_variable(std::string name);
423 
424 
425  /**
-
426  * Arguments for "_threadargs_" macro in neuron implementation
-
427  */
-
428  std::string nrn_thread_internal_arguments() override;
-
429 
-
430 
-
431  /**
-
432  * Replace commonly used verbatim variables
-
433  * \param name A variable name to be checked and possibly updated
-
434  * \return The possibly replace variable name
+
426  * Process a verbatim block for possible variable renaming
+
427  * \param text The verbatim code to be processed
+
428  * \return The code with all variables renamed as needed
+
429  */
+
430  std::string process_verbatim_text(std::string const& text) override;
+
431 
+
432 
+
433  /**
+
434  * Arguments for register_mech or point_register_mech function
435  */
-
436  std::string replace_if_verbatim_variable(std::string name);
+
436  std::string register_mechanism_arguments() const override;
437 
-
438 
-
439  /**
-
440  * Process a verbatim block for possible variable renaming
-
441  * \param text The verbatim code to be processed
-
442  * \return The code with all variables renamed as needed
-
443  */
-
444  std::string process_verbatim_text(std::string const& text) override;
-
445 
-
446 
-
447  /**
-
448  * Arguments for register_mech or point_register_mech function
-
449  */
-
450  std::string register_mechanism_arguments() const override;
-
451 
-
452 
-
453  void append_conc_write_statements(std::vector<ShadowUseStatement>& statements,
-
454  const Ion& ion,
-
455  const std::string& concentration) override;
-
456 
-
457  /****************************************************************************************/
-
458  /* Code-specific printing routines for code generations */
-
459  /****************************************************************************************/
+
438 
+
439  void append_conc_write_statements(std::vector<ShadowUseStatement>& statements,
+
440  const Ion& ion,
+
441  const std::string& concentration) override;
+
442 
+
443  /****************************************************************************************/
+
444  /* Code-specific printing routines for code generations */
+
445  /****************************************************************************************/
+
446 
+
447 
+
448  /**
+
449  * Print the getter method for index position of first pointer variable
+
450  *
+
451  */
+ +
453 
+
454 
+
455  /**
+
456  * Print the getter method for index position of first RANDOM variable
+
457  *
+
458  */
+
460 
461 
462  /**
-
463  * Print the getter method for index position of first pointer variable
+
463  * Print the getter methods for float and integer variables count
464  *
465  */
- +
467 
468 
469  /**
-
470  * Print the getter method for index position of first RANDOM variable
+
470  * Print the getter method for getting number of arguments for net_receive
471  *
472  */
- +
474 
475 
476  /**
-
477  * Print the getter methods for float and integer variables count
+
477  * Print the getter method for returning mechtype
478  *
479  */
- +
480  void print_mech_type_getter();
481 
482 
483  /**
-
484  * Print the getter method for getting number of arguments for net_receive
+
484  * Print the getter method for returning membrane list from NrnThread
485  *
486  */
- +
487  void print_memb_list_getter();
488 
489 
490  /**
-
491  * Print the getter method for returning mechtype
-
492  *
-
493  */
-
494  void print_mech_type_getter();
-
495 
-
496 
-
497  /**
-
498  * Print the getter method for returning membrane list from NrnThread
-
499  *
-
500  */
-
501  void print_memb_list_getter();
-
502 
-
503 
-
504  /**
-
505  * Prints the start of the \c coreneuron namespace
-
506  */
-
507  void print_namespace_start() override;
+
491  * Prints the start of the \c coreneuron namespace
+
492  */
+
493  void print_namespace_start() override;
+
494 
+
495 
+
496  /**
+
497  * Prints the end of the \c coreneuron namespace
+
498  */
+
499  void print_namespace_stop() override;
+
500 
+
501 
+
502  /**
+
503  * Print the getter method for thread variables and ids
+
504  *
+
505  */
+
506  void print_thread_getters();
+
507 
508 
-
509 
-
510  /**
-
511  * Prints the end of the \c coreneuron namespace
-
512  */
-
513  void print_namespace_stop() override;
-
514 
-
515 
-
516  /**
-
517  * Print the getter method for thread variables and ids
-
518  *
-
519  */
-
520  void print_thread_getters();
-
521 
-
522 
-
523  /****************************************************************************************/
-
524  /* Routines for returning variable name */
-
525  /****************************************************************************************/
-
526 
-
527 
-
528  /**
-
529  * Determine the name of a \c float variable given its symbol
-
530  *
-
531  * This function typically returns the accessor expression in backend code for the given symbol.
-
532  * Since the model variables are stored in data arrays and accessed by offset, this function
-
533  * will return the C++ string representing the array access at the correct offset
-
534  *
-
535  * \param symbol The symbol of a variable for which we want to obtain its name
-
536  * \param use_instance Should the variable be accessed via instance or data array
-
537  * \return The backend code string representing the access to the given variable
-
538  * symbol
-
539  */
-
540  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
-
541 
-
542 
-
543  /**
-
544  * Determine the name of an \c int variable given its symbol
-
545  *
-
546  * This function typically returns the accessor expression in backend code for the given symbol.
-
547  * Since the model variables are stored in data arrays and accessed by offset, this function
-
548  * will return the C++ string representing the array access at the correct offset
-
549  *
-
550  * \param symbol The symbol of a variable for which we want to obtain its name
-
551  * \param name The name of the index variable
-
552  * \param use_instance Should the variable be accessed via instance or data array
-
553  * \return The backend code string representing the access to the given variable
-
554  * symbol
-
555  */
-
556  std::string int_variable_name(const IndexVariableInfo& symbol,
-
557  const std::string& name,
-
558  bool use_instance) const override;
-
559 
-
560 
-
561  /**
-
562  * Determine the variable name for a global variable given its symbol
-
563  * \param symbol The symbol of a variable for which we want to obtain its name
-
564  * \param use_instance Should the variable be accessed via the (host-only)
-
565  * global variable or the instance-specific copy (also available on GPU).
-
566  * \return The C++ string representing the access to the global variable
-
567  */
-
568  std::string global_variable_name(const SymbolType& symbol,
-
569  bool use_instance = true) const override;
-
570 
-
571 
-
572  /**
-
573  * Determine variable name in the structure of mechanism properties
-
574  *
-
575  * \param name Variable name that is being printed
-
576  * \param use_instance Should the variable be accessed via instance or data array
-
577  * \return The C++ string representing the access to the variable in the neuron
-
578  * thread structure
-
579  */
-
580  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
-
581 
-
582 
-
583  /****************************************************************************************/
-
584  /* Main printing routines for code generation */
-
585  /****************************************************************************************/
-
586 
-
587 
-
588  /**
-
589  * Print standard C/C++ includes
-
590  */
-
591  void print_standard_includes() override;
-
592 
-
593 
-
594  /**
-
595  * Print includes from coreneuron
-
596  */
- -
598 
-
599 
-
600  void print_sdlists_init(bool print_initializers) override;
-
601 
-
602 
-
603  /**
-
604  * Print the structure that wraps all global variables used in the NMODL
-
605  *
-
606  * \param print_initializers Whether to include default values in the struct
-
607  * definition (true: int foo{42}; false: int foo;)
+
509  /****************************************************************************************/
+
510  /* Routines for returning variable name */
+
511  /****************************************************************************************/
+
512 
+
513 
+
514  /**
+
515  * Determine the name of a \c float variable given its symbol
+
516  *
+
517  * This function typically returns the accessor expression in backend code for the given symbol.
+
518  * Since the model variables are stored in data arrays and accessed by offset, this function
+
519  * will return the C++ string representing the array access at the correct offset
+
520  *
+
521  * \param symbol The symbol of a variable for which we want to obtain its name
+
522  * \param use_instance Should the variable be accessed via instance or data array
+
523  * \return The backend code string representing the access to the given variable
+
524  * symbol
+
525  */
+
526  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
+
527 
+
528 
+
529  /**
+
530  * Determine the name of an \c int variable given its symbol
+
531  *
+
532  * This function typically returns the accessor expression in backend code for the given symbol.
+
533  * Since the model variables are stored in data arrays and accessed by offset, this function
+
534  * will return the C++ string representing the array access at the correct offset
+
535  *
+
536  * \param symbol The symbol of a variable for which we want to obtain its name
+
537  * \param name The name of the index variable
+
538  * \param use_instance Should the variable be accessed via instance or data array
+
539  * \return The backend code string representing the access to the given variable
+
540  * symbol
+
541  */
+
542  std::string int_variable_name(const IndexVariableInfo& symbol,
+
543  const std::string& name,
+
544  bool use_instance) const override;
+
545 
+
546 
+
547  /**
+
548  * Determine the variable name for a global variable given its symbol
+
549  * \param symbol The symbol of a variable for which we want to obtain its name
+
550  * \param use_instance Should the variable be accessed via the (host-only)
+
551  * global variable or the instance-specific copy (also available on GPU).
+
552  * \return The C++ string representing the access to the global variable
+
553  */
+
554  std::string global_variable_name(const SymbolType& symbol,
+
555  bool use_instance = true) const override;
+
556 
+
557 
+
558  /**
+
559  * Determine variable name in the structure of mechanism properties
+
560  *
+
561  * \param name Variable name that is being printed
+
562  * \param use_instance Should the variable be accessed via instance or data array
+
563  * \return The C++ string representing the access to the variable in the neuron
+
564  * thread structure
+
565  */
+
566  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
+
567 
+
568 
+
569  /****************************************************************************************/
+
570  /* Main printing routines for code generation */
+
571  /****************************************************************************************/
+
572 
+
573 
+
574  /**
+
575  * Print standard C/C++ includes
+
576  */
+
577  void print_standard_includes() override;
+
578 
+
579 
+
580  /**
+
581  * Print includes from coreneuron
+
582  */
+ +
584 
+
585 
+
586  void print_sdlists_init(bool print_initializers) override;
+
587 
+
588 
+
589  /**
+
590  * Print the structure that wraps all global variables used in the NMODL
+
591  *
+
592  * \param print_initializers Whether to include default values in the struct
+
593  * definition (true: int foo{42}; false: int foo;)
+
594  */
+
595  void print_mechanism_global_var_structure(bool print_initializers) override;
+
596 
+
597 
+
598  /**
+
599  * Print byte arrays that register scalar and vector variables for hoc interface
+
600  *
+
601  */
+
602  void print_global_variables_for_hoc() override;
+
603 
+
604 
+
605  /**
+
606  * Print the mechanism registration function
+
607  *
608  */
-
609  void print_mechanism_global_var_structure(bool print_initializers) override;
+
609  void print_mechanism_register() override;
610 
611 
612  /**
-
613  * Print byte arrays that register scalar and vector variables for hoc interface
-
614  *
-
615  */
-
616  void print_global_variables_for_hoc() override;
-
617 
-
618 
-
619  /**
-
620  * Print the mechanism registration function
-
621  *
-
622  */
-
623  void print_mechanism_register() override;
-
624 
-
625 
-
626  /**
-
627  * Print thread related memory allocation and deallocation callbacks
-
628  */
- -
630 
-
631 
-
632  /**
-
633  * Print structure of ion variables used for local copies
-
634  */
- -
636 
-
637 
-
638  /**
-
639  * Print constructor of ion variables
-
640  * \param members The ion variable names
+
613  * Print thread related memory allocation and deallocation callbacks
+
614  */
+ +
616 
+
617 
+
618  /**
+
619  * Print structure of ion variables used for local copies
+
620  */
+ +
622 
+
623 
+
624  /**
+
625  * Print constructor of ion variables
+
626  * \param members The ion variable names
+
627  */
+
628  virtual void print_ion_var_constructor(const std::vector<std::string>& members);
+
629 
+
630 
+
631  /**
+
632  * Print the ion variable struct
+
633  */
+
634  void print_ion_variable() override;
+
635 
+
636 
+
637  /**
+
638  * Print the pragma annotation to update global variables from host to the device
+
639  *
+
640  * \note This is not used for the C++ backend
641  */
-
642  virtual void print_ion_var_constructor(const std::vector<std::string>& members);
+
643 
644 
645  /**
-
646  * Print the ion variable struct
+
646  * Print the function that initialize range variable with different data type
647  */
-
648  void print_ion_variable() override;
+
649 
650 
651  /**
-
652  * Print the pragma annotation to update global variables from host to the device
-
653  *
-
654  * \note This is not used for the C++ backend
-
655  */
- -
657 
-
658 
-
659  /**
-
660  * Print the function that initialize range variable with different data type
-
661  */
- -
663 
-
664 
-
665  /**
-
666  * Returns floating point type for given range variable symbol
-
667  * \param symbol A range variable symbol
-
668  */
-
669  std::string get_range_var_float_type(const SymbolType& symbol);
-
670 
-
671 
-
672  /**
-
673  * Print initial block statements
-
674  *
-
675  * Generate the target backend code corresponding to the NMODL initial block statements
-
676  *
-
677  * \param node The AST Node representing a NMODL initial block
-
678  */
-
679  void print_initial_block(const ast::InitialBlock* node);
-
680 
-
681 
-
682  /**
-
683  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
-
684  * \param type The target backend code block type
-
685  */
- -
687  const std::string& function_name = "") override;
-
688 
-
689 
-
690  /**
-
691  * Print the \c nrn\_init function definition
-
692  * \param skip_init_check \c true to generate code executing the initialization conditionally
-
693  */
-
694  void print_nrn_init(bool skip_init_check = true);
-
695 
-
696 
-
697  /**
-
698  * Print NMODL before / after block in target backend code
-
699  * \param node AST node of type before/after type being printed
-
700  * \param block_id Index of the before/after block
+
652  * Returns floating point type for given range variable symbol
+
653  * \param symbol A range variable symbol
+
654  */
+
655  std::string get_range_var_float_type(const SymbolType& symbol);
+
656 
+
657 
+
658  /**
+
659  * Print initial block statements
+
660  *
+
661  * Generate the target backend code corresponding to the NMODL initial block statements
+
662  *
+
663  * \param node The AST Node representing a NMODL initial block
+
664  */
+
665  void print_initial_block(const ast::InitialBlock* node);
+
666 
+
667 
+
668  /**
+
669  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
+
670  * \param type The target backend code block type
+
671  */
+ +
673  const std::string& function_name = "") override;
+
674 
+
675 
+
676  /**
+
677  * Print the \c nrn\_init function definition
+
678  * \param skip_init_check \c true to generate code executing the initialization conditionally
+
679  */
+
680  void print_nrn_init(bool skip_init_check = true);
+
681 
+
682 
+
683  /**
+
684  * Print NMODL before / after block in target backend code
+
685  * \param node AST node of type before/after type being printed
+
686  * \param block_id Index of the before/after block
+
687  */
+
688  virtual void print_before_after_block(const ast::Block* node, size_t block_id);
+
689 
+
690 
+
691  /**
+
692  * Print nrn_constructor function definition
+
693  *
+
694  */
+
695  void print_nrn_constructor() override;
+
696 
+
697 
+
698  /**
+
699  * Print nrn_destructor function definition
+
700  *
701  */
-
702  virtual void print_before_after_block(const ast::Block* node, size_t block_id);
+
702  void print_nrn_destructor() override;
703 
704 
705  /**
-
706  * Print nrn_constructor function definition
+
706  * Print nrn_alloc function definition
707  *
708  */
-
709  void print_nrn_constructor() override;
+
709  void print_nrn_alloc() override;
710 
711 
712  /**
-
713  * Print nrn_destructor function definition
+
713  * Print watch activate function
714  *
715  */
-
716  void print_nrn_destructor() override;
+
716  void print_watch_activate();
717 
718 
719  /**
-
720  * Print nrn_alloc function definition
-
721  *
-
722  */
-
723  void print_nrn_alloc() override;
-
724 
-
725 
-
726  /**
-
727  * Print watch activate function
-
728  *
-
729  */
-
730  void print_watch_activate();
-
731 
-
732 
-
733  /**
-
734  * Print watch activate function
-
735  */
-
736  void print_watch_check();
-
737 
-
738 
-
739  /**
-
740  * Print the common code section for net receive related methods
-
741  *
-
742  * \param node The AST node representing the corresponding NMODL block
-
743  * \param need_mech_inst \c true if a local \c inst variable needs to be defined in generated
-
744  * code
+
720  * Print watch activate function
+
721  */
+
722  void print_watch_check();
+
723 
+
724 
+
725  /**
+
726  * Print the common code section for net receive related methods
+
727  *
+
728  * \param node The AST node representing the corresponding NMODL block
+
729  * \param need_mech_inst \c true if a local \c inst variable needs to be defined in generated
+
730  * code
+
731  */
+
732  void print_net_receive_common_code(const ast::Block& node, bool need_mech_inst = true);
+
733 
+
734 
+
735  /**
+
736  * Print call to \c net\_send
+
737  * \param node The AST node representing the function call
+
738  */
+
739  void print_net_send_call(const ast::FunctionCall& node) override;
+
740 
+
741 
+
742  /**
+
743  * Print call to net\_move
+
744  * \param node The AST node representing the function call
745  */
-
746  void print_net_receive_common_code(const ast::Block& node, bool need_mech_inst = true);
+
746  void print_net_move_call(const ast::FunctionCall& node) override;
747 
748 
749  /**
-
750  * Print call to \c net\_send
+
750  * Print call to net\_event
751  * \param node The AST node representing the function call
752  */
-
753  void print_net_send_call(const ast::FunctionCall& node) override;
+
753  void print_net_event_call(const ast::FunctionCall& node) override;
754 
755 
756  /**
-
757  * Print call to net\_move
-
758  * \param node The AST node representing the function call
-
759  */
-
760  void print_net_move_call(const ast::FunctionCall& node) override;
-
761 
-
762 
-
763  /**
-
764  * Print call to net\_event
-
765  * \param node The AST node representing the function call
-
766  */
-
767  void print_net_event_call(const ast::FunctionCall& node) override;
-
768 
-
769 
-
770  /**
-
771  * Print initial block in the net receive block
-
772  */
-
773  void print_net_init();
-
774 
-
775 
-
776  /**
-
777  * Print send event move block used in net receive as well as watch
-
778  */
-
779  void print_send_event_move();
-
780 
-
781 
-
782  /**
-
783  * Generate the target backend code for the \c net\_receive\_buffering function delcaration
-
784  * \return The target code string
-
785  */
-
786  virtual std::string net_receive_buffering_declaration();
-
787 
-
788 
-
789  /**
-
790  * Print the target backend code for defining and checking a local \c Memb\_list variable
-
791  */
-
792  virtual void print_get_memb_list();
-
793 
-
794 
-
795  /**
-
796  * Print the code for the main \c net\_receive loop
-
797  */
-
798  virtual void print_net_receive_loop_begin();
-
799 
-
800 
-
801  /**
-
802  * Print the code for closing the main \c net\_receive loop
-
803  */
-
804  virtual void print_net_receive_loop_end();
-
805 
-
806 
-
807  /**
-
808  * Print kernel for buffering net_receive events
-
809  *
-
810  * This kernel is only needed for accelerator backends where \c net\_receive needs to be
-
811  * executed in two stages as the actual communication must be done in the host code. \param
-
812  * need_mech_inst \c true if the generated code needs a local inst variable to be defined
-
813  */
-
814  void print_net_receive_buffering(bool need_mech_inst = true);
-
815 
-
816 
-
817  /**
-
818  * Print the code related to the update of NetSendBuffer_t cnt. For GPU this needs to be done
-
819  * with atomic operation, on CPU it's not needed.
+
757  * Print initial block in the net receive block
+
758  */
+
759  void print_net_init();
+
760 
+
761 
+
762  /**
+
763  * Print send event move block used in net receive as well as watch
+
764  */
+
765  void print_send_event_move();
+
766 
+
767 
+
768  /**
+
769  * Generate the target backend code for the \c net\_receive\_buffering function delcaration
+
770  * \return The target code string
+
771  */
+
772  virtual std::string net_receive_buffering_declaration();
+
773 
+
774 
+
775  /**
+
776  * Print the target backend code for defining and checking a local \c Memb\_list variable
+
777  */
+
778  virtual void print_get_memb_list();
+
779 
+
780 
+
781  /**
+
782  * Print the code for the main \c net\_receive loop
+
783  */
+
784  virtual void print_net_receive_loop_begin();
+
785 
+
786 
+
787  /**
+
788  * Print the code for closing the main \c net\_receive loop
+
789  */
+
790  virtual void print_net_receive_loop_end();
+
791 
+
792 
+
793  /**
+
794  * Print kernel for buffering net_receive events
+
795  *
+
796  * This kernel is only needed for accelerator backends where \c net\_receive needs to be
+
797  * executed in two stages as the actual communication must be done in the host code. \param
+
798  * need_mech_inst \c true if the generated code needs a local inst variable to be defined
+
799  */
+
800  void print_net_receive_buffering(bool need_mech_inst = true);
+
801 
+
802 
+
803  /**
+
804  * Print the code related to the update of NetSendBuffer_t cnt. For GPU this needs to be done
+
805  * with atomic operation, on CPU it's not needed.
+
806  *
+
807  */
+
808  virtual void print_net_send_buffering_cnt_update() const;
+
809 
+
810 
+
811  /**
+
812  * Print statement that grows NetSendBuffering_t structure if needed.
+
813  * This function should be overridden for backends that cannot dynamically reallocate the buffer
+
814  */
+
815  virtual void print_net_send_buffering_grow();
+
816 
+
817 
+
818  /**
+
819  * Print kernel for buffering net_send events
820  *
-
821  */
-
822  virtual void print_net_send_buffering_cnt_update() const;
-
823 
-
824 
-
825  /**
-
826  * Print statement that grows NetSendBuffering_t structure if needed.
-
827  * This function should be overridden for backends that cannot dynamically reallocate the buffer
-
828  */
-
829  virtual void print_net_send_buffering_grow();
-
830 
-
831 
-
832  /**
-
833  * Print kernel for buffering net_send events
-
834  *
-
835  * This kernel is only needed for accelerator backends where \c net\_send needs to be executed
-
836  * in two stages as the actual communication must be done in the host code.
-
837  */
- -
839 
-
840 
-
841  /**
-
842  * Print \c net\_receive kernel function definition
+
821  * This kernel is only needed for accelerator backends where \c net\_send needs to be executed
+
822  * in two stages as the actual communication must be done in the host code.
+
823  */
+ +
825 
+
826 
+
827  /**
+
828  * Print \c net\_receive kernel function definition
+
829  */
+ +
831 
+
832 
+
833  /**
+
834  * Print \c net\_receive function definition
+
835  */
+
836  void print_net_receive();
+
837 
+
838 
+
839  /**
+
840  * Print derivative kernel when \c derivimplicit method is used
+
841  *
+
842  * \param block The corresponding AST node representing an NMODL \c derivimplicit block
843  */
- +
844  void print_derivimplicit_kernel(const ast::Block& block);
845 
846 
847  /**
-
848  * Print \c net\_receive function definition
+
848  * Print code block to transfer newtonspace structure to device
849  */
-
850  void print_net_receive();
+
850  virtual void print_newtonspace_transfer_to_device() const;
851 
-
852 
-
853  /**
-
854  * Print derivative kernel when \c derivimplicit method is used
-
855  *
-
856  * \param block The corresponding AST node representing an NMODL \c derivimplicit block
-
857  */
-
858  void print_derivimplicit_kernel(const ast::Block& block);
-
859 
-
860 
-
861  /**
-
862  * Print code block to transfer newtonspace structure to device
-
863  */
-
864  virtual void print_newtonspace_transfer_to_device() const;
-
865 
-
866 
-
867  /****************************************************************************************/
-
868  /* Print nrn_state routine */
-
869  /****************************************************************************************/
-
870 
-
871 
-
872  /**
-
873  * Print nrn_state / state update function definition
+
852 
+
853  /****************************************************************************************/
+
854  /* Print nrn_state routine */
+
855  /****************************************************************************************/
+
856 
+
857 
+
858  /**
+
859  * Print nrn_state / state update function definition
+
860  */
+
861  void print_nrn_state() override;
+
862 
+
863 
+
864  /****************************************************************************************/
+
865  /* Print nrn_cur related routines */
+
866  /****************************************************************************************/
+
867 
+
868 
+
869  /**
+
870  * Print the \c nrn_current kernel
+
871  *
+
872  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
+
873  * \param node the AST node representing the NMODL breakpoint block
874  */
-
875  void print_nrn_state() override;
+
875  void print_nrn_current(const ast::BreakpointBlock& node) override;
876 
-
877 
-
878  /****************************************************************************************/
-
879  /* Print nrn_cur related routines */
-
880  /****************************************************************************************/
-
881 
-
882 
-
883  /**
-
884  * Print the \c nrn_current kernel
-
885  *
-
886  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
-
887  * \param node the AST node representing the NMODL breakpoint block
-
888  */
-
889  void print_nrn_current(const ast::BreakpointBlock& node) override;
-
890 
-
891 
-
892  /**
-
893  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
-
894  *
-
895  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
-
896  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
897  *
-
898  * \param node the AST node representing the NMODL breakpoint block
-
899  */
-
900  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
-
901 
-
902 
-
903  /**
-
904  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
-
905  *
-
906  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
-
907  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
908  */
-
909  void print_nrn_cur_non_conductance_kernel() override;
-
910 
-
911 
-
912  /**
-
913  * Print main body of nrn_cur function
-
914  * \param node the AST node representing the NMODL breakpoint block
-
915  */
-
916  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
-
917 
-
918 
-
919  /**
-
920  * Print fast membrane current calculation code
-
921  */
-
922  void print_fast_imem_calculation() override;
-
923 
-
924 
-
925  /**
-
926  * Print nrn_cur / current update function definition
-
927  */
-
928  void print_nrn_cur() override;
-
929 
-
930 
-
931  /****************************************************************************************/
-
932  /* Main code printing entry points */
-
933  /****************************************************************************************/
+
877 
+
878  /**
+
879  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
+
880  *
+
881  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
+
882  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
883  *
+
884  * \param node the AST node representing the NMODL breakpoint block
+
885  */
+
886  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
+
887 
+
888 
+
889  /**
+
890  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
+
891  *
+
892  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
+
893  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
894  */
+
895  void print_nrn_cur_non_conductance_kernel() override;
+
896 
+
897 
+
898  /**
+
899  * Print main body of nrn_cur function
+
900  * \param node the AST node representing the NMODL breakpoint block
+
901  */
+
902  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
+
903 
+
904 
+
905  /**
+
906  * Print fast membrane current calculation code
+
907  */
+
908  void print_fast_imem_calculation() override;
+
909 
+
910 
+
911  /**
+
912  * Print nrn_cur / current update function definition
+
913  */
+
914  void print_nrn_cur() override;
+
915 
+
916 
+
917  /****************************************************************************************/
+
918  /* Main code printing entry points */
+
919  /****************************************************************************************/
+
920 
+
921 
+
922  /**
+
923  * Print all includes
+
924  *
+
925  */
+
926  void print_headers_include() override;
+
927 
+
928 
+
929  /**
+
930  * Print common getters
+
931  *
+
932  */
+
933  void print_common_getters();
934 
935 
936  /**
-
937  * Print all includes
-
938  *
+
937  * Print all classes
+
938  * \param print_initializers Whether to include default values.
939  */
-
940  void print_headers_include() override;
+
940  void print_data_structures(bool print_initializers) override;
941 
942 
943  /**
-
944  * Print common getters
-
945  *
-
946  */
-
947  void print_common_getters();
-
948 
-
949 
-
950  /**
-
951  * Print all classes
-
952  * \param print_initializers Whether to include default values.
-
953  */
-
954  void print_data_structures(bool print_initializers) override;
-
955 
-
956 
-
957  /**
-
958  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
-
959  */
-
960  void print_v_unused() const override;
-
961 
-
962 
-
963  /**
-
964  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
944  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
+
945  */
+
946  void print_v_unused() const override;
+
947 
+
948 
+
949  /**
+
950  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
951  */
+
952  void print_g_unused() const override;
+
953 
+
954 
+
955  /**
+
956  * Print all compute functions for every backend
+
957  *
+
958  */
+
959  void print_compute_functions() override;
+
960 
+
961 
+
962  /**
+
963  * Print entry point to code generation
+
964  *
965  */
-
966  void print_g_unused() const override;
+
966  void print_codegen_routines() override;
967 
-
968 
-
969  /**
-
970  * Print all compute functions for every backend
-
971  *
-
972  */
-
973  void print_compute_functions() override;
-
974 
-
975 
-
976  /**
-
977  * Print entry point to code generation
-
978  *
-
979  */
-
980  void print_codegen_routines() override;
-
981 
-
982 
+
968 
+
969  /****************************************************************************************/
+
970  /* Overloaded visitor routines */
+
971  /****************************************************************************************/
+
972 
+
973 
+
974  void visit_derivimplicit_callback(const ast::DerivimplicitCallback& node) override;
+
975  void visit_for_netcon(const ast::ForNetcon& node) override;
+
976  void visit_watch_statement(const ast::WatchStatement& node) override;
+
977 
+
978  ParamVector functor_params() override;
+
979 
+
980  public:
+
981  /****************************************************************************************/
+
982  /* Public printing routines for code generation for use in unit tests */
983  /****************************************************************************************/
-
984  /* Overloaded visitor routines */
-
985  /****************************************************************************************/
-
986 
-
987 
-
988  void visit_derivimplicit_callback(const ast::DerivimplicitCallback& node) override;
-
989  void visit_for_netcon(const ast::ForNetcon& node) override;
-
990  void visit_watch_statement(const ast::WatchStatement& node) override;
-
991 
-
992  ParamVector functor_params() override;
-
993 
-
994  public:
-
995  /****************************************************************************************/
-
996  /* Public printing routines for code generation for use in unit tests */
-
997  /****************************************************************************************/
-
998 
-
999 
-
1000  /**
-
1001  * Print the function that initialize instance structure
-
1002  */
- -
1004 
-
1005 
-
1006  /**
-
1007  * Print the structure that wraps all range and int variables required for the NMODL
-
1008  *
-
1009  * \param print_initializers Whether or not default values for variables
-
1010  * be included in the struct declaration.
-
1011  */
-
1012  void print_mechanism_range_var_structure(bool print_initializers) override;
-
1013 };
-
1014 
-
1015 
-
1016 /** \} */ // end of codegen_backends
-
1017 
-
1018 } // namespace codegen
-
1019 } // namespace nmodl
+
984 
+
985 
+
986  /**
+
987  * Print the function that initialize instance structure
+
988  */
+ +
990 
+
991 
+
992  /**
+
993  * Print the structure that wraps all range and int variables required for the NMODL
+
994  *
+
995  * \param print_initializers Whether or not default values for variables
+
996  * be included in the struct declaration.
+
997  */
+
998  void print_mechanism_range_var_structure(bool print_initializers) override;
+
999 };
+
1000 
+
1001 
+
1002 /** \} */ // end of codegen_backends
+
1003 
+
1004 } // namespace codegen
+
1005 } // namespace nmodl
-
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
-
void print_coreneuron_includes()
Print includes from coreneuron.
-
virtual std::string net_receive_buffering_declaration()
Generate the target backend code for the net_receive_buffering function delcaration.
+
void print_coreneuron_includes()
Print includes from coreneuron.
+
virtual std::string net_receive_buffering_declaration()
Generate the target backend code for the net_receive_buffering function delcaration.
virtual bool nrn_cur_reduction_loop_required()
Check if reduction block in nrn_cur required.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
virtual void print_net_send_buf_count_update_to_host() const
Print the code to update NetSendBuffer_t count from device to host.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_namespace_stop() override
Prints the end of the coreneuron namespace.
-
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
-
void print_derivimplicit_kernel(const ast::Block &block)
Print derivative kernel when derivimplicit method is used.
+
void print_namespace_stop() override
Prints the end of the coreneuron namespace.
+
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+
void print_derivimplicit_kernel(const ast::Block &block)
Print derivative kernel when derivimplicit method is used.
virtual void print_device_stream_wait() const
Print the code to synchronise/wait on stream specific to NrnThread.
virtual void print_instance_struct_delete_from_device()
Delete the instance struct from the device.
virtual void print_net_send_buf_count_update_to_device() const
Print the code to update NetSendBuffer_t count from host to device.
codegen::CodegenInfo info
All ast information for code generation.
-
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
- -
virtual void print_newtonspace_transfer_to_device() const
Print code block to transfer newtonspace structure to device.
+
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
+
virtual void print_newtonspace_transfer_to_device() const
Print code block to transfer newtonspace structure to device.
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies, std::unique_ptr< nmodl::utils::Blame > blame)
Constructs the C++ code generator visitor.
int thread_data_index
thread_data_index indicates number of threads being allocated.
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
-
virtual void print_net_receive_loop_begin()
Print the code for the main net_receive loop.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
virtual void print_net_receive_loop_begin()
Print the code for the main net_receive loop.
virtual void print_kernel_data_present_annotation_block_begin()
Print accelerator annotations indicating data presence on device.
-
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
- -
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
-
void print_initial_block(const ast::InitialBlock *node)
Print initial block statements.
-
void print_net_receive_kernel()
Print net_receive kernel function definition.
-
void print_thread_getters()
Print the getter method for thread variables and ids.
+
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+ +
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
+
void print_initial_block(const ast::InitialBlock *node)
Print initial block statements.
+
void print_net_receive_kernel()
Print net_receive kernel function definition.
+
void print_thread_getters()
Print the getter method for thread variables and ids.
std::string simulator_name() override
Name of the simulator the code was generated for.
-
void print_net_send_buffering()
Print kernel for buffering net_send events.
+
void print_net_send_buffering()
Print kernel for buffering net_send events.
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
int num_thread_objects() const noexcept
Determine the number of threads to allocate.
-
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
virtual void print_dt_update_to_device() const
Print the code to update dt from host to device.
virtual void print_net_init_acc_serial_annotation_block_end()
Print accelerator kernels end annotation for net_init kernel.
-
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
-
void print_net_init()
Print initial block in the net receive block.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
-
void print_sdlists_init(bool print_initializers) override
+
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
+
void print_net_init()
Print initial block in the net receive block.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_sdlists_init(bool print_initializers) override
Implement classes for representing symbol table at block and file scope.
- -
void print_send_event_move()
Print send event move block used in net receive as well as watch.
-
void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
Generate Function call statement for nrn_wrote_conc.
+ +
void print_send_event_move()
Print send event move block used in net receive as well as watch.
+
void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
Generate Function call statement for nrn_wrote_conc.
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
virtual void print_instance_struct_copy_to_device()
Transfer the instance struct to the device.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
-
void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
Print the common code section for net receive related methods.
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
-
void print_first_pointer_var_index_getter()
Print the getter method for index position of first pointer variable.
-
void print_setup_range_variable()
Print the function that initialize range variable with different data type.
-
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+
void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
Print the common code section for net receive related methods.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
void print_first_pointer_var_index_getter()
Print the getter method for index position of first pointer variable.
+
void print_setup_range_variable()
Print the function that initialize range variable with different data type.
+
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
virtual void print_instance_struct_transfer_routine_declarations()
Print declarations of the functions used by print_instance_struct_copy_to_device and print_instance_s...
-
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
-
void print_net_receive_arg_size_getter()
Print the getter method for getting number of arguments for net_receive.
+
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
+
void print_net_receive_arg_size_getter()
Print the getter method for getting number of arguments for net_receive.
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
Visitor for printing C++ code compatible with legacy api of CoreNEURON
Base class for all block scoped nodes.
Definition: block.hpp:41
Represents a INITIAL block in the NMODL.
virtual void print_nrn_cur_matrix_shadow_update()
Print the update to matrix elements with/without shadow vectors.
-
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
+
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
virtual void print_net_init_acc_serial_annotation_block_begin()
Print accelerator kernels begin annotation for net_init kernel.
virtual void print_deriv_advance_flag_transfer_to_device() const
Print the code to copy derivative advance flag to device.
-
void print_first_random_var_index_getter()
Print the getter method for index position of first RANDOM variable.
+
void print_first_random_var_index_getter()
Print the getter method for index position of first RANDOM variable.
Represent WATCH statement in NMODL.
-
virtual void print_before_after_block(const ast::Block *node, size_t block_id)
Print NMODL before / after block in target backend code.
+
virtual void print_before_after_block(const ast::Block *node, size_t block_id)
Print NMODL before / after block in target backend code.
Represents a BREAKPOINT block in NMODL.
-
void print_ion_variable() override
Print the ion variable struct.
+
void print_ion_variable() override
Print the ion variable struct.
Helper class for printing C/C++ code.
-
void print_ion_var_structure()
Print structure of ion variables used for local copies.
-
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
+
void print_ion_var_structure()
Print structure of ion variables used for local copies.
+
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
virtual void print_channel_iteration_block_parallel_hint(BlockType type, const ast::Block *block)
Print pragma annotations for channel iterations.
virtual bool is_constant_variable(const std::string &name) const
Check if variable is qualified as constant.
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
-
void visit_for_netcon(const ast::ForNetcon &node) override
visit node of type ast::ForNetcon
-
void print_compute_functions() override
Print all compute functions for every backend.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
void visit_for_netcon(const ast::ForNetcon &node) override
visit node of type ast::ForNetcon
+
void print_compute_functions() override
Print all compute functions for every backend.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
virtual void print_memory_allocation_routine() const
Print memory allocation routine.
void print_check_table_thread_function()
Print check_table functions.
std::string backend_name() const override
Name of the code generation backend.
virtual void print_rhs_d_shadow_variables()
Print the setup method for setting matrix shadow vectors.
-
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
-
void print_net_receive()
Print net_receive function definition.
+
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
+
void print_net_receive()
Print net_receive function definition.
bool vectorize
true if mod file is vectorizable (which should be always true for coreneuron) But there are some bloc...
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
-
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
void print_top_verbatim_blocks()
Print top level (global scope) verbatim blocks.
Various types to store code generation specific information.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
virtual void print_kernel_data_present_annotation_block_end()
Print matching block end of accelerator annotations for data presence on device.
virtual void print_instance_struct_transfer_routines(std::vector< std::string > const &)
Print the definitions of the functions used by print_instance_struct_copy_to_device and print_instanc...
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
virtual void print_nrn_cur_matrix_shadow_reduction()
Print the reduction to matrix elements from shadow vectors.
-
void print_memb_list_getter()
Print the getter method for returning membrane list from NrnThread.
+
void print_memb_list_getter()
Print the getter method for returning membrane list from NrnThread.
- -
void print_instance_variable_setup()
Print the function that initialize instance structure.
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
-
void print_namespace_start() override
Prints the start of the coreneuron namespace.
+ +
void print_instance_variable_setup()
Print the function that initialize instance structure.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
void print_namespace_start() override
Prints the start of the coreneuron namespace.
virtual void print_abort_routine() const
Print backend specific abort routine.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
std::string get_range_var_float_type(const SymbolType &symbol)
Returns floating point type for given range variable symbol.
-
virtual void print_net_send_buffering_cnt_update() const
Print the code related to the update of NetSendBuffer_t cnt.
-
void print_thread_memory_callbacks()
Print thread related memory allocation and deallocation callbacks.
+
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
std::string get_range_var_float_type(const SymbolType &symbol)
Returns floating point type for given range variable symbol.
+
virtual void print_net_send_buffering_cnt_update() const
Print the code related to the update of NetSendBuffer_t cnt.
+
void print_thread_memory_callbacks()
Print thread related memory allocation and deallocation callbacks.
Represent a callback to NEURON's derivimplicit solver.
- -
void print_net_receive_buffering(bool need_mech_inst=true)
Print kernel for buffering net_receive events.
-
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
-
ParamVector functor_params() override
The parameters of the Newton solver "functor".
+
void print_net_receive_buffering(bool need_mech_inst=true)
Print kernel for buffering net_receive events.
+
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
ParamVector functor_params() override
The parameters of the Newton solver "functor".
Implement logger based on spdlog library.
parser::NmodlParser::symbol_type SymbolType
Definition: main_nmodl.cpp:33
BlockType
Helper to represent various block types.
-
void print_mechanism_register() override
Print the mechanism registration function.
+
void print_mechanism_register() override
Print the mechanism registration function.
virtual void print_global_method_annotation()
Print backend specific global method annotation.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
-
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
virtual void print_device_atomic_capture_annotation() const
Print pragma annotation for increase and capture of variable in automatic way.
-
void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
visit node of type ast::DerivimplicitCallback
+
void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
visit node of type ast::DerivimplicitCallback
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
virtual void print_get_memb_list()
Print the target backend code for defining and checking a local Memb_list variable.
-
void print_num_variable_getter()
Print the getter methods for float and integer variables count.
-
void print_standard_includes() override
Print standard C/C++ includes.
-
virtual void print_net_receive_loop_end()
Print the code for closing the main net_receive loop.
-
void print_mech_type_getter()
Print the getter method for returning mechtype.
-
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
-
virtual void print_global_variable_device_update_annotation()
Print the pragma annotation to update global variables from host to the device.
-
void print_function_tables(const ast::FunctionTableBlock &node)
Print NMODL function_table in target backend code.
-
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
-
void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
-
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
virtual void print_get_memb_list()
Print the target backend code for defining and checking a local Memb_list variable.
+
void print_num_variable_getter()
Print the getter methods for float and integer variables count.
+
void print_standard_includes() override
Print standard C/C++ includes.
+
virtual void print_net_receive_loop_end()
Print the code for closing the main net_receive loop.
+
void print_mech_type_getter()
Print the getter method for returning mechtype.
+
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
+
virtual void print_global_variable_device_update_annotation()
Print the pragma annotation to update global variables from host to the device.
+
void print_function_tables(const ast::FunctionTableBlock &node)
Print NMODL function_table in target backend code.
+
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
+
void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
+
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
virtual void print_backend_includes()
Print backend specific includes (none needed for C++ backend)
std::string process_verbatim_token(const std::string &token)
Process a token in a verbatim block for possible variable renaming.
-
void print_nrn_state() override
Print nrn_state / state update function definition.
-
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
-
void print_codegen_routines() override
Print entry point to code generation.
- -
virtual void print_net_send_buffering_grow()
Print statement that grows NetSendBuffering_t structure if needed.
+
void print_nrn_state() override
Print nrn_state / state update function definition.
+
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
+
void print_codegen_routines() override
Print entry point to code generation.
+ +
virtual void print_net_send_buffering_grow()
Print statement that grows NetSendBuffering_t structure if needed.
virtual void print_net_send_buf_update_to_host() const
Print the code to update NetSendBuffer_t from device to host.
-
void print_data_structures(bool print_initializers) override
Print all classes.
-
std::string replace_if_verbatim_variable(std::string name)
Replace commonly used verbatim variables.
-
virtual void print_ion_var_constructor(const std::vector< std::string > &members)
Print constructor of ion variables.
+
void print_data_structures(bool print_initializers) override
Print all classes.
+
std::string replace_if_verbatim_variable(std::string name)
Replace commonly used verbatim variables.
+
virtual void print_ion_var_constructor(const std::vector< std::string > &members)
Print constructor of ion variables.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
Concrete visitor for all AST classes.
diff --git a/doxygen/codegen__cpp__visitor_8cpp_source.html b/doxygen/codegen__cpp__visitor_8cpp_source.html index 56560f8a6..46cc93931 100644 --- a/doxygen/codegen__cpp__visitor_8cpp_source.html +++ b/doxygen/codegen__cpp__visitor_8cpp_source.html @@ -601,1178 +601,1205 @@
505 }
506 
507 
- -
509  printer->add_line("#ifndef NRN_PRCELLSTATE");
-
510  printer->add_line("#define NRN_PRCELLSTATE 0");
-
511  printer->add_line("#endif");
-
512 }
-
513 
-
514 
- -
516  auto variable_printer = [&](const std::vector<SymbolType>& variables) {
-
517  for (const auto& v: variables) {
-
518  auto name = v->get_name();
-
519  if (!info.point_process) {
-
520  name += "_" + info.mod_suffix;
-
521  }
-
522  if (v->is_array()) {
-
523  name += fmt::format("[{}]", v->get_length());
-
524  }
-
525  printer->add_line(add_escape_quote(name), ",");
-
526  }
-
527  };
+ +
509  print_function_procedure_helper(node);
+
510 }
+
511 
+
512 
+ +
514  auto name = node.get_node_name();
+
515 
+
516  // name of return variable
+
517  std::string return_var;
+
518  if (info.function_uses_table(name)) {
+
519  return_var = "ret_f_" + name;
+
520  } else {
+
521  return_var = "ret_" + name;
+
522  }
+
523 
+
524  // first rename return variable name
+
525  auto block = node.get_statement_block().get();
+
526  RenameVisitor v(name, return_var);
+
527  block->accept(v);
528 
-
529  printer->add_newline(2);
-
530  printer->add_line("/** channel information */");
-
531  printer->fmt_line("static const char *{}[] = {{", get_channel_info_var_name());
-
532  printer->increase_indent();
-
533  printer->add_line(add_escape_quote(nmodl_version()), ",");
-
534  printer->add_line(add_escape_quote(info.mod_suffix), ",");
-
535  variable_printer(info.range_parameter_vars);
-
536  printer->add_line("0,");
-
537  variable_printer(info.range_assigned_vars);
-
538  printer->add_line("0,");
-
539  variable_printer(info.range_state_vars);
-
540  printer->add_line("0,");
-
541  variable_printer(info.pointer_variables);
-
542  printer->add_line("0");
-
543  printer->decrease_indent();
-
544  printer->add_line("};");
-
545 }
-
546 
-
547 
-
548 /****************************************************************************************/
-
549 /* Printing routines for code generation */
-
550 /****************************************************************************************/
-
551 
-
552 
- -
554  bool open_brace,
-
555  bool close_brace) {
-
556  if (open_brace) {
-
557  printer->push_block();
-
558  }
-
559 
-
560  const auto& statements = node.get_statements();
-
561  for (const auto& statement: statements) {
-
562  if (statement_to_skip(*statement)) {
-
563  continue;
-
564  }
-
565  /// not necessary to add indent for verbatim block (pretty-printing)
-
566  if (!statement->is_verbatim() && !statement->is_mutex_lock() &&
-
567  !statement->is_mutex_unlock() && !statement->is_protect_statement()) {
-
568  printer->add_indent();
-
569  }
-
570  statement->accept(*this);
-
571  if (need_semicolon(*statement)) {
-
572  printer->add_text(';');
-
573  }
-
574  if (!statement->is_mutex_lock() && !statement->is_mutex_unlock()) {
-
575  printer->add_newline();
-
576  }
-
577  }
-
578 
-
579  if (close_brace) {
-
580  printer->pop_block_nl(0);
-
581  }
-
582 }
-
583 
-
584 
-
585 /**
-
586  * \todo Issue with verbatim renaming. e.g. pattern.mod has info struct with
-
587  * index variable. If we use "index" instead of "indexes" as default argument
-
588  * then during verbatim replacement we don't know the index is which one. This
-
589  * is because verbatim renaming pass has already stripped out prefixes from
-
590  * the text.
-
591  */
- -
593  const auto& default_arguments = stringutils::split_string(nrn_thread_arguments(), ',');
-
594  for (const auto& dirty_arg: default_arguments) {
-
595  const auto& arg = stringutils::trim(dirty_arg);
-
596  RenameVisitor v(arg, "arg_" + arg);
-
597  for (const auto& function: info.functions) {
-
598  if (has_parameter_of_name(function, arg)) {
-
599  function->accept(v);
-
600  }
+
529  print_function_procedure_helper(node);
+
530 }
+
531 
+
532 
+ +
534  printer->add_line("#ifndef NRN_PRCELLSTATE");
+
535  printer->add_line("#define NRN_PRCELLSTATE 0");
+
536  printer->add_line("#endif");
+
537 }
+
538 
+
539 
+ +
541  auto variable_printer = [&](const std::vector<SymbolType>& variables) {
+
542  for (const auto& v: variables) {
+
543  auto name = v->get_name();
+
544  if (!info.point_process) {
+
545  name += "_" + info.mod_suffix;
+
546  }
+
547  if (v->is_array()) {
+
548  name += fmt::format("[{}]", v->get_length());
+
549  }
+
550  printer->add_line(add_escape_quote(name), ",");
+
551  }
+
552  };
+
553 
+
554  printer->add_newline(2);
+
555  printer->add_line("/** channel information */");
+
556  printer->fmt_line("static const char *{}[] = {{", get_channel_info_var_name());
+
557  printer->increase_indent();
+
558  printer->add_line(add_escape_quote(nmodl_version()), ",");
+
559  printer->add_line(add_escape_quote(info.mod_suffix), ",");
+
560  variable_printer(info.range_parameter_vars);
+
561  printer->add_line("0,");
+
562  variable_printer(info.range_assigned_vars);
+
563  printer->add_line("0,");
+
564  variable_printer(info.range_state_vars);
+
565  printer->add_line("0,");
+
566  variable_printer(info.pointer_variables);
+
567  printer->add_line("0");
+
568  printer->decrease_indent();
+
569  printer->add_line("};");
+
570 }
+
571 
+
572 
+
573 /****************************************************************************************/
+
574 /* Printing routines for code generation */
+
575 /****************************************************************************************/
+
576 
+
577 
+ +
579  bool open_brace,
+
580  bool close_brace) {
+
581  if (open_brace) {
+
582  printer->push_block();
+
583  }
+
584 
+
585  const auto& statements = node.get_statements();
+
586  for (const auto& statement: statements) {
+
587  if (statement_to_skip(*statement)) {
+
588  continue;
+
589  }
+
590  /// not necessary to add indent for verbatim block (pretty-printing)
+
591  if (!statement->is_verbatim() && !statement->is_mutex_lock() &&
+
592  !statement->is_mutex_unlock() && !statement->is_protect_statement()) {
+
593  printer->add_indent();
+
594  }
+
595  statement->accept(*this);
+
596  if (need_semicolon(*statement)) {
+
597  printer->add_text(';');
+
598  }
+
599  if (!statement->is_mutex_lock() && !statement->is_mutex_unlock()) {
+
600  printer->add_newline();
601  }
-
602  for (const auto& function: info.procedures) {
-
603  if (has_parameter_of_name(function, arg)) {
-
604  function->accept(v);
-
605  }
-
606  }
-
607  }
-
608 }
-
609 
-
610 
- -
612  const ast::StatementBlock& functor_block) {
-
613  // Create complete_block with both variable declarations (done in variable_block) and solver
-
614  // part (done in functor_block) to be able to run the SymtabVisitor and DefUseAnalyzeVisitor
-
615  // then and get the proper DUChains for the variables defined in the variable_block
-
616  ast::StatementBlock complete_block(functor_block);
-
617  // Typically variable_block has only one statement, a statement containing the declaration
-
618  // of the local variables
-
619  for (const auto& statement: variable_block.get_statements()) {
-
620  complete_block.insert_statement(complete_block.get_statements().begin(), statement);
-
621  }
-
622 
-
623  // Create Symbol Table for complete_block
-
624  auto model_symbol_table = std::make_shared<symtab::ModelSymbolTable>();
-
625  SymtabVisitor(model_symbol_table.get()).visit_statement_block(complete_block);
-
626  // Initialize DefUseAnalyzeVisitor to generate the DUChains for the variables defined in the
-
627  // variable_block
-
628  DefUseAnalyzeVisitor v(*complete_block.get_symbol_table());
-
629 
-
630  // Check the DUChains for all the variables in the variable_block
-
631  // If variable is defined in complete_block don't add const quilifier in operator()
-
632  auto is_functor_const = true;
-
633  const auto& variables = collect_nodes(variable_block, {ast::AstNodeType::LOCAL_VAR});
-
634  for (const auto& variable: variables) {
-
635  const auto& chain = v.analyze(complete_block, variable->get_node_name());
-
636  is_functor_const = !(chain.eval() == DUState::D || chain.eval() == DUState::LD ||
-
637  chain.eval() == DUState::CD);
-
638  if (!is_functor_const) {
-
639  break;
-
640  }
-
641  }
-
642 
-
643  return is_functor_const;
-
644 }
-
645 
-
646 
- -
648  for (const auto& functor_name: info.functor_names) {
-
649  printer->add_newline(2);
-
650  print_functor_definition(*functor_name.first);
-
651  }
-
652 }
-
653 
- -
655  // functor that evaluates F(X) and J(X) for
-
656  // Newton solver
-
657  auto float_type = default_float_data_type();
-
658  int N = node.get_n_state_vars()->get_value();
-
659 
-
660  const auto functor_name = info.functor_names[&node];
-
661  printer->fmt_push_block("struct {}", functor_name);
-
662 
-
663  auto params = functor_params();
-
664  for (const auto& param: params) {
-
665  printer->fmt_line("{}{} {};", std::get<0>(param), std::get<1>(param), std::get<3>(param));
+
602  }
+
603 
+
604  if (close_brace) {
+
605  printer->pop_block_nl(0);
+
606  }
+
607 }
+
608 
+
609 
+
610 /**
+
611  * \todo Issue with verbatim renaming. e.g. pattern.mod has info struct with
+
612  * index variable. If we use "index" instead of "indexes" as default argument
+
613  * then during verbatim replacement we don't know the index is which one. This
+
614  * is because verbatim renaming pass has already stripped out prefixes from
+
615  * the text.
+
616  */
+ +
618  const auto& default_arguments = stringutils::split_string(nrn_thread_arguments(), ',');
+
619  for (const auto& dirty_arg: default_arguments) {
+
620  const auto& arg = stringutils::trim(dirty_arg);
+
621  RenameVisitor v(arg, "arg_" + arg);
+
622  for (const auto& function: info.functions) {
+
623  if (has_parameter_of_name(function, arg)) {
+
624  function->accept(v);
+
625  }
+
626  }
+
627  for (const auto& function: info.procedures) {
+
628  if (has_parameter_of_name(function, arg)) {
+
629  function->accept(v);
+
630  }
+
631  }
+
632  }
+
633 }
+
634 
+
635 
+ +
637  const ast::StatementBlock& functor_block) {
+
638  // Create complete_block with both variable declarations (done in variable_block) and solver
+
639  // part (done in functor_block) to be able to run the SymtabVisitor and DefUseAnalyzeVisitor
+
640  // then and get the proper DUChains for the variables defined in the variable_block
+
641  ast::StatementBlock complete_block(functor_block);
+
642  // Typically variable_block has only one statement, a statement containing the declaration
+
643  // of the local variables
+
644  for (const auto& statement: variable_block.get_statements()) {
+
645  complete_block.insert_statement(complete_block.get_statements().begin(), statement);
+
646  }
+
647 
+
648  // Create Symbol Table for complete_block
+
649  auto model_symbol_table = std::make_shared<symtab::ModelSymbolTable>();
+
650  SymtabVisitor(model_symbol_table.get()).visit_statement_block(complete_block);
+
651  // Initialize DefUseAnalyzeVisitor to generate the DUChains for the variables defined in the
+
652  // variable_block
+
653  DefUseAnalyzeVisitor v(*complete_block.get_symbol_table());
+
654 
+
655  // Check the DUChains for all the variables in the variable_block
+
656  // If variable is defined in complete_block don't add const quilifier in operator()
+
657  auto is_functor_const = true;
+
658  const auto& variables = collect_nodes(variable_block, {ast::AstNodeType::LOCAL_VAR});
+
659  for (const auto& variable: variables) {
+
660  const auto& chain = v.analyze(complete_block, variable->get_node_name());
+
661  is_functor_const = !(chain.eval() == DUState::D || chain.eval() == DUState::LD ||
+
662  chain.eval() == DUState::CD);
+
663  if (!is_functor_const) {
+
664  break;
+
665  }
666  }
667 
-
668  if (ion_variable_struct_required()) {
-
669  print_ion_variable();
-
670  }
+
668  return is_functor_const;
+
669 }
+
670 
671 
-
672  print_statement_block(*node.get_variable_block(), false, false);
-
673  printer->add_newline();
-
674 
-
675  printer->push_block("void initialize()");
-
676  print_statement_block(*node.get_initialize_block(), false, false);
-
677  printer->pop_block();
-
678  printer->add_newline();
-
679 
-
680  printer->fmt_line("{}({})", functor_name, get_parameter_str(params));
-
681  printer->increase_indent();
-
682  auto initializers = std::vector<std::string>();
-
683  for (const auto& param: params) {
-
684  initializers.push_back(fmt::format("{0}({0})", std::get<3>(param)));
-
685  }
-
686 
-
687  printer->add_multi_line(": " + fmt::format("{}", fmt::join(initializers, ", ")));
-
688  printer->decrease_indent();
-
689  printer->add_line("{}");
-
690 
-
691  printer->add_indent();
+ +
673  for (const auto& functor_name: info.functor_names) {
+
674  printer->add_newline(2);
+
675  print_functor_definition(*functor_name.first);
+
676  }
+
677 }
+
678 
+ +
680  // functor that evaluates F(X) and J(X) for
+
681  // Newton solver
+
682  auto float_type = default_float_data_type();
+
683  int N = node.get_n_state_vars()->get_value();
+
684 
+
685  const auto functor_name = info.functor_names[&node];
+
686  printer->fmt_push_block("struct {}", functor_name);
+
687 
+
688  auto params = functor_params();
+
689  for (const auto& param: params) {
+
690  printer->fmt_line("{}{} {};", std::get<0>(param), std::get<1>(param), std::get<3>(param));
+
691  }
692 
-
693  const auto& variable_block = *node.get_variable_block();
-
694  const auto& functor_block = *node.get_functor_block();
-
695 
-
696  printer->fmt_text(
-
697  "void operator()(const Eigen::Matrix<{0}, {1}, 1>& nmodl_eigen_xm, Eigen::Matrix<{0}, {1}, "
-
698  "1>& nmodl_eigen_fm, "
-
699  "Eigen::Matrix<{0}, {1}, {1}>& nmodl_eigen_jm) {2}",
-
700  float_type,
-
701  N,
-
702  is_functor_const(variable_block, functor_block) ? "const " : "");
-
703  printer->push_block();
-
704  printer->fmt_line("const {}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
-
705  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
-
706  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
-
707  print_statement_block(functor_block, false, false);
-
708  printer->pop_block();
-
709  printer->add_newline();
-
710 
-
711  // assign newton solver results in matrix X to state vars
-
712  printer->push_block("void finalize()");
-
713  print_statement_block(*node.get_finalize_block(), false, false);
-
714  printer->pop_block();
+
693  if (ion_variable_struct_required()) {
+
694  print_ion_variable();
+
695  }
+
696 
+
697  print_statement_block(*node.get_variable_block(), false, false);
+
698  printer->add_newline();
+
699 
+
700  printer->push_block("void initialize()");
+
701  print_statement_block(*node.get_initialize_block(), false, false);
+
702  printer->pop_block();
+
703  printer->add_newline();
+
704 
+
705  printer->fmt_line("{}({})", functor_name, get_parameter_str(params));
+
706  printer->increase_indent();
+
707  auto initializers = std::vector<std::string>();
+
708  for (const auto& param: params) {
+
709  initializers.push_back(fmt::format("{0}({0})", std::get<3>(param)));
+
710  }
+
711 
+
712  printer->add_multi_line(": " + fmt::format("{}", fmt::join(initializers, ", ")));
+
713  printer->decrease_indent();
+
714  printer->add_line("{}");
715 
-
716  printer->pop_block(";");
-
717 }
-
718 
-
719 
-
720 void CodegenCppVisitor::print_eigen_linear_solver(const std::string& float_type, int N) {
-
721  if (N <= 4) {
-
722  // Faster compared to LU, given the template specialization in Eigen.
-
723  printer->add_multi_line(R"CODE(
-
724  bool invertible;
-
725  nmodl_eigen_jm.computeInverseWithCheck(nmodl_eigen_jm_inv,invertible);
-
726  nmodl_eigen_xm = nmodl_eigen_jm_inv*nmodl_eigen_fm;
-
727  if (!invertible) assert(false && "Singular or ill-conditioned matrix (Eigen::inverse)!");
-
728  )CODE");
-
729  } else {
-
730  // In Eigen the default storage order is ColMajor.
-
731  // Crout's implementation requires matrices stored in RowMajor order (C++-style arrays).
-
732  // Therefore, the transposeInPlace is critical such that the data() method to give the rows
-
733  // instead of the columns.
-
734  printer->add_line("if (!nmodl_eigen_jm.IsRowMajor) nmodl_eigen_jm.transposeInPlace();");
+
716  printer->add_indent();
+
717 
+
718  const auto& variable_block = *node.get_variable_block();
+
719  const auto& functor_block = *node.get_functor_block();
+
720 
+
721  printer->fmt_text(
+
722  "void operator()(const Eigen::Matrix<{0}, {1}, 1>& nmodl_eigen_xm, Eigen::Matrix<{0}, {1}, "
+
723  "1>& nmodl_eigen_fm, "
+
724  "Eigen::Matrix<{0}, {1}, {1}>& nmodl_eigen_jm) {2}",
+
725  float_type,
+
726  N,
+
727  is_functor_const(variable_block, functor_block) ? "const " : "");
+
728  printer->push_block();
+
729  printer->fmt_line("const {}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
+
730  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
+
731  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
+
732  print_statement_block(functor_block, false, false);
+
733  printer->pop_block();
+
734  printer->add_newline();
735 
-
736  // pivot vector
-
737  printer->fmt_line("Eigen::Matrix<int, {}, 1> pivot;", N);
-
738  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> rowmax;", float_type, N);
-
739 
-
740  // In-place LU-Decomposition (Crout Algo) : Jm is replaced by its LU-decomposition
-
741  printer->fmt_line(
-
742  "if (nmodl::crout::Crout<{0}>({1}, nmodl_eigen_jm.data(), pivot.data(), rowmax.data()) "
-
743  "< 0) assert(false && \"Singular or ill-conditioned matrix (nmodl::crout)!\");",
-
744  float_type,
-
745  N);
-
746 
-
747  // Solve the linear system : Forward/Backward substitution part
-
748  printer->fmt_line(
-
749  "nmodl::crout::solveCrout<{0}>({1}, nmodl_eigen_jm.data(), nmodl_eigen_fm.data(), "
-
750  "nmodl_eigen_xm.data(), pivot.data());",
-
751  float_type,
-
752  N);
-
753  }
-
754 }
-
755 
-
756 
-
757 /****************************************************************************************/
-
758 /* Main code printing entry points */
-
759 /****************************************************************************************/
+
736  // assign newton solver results in matrix X to state vars
+
737  printer->push_block("void finalize()");
+
738  print_statement_block(*node.get_finalize_block(), false, false);
+
739  printer->pop_block();
+
740 
+
741  printer->pop_block(";");
+
742 }
+
743 
+
744 
+
745 void CodegenCppVisitor::print_eigen_linear_solver(const std::string& float_type, int N) {
+
746  if (N <= 4) {
+
747  // Faster compared to LU, given the template specialization in Eigen.
+
748  printer->add_multi_line(R"CODE(
+
749  bool invertible;
+
750  nmodl_eigen_jm.computeInverseWithCheck(nmodl_eigen_jm_inv,invertible);
+
751  nmodl_eigen_xm = nmodl_eigen_jm_inv*nmodl_eigen_fm;
+
752  if (!invertible) assert(false && "Singular or ill-conditioned matrix (Eigen::inverse)!");
+
753  )CODE");
+
754  } else {
+
755  // In Eigen the default storage order is ColMajor.
+
756  // Crout's implementation requires matrices stored in RowMajor order (C++-style arrays).
+
757  // Therefore, the transposeInPlace is critical such that the data() method to give the rows
+
758  // instead of the columns.
+
759  printer->add_line("if (!nmodl_eigen_jm.IsRowMajor) nmodl_eigen_jm.transposeInPlace();");
760 
-
761 
-
762 /**
-
763  * NMODL constants from unit database
-
764  *
-
765  */
- -
767  if (!info.factor_definitions.empty()) {
-
768  printer->add_newline(2);
-
769  printer->add_line("/** constants used in nmodl from UNITS */");
-
770  for (const auto& it: info.factor_definitions) {
-
771  const std::string format_string = "static const double {} = {};";
-
772  printer->fmt_line(format_string, it->get_node_name(), it->get_value()->get_value());
-
773  }
-
774  }
-
775 }
-
776 
-
777 
-
778 /****************************************************************************************/
-
779 /* Overloaded visitor routines */
-
780 /****************************************************************************************/
+
761  // pivot vector
+
762  printer->fmt_line("Eigen::Matrix<int, {}, 1> pivot;", N);
+
763  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> rowmax;", float_type, N);
+
764 
+
765  // In-place LU-Decomposition (Crout Algo) : Jm is replaced by its LU-decomposition
+
766  printer->fmt_line(
+
767  "if (nmodl::crout::Crout<{0}>({1}, nmodl_eigen_jm.data(), pivot.data(), rowmax.data()) "
+
768  "< 0) assert(false && \"Singular or ill-conditioned matrix (nmodl::crout)!\");",
+
769  float_type,
+
770  N);
+
771 
+
772  // Solve the linear system : Forward/Backward substitution part
+
773  printer->fmt_line(
+
774  "nmodl::crout::solveCrout<{0}>({1}, nmodl_eigen_jm.data(), nmodl_eigen_fm.data(), "
+
775  "nmodl_eigen_xm.data(), pivot.data());",
+
776  float_type,
+
777  N);
+
778  }
+
779 }
+
780 
781 
-
782 
-
783 extern const std::regex regex_special_chars{R"([-[\]{}()*+?.,\^$|#\s])"};
-
784 
-
785 
- -
787  std::string name = node.eval();
-
788  if (enable_variable_name_lookup) {
-
789  name = get_variable_name(name);
-
790  }
-
791  printer->add_text(name);
-
792 }
-
793 
-
794 
- -
796  const auto& value = node.get_value();
-
797  printer->add_text(std::to_string(value));
-
798 }
-
799 
-
800 
- -
802  printer->add_text(format_float_string(node.get_value()));
-
803 }
-
804 
-
805 
- -
807  printer->add_text(format_double_string(node.get_value()));
-
808 }
-
809 
-
810 
- -
812  printer->add_text(std::to_string(static_cast<int>(node.eval())));
-
813 }
-
814 
-
815 
- -
817  node.visit_children(*this);
-
818 }
+
782 /****************************************************************************************/
+
783 /* Main code printing entry points */
+
784 /****************************************************************************************/
+
785 
+
786 
+
787 /**
+
788  * NMODL constants from unit database
+
789  *
+
790  */
+ +
792  if (!info.factor_definitions.empty()) {
+
793  printer->add_newline(2);
+
794  printer->add_line("/** constants used in nmodl from UNITS */");
+
795  for (const auto& it: info.factor_definitions) {
+
796  const std::string format_string = "static const double {} = {};";
+
797  printer->fmt_line(format_string, it->get_node_name(), it->get_value()->get_value());
+
798  }
+
799  }
+
800 }
+
801 
+
802 
+
803 /****************************************************************************************/
+
804 /* Overloaded visitor routines */
+
805 /****************************************************************************************/
+
806 
+
807 
+
808 extern const std::regex regex_special_chars{R"([-[\]{}()*+?.,\^$|#\s])"};
+
809 
+
810 
+ +
812  std::string name = node.eval();
+
813  if (enable_variable_name_lookup) {
+
814  name = get_variable_name(name);
+
815  }
+
816  printer->add_text(name);
+
817 }
+
818 
819 
-
820 
- -
822  // do not print units
+ +
821  const auto& value = node.get_value();
+
822  printer->add_text(std::to_string(value));
823 }
824 
825 
- -
827  throw std::runtime_error("PRIME encountered during code generation, ODEs not solved?");
+ +
827  printer->add_text(format_float_string(node.get_value()));
828 }
829 
-
830 
-
831 /**
-
832  * \todo : Validate how @ is being handled in neuron implementation
-
833  */
- -
835  const auto& name = node.get_name();
-
836  const auto& at_index = node.get_at();
-
837  const auto& index = node.get_index();
-
838  name->accept(*this);
-
839  if (at_index) {
-
840  printer->add_text("@");
-
841  at_index->accept(*this);
-
842  }
-
843  if (index) {
-
844  printer->add_text("[");
-
845  printer->add_text("static_cast<int>(");
-
846  index->accept(*this);
-
847  printer->add_text(")");
-
848  printer->add_text("]");
-
849  }
-
850 }
-
851 
-
852 
- -
854  node.get_name()->accept(*this);
-
855  printer->add_text("[");
-
856  printer->add_text("static_cast<int>(");
-
857  node.get_length()->accept(*this);
-
858  printer->add_text(")");
-
859  printer->add_text("]");
-
860 }
-
861 
-
862 
- -
864  printer->add_text(local_var_type(), ' ');
-
865  print_vector_elements(node.get_variables(), ", ");
-
866 }
-
867 
-
868 
- -
870  printer->add_text("if (");
-
871  node.get_condition()->accept(*this);
-
872  printer->add_text(") ");
-
873  node.get_statement_block()->accept(*this);
-
874  print_vector_elements(node.get_elseifs(), "");
-
875  const auto& elses = node.get_elses();
-
876  if (elses) {
-
877  elses->accept(*this);
-
878  }
-
879 }
-
880 
-
881 
- -
883  printer->add_text(" else if (");
-
884  node.get_condition()->accept(*this);
-
885  printer->add_text(") ");
-
886  node.get_statement_block()->accept(*this);
-
887 }
-
888 
-
889 
- -
891  printer->add_text(" else ");
-
892  node.visit_children(*this);
-
893 }
-
894 
-
895 
- -
897  printer->add_text("while (");
-
898  node.get_condition()->accept(*this);
-
899  printer->add_text(") ");
-
900  node.get_statement_block()->accept(*this);
-
901 }
-
902 
-
903 
- -
905  auto name = node.get_node_name();
-
906  const auto& from = node.get_from();
-
907  const auto& to = node.get_to();
-
908  const auto& inc = node.get_increment();
-
909  const auto& block = node.get_statement_block();
-
910  printer->fmt_text("for (int {} = ", name);
-
911  from->accept(*this);
-
912  printer->fmt_text("; {} <= ", name);
-
913  to->accept(*this);
-
914  if (inc) {
-
915  printer->fmt_text("; {} += ", name);
-
916  inc->accept(*this);
-
917  } else {
-
918  printer->fmt_text("; {}++", name);
-
919  }
-
920  printer->add_text(") ");
-
921  block->accept(*this);
-
922 }
-
923 
-
924 
- -
926  printer->add_text("(");
-
927  node.get_expression()->accept(*this);
-
928  printer->add_text(")");
-
929 }
-
930 
-
931 
- -
933  auto op = node.get_op().eval();
-
934  const auto& lhs = node.get_lhs();
-
935  const auto& rhs = node.get_rhs();
-
936  if (op == "^") {
-
937  printer->add_text("pow(");
-
938  lhs->accept(*this);
-
939  printer->add_text(", ");
-
940  rhs->accept(*this);
-
941  printer->add_text(")");
+
830 
+ +
832  printer->add_text(format_double_string(node.get_value()));
+
833 }
+
834 
+
835 
+ +
837  printer->add_text(std::to_string(static_cast<int>(node.eval())));
+
838 }
+
839 
+
840 
+ +
842  node.visit_children(*this);
+
843 }
+
844 
+
845 
+ +
847  // do not print units
+
848 }
+
849 
+
850 
+ +
852  throw std::runtime_error("PRIME encountered during code generation, ODEs not solved?");
+
853 }
+
854 
+
855 
+
856 /**
+
857  * \todo : Validate how @ is being handled in neuron implementation
+
858  */
+ +
860  const auto& name = node.get_name();
+
861  const auto& at_index = node.get_at();
+
862  const auto& index = node.get_index();
+
863  name->accept(*this);
+
864  if (at_index) {
+
865  printer->add_text("@");
+
866  at_index->accept(*this);
+
867  }
+
868  if (index) {
+
869  printer->add_text("[");
+
870  printer->add_text("static_cast<int>(");
+
871  index->accept(*this);
+
872  printer->add_text(")");
+
873  printer->add_text("]");
+
874  }
+
875 }
+
876 
+
877 
+ +
879  node.get_name()->accept(*this);
+
880  printer->add_text("[");
+
881  printer->add_text("static_cast<int>(");
+
882  node.get_length()->accept(*this);
+
883  printer->add_text(")");
+
884  printer->add_text("]");
+
885 }
+
886 
+
887 
+ +
889  printer->add_text(local_var_type(), ' ');
+
890  print_vector_elements(node.get_variables(), ", ");
+
891 }
+
892 
+
893 
+ +
895  printer->add_text("if (");
+
896  node.get_condition()->accept(*this);
+
897  printer->add_text(") ");
+
898  node.get_statement_block()->accept(*this);
+
899  print_vector_elements(node.get_elseifs(), "");
+
900  const auto& elses = node.get_elses();
+
901  if (elses) {
+
902  elses->accept(*this);
+
903  }
+
904 }
+
905 
+
906 
+ +
908  printer->add_text(" else if (");
+
909  node.get_condition()->accept(*this);
+
910  printer->add_text(") ");
+
911  node.get_statement_block()->accept(*this);
+
912 }
+
913 
+
914 
+ +
916  printer->add_text(" else ");
+
917  node.visit_children(*this);
+
918 }
+
919 
+
920 
+ +
922  printer->add_text("while (");
+
923  node.get_condition()->accept(*this);
+
924  printer->add_text(") ");
+
925  node.get_statement_block()->accept(*this);
+
926 }
+
927 
+
928 
+ +
930  auto name = node.get_node_name();
+
931  const auto& from = node.get_from();
+
932  const auto& to = node.get_to();
+
933  const auto& inc = node.get_increment();
+
934  const auto& block = node.get_statement_block();
+
935  printer->fmt_text("for (int {} = ", name);
+
936  from->accept(*this);
+
937  printer->fmt_text("; {} <= ", name);
+
938  to->accept(*this);
+
939  if (inc) {
+
940  printer->fmt_text("; {} += ", name);
+
941  inc->accept(*this);
942  } else {
-
943  lhs->accept(*this);
-
944  printer->add_text(" " + op + " ");
-
945  rhs->accept(*this);
-
946  }
+
943  printer->fmt_text("; {}++", name);
+
944  }
+
945  printer->add_text(") ");
+
946  block->accept(*this);
947 }
948 
949 
- -
951  printer->add_text(node.eval());
-
952 }
-
953 
-
954 
- -
956  printer->add_text(" " + node.eval());
-
957 }
-
958 
-
959 
-
960 /**
-
961  * \details Statement block is top level construct (for every nmodl block).
-
962  * Sometime we want to analyse ast nodes even if code generation is
-
963  * false. Hence we visit children even if code generation is false.
-
964  */
- -
966  print_statement_block(node);
-
967 }
-
968 
-
969 
- -
971  print_function_call(node);
+ +
951  printer->add_text("(");
+
952  node.get_expression()->accept(*this);
+
953  printer->add_text(")");
+
954 }
+
955 
+
956 
+ +
958  auto op = node.get_op().eval();
+
959  const auto& lhs = node.get_lhs();
+
960  const auto& rhs = node.get_rhs();
+
961  if (op == "^") {
+
962  printer->add_text("pow(");
+
963  lhs->accept(*this);
+
964  printer->add_text(", ");
+
965  rhs->accept(*this);
+
966  printer->add_text(")");
+
967  } else {
+
968  lhs->accept(*this);
+
969  printer->add_text(" " + op + " ");
+
970  rhs->accept(*this);
+
971  }
972 }
973 
974 
- -
976  const auto& text = node.get_statement()->eval();
-
977  printer->add_line("// VERBATIM");
-
978  const auto& result = process_verbatim_text(text);
+ +
976  printer->add_text(node.eval());
+
977 }
+
978 
979 
-
980  const auto& statements = stringutils::split_string(result, '\n');
-
981  for (const auto& statement: statements) {
-
982  const auto& trimed_stmt = stringutils::trim_newline(statement);
-
983  if (trimed_stmt.find_first_not_of(' ') != std::string::npos) {
-
984  printer->add_line(trimed_stmt);
-
985  }
-
986  }
-
987  printer->add_line("// ENDVERBATIM");
-
988 }
-
989 
-
990 
- -
992  // dt change statement should be pulled outside already
-
993 }
+ +
981  printer->add_text(" " + node.eval());
+
982 }
+
983 
+
984 
+
985 /**
+
986  * \details Statement block is top level construct (for every nmodl block).
+
987  * Sometime we want to analyse ast nodes even if code generation is
+
988  * false. Hence we visit children even if code generation is false.
+
989  */
+ +
991  print_statement_block(node);
+
992 }
+
993 
994 
-
995 
- -
997  print_atomic_reduction_pragma();
-
998  printer->add_indent();
-
999  node.get_expression()->accept(*this);
-
1000  printer->add_text(";");
-
1001 }
-
1002 
-
1003 
- -
1005  printer->fmt_line("#pragma omp critical ({})", info.mod_suffix);
-
1006  printer->add_indent();
-
1007  printer->push_block();
-
1008 }
-
1009 
-
1010 
- -
1012  printer->pop_block();
+ +
996  print_function_call(node);
+
997 }
+
998 
+
999 
+ +
1001  const auto& text = node.get_statement()->eval();
+
1002  printer->add_line("// VERBATIM");
+
1003  const auto& result = process_verbatim_text(text);
+
1004 
+
1005  const auto& statements = stringutils::split_string(result, '\n');
+
1006  for (const auto& statement: statements) {
+
1007  const auto& trimed_stmt = stringutils::trim_newline(statement);
+
1008  if (trimed_stmt.find_first_not_of(' ') != std::string::npos) {
+
1009  printer->add_line(trimed_stmt);
+
1010  }
+
1011  }
+
1012  printer->add_line("// ENDVERBATIM");
1013 }
1014 
1015 
- -
1017  auto block = node.get_node_to_solve().get();
-
1018  if (block->is_statement_block()) {
-
1019  auto statement_block = dynamic_cast<ast::StatementBlock*>(block);
-
1020  print_statement_block(*statement_block, false, false);
-
1021  } else {
-
1022  block->accept(*this);
-
1023  }
-
1024 }
-
1025 
-
1026 
- -
1028  // solution vector to store copy of state vars for Newton solver
-
1029  printer->add_newline();
-
1030 
-
1031  auto float_type = default_float_data_type();
-
1032  int N = node.get_n_state_vars()->get_value();
-
1033  printer->fmt_line("Eigen::Matrix<{}, {}, 1> nmodl_eigen_xm;", float_type, N);
-
1034  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
+ +
1017  // dt change statement should be pulled outside already
+
1018 }
+
1019 
+
1020 
+ +
1022  print_atomic_reduction_pragma();
+
1023  printer->add_indent();
+
1024  node.get_expression()->accept(*this);
+
1025  printer->add_text(";");
+
1026 }
+
1027 
+
1028 
+ +
1030  printer->fmt_line("#pragma omp critical ({})", info.mod_suffix);
+
1031  printer->add_indent();
+
1032  printer->push_block();
+
1033 }
+
1034 
1035 
-
1036  print_statement_block(*node.get_setup_x_block(), false, false);
-
1037 
-
1038  // call newton solver with functor and X matrix that contains state vars
-
1039  printer->add_line("// call newton solver");
-
1040  printer->fmt_line("{} newton_functor({});",
-
1041  info.functor_names[&node],
-
1042  get_arg_str(functor_params()));
-
1043  printer->add_line("newton_functor.initialize();");
-
1044  printer->add_line(
-
1045  "int newton_iterations = nmodl::newton::newton_solver(nmodl_eigen_xm, newton_functor);");
-
1046  printer->add_line(
-
1047  "if (newton_iterations < 0) assert(false && \"Newton solver did not converge!\");");
-
1048 
-
1049  // assign newton solver results in matrix X to state vars
-
1050  print_statement_block(*node.get_update_states_block(), false, false);
-
1051  printer->add_line("newton_functor.finalize();");
-
1052 }
-
1053 
-
1054 
- -
1056  printer->add_newline();
-
1057 
-
1058  const std::string float_type = default_float_data_type();
-
1059  int N = node.get_n_state_vars()->get_value();
-
1060  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> nmodl_eigen_xm, nmodl_eigen_fm;", float_type, N);
-
1061  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm;", float_type, N);
-
1062  if (N <= 4) {
-
1063  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm_inv;", float_type, N);
-
1064  }
-
1065  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
-
1066  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
-
1067  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
-
1068  print_statement_block(*node.get_variable_block(), false, false);
-
1069  print_statement_block(*node.get_initialize_block(), false, false);
-
1070  print_statement_block(*node.get_setup_x_block(), false, false);
-
1071 
-
1072  printer->add_newline();
-
1073  print_eigen_linear_solver(float_type, N);
-
1074  printer->add_newline();
-
1075 
-
1076  print_statement_block(*node.get_update_states_block(), false, false);
-
1077  print_statement_block(*node.get_finalize_block(), false, false);
-
1078 }
+ +
1037  printer->pop_block();
+
1038 }
+
1039 
+
1040 
+ +
1042  auto block = node.get_node_to_solve().get();
+
1043  if (block->is_statement_block()) {
+
1044  auto statement_block = dynamic_cast<ast::StatementBlock*>(block);
+
1045  print_statement_block(*statement_block, false, false);
+
1046  } else {
+
1047  block->accept(*this);
+
1048  }
+
1049 }
+
1050 
+
1051 
+ +
1053  // solution vector to store copy of state vars for Newton solver
+
1054  printer->add_newline();
+
1055 
+
1056  auto float_type = default_float_data_type();
+
1057  int N = node.get_n_state_vars()->get_value();
+
1058  printer->fmt_line("Eigen::Matrix<{}, {}, 1> nmodl_eigen_xm;", float_type, N);
+
1059  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
+
1060 
+
1061  print_statement_block(*node.get_setup_x_block(), false, false);
+
1062 
+
1063  // call newton solver with functor and X matrix that contains state vars
+
1064  printer->add_line("// call newton solver");
+
1065  printer->fmt_line("{} newton_functor({});",
+
1066  info.functor_names[&node],
+
1067  get_arg_str(functor_params()));
+
1068  printer->add_line("newton_functor.initialize();");
+
1069  printer->add_line(
+
1070  "int newton_iterations = nmodl::newton::newton_solver(nmodl_eigen_xm, newton_functor);");
+
1071  printer->add_line(
+
1072  "if (newton_iterations < 0) assert(false && \"Newton solver did not converge!\");");
+
1073 
+
1074  // assign newton solver results in matrix X to state vars
+
1075  print_statement_block(*node.get_update_states_block(), false, false);
+
1076  printer->add_line("newton_functor.finalize();");
+
1077 }
+
1078 
1079 
-
1080 
-
1081 /**
-
1082  * \details Once variables are populated, update index semantics to register with coreneuron
-
1083  */
-
1084 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
- -
1086  int index = 0;
-
1087  info.semantics.clear();
-
1088 
-
1089  if (info.point_process) {
-
1090  info.semantics.emplace_back(index++, naming::AREA_SEMANTIC, 1);
-
1091  info.semantics.emplace_back(index++, naming::POINT_PROCESS_SEMANTIC, 1);
-
1092  }
-
1093  for (const auto& ion: info.ions) {
-
1094  for (auto i = 0; i < ion.reads.size(); ++i) {
-
1095  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
-
1096  }
-
1097  for (const auto& var: ion.writes) {
-
1098  /// add if variable is not present in the read list
-
1099  if (std::find(ion.reads.begin(), ion.reads.end(), var) == ion.reads.end()) {
-
1100  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
-
1101  }
-
1102  if (ion.is_ionic_current(var)) {
-
1103  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
-
1104  }
-
1105  }
-
1106  if (ion.need_style) {
-
1107  info.semantics.emplace_back(index++, fmt::format("{}_ion", ion.name), 1);
-
1108  info.semantics.emplace_back(index++, fmt::format("#{}_ion", ion.name), 1);
-
1109  }
-
1110  }
-
1111  for (auto& var: info.pointer_variables) {
-
1112  if (info.first_pointer_var_index == -1) {
-
1113  info.first_pointer_var_index = index;
-
1114  }
-
1115  int size = var->get_length();
-
1116  if (var->has_any_property(NmodlType::pointer_var)) {
-
1117  info.semantics.emplace_back(index, naming::POINTER_SEMANTIC, size);
-
1118  } else {
-
1119  info.semantics.emplace_back(index, naming::CORE_POINTER_SEMANTIC, size);
-
1120  }
-
1121  index += size;
-
1122  }
-
1123 
-
1124  for (auto& var: info.random_variables) {
-
1125  if (info.first_random_var_index == -1) {
-
1126  info.first_random_var_index = index;
-
1127  }
-
1128  int size = var->get_length();
-
1129  info.semantics.emplace_back(index, naming::RANDOM_SEMANTIC, size);
-
1130  index += size;
-
1131  }
-
1132 
-
1133  if (info.diam_used) {
-
1134  info.semantics.emplace_back(index++, naming::DIAM_VARIABLE, 1);
+ +
1081  printer->add_newline();
+
1082 
+
1083  const std::string float_type = default_float_data_type();
+
1084  int N = node.get_n_state_vars()->get_value();
+
1085  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> nmodl_eigen_xm, nmodl_eigen_fm;", float_type, N);
+
1086  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm;", float_type, N);
+
1087  if (N <= 4) {
+
1088  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm_inv;", float_type, N);
+
1089  }
+
1090  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
+
1091  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
+
1092  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
+
1093  print_statement_block(*node.get_variable_block(), false, false);
+
1094  print_statement_block(*node.get_initialize_block(), false, false);
+
1095  print_statement_block(*node.get_setup_x_block(), false, false);
+
1096 
+
1097  printer->add_newline();
+
1098  print_eigen_linear_solver(float_type, N);
+
1099  printer->add_newline();
+
1100 
+
1101  print_statement_block(*node.get_update_states_block(), false, false);
+
1102  print_statement_block(*node.get_finalize_block(), false, false);
+
1103 }
+
1104 
+
1105 
+
1106 /**
+
1107  * \details Once variables are populated, update index semantics to register with coreneuron
+
1108  */
+
1109 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
+ +
1111  int index = 0;
+
1112  info.semantics.clear();
+
1113 
+
1114  if (info.point_process) {
+
1115  info.semantics.emplace_back(index++, naming::AREA_SEMANTIC, 1);
+
1116  info.semantics.emplace_back(index++, naming::POINT_PROCESS_SEMANTIC, 1);
+
1117  }
+
1118  for (const auto& ion: info.ions) {
+
1119  for (auto i = 0; i < ion.reads.size(); ++i) {
+
1120  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
+
1121  }
+
1122  for (const auto& var: ion.writes) {
+
1123  /// add if variable is not present in the read list
+
1124  if (std::find(ion.reads.begin(), ion.reads.end(), var) == ion.reads.end()) {
+
1125  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
+
1126  }
+
1127  if (ion.is_ionic_current(var)) {
+
1128  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
+
1129  }
+
1130  }
+
1131  if (ion.need_style) {
+
1132  info.semantics.emplace_back(index++, fmt::format("{}_ion", ion.name), 1);
+
1133  info.semantics.emplace_back(index++, fmt::format("#{}_ion", ion.name), 1);
+
1134  }
1135  }
-
1136 
-
1137  if (info.area_used) {
-
1138  info.semantics.emplace_back(index++, naming::AREA_VARIABLE, 1);
-
1139  }
-
1140 
-
1141  if (info.net_send_used) {
-
1142  info.semantics.emplace_back(index++, naming::NET_SEND_SEMANTIC, 1);
-
1143  }
-
1144 
-
1145  /*
-
1146  * Number of semantics for watch is one greater than number of
-
1147  * actual watch statements in the mod file
-
1148  */
-
1149  if (!info.watch_statements.empty()) {
-
1150  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
-
1151  info.semantics.emplace_back(index++, naming::WATCH_SEMANTIC, 1);
+
1136  for (auto& var: info.pointer_variables) {
+
1137  if (info.first_pointer_var_index == -1) {
+
1138  info.first_pointer_var_index = index;
+
1139  }
+
1140  int size = var->get_length();
+
1141  if (var->has_any_property(NmodlType::pointer_var)) {
+
1142  info.semantics.emplace_back(index, naming::POINTER_SEMANTIC, size);
+
1143  } else {
+
1144  info.semantics.emplace_back(index, naming::CORE_POINTER_SEMANTIC, size);
+
1145  }
+
1146  index += size;
+
1147  }
+
1148 
+
1149  for (auto& var: info.random_variables) {
+
1150  if (info.first_random_var_index == -1) {
+
1151  info.first_random_var_index = index;
1152  }
-
1153  }
-
1154 
-
1155  if (info.for_netcon_used) {
-
1156  info.semantics.emplace_back(index++, naming::FOR_NETCON_SEMANTIC, 1);
-
1157  }
-
1158 }
-
1159 
-
1160 
-
1161 std::vector<CodegenCppVisitor::SymbolType> CodegenCppVisitor::get_float_variables() const {
-
1162  // sort with definition order
-
1163  auto comparator = [](const SymbolType& first, const SymbolType& second) -> bool {
-
1164  return first->get_definition_order() < second->get_definition_order();
-
1165  };
-
1166 
-
1167  auto assigned = info.assigned_vars;
-
1168  auto states = info.state_vars;
+
1153  int size = var->get_length();
+
1154  info.semantics.emplace_back(index, naming::RANDOM_SEMANTIC, size);
+
1155  index += size;
+
1156  }
+
1157 
+
1158  if (info.diam_used) {
+
1159  info.semantics.emplace_back(index++, naming::DIAM_VARIABLE, 1);
+
1160  }
+
1161 
+
1162  if (info.area_used) {
+
1163  info.semantics.emplace_back(index++, naming::AREA_VARIABLE, 1);
+
1164  }
+
1165 
+
1166  if (info.net_send_used) {
+
1167  info.semantics.emplace_back(index++, naming::NET_SEND_SEMANTIC, 1);
+
1168  }
1169 
-
1170  // each state variable has corresponding Dstate variable
-
1171  for (const auto& state: states) {
-
1172  auto name = "D" + state->get_name();
-
1173  auto symbol = make_symbol(name);
-
1174  if (state->is_array()) {
-
1175  symbol->set_as_array(state->get_length());
-
1176  }
-
1177  symbol->set_definition_order(state->get_definition_order());
-
1178  assigned.push_back(symbol);
-
1179  }
-
1180  std::sort(assigned.begin(), assigned.end(), comparator);
-
1181 
-
1182  auto variables = info.range_parameter_vars;
-
1183  variables.insert(variables.end(),
-
1184  info.range_assigned_vars.begin(),
-
1185  info.range_assigned_vars.end());
-
1186  variables.insert(variables.end(), info.range_state_vars.begin(), info.range_state_vars.end());
-
1187  variables.insert(variables.end(), assigned.begin(), assigned.end());
-
1188 
-
1189  if (info.vectorize) {
-
1190  variables.push_back(make_symbol(naming::VOLTAGE_UNUSED_VARIABLE));
-
1191  }
-
1192 
-
1193  if (breakpoint_exist()) {
-
1194  std::string name = info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
- -
1196 
-
1197  // make sure conductance variable like `g` is not already defined
-
1198  if (auto r = std::find_if(variables.cbegin(),
-
1199  variables.cend(),
-
1200  [&](const auto& s) { return name == s->get_name(); });
-
1201  r == variables.cend()) {
-
1202  variables.push_back(make_symbol(name));
-
1203  }
+
1170  /*
+
1171  * Number of semantics for watch is one greater than number of
+
1172  * actual watch statements in the mod file
+
1173  */
+
1174  if (!info.watch_statements.empty()) {
+
1175  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
+
1176  info.semantics.emplace_back(index++, naming::WATCH_SEMANTIC, 1);
+
1177  }
+
1178  }
+
1179 
+
1180  if (info.for_netcon_used) {
+
1181  info.semantics.emplace_back(index++, naming::FOR_NETCON_SEMANTIC, 1);
+
1182  }
+
1183 }
+
1184 
+
1185 
+
1186 std::vector<CodegenCppVisitor::SymbolType> CodegenCppVisitor::get_float_variables() const {
+
1187  // sort with definition order
+
1188  auto comparator = [](const SymbolType& first, const SymbolType& second) -> bool {
+
1189  return first->get_definition_order() < second->get_definition_order();
+
1190  };
+
1191 
+
1192  auto assigned = info.assigned_vars;
+
1193  auto states = info.state_vars;
+
1194 
+
1195  // each state variable has corresponding Dstate variable
+
1196  for (const auto& state: states) {
+
1197  auto name = "D" + state->get_name();
+
1198  auto symbol = make_symbol(name);
+
1199  if (state->is_array()) {
+
1200  symbol->set_as_array(state->get_length());
+
1201  }
+
1202  symbol->set_definition_order(state->get_definition_order());
+
1203  assigned.push_back(symbol);
1204  }
-
1205 
-
1206  if (net_receive_exist()) {
-
1207  variables.push_back(make_symbol(naming::T_SAVE_VARIABLE));
-
1208  }
-
1209 
-
1210  return variables;
-
1211 }
-
1212 
-
1213 
-
1214 /**
-
1215  * IndexVariableInfo has following constructor arguments:
-
1216  * - symbol
-
1217  * - is_vdata (false)
-
1218  * - is_index (false
-
1219  * - is_integer (false)
-
1220  *
-
1221  * Which variables are constant qualified?
-
1222  *
-
1223  * - node area is read only
-
1224  * - read ion variables are read only
-
1225  * - style_ionname is index / offset
-
1226  */
-
1227 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
-
1228 std::vector<IndexVariableInfo> CodegenCppVisitor::get_int_variables() {
-
1229  std::vector<IndexVariableInfo> variables;
-
1230  if (info.point_process) {
-
1231  variables.emplace_back(make_symbol(naming::NODE_AREA_VARIABLE));
-
1232  variables.back().is_constant = true;
-
1233 
-
1234  add_variable_point_process(variables);
-
1235  }
-
1236 
-
1237  for (auto& ion: info.ions) {
-
1238  bool need_style = false;
-
1239  std::unordered_map<std::string, int> ion_vars; // used to keep track of the variables to
-
1240  // not have doubles between read/write. Same
-
1241  // name variables are allowed
-
1242  // See if we need to add extra readion statements to match NEURON with SoA data
-
1243  auto const has_var = [&ion](const char* suffix) -> bool {
-
1244  auto const pred = [name = ion.name + suffix](auto const& x) { return x == name; };
-
1245  return std::any_of(ion.reads.begin(), ion.reads.end(), pred) ||
-
1246  std::any_of(ion.writes.begin(), ion.writes.end(), pred);
-
1247  };
-
1248  auto const add_implicit_read = [&ion](const char* suffix) {
-
1249  auto name = ion.name + suffix;
-
1250  ion.reads.push_back(name);
-
1251  ion.implicit_reads.push_back(std::move(name));
-
1252  };
-
1253  bool const have_ionin{has_var("i")}, have_ionout{has_var("o")};
-
1254  if (have_ionin && !have_ionout) {
-
1255  add_implicit_read("o");
-
1256  } else if (have_ionout && !have_ionin) {
-
1257  add_implicit_read("i");
-
1258  }
-
1259  for (const auto& var: ion.reads) {
-
1260  const std::string name = naming::ION_VARNAME_PREFIX + var;
-
1261  variables.emplace_back(make_symbol(name));
-
1262  variables.back().is_constant = true;
-
1263  ion_vars[name] = static_cast<int>(variables.size() - 1);
-
1264  }
-
1265 
-
1266  /// symbol for di_ion_dv var
-
1267  std::shared_ptr<symtab::Symbol> ion_di_dv_var = nullptr;
-
1268 
-
1269  for (const auto& var: ion.writes) {
-
1270  const std::string name = naming::ION_VARNAME_PREFIX + var;
-
1271 
-
1272  const auto ion_vars_it = ion_vars.find(name);
-
1273  if (ion_vars_it != ion_vars.end()) {
-
1274  variables[ion_vars_it->second].is_constant = false;
-
1275  } else {
-
1276  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + var));
-
1277  }
-
1278  if (ion.is_ionic_current(var)) {
-
1279  ion_di_dv_var = make_symbol(std::string(naming::ION_VARNAME_PREFIX) + "di" +
-
1280  ion.name + "dv");
-
1281  }
-
1282  if (ion.is_intra_cell_conc(var) || ion.is_extra_cell_conc(var)) {
-
1283  need_style = true;
-
1284  }
-
1285  }
-
1286 
-
1287  /// insert after read/write variables but before style ion variable
-
1288  if (ion_di_dv_var != nullptr) {
-
1289  variables.emplace_back(ion_di_dv_var);
-
1290  }
-
1291 
-
1292  if (need_style) {
-
1293  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + ion.name + "_erev"));
-
1294  variables.emplace_back(make_symbol("style_" + ion.name), false, true);
-
1295  variables.back().is_constant = true;
-
1296  }
-
1297  }
-
1298 
-
1299  for (const auto& var: info.pointer_variables) {
-
1300  auto name = var->get_name();
-
1301  if (var->has_any_property(NmodlType::pointer_var)) {
-
1302  variables.emplace_back(make_symbol(name));
-
1303  } else {
-
1304  variables.emplace_back(make_symbol(name), true);
-
1305  }
-
1306  }
-
1307 
-
1308  for (const auto& var: info.random_variables) {
-
1309  auto name = var->get_name();
-
1310  variables.emplace_back(make_symbol(name), true);
-
1311  variables.back().symbol->add_properties(NmodlType::random_var);
-
1312  }
-
1313 
-
1314  if (info.diam_used) {
-
1315  variables.emplace_back(make_symbol(naming::DIAM_VARIABLE));
-
1316  }
-
1317 
-
1318  if (info.area_used) {
-
1319  variables.emplace_back(make_symbol(naming::AREA_VARIABLE));
-
1320  }
-
1321 
-
1322  add_variable_tqitem(variables);
-
1323 
-
1324  /**
-
1325  * \note Variables for watch statements : there is one extra variable
-
1326  * used in coreneuron compared to actual watch statements for compatibility
-
1327  * with neuron (which uses one extra Datum variable)
-
1328  */
-
1329  if (!info.watch_statements.empty()) {
-
1330  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
-
1331  variables.emplace_back(make_symbol(fmt::format("watch{}", i)), false, false, true);
-
1332  }
-
1333  }
-
1334  return variables;
-
1335 }
-
1336 
-
1337 
- -
1339  program_symtab = node.get_symbol_table();
-
1340 
- -
1342  info = v.analyze(node);
-
1343  info.mod_file = mod_filename;
-
1344 
-
1345  if (info.mod_suffix == "") {
-
1346  info.mod_suffix = std::filesystem::path(mod_filename).stem().string();
-
1347  }
-
1348  info.rsuffix = info.point_process ? "" : "_" + info.mod_suffix;
-
1349 
-
1350  if (!info.vectorize) {
-
1351  logger->warn(
-
1352  "CodegenCoreneuronCppVisitor : MOD file uses non-thread safe constructs of NMODL");
-
1353  }
-
1354 
-
1355  codegen_float_variables = get_float_variables();
-
1356  codegen_int_variables = get_int_variables();
-
1357 
-
1358  update_index_semantics();
-
1359  rename_function_arguments();
-
1360 
-
1361  info.semantic_variable_count = int_variables_size();
-
1362 }
-
1363 
- -
1365  if (type == BlockType::Initial) {
-
1366  return method_name(naming::NRN_INIT_METHOD);
-
1367  }
-
1368  if (type == BlockType::Constructor) {
-
1369  return method_name(naming::NRN_CONSTRUCTOR_METHOD);
-
1370  }
-
1371  if (type == BlockType::Destructor) {
-
1372  return method_name(naming::NRN_DESTRUCTOR_METHOD);
-
1373  }
-
1374  if (type == BlockType::State) {
-
1375  return method_name(naming::NRN_STATE_METHOD);
-
1376  }
-
1377  if (type == BlockType::Equation) {
-
1378  return method_name(naming::NRN_CUR_METHOD);
-
1379  }
-
1380  if (type == BlockType::Watch) {
-
1381  return method_name(naming::NRN_WATCH_CHECK_METHOD);
-
1382  }
-
1383  throw std::logic_error("compute_method_name not implemented");
-
1384 }
+
1205  std::sort(assigned.begin(), assigned.end(), comparator);
+
1206 
+
1207  auto variables = info.range_parameter_vars;
+
1208  variables.insert(variables.end(),
+
1209  info.range_assigned_vars.begin(),
+
1210  info.range_assigned_vars.end());
+
1211  variables.insert(variables.end(), info.range_state_vars.begin(), info.range_state_vars.end());
+
1212  variables.insert(variables.end(), assigned.begin(), assigned.end());
+
1213 
+
1214  if (info.vectorize) {
+
1215  variables.push_back(make_symbol(naming::VOLTAGE_UNUSED_VARIABLE));
+
1216  }
+
1217 
+
1218  if (breakpoint_exist()) {
+
1219  std::string name = info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
+ +
1221 
+
1222  // make sure conductance variable like `g` is not already defined
+
1223  if (auto r = std::find_if(variables.cbegin(),
+
1224  variables.cend(),
+
1225  [&](const auto& s) { return name == s->get_name(); });
+
1226  r == variables.cend()) {
+
1227  variables.push_back(make_symbol(name));
+
1228  }
+
1229  }
+
1230 
+
1231  if (net_receive_exist()) {
+
1232  variables.push_back(make_symbol(naming::T_SAVE_VARIABLE));
+
1233  }
+
1234 
+
1235  return variables;
+
1236 }
+
1237 
+
1238 
+
1239 /**
+
1240  * IndexVariableInfo has following constructor arguments:
+
1241  * - symbol
+
1242  * - is_vdata (false)
+
1243  * - is_index (false
+
1244  * - is_integer (false)
+
1245  *
+
1246  * Which variables are constant qualified?
+
1247  *
+
1248  * - node area is read only
+
1249  * - read ion variables are read only
+
1250  * - style_ionname is index / offset
+
1251  */
+
1252 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
+
1253 std::vector<IndexVariableInfo> CodegenCppVisitor::get_int_variables() {
+
1254  std::vector<IndexVariableInfo> variables;
+
1255  if (info.point_process) {
+
1256  variables.emplace_back(make_symbol(naming::NODE_AREA_VARIABLE));
+
1257  variables.back().is_constant = true;
+
1258 
+
1259  add_variable_point_process(variables);
+
1260  }
+
1261 
+
1262  for (auto& ion: info.ions) {
+
1263  bool need_style = false;
+
1264  std::unordered_map<std::string, int> ion_vars; // used to keep track of the variables to
+
1265  // not have doubles between read/write. Same
+
1266  // name variables are allowed
+
1267  // See if we need to add extra readion statements to match NEURON with SoA data
+
1268  auto const has_var = [&ion](const char* suffix) -> bool {
+
1269  auto const pred = [name = ion.name + suffix](auto const& x) { return x == name; };
+
1270  return std::any_of(ion.reads.begin(), ion.reads.end(), pred) ||
+
1271  std::any_of(ion.writes.begin(), ion.writes.end(), pred);
+
1272  };
+
1273  auto const add_implicit_read = [&ion](const char* suffix) {
+
1274  auto name = ion.name + suffix;
+
1275  ion.reads.push_back(name);
+
1276  ion.implicit_reads.push_back(std::move(name));
+
1277  };
+
1278  bool const have_ionin{has_var("i")}, have_ionout{has_var("o")};
+
1279  if (have_ionin && !have_ionout) {
+
1280  add_implicit_read("o");
+
1281  } else if (have_ionout && !have_ionin) {
+
1282  add_implicit_read("i");
+
1283  }
+
1284  for (const auto& var: ion.reads) {
+
1285  const std::string name = naming::ION_VARNAME_PREFIX + var;
+
1286  variables.emplace_back(make_symbol(name));
+
1287  variables.back().is_constant = true;
+
1288  ion_vars[name] = static_cast<int>(variables.size() - 1);
+
1289  }
+
1290 
+
1291  /// symbol for di_ion_dv var
+
1292  std::shared_ptr<symtab::Symbol> ion_di_dv_var = nullptr;
+
1293 
+
1294  for (const auto& var: ion.writes) {
+
1295  const std::string name = naming::ION_VARNAME_PREFIX + var;
+
1296 
+
1297  const auto ion_vars_it = ion_vars.find(name);
+
1298  if (ion_vars_it != ion_vars.end()) {
+
1299  variables[ion_vars_it->second].is_constant = false;
+
1300  } else {
+
1301  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + var));
+
1302  }
+
1303  if (ion.is_ionic_current(var)) {
+
1304  ion_di_dv_var = make_symbol(std::string(naming::ION_VARNAME_PREFIX) + "di" +
+
1305  ion.name + "dv");
+
1306  }
+
1307  if (ion.is_intra_cell_conc(var) || ion.is_extra_cell_conc(var)) {
+
1308  need_style = true;
+
1309  }
+
1310  }
+
1311 
+
1312  /// insert after read/write variables but before style ion variable
+
1313  if (ion_di_dv_var != nullptr) {
+
1314  variables.emplace_back(ion_di_dv_var);
+
1315  }
+
1316 
+
1317  if (need_style) {
+
1318  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + ion.name + "_erev"));
+
1319  variables.emplace_back(make_symbol("style_" + ion.name), false, true);
+
1320  variables.back().is_constant = true;
+
1321  }
+
1322  }
+
1323 
+
1324  for (const auto& var: info.pointer_variables) {
+
1325  auto name = var->get_name();
+
1326  if (var->has_any_property(NmodlType::pointer_var)) {
+
1327  variables.emplace_back(make_symbol(name));
+
1328  } else {
+
1329  variables.emplace_back(make_symbol(name), true);
+
1330  }
+
1331  }
+
1332 
+
1333  for (const auto& var: info.random_variables) {
+
1334  auto name = var->get_name();
+
1335  variables.emplace_back(make_symbol(name), true);
+
1336  variables.back().symbol->add_properties(NmodlType::random_var);
+
1337  }
+
1338 
+
1339  if (info.diam_used) {
+
1340  variables.emplace_back(make_symbol(naming::DIAM_VARIABLE));
+
1341  }
+
1342 
+
1343  if (info.area_used) {
+
1344  variables.emplace_back(make_symbol(naming::AREA_VARIABLE));
+
1345  }
+
1346 
+
1347  add_variable_tqitem(variables);
+
1348 
+
1349  /**
+
1350  * \note Variables for watch statements : there is one extra variable
+
1351  * used in coreneuron compared to actual watch statements for compatibility
+
1352  * with neuron (which uses one extra Datum variable)
+
1353  */
+
1354  if (!info.watch_statements.empty()) {
+
1355  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
+
1356  variables.emplace_back(make_symbol(fmt::format("watch{}", i)), false, false, true);
+
1357  }
+
1358  }
+
1359  return variables;
+
1360 }
+
1361 
+
1362 
+ +
1364  program_symtab = node.get_symbol_table();
+
1365 
+ +
1367  info = v.analyze(node);
+
1368  info.mod_file = mod_filename;
+
1369 
+
1370  if (info.mod_suffix == "") {
+
1371  info.mod_suffix = std::filesystem::path(mod_filename).stem().string();
+
1372  }
+
1373  info.rsuffix = info.point_process ? "" : "_" + info.mod_suffix;
+
1374 
+
1375  if (!info.vectorize) {
+
1376  logger->warn(
+
1377  "CodegenCoreneuronCppVisitor : MOD file uses non-thread safe constructs of NMODL");
+
1378  }
+
1379 
+
1380  codegen_float_variables = get_float_variables();
+
1381  codegen_int_variables = get_int_variables();
+
1382 
+
1383  update_index_semantics();
+
1384  rename_function_arguments();
1385 
-
1386 
- -
1388  setup(node);
-
1389  print_codegen_routines();
-
1390 }
-
1391 
-
1392 
- -
1394  auto name = node.get_node_name();
-
1395  auto statement = get_table_statement(node);
-
1396  auto table_variables = statement->get_table_vars();
-
1397  auto with = statement->get_with()->eval();
-
1398  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
-
1399  auto tmin_name = get_variable_name("tmin_" + name);
-
1400  auto mfac_name = get_variable_name("mfac_" + name);
-
1401  auto function_name = method_name("f_" + name);
-
1402 
-
1403  printer->add_newline(2);
-
1404  print_function_declaration(node, name);
-
1405  printer->push_block();
-
1406  {
-
1407  const auto& params = node.get_parameters();
-
1408  printer->fmt_push_block("if ({} == 0)", use_table_var);
-
1409  if (node.is_procedure_block()) {
-
1410  printer->fmt_line("{}({}, {});",
-
1411  function_name,
-
1412  internal_method_arguments(),
-
1413  params[0].get()->get_node_name());
-
1414  printer->add_line("return 0;");
-
1415  } else {
-
1416  printer->fmt_line("return {}({}, {});",
-
1417  function_name,
-
1418  internal_method_arguments(),
-
1419  params[0].get()->get_node_name());
-
1420  }
-
1421  printer->pop_block();
-
1422 
-
1423  printer->fmt_line("double xi = {} * ({} - {});",
-
1424  mfac_name,
-
1425  params[0].get()->get_node_name(),
-
1426  tmin_name);
-
1427  printer->push_block("if (isnan(xi))");
-
1428  if (node.is_procedure_block()) {
-
1429  for (const auto& var: table_variables) {
-
1430  auto var_name = get_variable_name(var->get_node_name());
-
1431  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
-
1432  if (is_array) {
-
1433  for (int j = 0; j < array_length; j++) {
-
1434  printer->fmt_line("{}[{}] = xi;", var_name, j);
-
1435  }
-
1436  } else {
-
1437  printer->fmt_line("{} = xi;", var_name);
-
1438  }
-
1439  }
-
1440  printer->add_line("return 0;");
-
1441  } else {
-
1442  printer->add_line("return xi;");
-
1443  }
-
1444  printer->pop_block();
-
1445 
-
1446  printer->fmt_push_block("if (xi <= 0. || xi >= {}.)", with);
-
1447  printer->fmt_line("int index = (xi <= 0.) ? 0 : {};", with);
-
1448  if (node.is_procedure_block()) {
-
1449  for (const auto& variable: table_variables) {
-
1450  auto var_name = variable->get_node_name();
-
1451  auto instance_name = get_variable_name(var_name);
-
1452  auto table_name = get_variable_name("t_" + var_name);
-
1453  auto [is_array, array_length] = check_if_var_is_array(var_name);
-
1454  if (is_array) {
-
1455  for (int j = 0; j < array_length; j++) {
-
1456  printer->fmt_line(
-
1457  "{}[{}] = {}[{}][index];", instance_name, j, table_name, j);
-
1458  }
-
1459  } else {
-
1460  printer->fmt_line("{} = {}[index];", instance_name, table_name);
-
1461  }
-
1462  }
-
1463  printer->add_line("return 0;");
-
1464  } else {
-
1465  auto table_name = get_variable_name("t_" + name);
-
1466  printer->fmt_line("return {}[index];", table_name);
-
1467  }
-
1468  printer->pop_block();
-
1469 
-
1470  printer->add_line("int i = int(xi);");
-
1471  printer->add_line("double theta = xi - double(i);");
-
1472  if (node.is_procedure_block()) {
-
1473  for (const auto& var: table_variables) {
-
1474  auto var_name = var->get_node_name();
-
1475  auto instance_name = get_variable_name(var_name);
-
1476  auto table_name = get_variable_name("t_" + var_name);
-
1477  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
-
1478  if (is_array) {
-
1479  for (size_t j = 0; j < array_length; j++) {
-
1480  printer->fmt_line(
-
1481  "{0}[{1}] = {2}[{1}][i] + theta*({2}[{1}][i+1]-{2}[{1}][i]);",
-
1482  instance_name,
-
1483  j,
-
1484  table_name);
-
1485  }
-
1486  } else {
-
1487  printer->fmt_line("{0} = {1}[i] + theta*({1}[i+1]-{1}[i]);",
-
1488  instance_name,
-
1489  table_name);
-
1490  }
-
1491  }
-
1492  printer->add_line("return 0;");
-
1493  } else {
-
1494  auto table_name = get_variable_name("t_" + name);
-
1495  printer->fmt_line("return {0}[i] + theta * ({0}[i+1] - {0}[i]);", table_name);
-
1496  }
-
1497  }
-
1498  printer->pop_block();
-
1499 }
-
1500 
-
1501 
- -
1503  auto statement = get_table_statement(node);
-
1504  auto table_variables = statement->get_table_vars();
-
1505  auto depend_variables = statement->get_depend_vars();
-
1506  const auto& from = statement->get_from();
-
1507  const auto& to = statement->get_to();
-
1508  auto name = node.get_node_name();
-
1509  auto internal_params = internal_method_parameters();
-
1510  auto with = statement->get_with()->eval();
-
1511  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
-
1512  auto tmin_name = get_variable_name("tmin_" + name);
-
1513  auto mfac_name = get_variable_name("mfac_" + name);
-
1514  auto float_type = default_float_data_type();
-
1515 
-
1516  printer->add_newline(2);
-
1517  printer->fmt_push_block("void {}({})",
-
1518  table_update_function_name(name),
-
1519  get_parameter_str(internal_params));
-
1520  {
-
1521  printer->fmt_push_block("if ({} == 0)", use_table_var);
-
1522  printer->add_line("return;");
-
1523  printer->pop_block();
-
1524 
-
1525  printer->add_line("static bool make_table = true;");
-
1526  for (const auto& variable: depend_variables) {
-
1527  printer->fmt_line("static {} save_{};", float_type, variable->get_node_name());
-
1528  }
-
1529 
-
1530  for (const auto& variable: depend_variables) {
-
1531  const auto& var_name = variable->get_node_name();
-
1532  const auto& instance_name = get_variable_name(var_name);
-
1533  printer->fmt_push_block("if (save_{} != {})", var_name, instance_name);
-
1534  printer->add_line("make_table = true;");
-
1535  printer->pop_block();
-
1536  }
-
1537 
-
1538  printer->push_block("if (make_table)");
-
1539  {
-
1540  printer->add_line("make_table = false;");
-
1541 
-
1542  printer->add_indent();
-
1543  printer->add_text(tmin_name, " = ");
-
1544  from->accept(*this);
-
1545  printer->add_text(';');
-
1546  printer->add_newline();
-
1547 
-
1548  printer->add_indent();
-
1549  printer->add_text("double tmax = ");
-
1550  to->accept(*this);
-
1551  printer->add_text(';');
-
1552  printer->add_newline();
-
1553 
+
1386  info.semantic_variable_count = int_variables_size();
+
1387 }
+
1388 
+ +
1390  if (type == BlockType::Initial) {
+
1391  return method_name(naming::NRN_INIT_METHOD);
+
1392  }
+
1393  if (type == BlockType::Constructor) {
+
1394  return method_name(naming::NRN_CONSTRUCTOR_METHOD);
+
1395  }
+
1396  if (type == BlockType::Destructor) {
+
1397  return method_name(naming::NRN_DESTRUCTOR_METHOD);
+
1398  }
+
1399  if (type == BlockType::State) {
+
1400  return method_name(naming::NRN_STATE_METHOD);
+
1401  }
+
1402  if (type == BlockType::Equation) {
+
1403  return method_name(naming::NRN_CUR_METHOD);
+
1404  }
+
1405  if (type == BlockType::Watch) {
+
1406  return method_name(naming::NRN_WATCH_CHECK_METHOD);
+
1407  }
+
1408  throw std::logic_error("compute_method_name not implemented");
+
1409 }
+
1410 
+
1411 
+ +
1413  setup(node);
+
1414  print_codegen_routines();
+
1415 }
+
1416 
+
1417 
+ +
1419  auto name = node.get_node_name();
+
1420  auto statement = get_table_statement(node);
+
1421  auto table_variables = statement->get_table_vars();
+
1422  auto with = statement->get_with()->eval();
+
1423  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
+
1424  auto tmin_name = get_variable_name("tmin_" + name);
+
1425  auto mfac_name = get_variable_name("mfac_" + name);
+
1426  auto function_name = method_name("f_" + name);
+
1427 
+
1428  printer->add_newline(2);
+
1429  print_function_declaration(node, name);
+
1430  printer->push_block();
+
1431  {
+
1432  const auto& params = node.get_parameters();
+
1433  printer->fmt_push_block("if ({} == 0)", use_table_var);
+
1434  if (node.is_procedure_block()) {
+
1435  printer->fmt_line("{}({}, {});",
+
1436  function_name,
+
1437  internal_method_arguments(),
+
1438  params[0].get()->get_node_name());
+
1439  printer->add_line("return 0;");
+
1440  } else {
+
1441  printer->fmt_line("return {}({}, {});",
+
1442  function_name,
+
1443  internal_method_arguments(),
+
1444  params[0].get()->get_node_name());
+
1445  }
+
1446  printer->pop_block();
+
1447 
+
1448  printer->fmt_line("double xi = {} * ({} - {});",
+
1449  mfac_name,
+
1450  params[0].get()->get_node_name(),
+
1451  tmin_name);
+
1452  printer->push_block("if (isnan(xi))");
+
1453  if (node.is_procedure_block()) {
+
1454  for (const auto& var: table_variables) {
+
1455  auto var_name = get_variable_name(var->get_node_name());
+
1456  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
+
1457  if (is_array) {
+
1458  for (int j = 0; j < array_length; j++) {
+
1459  printer->fmt_line("{}[{}] = xi;", var_name, j);
+
1460  }
+
1461  } else {
+
1462  printer->fmt_line("{} = xi;", var_name);
+
1463  }
+
1464  }
+
1465  printer->add_line("return 0;");
+
1466  } else {
+
1467  printer->add_line("return xi;");
+
1468  }
+
1469  printer->pop_block();
+
1470 
+
1471  printer->fmt_push_block("if (xi <= 0. || xi >= {}.)", with);
+
1472  printer->fmt_line("int index = (xi <= 0.) ? 0 : {};", with);
+
1473  if (node.is_procedure_block()) {
+
1474  for (const auto& variable: table_variables) {
+
1475  auto var_name = variable->get_node_name();
+
1476  auto instance_name = get_variable_name(var_name);
+
1477  auto table_name = get_variable_name("t_" + var_name);
+
1478  auto [is_array, array_length] = check_if_var_is_array(var_name);
+
1479  if (is_array) {
+
1480  for (int j = 0; j < array_length; j++) {
+
1481  printer->fmt_line(
+
1482  "{}[{}] = {}[{}][index];", instance_name, j, table_name, j);
+
1483  }
+
1484  } else {
+
1485  printer->fmt_line("{} = {}[index];", instance_name, table_name);
+
1486  }
+
1487  }
+
1488  printer->add_line("return 0;");
+
1489  } else {
+
1490  auto table_name = get_variable_name("t_" + name);
+
1491  printer->fmt_line("return {}[index];", table_name);
+
1492  }
+
1493  printer->pop_block();
+
1494 
+
1495  printer->add_line("int i = int(xi);");
+
1496  printer->add_line("double theta = xi - double(i);");
+
1497  if (node.is_procedure_block()) {
+
1498  for (const auto& var: table_variables) {
+
1499  auto var_name = var->get_node_name();
+
1500  auto instance_name = get_variable_name(var_name);
+
1501  auto table_name = get_variable_name("t_" + var_name);
+
1502  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
+
1503  if (is_array) {
+
1504  for (size_t j = 0; j < array_length; j++) {
+
1505  printer->fmt_line(
+
1506  "{0}[{1}] = {2}[{1}][i] + theta*({2}[{1}][i+1]-{2}[{1}][i]);",
+
1507  instance_name,
+
1508  j,
+
1509  table_name);
+
1510  }
+
1511  } else {
+
1512  printer->fmt_line("{0} = {1}[i] + theta*({1}[i+1]-{1}[i]);",
+
1513  instance_name,
+
1514  table_name);
+
1515  }
+
1516  }
+
1517  printer->add_line("return 0;");
+
1518  } else {
+
1519  auto table_name = get_variable_name("t_" + name);
+
1520  printer->fmt_line("return {0}[i] + theta * ({0}[i+1] - {0}[i]);", table_name);
+
1521  }
+
1522  }
+
1523  printer->pop_block();
+
1524 }
+
1525 
+
1526 
+ +
1528  auto statement = get_table_statement(node);
+
1529  auto table_variables = statement->get_table_vars();
+
1530  auto depend_variables = statement->get_depend_vars();
+
1531  const auto& from = statement->get_from();
+
1532  const auto& to = statement->get_to();
+
1533  auto name = node.get_node_name();
+
1534  auto internal_params = internal_method_parameters();
+
1535  auto with = statement->get_with()->eval();
+
1536  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
+
1537  auto tmin_name = get_variable_name("tmin_" + name);
+
1538  auto mfac_name = get_variable_name("mfac_" + name);
+
1539  auto float_type = default_float_data_type();
+
1540 
+
1541  printer->add_newline(2);
+
1542  printer->fmt_push_block("void {}({})",
+
1543  table_update_function_name(name),
+
1544  get_parameter_str(internal_params));
+
1545  {
+
1546  printer->fmt_push_block("if ({} == 0)", use_table_var);
+
1547  printer->add_line("return;");
+
1548  printer->pop_block();
+
1549 
+
1550  printer->add_line("static bool make_table = true;");
+
1551  for (const auto& variable: depend_variables) {
+
1552  printer->fmt_line("static {} save_{};", float_type, variable->get_node_name());
+
1553  }
1554 
-
1555  printer->fmt_line("double dx = (tmax-{}) / {}.;", tmin_name, with);
-
1556  printer->fmt_line("{} = 1./dx;", mfac_name);
-
1557 
-
1558  printer->fmt_line("double x = {};", tmin_name);
-
1559  printer->fmt_push_block("for (std::size_t i = 0; i < {}; x += dx, i++)", with + 1);
-
1560  auto function = method_name("f_" + name);
-
1561  if (node.is_procedure_block()) {
-
1562  printer->fmt_line("{}({}, x);", function, internal_method_arguments());
-
1563  for (const auto& variable: table_variables) {
-
1564  auto var_name = variable->get_node_name();
-
1565  auto instance_name = get_variable_name(var_name);
-
1566  auto table_name = get_variable_name("t_" + var_name);
-
1567  auto [is_array, array_length] = check_if_var_is_array(var_name);
-
1568  if (is_array) {
-
1569  for (int j = 0; j < array_length; j++) {
-
1570  printer->fmt_line(
-
1571  "{}[{}][i] = {}[{}];", table_name, j, instance_name, j);
-
1572  }
-
1573  } else {
-
1574  printer->fmt_line("{}[i] = {};", table_name, instance_name);
-
1575  }
-
1576  }
-
1577  } else {
-
1578  auto table_name = get_variable_name("t_" + name);
-
1579  printer->fmt_line("{}[i] = {}({}, x);",
-
1580  table_name,
-
1581  function,
-
1582  internal_method_arguments());
-
1583  }
-
1584  printer->pop_block();
-
1585 
-
1586  for (const auto& variable: depend_variables) {
-
1587  auto var_name = variable->get_node_name();
-
1588  auto instance_name = get_variable_name(var_name);
-
1589  printer->fmt_line("save_{} = {};", var_name, instance_name);
-
1590  }
-
1591  }
-
1592  printer->pop_block();
-
1593  }
-
1594  printer->pop_block();
-
1595 }
-
1596 
- -
1598  const std::unordered_set<CppObjectSpecifier>& specifiers) {
-
1599  std::string result;
-
1600  for (const auto& specifier: specifiers) {
-
1601  if (!result.empty()) {
-
1602  result += " ";
-
1603  }
-
1604  result += object_specifier_map[specifier];
-
1605  }
-
1606  return result;
-
1607 }
-
1608 
- -
1610  const auto& table_statements = collect_nodes(node, {AstNodeType::TABLE_STATEMENT});
-
1611 
-
1612  if (table_statements.size() != 1) {
-
1613  auto message = fmt::format("One table statement expected in {} found {}",
-
1614  node.get_node_name(),
-
1615  table_statements.size());
-
1616  throw std::runtime_error(message);
-
1617  }
-
1618  return dynamic_cast<const ast::TableStatement*>(table_statements.front().get());
-
1619 }
-
1620 
+
1555  for (const auto& variable: depend_variables) {
+
1556  const auto& var_name = variable->get_node_name();
+
1557  const auto& instance_name = get_variable_name(var_name);
+
1558  printer->fmt_push_block("if (save_{} != {})", var_name, instance_name);
+
1559  printer->add_line("make_table = true;");
+
1560  printer->pop_block();
+
1561  }
+
1562 
+
1563  printer->push_block("if (make_table)");
+
1564  {
+
1565  printer->add_line("make_table = false;");
+
1566 
+
1567  printer->add_indent();
+
1568  printer->add_text(tmin_name, " = ");
+
1569  from->accept(*this);
+
1570  printer->add_text(';');
+
1571  printer->add_newline();
+
1572 
+
1573  printer->add_indent();
+
1574  printer->add_text("double tmax = ");
+
1575  to->accept(*this);
+
1576  printer->add_text(';');
+
1577  printer->add_newline();
+
1578 
+
1579 
+
1580  printer->fmt_line("double dx = (tmax-{}) / {}.;", tmin_name, with);
+
1581  printer->fmt_line("{} = 1./dx;", mfac_name);
+
1582 
+
1583  printer->fmt_line("double x = {};", tmin_name);
+
1584  printer->fmt_push_block("for (std::size_t i = 0; i < {}; x += dx, i++)", with + 1);
+
1585  auto function = method_name("f_" + name);
+
1586  if (node.is_procedure_block()) {
+
1587  printer->fmt_line("{}({}, x);", function, internal_method_arguments());
+
1588  for (const auto& variable: table_variables) {
+
1589  auto var_name = variable->get_node_name();
+
1590  auto instance_name = get_variable_name(var_name);
+
1591  auto table_name = get_variable_name("t_" + var_name);
+
1592  auto [is_array, array_length] = check_if_var_is_array(var_name);
+
1593  if (is_array) {
+
1594  for (int j = 0; j < array_length; j++) {
+
1595  printer->fmt_line(
+
1596  "{}[{}][i] = {}[{}];", table_name, j, instance_name, j);
+
1597  }
+
1598  } else {
+
1599  printer->fmt_line("{}[i] = {};", table_name, instance_name);
+
1600  }
+
1601  }
+
1602  } else {
+
1603  auto table_name = get_variable_name("t_" + name);
+
1604  printer->fmt_line("{}[i] = {}({}, x);",
+
1605  table_name,
+
1606  function,
+
1607  internal_method_arguments());
+
1608  }
+
1609  printer->pop_block();
+
1610 
+
1611  for (const auto& variable: depend_variables) {
+
1612  auto var_name = variable->get_node_name();
+
1613  auto instance_name = get_variable_name(var_name);
+
1614  printer->fmt_line("save_{} = {};", var_name, instance_name);
+
1615  }
+
1616  }
+
1617  printer->pop_block();
+
1618  }
+
1619  printer->pop_block();
+
1620 }
1621 
-
1622 std::tuple<bool, int> CodegenCppVisitor::check_if_var_is_array(const std::string& name) {
-
1623  auto symbol = program_symtab->lookup_in_scope(name);
-
1624  if (!symbol) {
-
1625  throw std::runtime_error(
-
1626  fmt::format("CodegenCppVisitor:: {} not found in symbol table!", name));
-
1627  }
-
1628  if (symbol->is_array()) {
-
1629  return {true, symbol->get_length()};
-
1630  } else {
-
1631  return {false, 0};
-
1632  }
-
1633 }
-
1634 } // namespace codegen
-
1635 } // namespace nmodl
+ +
1623  const std::unordered_set<CppObjectSpecifier>& specifiers) {
+
1624  std::string result;
+
1625  for (const auto& specifier: specifiers) {
+
1626  if (!result.empty()) {
+
1627  result += " ";
+
1628  }
+
1629  result += object_specifier_map[specifier];
+
1630  }
+
1631  return result;
+
1632 }
+
1633 
+ +
1635  const auto& table_statements = collect_nodes(node, {AstNodeType::TABLE_STATEMENT});
+
1636 
+
1637  if (table_statements.size() != 1) {
+
1638  auto message = fmt::format("One table statement expected in {} found {}",
+
1639  node.get_node_name(),
+
1640  table_statements.size());
+
1641  throw std::runtime_error(message);
+
1642  }
+
1643  return dynamic_cast<const ast::TableStatement*>(table_statements.front().get());
+
1644 }
+
1645 
+
1646 
+
1647 std::tuple<bool, int> CodegenCppVisitor::check_if_var_is_array(const std::string& name) {
+
1648  auto symbol = program_symtab->lookup_in_scope(name);
+
1649  if (!symbol) {
+
1650  throw std::runtime_error(
+
1651  fmt::format("CodegenCppVisitor:: {} not found in symbol table!", name));
+
1652  }
+
1653  if (symbol->is_array()) {
+
1654  return {true, symbol->get_length()};
+
1655  } else {
+
1656  return {false, 0};
+
1657  }
+
1658 }
+
1659 } // namespace codegen
+
1660 } // namespace nmodl
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:7061
std::shared_ptr< Expression > get_length() const noexcept
Getter for member variable IndexedName::length.
std::string table_update_function_name(const std::string &block_name) const
The name of the function that updates the table value if the parameters changed.
-
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
+
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
-
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
+
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
std::string format_double_string< CodegenCppVisitor >(const std::string &s_value)
const LocalVarVector & get_variables() const noexcept
Getter for member variable LocalListStatement::variables.
-
void print_table_replacement_function(const ast::Block &)
Print replacement function for function or procedure using table.
+
void print_table_replacement_function(const ast::Block &)
Print replacement function for function or procedure using table.
static constexpr char RANDOM_SEMANTIC[]
semantic type for RANDOM variable
Represents a C code block.
Definition: verbatim.hpp:38
static constexpr char NET_SEND_SEMANTIC[]
semantic type for net send call
-
void visit_name(const ast::Name &node) override
visit node of type ast::Name
+
void visit_name(const ast::Name &node) override
visit node of type ast::Name
bool has_parameter_of_name(const T &node, const std::string &name)
Check if function or procedure node has parameter with given name.
int int_variables_size() const
Number of integer variables in the model.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:795
-
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
+
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
std::vector< ShadowUseStatement > ion_write_statements(BlockType type)
For a given output block type, return statements for writing back ion variables.
-
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
+
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
bool breakpoint_exist() const noexcept
Check if breakpoint node exist.
DUState
Represent a state in Def-Use chain.
@ Destructor
destructor block
-
void print_eigen_linear_solver(const std::string &float_type, int N)
Print linear solver using Eigen.
+
void print_eigen_linear_solver(const std::string &float_type, int N)
Print linear solver using Eigen.
Represents a double variable.
Definition: double.hpp:53
+
static std::pair< std::string, std::string > write_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion write variable name.
bool net_receive_exist() const noexcept
Check if net_receive node exist.
std::shared_ptr< symtab::Symbol > SymbolType
int get_int_variable_index(const std::string &var_name)
static constexpr char VOLTAGE_UNUSED_VARIABLE[]
range variable for voltage when unused (for vectorized model)
static constexpr char NRN_WATCH_CHECK_METHOD[]
nrn_watch_check method in generated c++ file
+
void print_procedure(const ast::ProcedureBlock &node)
Print NMODL procedure in target backend code.
virtual bool is_conductance_hint() const noexcept
Check if the ast node is an instance of ast::ConductanceHint.
Definition: ast.cpp:224
int float_variables_size() const
Number of float variables in the model.
void print_backend_info()
Print top file header printed in generated code.
-
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
-
void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
+
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
+
void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
virtual void print_global_var_struct_assertions() const
Print static assertions about the global variable struct.
-
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
-
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
-
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
+
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
+
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
+
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
std::shared_ptr< StatementBlock > get_initialize_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::initialize_block.
@@ -1787,39 +1814,40 @@
std::shared_ptr< StatementBlock > get_variable_block() const noexcept
Getter for member variable EigenLinearSolverBlock::variable_block.
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
Represent MUTEXLOCK statement in NMODL.
Definition: mutex_lock.hpp:38
-
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
+
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
const std::string & get_value() const noexcept
Getter for member variable Double::value.
Definition: double.hpp:158
StatementVector::const_iterator insert_statement(StatementVector::const_iterator position, const std::shared_ptr< Statement > &n)
Insert member to statements.
Definition: ast.cpp:3130
virtual bool is_procedure_block() const noexcept
Check if the ast node is an instance of ast::ProcedureBlock.
Definition: ast.cpp:144
Represents TABLE statement in NMODL.
virtual bool is_protect_statement() const noexcept
Check if the ast node is an instance of ast::ProtectStatement.
Definition: ast.cpp:228
-
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
+
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
Represents a variable.
Definition: var_name.hpp:43
Represents an integer variable.
Definition: integer.hpp:49
-
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
-
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
+
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
+
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
virtual bool is_expression_statement() const noexcept
Check if the ast node is an instance of ast::ExpressionStatement.
Definition: ast.cpp:226
static constexpr char NODE_AREA_VARIABLE[]
inbuilt neuron variable for area of the compartment
-
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
+
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
Concrete visitor for constructing symbol table from AST.
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
std::string update_if_ion_variable_name(const std::string &name) const
Determine the updated name if the ion variable has been optimized.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:9855
std::shared_ptr< Integer > get_n_state_vars() const noexcept
Getter for member variable EigenNewtonSolverBlock::n_state_vars.
+
void print_function(const ast::FunctionBlock &node)
Print NMODL function in target backend code.
std::shared_ptr< Expression > get_index() const noexcept
Getter for member variable VarName::index.
Definition: var_name.hpp:182
static const std::string GIT_REVISION
git revision id
Definition: config.h:33
logger_type logger
Definition: logger.cpp:34
-
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
+
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
std::shared_ptr< String > get_statement() const noexcept
Getter for member variable Verbatim::statement.
Definition: verbatim.hpp:157
Visitor to return Def-Use chain for a given variable in the block/node
-
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
+
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
std::shared_ptr< Expression > get_rhs() const noexcept
Getter for member variable BinaryExpression::rhs.
Represent newton solver solution block based on Eigen.
bool eval() const
Return value of the ast node.
Definition: boolean.hpp:243
-
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
+
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
Helper visitor to gather AST information to help code generation.
std::shared_ptr< Expression > get_increment() const noexcept
Getter for member variable FromStatement::increment.
static constexpr char CONDUCTANCE_VARIABLE[]
range variable for conductance
@@ -1829,11 +1857,11 @@
static std::string trim_newline(std::string text)
static constexpr char DEFAULT_FLOAT_TYPE[]
default float variable type
std::shared_ptr< StatementBlock > get_update_states_block() const noexcept
Getter for member variable EigenLinearSolverBlock::update_states_block.
-
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
+
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
const StatementVector & get_statements() const noexcept
Getter for member variable StatementBlock::statements.
-
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
+
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
Base class for all block scoped nodes.
Definition: block.hpp:41
const ElseIfStatementVector & get_elseifs() const noexcept
Getter for member variable IfStatement::elseifs.
std::shared_ptr< StatementBlock > get_setup_x_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::setup_x_block.
@@ -1851,14 +1879,14 @@
virtual bool is_verbatim() const noexcept
Check if the ast node is an instance of ast::Verbatim.
Definition: ast.cpp:282
Represents specific element of an array variable.
std::string eval() const
Return value of the ast node.
Definition: string.hpp:237
-
const std::regex regex_special_chars
+
const std::regex regex_special_chars
std::shared_ptr< Expression > get_from() const noexcept
Getter for member variable FromStatement::from.
-
void setup(const ast::Program &node)
Setup the target backend code generator.
-
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
+
void setup(const ast::Program &node)
Setup the target backend code generator.
+
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
static constexpr char POINT_PROCESS_SEMANTIC[]
semantic type for point process variable
-
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
-
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
+
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
+
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
virtual bool is_else_if_statement() const noexcept
Check if the ast node is an instance of ast::ElseIfStatement.
Definition: ast.cpp:236
bool nrn_cur_required() const noexcept
Check if nrn_cur function is required.
virtual bool is_table_statement() const noexcept
Check if the ast node is an instance of ast::TableStatement.
Definition: ast.cpp:258
@@ -1867,27 +1895,27 @@
@ Constructor
constructor block
Represent MUTEXUNLOCK statement in NMODL.
symtab::SymbolTable * get_symbol_table() const override
Return associated symbol table for the current ast node.
-
void visit_double(const ast::Double &node) override
visit node of type ast::Double
+
void visit_double(const ast::Double &node) override
visit node of type ast::Double
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
-
void visit_float(const ast::Float &node) override
visit node of type ast::Float
-
void visit_string(const ast::String &node) override
visit node of type ast::String
+
void visit_float(const ast::Float &node) override
visit node of type ast::Float
+
void visit_string(const ast::String &node) override
visit node of type ast::String
Represent semantic information for index variable.
std::string to_string(const T &obj)
virtual bool is_block_comment() const noexcept
Check if the ast node is an instance of ast::BlockComment.
Definition: ast.cpp:286
std::string format_float_string(const std::string &s_value)
Handles the float constants format being printed in the generated code.
-
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
+
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
static constexpr char NRN_INIT_METHOD[]
nrn_init method in generated code
const ExpressionVector & get_arguments() const noexcept
Getter for member variable FunctionCall::arguments.
static constexpr char POINTER_SEMANTIC[]
semantic type for pointer variable
virtual void print_global_var_struct_decl()
Instantiate global var instance.
static constexpr char AREA_SEMANTIC[]
semantic type for area variable
-
void visit_var_name(const ast::VarName &node) override
+
void visit_var_name(const ast::VarName &node) override
std::string mod_file
name of mod file
-
void print_nmodl_constants()
Print the nmodl constants used in backend code.
+
void print_nmodl_constants()
Print the nmodl constants used in backend code.
std::shared_ptr< Expression > get_expression() const noexcept
Getter for member variable ParenExpression::expression.
const BinaryOperator & get_op() const noexcept
Getter for member variable BinaryExpression::op.
-
void print_table_check_function(const ast::Block &)
Print check_function() for functions or procedure using table.
+
void print_table_check_function(const ast::Block &)
Print check_function() for functions or procedure using table.
virtual bool is_from_statement() const noexcept
Check if the ast node is an instance of ast::FromStatement.
Definition: ast.cpp:230
Represents a prime variable (for ODE)
Definition: prime_name.hpp:48
static std::pair< std::string, std::string > read_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion read variable name.
@@ -1906,17 +1934,18 @@
@ LOCAL_VAR
type of ast::LocalVar
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable WhileStatement::statement_block.
-
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
+
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
Represent linear solver solution block based on Eigen.
std::vector< std::shared_ptr< const ast::Ast > > collect_nodes(const ast::Ast &node, const std::vector< ast::AstNodeType > &types)
traverse node recursively and collect nodes of given types
Visitor to return Def-Use chain for a given variable in the block/node
+
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:3963
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
std::shared_ptr< StatementBlock > get_functor_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::functor_block.
-
const ast::TableStatement * get_table_statement(const ast::Block &)
+
const ast::TableStatement * get_table_statement(const ast::Block &)
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
-
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
-
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
+
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
+
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
std::shared_ptr< Expression > get_node_to_solve() const noexcept
Getter for member variable SolutionExpression::node_to_solve.
static std::vector< std::string > split_string(const std::string &text, char delimiter)
Split a text in a list of words, using a given delimiter character.
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
@@ -1927,11 +1956,12 @@
bool net_receive_required() const noexcept
Check if net_receive function is required.
static constexpr char CORE_POINTER_SEMANTIC[]
semantic type for core pointer variable
-
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
+
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
std::shared_ptr< StatementBlock > get_variable_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::variable_block.
-
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
-
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
+
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
+
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
Represents ion write statement during code generation.
+
static constexpr char WATCH_SEMANTIC[]
semantic type for watch statement
Operator used in ast::BinaryExpression.
bool defined_method(const std::string &name) const
Check if given method is defined in this model.
@@ -1940,31 +1970,32 @@
virtual void print_function_call(const ast::FunctionCall &node)
Print call to internal or external function.
Represent solution of a block in the AST.
std::string process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)
Process shadow update statement.
+
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable FunctionBlock::statement_block.
Helper visitor to gather AST information to help code generation.
BlockType
Helper to represent various block types.
std::shared_ptr< Identifier > get_name() const noexcept
Getter for member variable VarName::name.
Definition: var_name.hpp:164
symtab::SymbolTable * get_symbol_table() const override
Return associated symbol table for the current ast node.
Definition: program.hpp:153
static constexpr char NRN_STATE_METHOD[]
nrn_state method in generated code
std::string breakpoint_current(std::string current) const
Determine the variable name for the "current" used in breakpoint block taking into account intermedia...
-
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
+
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
Version information and units file path.
virtual bool is_solve_block() const noexcept
Check if the ast node is an instance of ast::SolveBlock.
Definition: ast.cpp:148
-
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
+
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
std::shared_ptr< ElseStatement > get_elses() const noexcept
Getter for member variable IfStatement::elses.
std::shared_ptr< Expression > get_lhs() const noexcept
Getter for member variable BinaryExpression::lhs.
virtual bool is_line_comment() const noexcept
Check if the ast node is an instance of ast::LineComment.
Definition: ast.cpp:284
-
std::string compute_method_name(BlockType type) const
+
std::string compute_method_name(BlockType type) const
static constexpr char AREA_VARIABLE[]
similar to node_area but user can explicitly declare it as area
Represents a name.
Definition: name.hpp:44
virtual bool is_while_statement() const noexcept
Check if the ast node is an instance of ast::WhileStatement.
Definition: ast.cpp:232
-
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
+
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
virtual bool is_else_statement() const noexcept
Check if the ast node is an instance of ast::ElseStatement.
Definition: ast.cpp:238
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable FromStatement::statement_block.
Represents top level AST node for whole NMODL input.
Definition: program.hpp:39
-
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
+
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
std::shared_ptr< Expression > get_to() const noexcept
Getter for member variable FromStatement::to.
static constexpr char T_SAVE_VARIABLE[]
variable t indicating last execution time of net receive block
-
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
+
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
static constexpr char FOR_NETCON_SEMANTIC[]
semantic type for for_netcon statement
std::shared_ptr< StatementBlock > get_update_states_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::update_states_block.
std::string format_double_string(const std::string &s_value)
Handles the double constants format being printed in the generated code.
@@ -1975,14 +2006,14 @@
static constexpr char DIAM_VARIABLE[]
inbuilt neuron variable for diameter of the compartment
THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
virtual const ArgumentVector & get_parameters() const
Definition: block.hpp:50
-
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
+
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
Represents binary expression in the NMODL.
static constexpr char NRN_DESTRUCTOR_METHOD[]
nrn_destructor method in generated code
static constexpr char CONDUCTANCE_UNUSED_VARIABLE[]
range variable when conductance is not used (for vectorized model)
static bool statement_to_skip(const ast::Statement &node)
Check if given statement should be skipped during code generation.
std::vector< std::string > ion_read_statements(BlockType type) const
For a given output block type, return statements for all read ion variables.
-
void print_functors_definitions()
Print all Newton functor structs.
+
void print_functors_definitions()
Print all Newton functor structs.
std::shared_ptr< StatementBlock > get_finalize_block() const noexcept
Getter for member variable EigenNewtonSolverBlock::finalize_block.
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
int get_index_from_name(const std::vector< T > &variables, const std::string &name)
@@ -1992,11 +2023,11 @@
Auto generated AST classes declaration.
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:9196
-
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
+
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
static constexpr char ION_VARNAME_PREFIX[]
prefix for ion variable
std::shared_ptr< Expression > get_condition() const noexcept
Getter for member variable WhileStatement::condition.
-
void visit_statement_block(const ast::StatementBlock &node) override
+
void visit_statement_block(const ast::StatementBlock &node) override
virtual void print_nrn_constructor()=0
Print nrn_constructor function definition.
std::string table_update_function_name(const std::string &block_name) const
The name of the function that updates the table value if the parameters changed.
-
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
+
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
bool is_last(Iter iter, const Cont &cont)
Check if the iterator is pointing to last element in the container.
int get_length(const std::shared_ptr< symtab::Symbol > &sym)
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
-
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
-
void print_table_replacement_function(const ast::Block &)
Print replacement function for function or procedure using table.
+
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
+
void print_table_replacement_function(const ast::Block &)
Print replacement function for function or procedure using table.
virtual std::string register_mechanism_arguments() const =0
Arguments for register_mech or point_register_mech function.
virtual void print_g_unused() const =0
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
bool is_index
if this is pure index (e.g.
Represents a C code block.
Definition: verbatim.hpp:38
-
void visit_name(const ast::Name &node) override
visit node of type ast::Name
+
void visit_name(const ast::Name &node) override
visit node of type ast::Name
bool has_parameter_of_name(const T &node, const std::string &name)
Check if function or procedure node has parameter with given name.
int int_variables_size() const
Number of integer variables in the model.
virtual void print_sdlists_init(bool print_initializers)=0
-
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
+
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
CppObjectSpecifier
various specifiers (mostly for function codegen)
@ global
global variables
std::vector< ShadowUseStatement > ion_write_statements(BlockType type)
For a given output block type, return statements for writing back ion variables.
-
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
+
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
Helper to represent information about index/int variables.
bool breakpoint_exist() const noexcept
Check if breakpoint node exist.
Concrete constant visitor for all AST classes.
virtual void print_nrn_current(const ast::BreakpointBlock &node)=0
Print the nrn_current kernel.
@ Destructor
destructor block
static constexpr char DEFAULT_LOCAL_VAR_TYPE[]
default local variable type
-
void print_eigen_linear_solver(const std::string &float_type, int N)
Print linear solver using Eigen.
+
void print_eigen_linear_solver(const std::string &float_type, int N)
Print linear solver using Eigen.
const std::shared_ptr< symtab::Symbol > symbol
symbol for the variable
codegen::CodegenInfo info
All ast information for code generation.
virtual void print_atomic_reduction_pragma()=0
Print atomic update pragma for reduction statements.
@@ -1713,20 +1713,21 @@
int get_int_variable_index(const std::string &var_name)
@ thread
thread variables
virtual bool optimize_ion_variable_copies() const =0
Check if ion variable copies should be avoided.
+
void print_procedure(const ast::ProcedureBlock &node)
Print NMODL procedure in target backend code.
std::string nmodl_version() const noexcept
Return Nmodl language version.
bool printing_top_verbatim_blocks
true if currently printing top level verbatim blocks
int float_variables_size() const
Number of float variables in the model.
bool is_constant
if the variable is qualified as constant (this is property of IndexVariable)
void print_backend_info()
Print top file header printed in generated code.
-
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
-
void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
+
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
+
void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
virtual void print_global_var_struct_assertions() const
Print static assertions about the global variable struct.
bool printing_net_init
true if currently initial block of net_receive being printed
-
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
-
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
+
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
+
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="")=0
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
virtual void print_standard_includes()=0
Print standard C/C++ includes.
-
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
+
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
virtual void print_nrn_cur_non_conductance_kernel()=0
Print the nrn_cur kernel without NMODL conductance keyword provisions.
virtual void print_function_procedure_helper(const ast::Block &node)=0
Common helper function to help printing function or procedure blocks.
@@ -1736,49 +1737,49 @@
@ index
index / int variables
const std::string & float_data_type() const noexcept
Data type for floating point elements specified on command line.
Represent ions used in mod file.
-
virtual void print_function(const ast::FunctionBlock &node)=0
Print NMODL function in target backend code.
Implement classes for representing symbol table at block and file scope.
virtual std::string nrn_thread_arguments() const =0
Arguments for "_threadargs_" macro in neuron implementation.
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
Represent MUTEXLOCK statement in NMODL.
Definition: mutex_lock.hpp:38
-
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
+
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
int get_prefixsum_from_name(const std::vector< T > &variables, const std::string &name)
virtual std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const =0
Determine the variable name for a global variable given its symbol.
Represents TABLE statement in NMODL.
-
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
+
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
Represents a variable.
Definition: var_name.hpp:43
Represents an integer variable.
Definition: integer.hpp:49
@ BlockTypeEnd
fake ending block type for loops on the enums. Keep it at the end
-
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
-
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
+
std::string get_object_specifiers(const std::unordered_set< CppObjectSpecifier > &)
+
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
virtual void print_net_move_call(const ast::FunctionCall &node)=0
Print call to net_move.
const char * default_int_data_type() const noexcept
Default data type for integer (offset) elements.
std::string mod_suffix
name of the suffix
Represent information collected from AST for code generation.
-
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
+
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
const char * default_float_data_type() const noexcept
Default data type for floating point elements.
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
std::string update_if_ion_variable_name(const std::string &name) const
Determine the updated name if the ion variable has been optimized.
+
void print_function(const ast::FunctionBlock &node)
Print NMODL function in target backend code.
virtual void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node)=0
Print the nrn_cur kernel with NMODL conductance keyword provisions.
-
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
+
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
bool is_integer
if this is an integer (e.g.
virtual std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const =0
Determine the name of an int variable given its symbol.
-
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
+
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
std::unordered_map< CppObjectSpecifier, std::string > object_specifier_map
Represent newton solver solution block based on Eigen.
-
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
+
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
void print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
Print the items in a vector as a list.
IndexVariableInfo(std::shared_ptr< symtab::Symbol > symbol, bool is_vdata=false, bool is_index=false, bool is_integer=false)
virtual void add_variable_point_process(std::vector< IndexVariableInfo > &variables)=0
Add the variable point_process during get_int_variables.
static constexpr char DEFAULT_FLOAT_TYPE[]
default float variable type
-
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
+
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
virtual std::string nrn_thread_internal_arguments()=0
Arguments for "_threadargs_" macro in neuron implementation.
-
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
+
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
Base class for all block scoped nodes.
Definition: block.hpp:41
virtual const ParamVector external_method_parameters(bool table=false) noexcept=0
Parameters for functions in generated code that are called back from external code.
virtual int position_of_int_var(const std::string &name) const =0
Determine the position in the data array for a given int variable.
@@ -1797,11 +1798,11 @@
virtual void add_variable_tqitem(std::vector< IndexVariableInfo > &variables)=0
Add the variable tqitem during get_int_variables.
virtual std::string simulator_name()=0
Name of the simulator the code was generated for.
-
void setup(const ast::Program &node)
Setup the target backend code generator.
-
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
-
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
+
void setup(const ast::Program &node)
Setup the target backend code generator.
+
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
+
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
virtual void print_net_event_call(const ast::FunctionCall &node)=0
Print call to net_event.
-
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
+
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
bool nrn_cur_required() const noexcept
Check if nrn_cur function is required.
std::vector< std::string > ion_read_statements_optimized(BlockType type) const
For a given output block type, return minimal statements for all read ion variables.
@@ -1812,22 +1813,22 @@
virtual void print_codegen_routines()=0
Print entry point to code generation.
Represent MUTEXUNLOCK statement in NMODL.
Helper class for printing C/C++ code.
-
void visit_double(const ast::Double &node) override
visit node of type ast::Double
+
void visit_double(const ast::Double &node) override
visit node of type ast::Double
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
static constexpr char NMODL_VERSION[]
nmodl language version
std::vector< IndexVariableInfo > codegen_int_variables
All int variables for the model.
-
void visit_float(const ast::Float &node) override
visit node of type ast::Float
-
void visit_string(const ast::String &node) override
visit node of type ast::String
+
void visit_float(const ast::Float &node) override
visit node of type ast::Float
+
void visit_string(const ast::String &node) override
visit node of type ast::String
@ NetReceive
net_receive block
-
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
+
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
const char * local_var_type() const noexcept
Data type for the local variables.
virtual void print_global_var_struct_decl()
Instantiate global var instance.
std::string get_channel_info_var_name() const noexcept
Name of channel info variable.
-
void visit_var_name(const ast::VarName &node) override
+
void visit_var_name(const ast::VarName &node) override
-
void print_nmodl_constants()
Print the nmodl constants used in backend code.
-
void print_table_check_function(const ast::Block &)
Print check_function() for functions or procedure using table.
+
void print_nmodl_constants()
Print the nmodl constants used in backend code.
+
void print_table_check_function(const ast::Block &)
Print check_function() for functions or procedure using table.
Represents a prime variable (for ODE)
Definition: prime_name.hpp:48
static std::pair< std::string, std::string > read_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion read variable name.
static std::string get_arg_str(const ParamVector &params)
Generate the string representing the parameters in a function call.
@@ -1838,18 +1839,18 @@
static constexpr char DEFAULT_INTEGER_TYPE[]
default integer variable type
virtual void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers)=0
Print nmodl function or procedure (common code)
Represent symbol table for a NMODL block.
-
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
+
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
Represent linear solver solution block based on Eigen.
bool printing_net_receive
true if currently net_receive block being printed
virtual std::string process_verbatim_text(std::string const &text)=0
Process a verbatim block for possible variable renaming.
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
-
const ast::TableStatement * get_table_statement(const ast::Block &)
+
const ast::TableStatement * get_table_statement(const ast::Block &)
virtual void print_global_variables_for_hoc()=0
Print byte arrays that register scalar and vector variables for hoc interface.
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
-
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
-
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
+
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
+
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
virtual void print_nrn_cur()=0
Print nrn_cur / current update function definition.
@@ -1863,11 +1864,11 @@
std::string global_struct() const
Name of structure that wraps global variables.
bool electrode_current
if electrode current specified
-
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
+
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
virtual ParamVector internal_method_parameters()=0
Parameters for internally defined functions.
virtual void print_nrn_destructor()=0
Print nrn_destructor function definition.
-
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
-
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
+
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
+
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
Represents ion write statement during code generation.
virtual void print_mechanism_range_var_structure(bool print_initializers)=0
Print the structure that wraps all range and int variables required for the NMODL.
@@ -1890,23 +1891,23 @@
virtual void print_fast_imem_calculation()=0
Print fast membrane current calculation code.
virtual void print_mechanism_register()=0
Print the mechanism registration function.
std::string breakpoint_current(std::string current) const
Determine the variable name for the "current" used in breakpoint block taking into account intermedia...
-
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
-
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
+
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
+
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
Visitor for printing C++ code compatible with legacy api of CoreNEURON
virtual void print_namespace_start()=0
Prints the start of the simulator namespace.
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies, std::unique_ptr< nmodl::utils::Blame > blame=nullptr)
Constructs the C++ code generator visitor.
std::string instance_struct() const
Name of structure that wraps range variables.
-
std::string compute_method_name(BlockType type) const
+
std::string compute_method_name(BlockType type) const
Represents a name.
Definition: name.hpp:44
-
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
+
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
std::string mod_filename
Name of mod file (without .mod suffix)
virtual std::string get_variable_name(const std::string &name, bool use_instance=true) const =0
Determine variable name in the structure of mechanism properties.
Represents top level AST node for whole NMODL input.
Definition: program.hpp:39
-
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
+
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
const char * operator_for_rhs() const noexcept
Operator for rhs vector update (matrix update)
-
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
+
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
std::unique_ptr< CodePrinter > printer
Code printer object for target (C++)
virtual void print_namespace_stop()=0
Prints the end of the simulator namespace.
@@ -1917,7 +1918,7 @@
bool internal_method_call_encountered
true if internal method call was encountered while processing verbatim block
virtual void print_v_unused() const =0
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
-
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
+
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
bool is_net_event(const std::string &name) const noexcept
Checks if given function name is net_event.
Represents binary expression in the NMODL.
@@ -1929,8 +1930,7 @@
static bool statement_to_skip(const ast::Statement &node)
Check if given statement should be skipped during code generation.
std::vector< std::string > ion_read_statements(BlockType type) const
For a given output block type, return statements for all read ion variables.
-
virtual void print_procedure(const ast::ProcedureBlock &node)=0
Print NMODL procedure in target backend code.
-
void print_functors_definitions()
Print all Newton functor structs.
+
void print_functors_definitions()
Print all Newton functor structs.
@ BeforeAfter
before / after block
virtual void print_data_structures(bool print_initializers)=0
Print all classes.
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
@@ -1944,10 +1944,10 @@
virtual void print_function_prototypes()=0
Print function and procedures prototype declaration.
static constexpr char NET_SEND_METHOD[]
net_send function call in nmodl
virtual void print_nrn_alloc()=0
Print nrn_alloc function definition.
-
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
+
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
@ range
range / double variables
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
-
void visit_statement_block(const ast::StatementBlock &node) override
+
void visit_statement_block(const ast::StatementBlock &node) override
Concrete visitor for all AST classes.
diff --git a/doxygen/codegen__helper__visitor_8cpp_source.html b/doxygen/codegen__helper__visitor_8cpp_source.html index 0a2dabefb..96356618d 100644 --- a/doxygen/codegen__helper__visitor_8cpp_source.html +++ b/doxygen/codegen__helper__visitor_8cpp_source.html @@ -868,25 +868,23 @@
772 
773  // check if the token exist in the symbol table
774  for (auto& token: tokens) {
-
775  if (info.variables_in_verbatim.find(token) == info.variables_in_verbatim.end()) {
-
776  auto symbol = psymtab->lookup(token);
-
777  if (symbol != nullptr) {
-
778  info.variables_in_verbatim.insert(token);
-
779  }
-
780  }
-
781  }
-
782 }
-
783 
- -
785  info.before_after_blocks.push_back(&node);
-
786 }
-
787 
- -
789  info.before_after_blocks.push_back(&node);
-
790 }
-
791 
-
792 } // namespace codegen
-
793 } // namespace nmodl
+
775  auto symbol = psymtab->lookup(token);
+
776  if (symbol != nullptr) {
+
777  info.variables_in_verbatim.insert(token);
+
778  }
+
779  }
+
780 }
+
781 
+ +
783  info.before_after_blocks.push_back(&node);
+
784 }
+
785 
+ +
787  info.before_after_blocks.push_back(&node);
+
788 }
+
789 
+
790 } // namespace codegen
+
791 } // namespace nmodl
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:7061
@@ -957,7 +955,7 @@
Represents a DESTRUCTOR block in the NMODL.
Represents a CONSTRUCTOR block in the NMODL.
void visit_non_linear_block(const ast::NonLinearBlock &node) override
visit node of type ast::NonLinearBlock
-
void visit_after_block(const ast::AfterBlock &node) override
visit node of type ast::AfterBlock
+
void visit_after_block(const ast::AfterBlock &node) override
visit node of type ast::AfterBlock
void find_range_variables()
Find range variables i.e.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:13377
@@ -970,7 +968,7 @@
void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
const BinaryOperator & get_op() const noexcept
Getter for member variable BinaryExpression::op.
void visit_procedure_block(const ast::ProcedureBlock &node) override
visit node of type ast::ProcedureBlock
-
void visit_before_block(const ast::BeforeBlock &node) override
visit node of type ast::BeforeBlock
+
void visit_before_block(const ast::BeforeBlock &node) override
visit node of type ast::BeforeBlock
Represents DERIVATIVE block in the NMODL.
std::string eval() const
Return enum value in string form.
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
diff --git a/doxygen/codegen__helper__visitor_8hpp_source.html b/doxygen/codegen__helper__visitor_8hpp_source.html index 8c3857264..bb76225d6 100644 --- a/doxygen/codegen__helper__visitor_8hpp_source.html +++ b/doxygen/codegen__helper__visitor_8hpp_source.html @@ -265,13 +265,13 @@
bool under_breakpoint_block
if visiting breakpoint block
Represents a CONSTRUCTOR block in the NMODL.
void visit_non_linear_block(const ast::NonLinearBlock &node) override
visit node of type ast::NonLinearBlock
-
void visit_after_block(const ast::AfterBlock &node) override
visit node of type ast::AfterBlock
+
void visit_after_block(const ast::AfterBlock &node) override
visit node of type ast::AfterBlock
void find_range_variables()
Find range variables i.e.
void visit_watch(const ast::Watch &node) override
visit node of type ast::Watch
static void sort_with_mod2c_symbol_order(std::vector< SymbolType > &symbols)
How symbols are stored in NEURON? See notes written in markdown file.
void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
void visit_procedure_block(const ast::ProcedureBlock &node) override
visit node of type ast::ProcedureBlock
-
void visit_before_block(const ast::BeforeBlock &node) override
visit node of type ast::BeforeBlock
+
void visit_before_block(const ast::BeforeBlock &node) override
visit node of type ast::BeforeBlock
Represents DERIVATIVE block in the NMODL.
Various types to store code generation specific information.
diff --git a/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html b/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html index 58f39c6a0..f75ecbf75 100644 --- a/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html +++ b/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html @@ -331,620 +331,602 @@
235  */
236  void print_function_procedure_helper(const ast::Block& node) override;
237 
-
238 
-
239  /**
-
240  * Print NMODL procedure in target backend code
-
241  * \param node
-
242  */
-
243  void print_procedure(const ast::ProcedureBlock& node) override;
+
238 
+
239  void print_hoc_py_wrapper_function_body(const ast::Block* function_or_procedure_block,
+
240  InterpreterWrapper wrapper_type);
+
241 
+
242 
+
244 
-
245 
-
246  /**
-
247  * Print NMODL function in target backend code
-
248  * \param node
-
249  */
-
250  void print_function(const ast::FunctionBlock& node) override;
-
251 
-
252 
-
253  void print_hoc_py_wrapper_function_body(const ast::Block* function_or_procedure_block,
-
254  InterpreterWrapper wrapper_type);
-
255 
-
256 
- +
245 
+
246  /****************************************************************************************/
+
247  /* Code-specific helper routines */
+
248  /****************************************************************************************/
+
249 
+
250  void add_variable_tqitem(std::vector<IndexVariableInfo>& variables) override;
+
251  void add_variable_point_process(std::vector<IndexVariableInfo>& variables) override;
+
252 
+
253  /**
+
254  * Arguments for functions that are defined and used internally.
+
255  * \return the method arguments
+
256  */
+
257  std::string internal_method_arguments() override;
258 
-
259 
-
260  /****************************************************************************************/
-
261  /* Code-specific helper routines */
-
262  /****************************************************************************************/
-
263 
-
264  void add_variable_tqitem(std::vector<IndexVariableInfo>& variables) override;
-
265  void add_variable_point_process(std::vector<IndexVariableInfo>& variables) override;
+
259 
+
260  /**
+
261  * Parameters for internally defined functions
+
262  * \return the method parameters
+
263  */
+ +
265 
266 
267  /**
-
268  * Arguments for functions that are defined and used internally.
-
269  * \return the method arguments
+
268  * Arguments for external functions called from generated code
+
269  * \return A string representing the arguments passed to an external function
270  */
-
271  std::string internal_method_arguments() override;
+
271  const std::string external_method_arguments() noexcept override;
272 
273 
274  /**
-
275  * Parameters for internally defined functions
-
276  * \return the method parameters
-
277  */
- -
279 
-
280 
-
281  /**
-
282  * Arguments for external functions called from generated code
-
283  * \return A string representing the arguments passed to an external function
-
284  */
-
285  const std::string external_method_arguments() noexcept override;
-
286 
-
287 
-
288  /**
-
289  * Parameters for functions in generated code that are called back from external code
-
290  *
-
291  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
-
292  * calling convention. This method generates the string representing the function parameters for
-
293  * these externally called functions.
-
294  * \param table
-
295  * \return A string representing the parameters of the function
-
296  */
-
297  const ParamVector external_method_parameters(bool table = false) noexcept override;
-
298 
-
299 
-
300  /**
-
301  * Arguments for "_threadargs_" macro in neuron implementation
+
275  * Parameters for functions in generated code that are called back from external code
+
276  *
+
277  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
+
278  * calling convention. This method generates the string representing the function parameters for
+
279  * these externally called functions.
+
280  * \param table
+
281  * \return A string representing the parameters of the function
+
282  */
+
283  const ParamVector external_method_parameters(bool table = false) noexcept override;
+
284 
+
285 
+
286  /**
+
287  * Arguments for "_threadargs_" macro in neuron implementation
+
288  */
+
289  std::string nrn_thread_arguments() const override;
+
290 
+
291 
+
292  /**
+
293  * Arguments for "_threadargs_" macro in neuron implementation
+
294  */
+
295  std::string nrn_thread_internal_arguments() override;
+
296 
+
297 
+
298  /**
+
299  * Process a verbatim block for possible variable renaming
+
300  * \param text The verbatim code to be processed
+
301  * \return The code with all variables renamed as needed
302  */
-
303  std::string nrn_thread_arguments() const override;
+
303  std::string process_verbatim_text(std::string const& text) override;
304 
305 
306  /**
-
307  * Arguments for "_threadargs_" macro in neuron implementation
+
307  * Arguments for register_mech or point_register_mech function
308  */
-
309  std::string nrn_thread_internal_arguments() override;
+
309  std::string register_mechanism_arguments() const override;
310 
-
311 
-
312  /**
-
313  * Process a verbatim block for possible variable renaming
-
314  * \param text The verbatim code to be processed
-
315  * \return The code with all variables renamed as needed
-
316  */
-
317  std::string process_verbatim_text(std::string const& text) override;
-
318 
-
319 
-
320  /**
-
321  * Arguments for register_mech or point_register_mech function
-
322  */
-
323  std::string register_mechanism_arguments() const override;
-
324 
-
325 
-
326  void append_conc_write_statements(std::vector<ShadowUseStatement>& statements,
-
327  const Ion& ion,
-
328  const std::string& concentration) override;
-
329 
-
330  /**
-
331  * All functions and procedures need a \c _hoc_<func_or_proc_name> to be available to the HOC
-
332  * interpreter
-
333  */
-
334  std::string hoc_function_name(const std::string& function_or_procedure_name) const;
-
335 
-
336 
-
337  /**
-
338  * Get the signature of the \c _hoc_<func_or_proc_name> function
-
339  */
-
340  std::string hoc_function_signature(const std::string& function_or_procedure_name) const;
-
341 
-
342 
-
343  /**
-
344  * In non POINT_PROCESS mechanisms all functions and procedures need a \c
-
345  * _py_<func_or_proc_name> to be available to the HOC interpreter
-
346  */
-
347  std::string py_function_name(const std::string& function_or_procedure_name) const;
-
348 
-
349  /**
-
350  * Get the signature of the \c _npy_<func_or_proc_name> function
-
351  */
-
352  std::string py_function_signature(const std::string& function_or_procedure_name) const;
-
353 
-
354 
-
355  /****************************************************************************************/
-
356  /* Code-specific printing routines for code generations */
-
357  /****************************************************************************************/
-
358 
-
359 
-
360  /**
-
361  * Prints the start of the \c neuron namespace
-
362  */
-
363  void print_namespace_start() override;
-
364 
-
365 
-
366  /**
-
367  * Prints the end of the \c neuron namespace
-
368  */
-
369  void print_namespace_stop() override;
-
370 
-
371 
-
372  /****************************************************************************************/
-
373  /* Routines for returning variable name */
-
374  /****************************************************************************************/
-
375 
-
376 
-
377  /**
-
378  * Determine the name of a \c float variable given its symbol
-
379  *
-
380  * This function typically returns the accessor expression in backend code for the given symbol.
-
381  * Since the model variables are stored in data arrays and accessed by offset, this function
-
382  * will return the C++ string representing the array access at the correct offset
-
383  *
-
384  * \param symbol The symbol of a variable for which we want to obtain its name
-
385  * \param use_instance Should the variable be accessed via instance or data array
-
386  * \return The backend code string representing the access to the given variable
-
387  * symbol
-
388  */
-
389  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
-
390 
-
391 
-
392  /**
-
393  * Determine the name of an \c int variable given its symbol
-
394  *
-
395  * This function typically returns the accessor expression in backend code for the given symbol.
-
396  * Since the model variables are stored in data arrays and accessed by offset, this function
-
397  * will return the C++ string representing the array access at the correct offset
-
398  *
-
399  * \param symbol The symbol of a variable for which we want to obtain its name
-
400  * \param name The name of the index variable
-
401  * \param use_instance Should the variable be accessed via instance or data array
-
402  * \return The backend code string representing the access to the given variable
-
403  * symbol
-
404  */
-
405  std::string int_variable_name(const IndexVariableInfo& symbol,
-
406  const std::string& name,
-
407  bool use_instance) const override;
-
408 
-
409 
-
410  /**
-
411  * Determine the variable name for a global variable given its symbol
-
412  * \param symbol The symbol of a variable for which we want to obtain its name
-
413  * \param use_instance Should the variable be accessed via the (host-only)
-
414  * global variable or the instance-specific copy (also available on GPU).
-
415  * \return The C++ string representing the access to the global variable
-
416  */
-
417  std::string global_variable_name(const SymbolType& symbol,
-
418  bool use_instance = true) const override;
-
419 
-
420 
-
421  /**
-
422  * Determine the C++ string to print for thread variables.
-
423  *
-
424  * \param var_info Identifies the thread variable, typically an instance of
-
425  * `codegen_thread_variables`.
-
426  * \param use_instance Should the variable be accessed via instance or data array
-
427  */
-
428  std::string thread_variable_name(const ThreadVariableInfo& var_info,
-
429  bool use_instance = true) const;
-
430 
-
431 
-
432  /**
-
433  * Determine variable name in the structure of mechanism properties
-
434  *
-
435  * \param name Variable name that is being printed
-
436  * \param use_instance Should the variable be accessed via instance or data array
-
437  * \return The C++ string representing the variable.
-
438  * thread structure
-
439  */
-
440  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
-
441 
-
442 
-
443  /****************************************************************************************/
-
444  /* Main printing routines for code generation */
-
445  /****************************************************************************************/
-
446 
-
447 
-
448  /**
-
449  * Print standard C/C++ includes
-
450  */
-
451  void print_standard_includes() override;
-
452 
-
453 
-
454  /**
-
455  * Print includes from NEURON
-
456  */
-
457  void print_neuron_includes();
-
458 
-
459 
-
460  void print_sdlists_init(bool print_initializers) override;
-
461 
-
462 
-
463  /**
-
464  * Print the structure that wraps all global variables used in the NMODL
-
465  *
-
466  * \param print_initializers Whether to include default values in the struct
-
467  * definition (true: int foo{42}; false: int foo;)
-
468  */
-
469  void print_mechanism_global_var_structure(bool print_initializers) override;
-
470 
-
471 
-
472  /**
-
473  * Print byte arrays that register scalar and vector variables for hoc interface
-
474  *
-
475  */
-
476  void print_global_variables_for_hoc() override;
-
477 
-
478  /** Print global struct with default value of RANGE PARAMETERs.
-
479  */
- -
481 
-
482  /**
-
483  * Print the mechanism registration function
-
484  *
-
485  */
-
486  void print_mechanism_register() override;
+
311 
+
312  void append_conc_write_statements(std::vector<ShadowUseStatement>& statements,
+
313  const Ion& ion,
+
314  const std::string& concentration) override;
+
315 
+
316  /**
+
317  * All functions and procedures need a \c _hoc_<func_or_proc_name> to be available to the HOC
+
318  * interpreter
+
319  */
+
320  std::string hoc_function_name(const std::string& function_or_procedure_name) const;
+
321 
+
322 
+
323  /**
+
324  * Get the signature of the \c _hoc_<func_or_proc_name> function
+
325  */
+
326  std::string hoc_function_signature(const std::string& function_or_procedure_name) const;
+
327 
+
328 
+
329  /**
+
330  * In non POINT_PROCESS mechanisms all functions and procedures need a \c
+
331  * _py_<func_or_proc_name> to be available to the HOC interpreter
+
332  */
+
333  std::string py_function_name(const std::string& function_or_procedure_name) const;
+
334 
+
335  /**
+
336  * Get the signature of the \c _npy_<func_or_proc_name> function
+
337  */
+
338  std::string py_function_signature(const std::string& function_or_procedure_name) const;
+
339 
+
340 
+
341  /****************************************************************************************/
+
342  /* Code-specific printing routines for code generations */
+
343  /****************************************************************************************/
+
344 
+
345 
+
346  /**
+
347  * Prints the start of the \c neuron namespace
+
348  */
+
349  void print_namespace_start() override;
+
350 
+
351 
+
352  /**
+
353  * Prints the end of the \c neuron namespace
+
354  */
+
355  void print_namespace_stop() override;
+
356 
+
357 
+
358  /****************************************************************************************/
+
359  /* Routines for returning variable name */
+
360  /****************************************************************************************/
+
361 
+
362 
+
363  /**
+
364  * Determine the name of a \c float variable given its symbol
+
365  *
+
366  * This function typically returns the accessor expression in backend code for the given symbol.
+
367  * Since the model variables are stored in data arrays and accessed by offset, this function
+
368  * will return the C++ string representing the array access at the correct offset
+
369  *
+
370  * \param symbol The symbol of a variable for which we want to obtain its name
+
371  * \param use_instance Should the variable be accessed via instance or data array
+
372  * \return The backend code string representing the access to the given variable
+
373  * symbol
+
374  */
+
375  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
+
376 
+
377 
+
378  /**
+
379  * Determine the name of an \c int variable given its symbol
+
380  *
+
381  * This function typically returns the accessor expression in backend code for the given symbol.
+
382  * Since the model variables are stored in data arrays and accessed by offset, this function
+
383  * will return the C++ string representing the array access at the correct offset
+
384  *
+
385  * \param symbol The symbol of a variable for which we want to obtain its name
+
386  * \param name The name of the index variable
+
387  * \param use_instance Should the variable be accessed via instance or data array
+
388  * \return The backend code string representing the access to the given variable
+
389  * symbol
+
390  */
+
391  std::string int_variable_name(const IndexVariableInfo& symbol,
+
392  const std::string& name,
+
393  bool use_instance) const override;
+
394 
+
395 
+
396  /**
+
397  * Determine the variable name for a global variable given its symbol
+
398  * \param symbol The symbol of a variable for which we want to obtain its name
+
399  * \param use_instance Should the variable be accessed via the (host-only)
+
400  * global variable or the instance-specific copy (also available on GPU).
+
401  * \return The C++ string representing the access to the global variable
+
402  */
+
403  std::string global_variable_name(const SymbolType& symbol,
+
404  bool use_instance = true) const override;
+
405 
+
406 
+
407  /**
+
408  * Determine the C++ string to print for thread variables.
+
409  *
+
410  * \param var_info Identifies the thread variable, typically an instance of
+
411  * `codegen_thread_variables`.
+
412  * \param use_instance Should the variable be accessed via instance or data array
+
413  */
+
414  std::string thread_variable_name(const ThreadVariableInfo& var_info,
+
415  bool use_instance = true) const;
+
416 
+
417 
+
418  /**
+
419  * Determine variable name in the structure of mechanism properties
+
420  *
+
421  * \param name Variable name that is being printed
+
422  * \param use_instance Should the variable be accessed via instance or data array
+
423  * \return The C++ string representing the variable.
+
424  * thread structure
+
425  */
+
426  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
+
427 
+
428 
+
429  /****************************************************************************************/
+
430  /* Main printing routines for code generation */
+
431  /****************************************************************************************/
+
432 
+
433 
+
434  /**
+
435  * Print standard C/C++ includes
+
436  */
+
437  void print_standard_includes() override;
+
438 
+
439 
+
440  /**
+
441  * Print includes from NEURON
+
442  */
+
443  void print_neuron_includes();
+
444 
+
445 
+
446  void print_sdlists_init(bool print_initializers) override;
+
447 
+
448 
+
449  /**
+
450  * Print the structure that wraps all global variables used in the NMODL
+
451  *
+
452  * \param print_initializers Whether to include default values in the struct
+
453  * definition (true: int foo{42}; false: int foo;)
+
454  */
+
455  void print_mechanism_global_var_structure(bool print_initializers) override;
+
456 
+
457 
+
458  /**
+
459  * Print byte arrays that register scalar and vector variables for hoc interface
+
460  *
+
461  */
+
462  void print_global_variables_for_hoc() override;
+
463 
+
464  /** Print global struct with default value of RANGE PARAMETERs.
+
465  */
+ +
467 
+
468  /**
+
469  * Print the mechanism registration function
+
470  *
+
471  */
+
472  void print_mechanism_register() override;
+
473 
+
474  /**
+
475  * Print thread variable (de-)initialization functions.
+
476  */
+ +
478 
+
479 
+
480  /**
+
481  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
+
482  * \param type The target backend code block type
+
483  */
+ +
485  const std::string& function_name = "") override;
+
486 
487 
488  /**
-
489  * Print thread variable (de-)initialization functions.
-
490  */
- -
492 
+
489  * Print the \c nrn\_init function definition
+
490  * \param skip_init_check \c true to generate code executing the initialization conditionally
+
491  */
+
492  void print_nrn_init(bool skip_init_check = true);
493 
-
494  /**
-
495  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
-
496  * \param type The target backend code block type
-
497  */
- -
499  const std::string& function_name = "") override;
-
500 
-
501 
-
502  /**
-
503  * Print the \c nrn\_init function definition
-
504  * \param skip_init_check \c true to generate code executing the initialization conditionally
-
505  */
-
506  void print_nrn_init(bool skip_init_check = true);
-
507 
-
508  /** Print the initial block. */
-
509  void print_initial_block(const ast::InitialBlock* node);
+
494  /** Print the initial block. */
+
495  void print_initial_block(const ast::InitialBlock* node);
+
496 
+
497  /**
+
498  * Print nrn_constructor function definition
+
499  *
+
500  */
+
501  void print_nrn_constructor() override;
+
502 
+
503 
+
504  /**
+
505  * Print nrn_destructor function definition
+
506  *
+
507  */
+
508  void print_nrn_destructor() override;
+
509 
510 
511  /**
-
512  * Print nrn_constructor function definition
+
512  * Print nrn_alloc function definition
513  *
514  */
-
515  void print_nrn_constructor() override;
+
515  void print_nrn_alloc() override;
516 
517 
518  /**
-
519  * Print nrn_destructor function definition
+
519  * Print nrn_jacob function definition
520  *
521  */
-
522  void print_nrn_destructor() override;
+
522  void print_nrn_jacob();
523 
-
524 
-
525  /**
-
526  * Print nrn_alloc function definition
-
527  *
-
528  */
-
529  void print_nrn_alloc() override;
-
530 
-
531 
-
532  /**
-
533  * Print nrn_jacob function definition
-
534  *
-
535  */
-
536  void print_nrn_jacob();
-
537 
-
538 
-
539  /****************************************************************************************/
-
540  /* Print nrn_state routine */
-
541  /****************************************************************************************/
-
542 
-
543 
-
544  /**
-
545  * Print nrn_state / state update function definition
-
546  */
-
547  void print_nrn_state() override;
-
548 
-
549 
-
550  /****************************************************************************************/
-
551  /* Print nrn_cur related routines */
-
552  /****************************************************************************************/
-
553 
-
554  std::string nrn_current_arguments();
- -
556 
-
557  /**
-
558  * Print the \c nrn_current kernel
-
559  *
-
560  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
-
561  * \param node the AST node representing the NMODL breakpoint block
-
562  */
-
563  void print_nrn_current(const ast::BreakpointBlock& node) override;
-
564 
-
565 
-
566  /**
-
567  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
-
568  *
-
569  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
-
570  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
571  *
-
572  * \param node the AST node representing the NMODL breakpoint block
-
573  */
-
574  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
-
575 
-
576 
-
577  /**
-
578  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
-
579  *
-
580  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
-
581  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
582  */
-
583  void print_nrn_cur_non_conductance_kernel() override;
-
584 
-
585 
-
586  /**
-
587  * Print main body of nrn_cur function
-
588  * \param node the AST node representing the NMODL breakpoint block
-
589  */
-
590  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
-
591 
-
592 
-
593  /**
-
594  * Print fast membrane current calculation code
-
595  */
-
596  void print_fast_imem_calculation() override;
-
597 
-
598 
-
599  /**
-
600  * Print nrn_cur / current update function definition
-
601  */
-
602  void print_nrn_cur() override;
-
603 
-
604 
-
605  /****************************************************************************************/
-
606  /* Main code printing entry points */
-
607  /****************************************************************************************/
+
524 
+
525  /****************************************************************************************/
+
526  /* Print nrn_state routine */
+
527  /****************************************************************************************/
+
528 
+
529 
+
530  /**
+
531  * Print nrn_state / state update function definition
+
532  */
+
533  void print_nrn_state() override;
+
534 
+
535 
+
536  /****************************************************************************************/
+
537  /* Print nrn_cur related routines */
+
538  /****************************************************************************************/
+
539 
+
540  std::string nrn_current_arguments();
+ +
542 
+
543  /**
+
544  * Print the \c nrn_current kernel
+
545  *
+
546  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
+
547  * \param node the AST node representing the NMODL breakpoint block
+
548  */
+
549  void print_nrn_current(const ast::BreakpointBlock& node) override;
+
550 
+
551 
+
552  /**
+
553  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
+
554  *
+
555  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
+
556  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
557  *
+
558  * \param node the AST node representing the NMODL breakpoint block
+
559  */
+
560  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
+
561 
+
562 
+
563  /**
+
564  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
+
565  *
+
566  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
+
567  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
568  */
+
569  void print_nrn_cur_non_conductance_kernel() override;
+
570 
+
571 
+
572  /**
+
573  * Print main body of nrn_cur function
+
574  * \param node the AST node representing the NMODL breakpoint block
+
575  */
+
576  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
+
577 
+
578 
+
579  /**
+
580  * Print fast membrane current calculation code
+
581  */
+
582  void print_fast_imem_calculation() override;
+
583 
+
584 
+
585  /**
+
586  * Print nrn_cur / current update function definition
+
587  */
+
588  void print_nrn_cur() override;
+
589 
+
590 
+
591  /****************************************************************************************/
+
592  /* Main code printing entry points */
+
593  /****************************************************************************************/
+
594 
+
595 
+
596  /**
+
597  * Print all includes
+
598  *
+
599  */
+
600  void print_headers_include() override;
+
601 
+
602 
+
603  /**
+
604  * Print all NEURON macros
+
605  *
+
606  */
+
608 
609 
610  /**
-
611  * Print all includes
+
611  * Print extern declarations for neuron global variables.
612  *
-
613  */
-
614  void print_headers_include() override;
-
615 
-
616 
-
617  /**
-
618  * Print all NEURON macros
-
619  *
-
620  */
- -
622 
-
623 
-
624  /**
-
625  * Print extern declarations for neuron global variables.
-
626  *
-
627  * Examples include `celsius`.
+
613  * Examples include `celsius`.
+
614  */
+ +
616 
+
617 
+
618  /**
+
619  * Print NEURON global variable macros
+
620  *
+
621  */
+
622  void print_global_macros();
+
623 
+
624 
+
625  /**
+
626  * Print mechanism variables' related macros
+
627  *
628  */
- +
630 
631 
632  /**
-
633  * Print NEURON global variable macros
-
634  *
+
633  * Print all classes
+
634  * \param print_initializers Whether to include default values.
635  */
-
636  void print_global_macros();
-
637 
-
638 
-
639  /**
-
640  * Print mechanism variables' related macros
-
641  *
-
642  */
- -
644 
+
636  void print_data_structures(bool print_initializers) override;
+
637 
+
638  /** Print `make_*_instance`.
+
639  */
+
640  void print_make_instance() const;
+
641 
+
642  /** Print `make_*_node_data`.
+
643  */
+
644  void print_make_node_data() const;
645 
646  /**
-
647  * Print all classes
-
648  * \param print_initializers Whether to include default values.
-
649  */
-
650  void print_data_structures(bool print_initializers) override;
+
647  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
+
648  */
+
649  void print_v_unused() const override;
+
650 
651 
-
652  /** Print `make_*_instance`.
-
653  */
-
654  void print_make_instance() const;
-
655 
-
656  /** Print `make_*_node_data`.
-
657  */
-
658  void print_make_node_data() const;
-
659 
-
660  /**
-
661  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
-
662  */
-
663  void print_v_unused() const override;
-
664 
-
665 
-
666  /**
-
667  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
652  /**
+
653  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
654  */
+
655  void print_g_unused() const override;
+
656 
+
657 
+
658  /**
+
659  * Print all compute functions for every backend
+
660  *
+
661  */
+
662  void print_compute_functions() override;
+
663 
+
664 
+
665  /**
+
666  * Print entry point to code generation
+
667  *
668  */
-
669  void print_g_unused() const override;
+
669  void print_codegen_routines() override;
670 
-
671 
-
672  /**
-
673  * Print all compute functions for every backend
-
674  *
-
675  */
-
676  void print_compute_functions() override;
-
677 
-
678 
-
679  /**
-
680  * Print entry point to code generation
-
681  *
-
682  */
-
683  void print_codegen_routines() override;
+
671 
+
672  void print_ion_variable() override;
+
673 
+
674 
+
675  /****************************************************************************************/
+
676  /* Overloaded visitor routines */
+
677  /****************************************************************************************/
+
678 
+
679 
+
680  void visit_watch_statement(const ast::WatchStatement& node) override;
+
681 
+
682 
+
683 
684 
-
685 
-
686  void print_ion_variable() override;
-
687 
-
688 
-
689  /****************************************************************************************/
-
690  /* Overloaded visitor routines */
-
691  /****************************************************************************************/
-
692 
-
693 
-
694  void visit_watch_statement(const ast::WatchStatement& node) override;
-
695 
-
696 
-
697 
-
698 
-
699  public:
-
700  /****************************************************************************************/
-
701  /* Public printing routines for code generation for use in unit tests */
-
702  /****************************************************************************************/
-
703  ParamVector functor_params() override;
-
704 
-
705  /**
-
706  * Print the structure that wraps all range and int variables required for the NMODL
-
707  *
-
708  * \param print_initializers Whether or not default values for variables
-
709  * be included in the struct declaration.
-
710  */
-
711  void print_mechanism_range_var_structure(bool print_initializers) override;
-
712 
-
713  /**
-
714  * Print the structure that wraps all node variables required for the NMODL.
-
715  *
-
716  * \param print_initializers Whether or not default values for variables
-
717  * be included in the struct declaration.
-
718  */
-
719  void print_node_data_structure(bool print_initializers);
-
720 
-
721  /**
-
722  * Print the data structure used to access thread variables.
-
723  */
-
724  void print_thread_variables_structure(bool print_initializers);
-
725 };
-
726 
-
727 
-
728 /** \} */ // end of codegen_backends
-
729 
-
730 } // namespace codegen
-
731 } // namespace nmodl
+
685  public:
+
686  /****************************************************************************************/
+
687  /* Public printing routines for code generation for use in unit tests */
+
688  /****************************************************************************************/
+
689  ParamVector functor_params() override;
+
690 
+
691  /**
+
692  * Print the structure that wraps all range and int variables required for the NMODL
+
693  *
+
694  * \param print_initializers Whether or not default values for variables
+
695  * be included in the struct declaration.
+
696  */
+
697  void print_mechanism_range_var_structure(bool print_initializers) override;
+
698 
+
699  /**
+
700  * Print the structure that wraps all node variables required for the NMODL.
+
701  *
+
702  * \param print_initializers Whether or not default values for variables
+
703  * be included in the struct declaration.
+
704  */
+
705  void print_node_data_structure(bool print_initializers);
+
706 
+
707  /**
+
708  * Print the data structure used to access thread variables.
+
709  */
+
710  void print_thread_variables_structure(bool print_initializers);
+
711 };
+
712 
+
713 
+
714 /** \} */ // end of codegen_backends
+
715 
+
716 } // namespace codegen
+
717 } // namespace nmodl
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
-
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
std::string py_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the npy <func_or_proc_name> function.
Helper to represent information about index/int variables.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
void print_macro_definitions()
Print all NEURON macros.
- +
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
void print_macro_definitions()
Print all NEURON macros.
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies, std::unique_ptr< nmodl::utils::Blame > blame)
Constructs the C++ code generator visitor.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
-
void print_neuron_includes()
Print includes from NEURON.
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
-
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
-
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_neuron_includes()
Print includes from NEURON.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
+
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
-
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
+
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
- +
std::string table_thread_function_name() const
Name of the threaded table checking function.
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
-
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
+
std::string hoc_function_name(const std::string &function_or_procedure_name) const
All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
-
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
+
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
Represent ions used in mod file.
-
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
+
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
Implement classes for representing symbol table at block and file scope.
std::string backend_name() const override
Name of the code generation backend.
-
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
- -
void print_global_param_default_values()
Print global struct with default value of RANGE PARAMETERs.
-
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
-
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
-
void print_nrn_state() override
Print nrn_state / state update function definition.
-
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
-
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
-
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
-
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
- -
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
- -
ParamVector functor_params() override
The parameters of the Newton solver "functor".
+
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
+ +
void print_global_param_default_values()
Print global struct with default value of RANGE PARAMETERs.
+
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+
void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+
std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
Determine the C++ string to print for thread variables.
+
void print_nrn_state() override
Print nrn_state / state update function definition.
+
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
+
void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
+ +
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+ +
ParamVector functor_params() override
The parameters of the Newton solver "functor".
Visitor for printing C++ code compatible with legacy api of CoreNEURON
Base class for all block scoped nodes.
Definition: block.hpp:41
Represents a INITIAL block in the NMODL.
void print_point_process_function_definitions()
Print POINT_PROCESS related functions Wrap external NEURON functions related to POINT_PROCESS mechani...
Represent WATCH statement in NMODL.
-
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
+
void print_neuron_global_variable_declarations()
Print extern declarations for neuron global variables.
Represents a BREAKPOINT block in NMODL.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
-
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
InterpreterWrapper
Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
-
void print_standard_includes() override
Print standard C/C++ includes.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+
void print_standard_includes() override
Print standard C/C++ includes.
std::vector< ThreadVariableInfo > codegen_thread_variables
GLOBAL variables in THREADSAFE MOD files that are not read-only are converted to thread variables.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
-
void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
-
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
Add the variable tqitem during get_int_variables.
Helper class for printing C/C++ code.
-
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
-
void print_namespace_start() override
Prints the start of the neuron namespace.
-
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
-
void print_compute_functions() override
Print all compute functions for every backend.
-
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
-
void print_mechanism_register() override
Print the mechanism registration function.
-
void print_nrn_jacob()
Print nrn_jacob function definition.
+
std::string hoc_function_signature(const std::string &function_or_procedure_name) const
Get the signature of the hoc <func_or_proc_name> function.
+
void print_namespace_start() override
Prints the start of the neuron namespace.
+
void print_thread_variables_structure(bool print_initializers)
Print the data structure used to access thread variables.
+
void print_compute_functions() override
Print all compute functions for every backend.
+
void print_thread_memory_callbacks()
Print thread variable (de-)initialization functions.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
void print_mechanism_register() override
Print the mechanism registration function.
+
void print_nrn_jacob()
Print nrn_jacob function definition.
Various types to store code generation specific information.
-
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-
void print_data_structures(bool print_initializers) override
Print all classes.
-
void print_sdlists_init(bool print_initializers) override
-
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
-
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
+
void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_data_structures(bool print_initializers) override
Print all classes.
+
void print_sdlists_init(bool print_initializers) override
+
const std::string external_method_arguments() noexcept override
Arguments for external functions called from generated code.
+
std::string py_function_name(const std::string &function_or_procedure_name) const
In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
size_t offset
The global variables ahead of this one require offset doubles to store.
-
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
+
void print_node_data_structure(bool print_initializers)
Print the structure that wraps all node variables required for the NMODL.
-
void print_make_instance() const
Print make_*_instance.
+
void print_make_instance() const
Print make_*_instance.
void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
-
void print_namespace_stop() override
Prints the end of the neuron namespace.
+
void print_namespace_stop() override
Prints the end of the neuron namespace.
void print_setdata_functions()
Print NEURON functions related to setting global variables of the mechanism.
std::string get_name(const std::shared_ptr< symtab::Symbol > &sym)
Represents ion write statement during code generation.
- -
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
+
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
Visitor for printing C++ code compatible with legacy api of NEURON
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
void print_check_table_function_prototypes()
Print all check_* function declarations.
Implement logger based on spdlog library.
parser::NmodlParser::symbol_type SymbolType
Definition: main_nmodl.cpp:33
BlockType
Helper to represent various block types.
size_t index
There index global variables ahead of this one.
-
void print_headers_include() override
Print all includes.
-
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
+
void print_headers_include() override
Print all includes.
+
const ParamVector external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
Print nmodl function or procedure (common code)
const std::shared_ptr< symtab::Symbol > symbol
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
void print_make_node_data() const
Print make_*_node_data.
+
void print_make_node_data() const
Print make_*_node_data.
std::string simulator_name() override
Name of the simulator the code was generated for.
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
-
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
-
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
+
void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
Add the variable point_process during get_int_variables.
+
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
void print_net_receive_registration()
Print code to register the call-back for the NET_RECEIVE block.
-
void print_codegen_routines() override
Print entry point to code generation.
-
void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
Generate Function call statement for nrn_wrote_conc.
-
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
-
void print_net_receive()
Print net_receive call-back.
+
void print_codegen_routines() override
Print entry point to code generation.
+
void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
Generate Function call statement for nrn_wrote_conc.
+
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
+
void print_net_receive()
Print net_receive call-back.
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void print_global_macros()
Print NEURON global variable macros.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void print_global_macros()
Print NEURON global variable macros.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
Concrete visitor for all AST classes.
diff --git a/doxygen/functions_func_p.html b/doxygen/functions_func_p.html index 5858581fa..fc80551c4 100644 --- a/doxygen/functions_func_p.html +++ b/doxygen/functions_func_p.html @@ -275,9 +275,7 @@

- p -

    : nmodl::codegen::CodegenCoreneuronCppVisitor
  • print_function() -: nmodl::codegen::CodegenCoreneuronCppVisitor -, nmodl::codegen::CodegenCppVisitor -, nmodl::codegen::CodegenNeuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
  • print_function_call() : nmodl::codegen::CodegenCppVisitor @@ -612,9 +610,7 @@

    - p -

      : nmodl::codegen::CodegenCppVisitor
    • print_procedure() -: nmodl::codegen::CodegenCoreneuronCppVisitor -, nmodl::codegen::CodegenCppVisitor -, nmodl::codegen::CodegenNeuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
    • print_rhs_d_shadow_variables() : nmodl::codegen::CodegenAccVisitor @@ -679,7 +675,7 @@

      - p -

        : nmodl::codegen::CodegenCoreneuronCppVisitor
      • ProcedureBlock() -: nmodl::ast::ProcedureBlock +: nmodl::ast::ProcedureBlock
      • process_conserve_reac_var() : nmodl::visitor::KineticBlockVisitor @@ -691,7 +687,7 @@

        - p -

          : nmodl::codegen::CodegenCppVisitor
        • process_variable() -: nmodl::visitor::DefUseAnalyzeVisitor +: nmodl::visitor::DefUseAnalyzeVisitor
        • process_verbatim_text() : nmodl::codegen::CodegenCoreneuronCppVisitor diff --git a/doxygen/functions_p.html b/doxygen/functions_p.html index be2c76184..4e99bf693 100644 --- a/doxygen/functions_p.html +++ b/doxygen/functions_p.html @@ -330,9 +330,7 @@

          - p -

            : nmodl::codegen::CodegenCoreneuronCppVisitor
          • print_function() -: nmodl::codegen::CodegenCoreneuronCppVisitor -, nmodl::codegen::CodegenCppVisitor -, nmodl::codegen::CodegenNeuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
          • print_function_call() : nmodl::codegen::CodegenCppVisitor @@ -667,9 +665,7 @@

            - p -

              : nmodl::codegen::CodegenCppVisitor
            • print_procedure() -: nmodl::codegen::CodegenCoreneuronCppVisitor -, nmodl::codegen::CodegenCppVisitor -, nmodl::codegen::CodegenNeuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
            • print_rhs_d_shadow_variables() : nmodl::codegen::CodegenAccVisitor @@ -750,7 +746,7 @@

              - p -

                : nmodl::codegen::CodegenCppVisitor
              • ProcedureBlock() -: nmodl::ast::ProcedureBlock +: nmodl::ast::ProcedureBlock
              • procedures : nmodl::codegen::CodegenInfo @@ -765,7 +761,7 @@

                - p -

                  : nmodl::codegen::CodegenCppVisitor
                • process_variable() -: nmodl::visitor::DefUseAnalyzeVisitor +: nmodl::visitor::DefUseAnalyzeVisitor
                • process_verbatim_text() : nmodl::codegen::CodegenCoreneuronCppVisitor @@ -776,7 +772,7 @@

                  - p -

                    : nmodl::codegen::CodegenCoreneuronCppVisitor
                  • Program() -: nmodl::ast::Program +: nmodl::ast::Program
                  • program_symtab : nmodl::codegen::CodegenCppVisitor @@ -789,14 +785,14 @@

                    - p -

                      : nmodl::symtab::Symbol
                    • ProtectStatement() -: nmodl::ast::ProtectStatement +: nmodl::ast::ProtectStatement
                    • psymtab : nmodl::codegen::CodegenHelperVisitor , nmodl::visitor::FunctionCallpathVisitor
                    • push_block() -: nmodl::printer::CodePrinter +: nmodl::printer::CodePrinter , nmodl::printer::JSONPrinter
                    • push_current_directory() diff --git a/doxygen/group__codegen__backends.js b/doxygen/group__codegen__backends.js index f2f355311..f50ab6b8d 100644 --- a/doxygen/group__codegen__backends.js +++ b/doxygen/group__codegen__backends.js @@ -91,7 +91,6 @@ var group__codegen__backends = [ "print_fast_imem_calculation", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c", null ], [ "print_first_pointer_var_index_getter", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e", null ], [ "print_first_random_var_index_getter", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8", null ], - [ "print_function", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7", null ], [ "print_function_or_procedure", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab530015ada1f6f6299b526a32e277a0c", null ], [ "print_function_procedure_helper", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5be32556e7bb7fd48b1bdb71d75fe5bb", null ], [ "print_function_prototypes", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4dd6948c9064a446dc45cf6f4d463975", null ], @@ -155,7 +154,6 @@ var group__codegen__backends = [ "print_nrn_init", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2998645f8c5bf76da0389299d033afe0", null ], [ "print_nrn_state", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a38c76390b1d1c0a5cf1fe8df3f27fb57", null ], [ "print_num_variable_getter", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e", null ], - [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8", null ], [ "print_rhs_d_shadow_variables", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137", null ], [ "print_sdlists_init", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42", null ], [ "print_send_event_move", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6", null ], @@ -253,7 +251,7 @@ var group__codegen__backends = [ "print_data_structures", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acbb83079b063cd6b48e07030b1f5df84", null ], [ "print_eigen_linear_solver", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a74fd9098a04a59ba0f11c17d0e51a876", null ], [ "print_fast_imem_calculation", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34492b32e18b9fbfd3ba01ba8ad85eb5", null ], - [ "print_function", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34", null ], + [ "print_function", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec5684647e34e9f3381635ab50ce4ed0", null ], [ "print_function_call", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad63b4318b5abd6b8c224fab70fe61081", null ], [ "print_function_declaration", "group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160", null ], [ "print_function_or_procedure", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9ec8d64ef0941d98af29b31060155c0b", null ], @@ -288,7 +286,7 @@ var group__codegen__backends = [ "print_nrn_destructor", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a481001b393776c233ccdc069916d2d7c", null ], [ "print_nrn_state", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2453a1be52f39c3fa9bab2603f1f4773", null ], [ "print_prcellstate_macros", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a522261006f1cc94869ef15cd26b739da", null ], - [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff", null ], + [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a60bf374a3063ccd280e46b7af0e48645", null ], [ "print_sdlists_init", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34ae139e68f31b69fa73c9a84c2197e8", null ], [ "print_standard_includes", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6131bec61397f01d9739e694c57afdbf", null ], [ "print_statement_block", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b912ad6d9a4f6d8e4c1bb16f2c95fbf", null ], @@ -394,7 +392,6 @@ var group__codegen__backends = [ "print_compute_functions", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a94f4993226aa53f6095ad4a44fe47420", null ], [ "print_data_structures", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aeb0635e7e6e488519882d930401b5c2b", null ], [ "print_fast_imem_calculation", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f", null ], - [ "print_function", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb", null ], [ "print_function_or_procedure", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c240b7ccb8aa19ad0cfca2e57fd8496", null ], [ "print_function_procedure_helper", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6a5224b66dde062241120381b3cb8df", null ], [ "print_function_prototypes", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7f941bd8151d12ef887be3670dec264e", null ], @@ -437,7 +434,6 @@ var group__codegen__backends = [ "print_nrn_jacob", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acc60913cbeb34f75a125224f6a3a79bd", null ], [ "print_nrn_state", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a24c55a8420d179cbbd7bc6968f3c12e3", null ], [ "print_point_process_function_definitions", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aba63d80e4b1b15280a92ea120bc6160c", null ], - [ "print_procedure", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622", null ], [ "print_sdlists_init", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a", null ], [ "print_setdata_functions", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c15974d73972df388dc1133fdfa406", null ], [ "print_standard_includes", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a75551174c0c66124b0096de40ca20cbf", null ], diff --git a/doxygen/namespacenmodl_1_1codegen.html b/doxygen/namespacenmodl_1_1codegen.html index be282bb1e..f6fb3cf04 100644 --- a/doxygen/namespacenmodl_1_1codegen.html +++ b/doxygen/namespacenmodl_1_1codegen.html @@ -285,7 +285,7 @@

                      Definition at line 1295 of file codegen_coreneuron_cpp_visitor.cpp.

                      +

                      Definition at line 1270 of file codegen_coreneuron_cpp_visitor.cpp.

                      @@ -331,7 +331,7 @@

                      x[id] = _args[1];

                      So, the R in AST needs to be renamed with _args[1].

                      -

                      Definition at line 2168 of file codegen_neuron_cpp_visitor.cpp.

                      +

                      Definition at line 2144 of file codegen_neuron_cpp_visitor.cpp.

                      @@ -381,7 +381,7 @@

                      (*R) = 1.0;

                      So, the R in AST needs to be renamed with (*R).

                      -

                      Definition at line 2355 of file codegen_coreneuron_cpp_visitor.cpp.

                      +

                      Definition at line 2330 of file codegen_coreneuron_cpp_visitor.cpp.

                      @@ -398,7 +398,7 @@

                      -

                      Definition at line 783 of file codegen_cpp_visitor.cpp.

                      +

                      Definition at line 808 of file codegen_cpp_visitor.cpp.

                      diff --git a/doxygen/navtreedata.js b/doxygen/navtreedata.js index 9867116cf..e1be7ccbe 100644 --- a/doxygen/navtreedata.js +++ b/doxygen/navtreedata.js @@ -79,25 +79,25 @@ var NAVTREEINDEX = "classnmodl_1_1ast_1_1_suffix.html#a7ea45f3672eab37276fc1a805a9ade1f", "classnmodl_1_1ast_1_1_useion.html#a2738a2e7bbadf0a7b1927aa3a8a27d12", "classnmodl_1_1ast_1_1_write_ion_var.html#afdbfd431fc9946611b2cb1014ce330ab", -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6b6f336bd93b1a3053428a92cf0fc909", -"classnmodl_1_1parser_1_1_c_driver.html#a43b1c0e96107027c6d4a268c996dd2af", -"classnmodl_1_1symtab_1_1_symbol.html#ab72dca24278ee2acc123d2b35a07b011", -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0c20b73e610f790c7bd861ba35300e99", -"classnmodl_1_1visitor_1_1_d_u_chain.html#a5d83efe0af5f73421f4ec313b53e7b75", -"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a67f4831ccfd4dadd5ac5df220dcdcdbc", -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a39006dd767c9741e985a7fbd38788d30", -"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#abc957c52a1bf35110a7fffe8c5ae3ce4", -"classnmodl_1_1visitor_1_1_visitor.html#a929b4adae6aacc9fa39b3148b653c1a4", -"codegen__naming_8hpp.html#a1cbc7704c95e06b613efd121525893bd", -"factor__def_8hpp.html", -"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4", -"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5335d3381381fc5e5c8a2ef39d82cc53", -"group__solver.html#ga0b8788299c392976f3159910e0af2e9c", -"loop__unroll__visitor_8hpp.html", -"pyembed_8cpp.html#a6df1d22fb5f09eccc23b9f399670cfd7", -"structnmodl_1_1codegen_1_1_codegen_info.html#ae0ae57c15bffa577993551d4345276e3", -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac4ba8c72426a2ce5d391710cb72d933a", -"verbatim__var__rename__visitor_8cpp.html" +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d73d64a97cc8f024e1ee3367bfd119d", +"classnmodl_1_1parser_1_1_c_driver.html#a6f5259ce939a3731bf4ba867fe5d3de2", +"classnmodl_1_1symtab_1_1_symbol.html#ac0efce1b092e9f2194305e406aa94e1e", +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a209c02aa1a9c3a88c57e6b1165e052d8", +"classnmodl_1_1visitor_1_1_d_u_instance.html#a0801173d998866460ca44a05ca7569a3", +"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a8e438e633134150468e511df6af4d7e1", +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a4299ad2404c0be0ab0b4bec5d0a85961", +"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#add7bdc7f6712c3205e28e0441a4cb465", +"classnmodl_1_1visitor_1_1_visitor.html#a9a4b4a21e8c55bcbb4cb6f28bde77d99", +"codegen__naming_8hpp.html#a2f9bd8ba3a4cd02ac98d5c34d53a9e10", +"file__library_8hpp.html", +"group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa", +"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5d5cd46919fa987731fb2edefe0f2a0c", +"group__solver.html#ga553e5133f871206a1ad6ab4fc10bde45", +"misc_8cpp.html#a9f62deb1d160e64c58f491dc2b5469d6", +"pyembed_8hpp.html", +"structnmodl_1_1codegen_1_1_codegen_info.html#afbc429aec58b9dbf16f0db7fc2d1869a", +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb2f7556254f071fb944800a31272b6b", +"verbatim__visitor_8cpp.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/doxygen/navtreeindex15.js b/doxygen/navtreeindex15.js index 418e1b16d..f447dbb30 100644 --- a/doxygen/navtreeindex15.js +++ b/doxygen/navtreeindex15.js @@ -47,133 +47,131 @@ var NAVTREEINDEX15 = "classnmodl_1_1codegen_1_1_codegen_compatibility_visitor.html#af8f4da257ecc161c61cabda2eee0cc3e":[0,1,0,1,2], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html":[0,1,0,2], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a009be25d4dc1397524ed5364898d5997":[0,1,0,2,2], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a03811d5433b03bea89083de74b62c40f":[0,1,0,2,98], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a03811d5433b03bea89083de74b62c40f":[0,1,0,2,97], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0620e76a8bf6864c3f4a38680f514158":[0,1,0,2,22], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0dfee548a568667a78d0ab729131d6c2":[0,1,0,2,36], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0eb6eb4f68afb0711caa99a0f9ee85d4":[0,1,0,2,114], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1094e3bda205659352865336751d56b3":[0,1,0,2,64], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a151c9e289cdc4df282ed47b1f72ecc6e":[0,1,0,2,49], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a16415780703b2653d6e4c29dba3ee7f9":[0,1,0,2,54], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0eb6eb4f68afb0711caa99a0f9ee85d4":[0,1,0,2,112], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1094e3bda205659352865336751d56b3":[0,1,0,2,63], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a151c9e289cdc4df282ed47b1f72ecc6e":[0,1,0,2,48], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a16415780703b2653d6e4c29dba3ee7f9":[0,1,0,2,53], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18c00e97466c3bf5a83f277ca48b0d95":[0,1,0,2,17], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18e0834ef774dd2bb5e5adc4ff2df5ae":[0,1,0,2,8], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b309a0bd2939736aadba430634ce52d":[0,1,0,2,10], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b43c39d762c18b8457ba45496726e24":[0,1,0,2,94], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1bd7222586890e03588e16f640f0bcbf":[0,1,0,2,84], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1ca2f8a251f296a1fde805928739be41":[0,1,0,2,100], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b43c39d762c18b8457ba45496726e24":[0,1,0,2,93], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1bd7222586890e03588e16f640f0bcbf":[0,1,0,2,83], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1ca2f8a251f296a1fde805928739be41":[0,1,0,2,99], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1e15a71e22ad32b958dd83b1df5d10fb":[0,1,0,2,18], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1edece0e83918dd7384d0bbe406bf9e7":[0,1,0,2,60], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a213e98f7c1ff3a0b9f07a6f3f3af3ee3":[0,1,0,2,90], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1edece0e83918dd7384d0bbe406bf9e7":[0,1,0,2,59], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a213e98f7c1ff3a0b9f07a6f3f3af3ee3":[0,1,0,2,89], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a227edd197659a7ae89b0beba807a4f54":[0,1,0,2,33], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137":[0,1,0,2,109], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24ec8383532b4cab19cafd75554a7119":[0,1,0,2,57], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24f47375affd9cc7195d83f026fc2ab8":[0,1,0,2,96], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a25d775a02a44f3e45f3b8a661249c5e8":[0,1,0,2,89], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137":[0,1,0,2,107], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24ec8383532b4cab19cafd75554a7119":[0,1,0,2,56], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24f47375affd9cc7195d83f026fc2ab8":[0,1,0,2,95], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a25d775a02a44f3e45f3b8a661249c5e8":[0,1,0,2,88], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a294fadf1935383379dd1002208363c71":[0,1,0,2,19], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2973dd8bba370083e1bfe449a70359ee":[0,1,0,2,50], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2998645f8c5bf76da0389299d033afe0":[0,1,0,2,105], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2973dd8bba370083e1bfe449a70359ee":[0,1,0,2,49], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2998645f8c5bf76da0389299d033afe0":[0,1,0,2,104], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2e6460f6c8b0f6a0ae0732a5a0a15c45":[0,1,0,2,29], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a30c0625de66788948965e8e6b1d6ff1c":[0,1,0,2,66], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a30c0625de66788948965e8e6b1d6ff1c":[0,1,0,2,65], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a328753b743f89bbdf4123c462d63ba0c":[0,1,0,2,13], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3516dd7938db6a28e1d5668a9c4aca25":[0,1,0,2,79], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a38c76390b1d1c0a5cf1fe8df3f27fb57":[0,1,0,2,106], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3ea1bf8ef47090b926d8738d18306de7":[0,1,0,2,119], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3fb561fbaba6ab77da1d69e531eac7d5":[0,1,0,2,51], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a421dd82c2f3762ff97fb4d0d646c1565":[0,1,0,2,72], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3516dd7938db6a28e1d5668a9c4aca25":[0,1,0,2,78], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a38c76390b1d1c0a5cf1fe8df3f27fb57":[0,1,0,2,105], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3ea1bf8ef47090b926d8738d18306de7":[0,1,0,2,117], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3fb561fbaba6ab77da1d69e531eac7d5":[0,1,0,2,50], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a421dd82c2f3762ff97fb4d0d646c1565":[0,1,0,2,71], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43b05a41af87606941c4dff097a5f7b9":[0,1,0,2,21], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a45b1dc5e371bf956e045d40f19b2470c":[0,1,0,2,30], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a47aa1e9e08042a9c2bc4c5a0773fdf53":[0,1,0,2,73], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a48e4c785bbae026d24044736fd6913c2":[0,1,0,2,80], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a498d36eb5344aa9689b514adeb57aefd":[0,1,0,2,59], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a47aa1e9e08042a9c2bc4c5a0773fdf53":[0,1,0,2,72], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a48e4c785bbae026d24044736fd6913c2":[0,1,0,2,79], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a498d36eb5344aa9689b514adeb57aefd":[0,1,0,2,58], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4b959a2df6058dc1539d8f4f745b01ec":[0,1,0,2,20], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c165609255c0fe51ba8af7684890d1e":[0,1,0,2,113], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c165609255c0fe51ba8af7684890d1e":[0,1,0,2,111], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c3349dba0cee6135e099e042936adac":[0,1,0,2,34], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705":[0,1,0,2,121], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4d163cf837717e6f1bac43c1a492f456":[0,1,0,2,93], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4dd6948c9064a446dc45cf6f4d463975":[0,1,0,2,47], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4f3cf2cc2726db4de8edd19ef660f52b":[0,1,0,2,76], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a524be3f8fa4165f983647ed8ebbb9f01":[0,1,0,2,126], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508":[0,1,0,2,120], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5b5df9be580baa41acf1e32b177ca2f7":[0,1,0,2,65], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5be32556e7bb7fd48b1bdb71d75fe5bb":[0,1,0,2,46], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705":[0,1,0,2,119], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4d163cf837717e6f1bac43c1a492f456":[0,1,0,2,92], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4dd6948c9064a446dc45cf6f4d463975":[0,1,0,2,46], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4f3cf2cc2726db4de8edd19ef660f52b":[0,1,0,2,75], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a524be3f8fa4165f983647ed8ebbb9f01":[0,1,0,2,124], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508":[0,1,0,2,118], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5b5df9be580baa41acf1e32b177ca2f7":[0,1,0,2,64], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5be32556e7bb7fd48b1bdb71d75fe5bb":[0,1,0,2,45], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5d1ca0fcb615508f88c56b6d7a987419":[0,1,0,2,16], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a60f89c589e7bde18fcb7dfcdd62160ef":[0,1,0,2,62], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a60f89c589e7bde18fcb7dfcdd62160ef":[0,1,0,2,61], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c":[0,1,0,2,41], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e":[0,1,0,2,42], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a656859e8b2ce968ed39db6e966c2338f":[0,1,0,2,77], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a656859e8b2ce968ed39db6e966c2338f":[0,1,0,2,76], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a66833aede8ecc336b85129ca1e8b8b2e":[0,1,0,2,26], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a668abea41fecf3599122af773e93c385":[0,1,0,2,4], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6aacd1083b5929ad28f227d20a412b4e":[0,1,0,2,86], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6f5682b33a0230cf3a068290df144831":[0,1,0,2,55], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e":[0,1,0,2,107], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a798b58891191750906359b1f097bca05":[0,1,0,2,104], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7bc87ceb8b4772c3e407ce79883bc368":[0,1,0,2,63], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7be1a9429e5200afb286bbc3b4e4ba13":[0,1,0,2,91], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6aacd1083b5929ad28f227d20a412b4e":[0,1,0,2,85], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6f5682b33a0230cf3a068290df144831":[0,1,0,2,54], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e":[0,1,0,2,106], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a798b58891191750906359b1f097bca05":[0,1,0,2,103], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7bc87ceb8b4772c3e407ce79883bc368":[0,1,0,2,62], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7be1a9429e5200afb286bbc3b4e4ba13":[0,1,0,2,90], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7d14e3cc08441dc6b3bd64f0ca0a13ba":[0,1,0,2,14], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a80d776bb5d856148ce5162af2dbabd44":[0,1,0,2,6], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8366981bc5ecb9b4d52af74865e16bb6":[0,1,0,2,118], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8baaf5567ede31aa84237b45e9a2ec5f":[0,1,0,2,68], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8c25ecae06f5de662111c25a57501ad8":[0,1,0,2,102], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42":[0,1,0,2,110], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6":[0,1,0,2,127], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9206c89aa6ac5f56a2d462df9659ded2":[0,1,0,2,83], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8366981bc5ecb9b4d52af74865e16bb6":[0,1,0,2,116], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8baaf5567ede31aa84237b45e9a2ec5f":[0,1,0,2,67], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8c25ecae06f5de662111c25a57501ad8":[0,1,0,2,101], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42":[0,1,0,2,108], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6":[0,1,0,2,125], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9206c89aa6ac5f56a2d462df9659ded2":[0,1,0,2,82], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a92f46b65366a865118933f37c589d34e":[0,1,0,2,31], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a93aa5868249076c8b0766369cbbba993":[0,1,0,2,37], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9494db3e1dfa2a390f133a9a8b5aa8e0":[0,1,0,2,23], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a950d9144e4f19333c602cfff78810d1b":[0,1,0,2,123], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a966d675b83b69bd16b7f9058638b69c7":[0,1,0,2,58], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97acfbb75ee033066beb784570ad4a04":[0,1,0,2,125], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9a8ec34d0a51fbf43a5318f67fc5d278":[0,1,0,2,48], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9aefdb1b586dd2b8b2102af7541be392":[0,1,0,2,88], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9b49da771d85d8326615e8b023dec3b8":[0,1,0,2,69], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a950d9144e4f19333c602cfff78810d1b":[0,1,0,2,121], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a966d675b83b69bd16b7f9058638b69c7":[0,1,0,2,57], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97acfbb75ee033066beb784570ad4a04":[0,1,0,2,123], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9a8ec34d0a51fbf43a5318f67fc5d278":[0,1,0,2,47], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9aefdb1b586dd2b8b2102af7541be392":[0,1,0,2,87], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9b49da771d85d8326615e8b023dec3b8":[0,1,0,2,68], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9d1748ca9db1665902c25c32a2b458d6":[0,1,0,2,28], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9e6c3ef2133bcee9aa8dbac0ad3601d8":[0,1,0,2,9], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9fad9ac24a10e083b2c5ee7cb168eea4":[0,1,0,2,12], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aa00bfb7065e72ad3b287eb78c414bd8d":[0,1,0,2,117], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aad6c90116002d10659c14c064bfa9aaa":[0,1,0,2,74], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8":[0,1,0,2,108], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aaf42cb87b55f8b75effc9a052bb58dc1":[0,1,0,2,85], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab13ca7a0bef674739095466ff66f9843":[0,1,0,2,124], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab44b2f7085319835ec99afa02f751bd4":[0,1,0,2,116], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab530015ada1f6f6299b526a32e277a0c":[0,1,0,2,45], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aa00bfb7065e72ad3b287eb78c414bd8d":[0,1,0,2,115], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aad6c90116002d10659c14c064bfa9aaa":[0,1,0,2,73], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aaf42cb87b55f8b75effc9a052bb58dc1":[0,1,0,2,84], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab13ca7a0bef674739095466ff66f9843":[0,1,0,2,122], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab44b2f7085319835ec99afa02f751bd4":[0,1,0,2,114], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab530015ada1f6f6299b526a32e277a0c":[0,1,0,2,44], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab58b5680bc2f8e2e0fb8f693c5c1d8e4":[0,1,0,2,5], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab7016831f7a1331681cd712690d64bc7":[0,1,0,2,70], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab83b1dd02818a29abd3ad0cd4697a470":[0,1,0,2,92], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab7016831f7a1331681cd712690d64bc7":[0,1,0,2,69], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab83b1dd02818a29abd3ad0cd4697a470":[0,1,0,2,91], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab87a69ec67fe4d42df3cb0084c99dc85":[0,1,0,2,25], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abbcf6dbd38c9ded33c7b55d5fadf7e24":[0,1,0,2,32], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abd6be1c541190358a512f0021ea82b16":[0,1,0,2,27], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abe7b5a4015101375080492cc8e691d1d":[0,1,0,2,112], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac1fd31d8615b5b189349471a7ca23cee":[0,1,0,2,81], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac6eb4038a1823315b2aa509f7c05c132":[0,1,0,2,95], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac9ba65a2697010e37db0eadc024e8635":[0,1,0,2,87], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acad81499ea14286cb3f598ee56a7930e":[0,1,0,2,53], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ace8a12f90790e0699523d9fe3dae6114":[0,1,0,2,67], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acf87cda48d91ff766adba418a86946a0":[0,1,0,2,115], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abe7b5a4015101375080492cc8e691d1d":[0,1,0,2,110], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac1fd31d8615b5b189349471a7ca23cee":[0,1,0,2,80], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac6eb4038a1823315b2aa509f7c05c132":[0,1,0,2,94], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac9ba65a2697010e37db0eadc024e8635":[0,1,0,2,86], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acad81499ea14286cb3f598ee56a7930e":[0,1,0,2,52], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ace8a12f90790e0699523d9fe3dae6114":[0,1,0,2,66], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acf87cda48d91ff766adba418a86946a0":[0,1,0,2,113], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acfddae56ef5e91b7394b6f4c91748698":[0,1,0,2,3], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad1c95ccd279e2585cc6ef6c114b6bc8e":[0,1,0,2,1], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad486de410befa347f320ec5a54ffd6d7":[0,1,0,2,7], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad518c9841fbf8ff0bd686774bb0babeb":[0,1,0,2,101], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad642a4b775008c980bffe4ad2b451691":[0,1,0,2,56], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad964cdf59c0f6c54e92cd652f2ea8a02":[0,1,0,2,75], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adaab88b7b51f2a19bd8a12403766be0a":[0,1,0,2,52], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad518c9841fbf8ff0bd686774bb0babeb":[0,1,0,2,100], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad642a4b775008c980bffe4ad2b451691":[0,1,0,2,55], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad964cdf59c0f6c54e92cd652f2ea8a02":[0,1,0,2,74], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adaab88b7b51f2a19bd8a12403766be0a":[0,1,0,2,51], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8":[0,1,0,2,43], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adcb3937d2bb619a2f22c8808f77be963":[0,1,0,2,40], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5ba77a6812001d674883bb7b751dd":[0,1,0,2,97], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5ba77a6812001d674883bb7b751dd":[0,1,0,2,96], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5eae64e455cccd9932e083fc17026":[0,1,0,2,38], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae188dfb96e7d00229f619b3a82188391":[0,1,0,2,39], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae1e239d860d7e7c0bf6722b2192f4306":[0,1,0,2,103], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6":[0,1,0,2,111], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7":[0,1,0,2,44], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae1e239d860d7e7c0bf6722b2192f4306":[0,1,0,2,102], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6":[0,1,0,2,109], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeada2d6cff883f8cbd1924f1d9729250":[0,1,0,2,24], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aec6d530200c05de3dbe762b8f20f6646":[0,1,0,2,0], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af48766525e3a1c8f88471a9338ae59e7":[0,1,0,2,15], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af4c6c80adb48bffce8c0c2b4119a4002":[0,1,0,2,71], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7875f3465315841ea962205c98a39d6":[0,1,0,2,99], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7cb383070a38db2f4015b982371ca1b":[0,1,0,2,82], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb":[0,1,0,2,122], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afaaa9405b30312279aa8977c015ef1fa":[0,1,0,2,78], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af4c6c80adb48bffce8c0c2b4119a4002":[0,1,0,2,70], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7875f3465315841ea962205c98a39d6":[0,1,0,2,98], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7cb383070a38db2f4015b982371ca1b":[0,1,0,2,81], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb":[0,1,0,2,120], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afaaa9405b30312279aa8977c015ef1fa":[0,1,0,2,77], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afae0368728a114f8b4ce82148e4489dd":[0,1,0,2,35], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afdb445887173a3e006e72772cfffffbc":[0,1,0,2,11], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afeaeb2e47f164b9ffd545c3dee232ab4":[0,1,0,2,61], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afeaeb2e47f164b9ffd545c3dee232ab4":[0,1,0,2,60], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html":[0,1,0,3], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a01b7bb925a48bbca6dbdfca8e1e6afd2":[0,1,0,3,16], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a022e94245068b1c395e13272d8bc4984":[0,1,0,3,94], @@ -212,7 +210,6 @@ var NAVTREEINDEX15 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a36470f1359566ee071015a630deb89cd":[0,1,0,3,98], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a37c30fea3191a0275918448626e043c4":[0,1,0,3,61], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a380ec35a9c68ed3384489d17a385551a":[0,1,0,3,179], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff":[0,1,0,3,111], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a441ca48ae4cff29a4f715314fcb0c9":[0,1,0,3,55], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3c5c3eba48b2417a66663739a128e05a":[0,1,0,3,142], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3d57488493a7ddc5273e1bb4799f7d62":[0,1,0,3,136], @@ -229,7 +226,6 @@ var NAVTREEINDEX15 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a48dcfcf9da8eabf3e2fd787c510f1ed5":[0,1,0,3,11], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a491e418920668f8fce331c65e8b48a02":[0,1,0,3,152], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a49519f5b846f396cd1a4bf0b8775ac65":[0,1,0,3,86], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34":[0,1,0,3,76], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4bf65c93bea904102b63553f3e5dd1b3":[0,1,0,3,107], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4f2304d508e3d9645581004c676d94ca":[0,1,0,3,160], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a502fd875dc95e68f905fe2070abaeff8":[0,1,0,3,156], @@ -242,6 +238,7 @@ var NAVTREEINDEX15 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc":[0,1,0,3,10], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5c6520580009a4608d6ea4e221ef3d29":[0,1,0,3,56], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5d7d3326aaa9849977f0c203078f39e4":[0,1,0,3,117], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a60bf374a3063ccd280e46b7af0e48645":[0,1,0,3,111], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6131bec61397f01d9739e694c57afdbf":[0,1,0,3,113], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6145c59148d531ca06c5d6f218e21b02":[0,1,0,3,102], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a629e1fff799f15735376832d9ed176a2":[0,1,0,3,176], @@ -249,5 +246,8 @@ var NAVTREEINDEX15 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a64ea6b995f5bdba987b466da3d374b51":[0,1,0,3,24], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a661794563709a984308164abcdd543ee":[0,1,0,3,166], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a668abea41fecf3599122af773e93c385":[0,1,0,3,2], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a679b657463892cddf8e20d553f2ca682":[0,1,0,3,33] +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a679b657463892cddf8e20d553f2ca682":[0,1,0,3,33], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6b6f336bd93b1a3053428a92cf0fc909":[0,1,0,3,159], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6c0ac0823d48779ad3c84ee0bedf1e23":[0,1,0,3,58], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d260fcee2ad4a83b36fc26adad5934d":[0,1,0,3,65] }; diff --git a/doxygen/navtreeindex16.js b/doxygen/navtreeindex16.js index c8291a353..6c73da7c4 100644 --- a/doxygen/navtreeindex16.js +++ b/doxygen/navtreeindex16.js @@ -1,8 +1,5 @@ var NAVTREEINDEX16 = { -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6b6f336bd93b1a3053428a92cf0fc909":[0,1,0,3,159], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6c0ac0823d48779ad3c84ee0bedf1e23":[0,1,0,3,58], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d260fcee2ad4a83b36fc26adad5934d":[0,1,0,3,65], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d73d64a97cc8f024e1ee3367bfd119d":[0,1,0,3,85], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463":[0,1,0,3,42], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e25890e173635c92d41465a2ee4d3a2":[0,1,0,3,44], @@ -92,6 +89,7 @@ var NAVTREEINDEX16 = "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae63ddf806884e983a264346f21794168":[0,1,0,3,164], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeacff81944f23540968aa617d25e3d22":[0,1,0,3,40], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec3cef47cc3c1e5901b4ff401ce8e725":[0,1,0,3,123], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec5684647e34e9f3381635ab50ce4ed0":[0,1,0,3,76], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aee824eb01f6cf6f9187af509245ffc3a":[0,1,0,3,93], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeeacd28215827d6b0cd23cf59e5fc0c2":[0,1,0,3,4], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aef331b9ddcbd761f3aea6b457f83e88e":[0,1,0,3,124], @@ -155,93 +153,91 @@ var NAVTREEINDEX16 = "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#af20451367756d95c85cd561cde6fe755":[0,1,1,2,29], "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#af27eb43d5a4f76227692de56333b6c08":[0,1,1,2,19], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html":[0,1,0,5], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a000f92fb0976845c64c6eda08255e8bd":[0,1,0,5,85], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0195ec229853e6a5568228b868829942":[0,1,0,5,63], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0576184abf30e0d410bcd3abd320224a":[0,1,0,5,55], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a05f014fb5be8b7dd4b747bcc5d861ae3":[0,1,0,5,47], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a085966219db2e0b51d168738421df098":[0,1,0,5,68], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0e20117b03f0840cc7686eb849e5ea74":[0,1,0,5,43], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a111784a1f5c4ef8a2c04edb714cca60f":[0,1,0,5,67], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a13af4fa40fc5b97bfcf91d199fe6a8e2":[0,1,0,5,80], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a190061ee034a8a342f484452f2c4de4f":[0,1,0,5,60], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a1d7cd0325d3658024daba8fe2d2cb804":[0,1,0,5,48], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a2142740635a801ade67d99228fd71ce2":[0,1,0,5,88], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a24c55a8420d179cbbd7bc6968f3c12e3":[0,1,0,5,71], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a2e35d75bdda2d2d46e097fc217e4ce9d":[0,1,0,5,78], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a000f92fb0976845c64c6eda08255e8bd":[0,1,0,5,83], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0195ec229853e6a5568228b868829942":[0,1,0,5,62], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0576184abf30e0d410bcd3abd320224a":[0,1,0,5,54], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a05f014fb5be8b7dd4b747bcc5d861ae3":[0,1,0,5,46], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a085966219db2e0b51d168738421df098":[0,1,0,5,67], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0e20117b03f0840cc7686eb849e5ea74":[0,1,0,5,42], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a111784a1f5c4ef8a2c04edb714cca60f":[0,1,0,5,66], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a13af4fa40fc5b97bfcf91d199fe6a8e2":[0,1,0,5,78], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a190061ee034a8a342f484452f2c4de4f":[0,1,0,5,59], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a1d7cd0325d3658024daba8fe2d2cb804":[0,1,0,5,47], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a2142740635a801ade67d99228fd71ce2":[0,1,0,5,86], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a24c55a8420d179cbbd7bc6968f3c12e3":[0,1,0,5,70], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a2e35d75bdda2d2d46e097fc217e4ce9d":[0,1,0,5,76], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3af0b90beeeec4a0e17e84a11a76ecbc":[0,1,0,5,11], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3c5c869470655815c71464f45fc82560":[0,1,0,5,77], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3c5c869470655815c71464f45fc82560":[0,1,0,5,75], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3e4bdc70a4d2eb6169d656c1ec9c9fe1":[0,1,0,5,10], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a403636272eebe18cf3f25759c06ec00a":[0,1,0,5,87], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a480879d1374101ede3c9542951433543":[0,1,0,5,65], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a403636272eebe18cf3f25759c06ec00a":[0,1,0,5,85], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a480879d1374101ede3c9542951433543":[0,1,0,5,64], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a4ad426a930f14bc970072c5a57fb2bc9":[0,1,0,5,25], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a4fb4ca054d85c8bc2c0bd0445633710e":[0,1,0,5,7], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a50026c205b223b41ffe682526735873c":[0,1,0,5,83], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5429cb9990f7cbe91dc33522da5ad76d":[0,1,0,5,66], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5997fef556aa7bad8fa4d6bfcf7427ef":[0,1,0,5,46], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5e99f3edec8e7e1f852cac39b1b7314e":[0,1,0,5,38], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a50026c205b223b41ffe682526735873c":[0,1,0,5,81], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5429cb9990f7cbe91dc33522da5ad76d":[0,1,0,5,65], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5997fef556aa7bad8fa4d6bfcf7427ef":[0,1,0,5,45], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5e99f3edec8e7e1f852cac39b1b7314e":[0,1,0,5,37], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5eabd60e4b1c6ca3fddab4ec5838e4c7":[0,1,0,5,17], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a606e755398e68eb19f67a321a75170e3":[0,1,0,5,18], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a62669c86daa6bdd6c1e67e93461ad747":[0,1,0,5,59], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a62669c86daa6bdd6c1e67e93461ad747":[0,1,0,5,58], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a668abea41fecf3599122af773e93c385":[0,1,0,5,4], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a70bd9cedc2fcae2e924ebcc59c7f728b":[0,1,0,5,21], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a73657c5681f2d69ee6d1220a6c864097":[0,1,0,5,86], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7383bfc53e24c3bfa1dc573fd588b5ac":[0,1,0,5,37], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a75551174c0c66124b0096de40ca20cbf":[0,1,0,5,76], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76894f40f5ef1531c1b3c884f93eda42":[0,1,0,5,35], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76f144fae532604ab1a1065d9c645211":[0,1,0,5,61], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a77ac6349ba709a4ef7ecd6a4c34b9e0c":[0,1,0,5,84], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7f941bd8151d12ef887be3670dec264e":[0,1,0,5,33], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb":[0,1,0,5,30], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a86768e3cdb9274090352da827243bb06":[0,1,0,5,56], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c15974d73972df388dc1133fdfa406":[0,1,0,5,75], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a73657c5681f2d69ee6d1220a6c864097":[0,1,0,5,84], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7383bfc53e24c3bfa1dc573fd588b5ac":[0,1,0,5,36], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a75551174c0c66124b0096de40ca20cbf":[0,1,0,5,74], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76894f40f5ef1531c1b3c884f93eda42":[0,1,0,5,34], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76f144fae532604ab1a1065d9c645211":[0,1,0,5,60], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a77ac6349ba709a4ef7ecd6a4c34b9e0c":[0,1,0,5,82], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7f941bd8151d12ef887be3670dec264e":[0,1,0,5,32], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a86768e3cdb9274090352da827243bb06":[0,1,0,5,55], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c15974d73972df388dc1133fdfa406":[0,1,0,5,73], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c5a0f046f8752579636a3db97d669a":[0,1,0,5,3], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c240b7ccb8aa19ad0cfca2e57fd8496":[0,1,0,5,31], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c240b7ccb8aa19ad0cfca2e57fd8496":[0,1,0,5,30], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c348f1869653cec3dcc39b1866bab97":[0,1,0,5,23], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a910f9f22e6fbdae4eefae177eb8910f9":[0,1,0,5,24], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a94f4993226aa53f6095ad4a44fe47420":[0,1,0,5,27], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a96edb3ade58fc8c569ac0c73a54fd091":[0,1,0,5,62], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9749309d724cd1f4a47989c9d76c92c3":[0,1,0,5,51], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a":[0,1,0,5,74], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a96edb3ade58fc8c569ac0c73a54fd091":[0,1,0,5,61], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9749309d724cd1f4a47989c9d76c92c3":[0,1,0,5,50], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a":[0,1,0,5,72], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9d5e1798a346c521650a976138b761b2":[0,1,0,5,16], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9f9d3aebd2dc5bbc05e0cb7e9a707c7f":[0,1,0,5,26], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa02a628bedfd1b7cbd65b32e8f2042e5":[0,1,0,5,36], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa02a628bedfd1b7cbd65b32e8f2042e5":[0,1,0,5,35], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa08a55bc62e18a9c545e8903dd3b1530":[0,1,0,5,20], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa29d902812736665c4efb78abee0814a":[0,1,0,5,82], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa40457fee0fa38359bb1ef9487efd00e":[0,1,0,5,52], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa7665c8b7c92f51b6fbccfa74b97a706":[0,1,0,5,39], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aac802efa00966f667ff0554bc1e9af1d":[0,1,0,5,44], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aaea5e3201bfb4a18f919f8e60db23d49":[0,1,0,5,79], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa29d902812736665c4efb78abee0814a":[0,1,0,5,80], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa40457fee0fa38359bb1ef9487efd00e":[0,1,0,5,51], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa7665c8b7c92f51b6fbccfa74b97a706":[0,1,0,5,38], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aac802efa00966f667ff0554bc1e9af1d":[0,1,0,5,43], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aaea5e3201bfb4a18f919f8e60db23d49":[0,1,0,5,77], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab30a8b2e8c4fb56f8e082a9735e3f093":[0,1,0,5,9], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab501ff577dc0c959112378c70a9bb125":[0,1,0,5,50], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab501ff577dc0c959112378c70a9bb125":[0,1,0,5,49], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab58b5680bc2f8e2e0fb8f693c5c1d8e4":[0,1,0,5,5], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622":[0,1,0,5,73], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab6d3ef0a7aaee1cbdb59070b6982f6f3":[0,1,0,5,45], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab7957fa5bb80e52265387b1b4fc244d8":[0,1,0,5,40], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab6d3ef0a7aaee1cbdb59070b6982f6f3":[0,1,0,5,44], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab7957fa5bb80e52265387b1b4fc244d8":[0,1,0,5,39], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab88a7d20486baa43e3e217b6deacead7":[0,1,0,5,1], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aba63d80e4b1b15280a92ea120bc6160c":[0,1,0,5,72], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aba63d80e4b1b15280a92ea120bc6160c":[0,1,0,5,71], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f":[0,1,0,5,29], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abd73fe57cf5edd770a7e775f130fc723":[0,1,0,5,49], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ac5eaa12b912040d6564bd2d1908a44e0":[0,1,0,5,42], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acaa8d4797838b7efc6b4d6d031c2a231":[0,1,0,5,34], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acaac1c205538693499bc4a62f7d3ab17":[0,1,0,5,81], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acc60913cbeb34f75a125224f6a3a79bd":[0,1,0,5,70], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abd73fe57cf5edd770a7e775f130fc723":[0,1,0,5,48], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ac5eaa12b912040d6564bd2d1908a44e0":[0,1,0,5,41], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acaa8d4797838b7efc6b4d6d031c2a231":[0,1,0,5,33], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acaac1c205538693499bc4a62f7d3ab17":[0,1,0,5,79], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acc60913cbeb34f75a125224f6a3a79bd":[0,1,0,5,69], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ace966e9c828bcdc9053886ba274883d6":[0,1,0,5,0], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acedc1d1337a478648f220e455e89b57f":[0,1,0,5,58], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acedc1d1337a478648f220e455e89b57f":[0,1,0,5,57], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acfd3c1256b1d34de5fef97cff079cb8a":[0,1,0,5,8], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad2fd467cd42a02e358169e3ada7301d8":[0,1,0,5,12], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad4ac4cce1ce357ab264dde505128f5e5":[0,1,0,5,69], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad4ac4cce1ce357ab264dde505128f5e5":[0,1,0,5,68], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad5b66ea20129a4cf098f744a8d449893":[0,1,0,5,14], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adbf8216b0f67ec9e714bee6aa52e1e3f":[0,1,0,5,57], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adbf8216b0f67ec9e714bee6aa52e1e3f":[0,1,0,5,56], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adcef8fd2dd003856988a6e592b6421ed":[0,1,0,5,6], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adf3ecfb21886bca7be8a882e2166a919":[0,1,0,5,53], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ae03bd2171756e341a6781b83ced6c925":[0,1,0,5,41], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ae8c6eae53160557133e32fb9cef1f153":[0,1,0,5,64], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adf3ecfb21886bca7be8a882e2166a919":[0,1,0,5,52], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ae03bd2171756e341a6781b83ced6c925":[0,1,0,5,40], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ae8c6eae53160557133e32fb9cef1f153":[0,1,0,5,63], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aea611e83959c5e3f6faa50d47ee69c0f":[0,1,0,5,2], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aeb0635e7e6e488519882d930401b5c2b":[0,1,0,5,28], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af2f331ce244ac6fa94bbc94de9163fba":[0,1,0,5,54], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af2f331ce244ac6fa94bbc94de9163fba":[0,1,0,5,53], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6676bc4b255a87e484bc2641d64b713":[0,1,0,5,19], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af66d9e0ce20ea0c75375aa354f9446bc":[0,1,0,5,15], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6a5224b66dde062241120381b3cb8df":[0,1,0,5,32], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6a5224b66dde062241120381b3cb8df":[0,1,0,5,31], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#afb9bb4944afddadd2b154bf48a65cffe":[0,1,0,5,13], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#afdd6466ebac569ec670c3b6f4ca11d3e":[0,1,0,5,22], "classnmodl_1_1parser_1_1_c_driver.html":[0,10,0], @@ -249,5 +245,9 @@ var NAVTREEINDEX16 = "classnmodl_1_1parser_1_1_c_driver.html#a1517751d004ce35202eeaae7c01a51cb":[0,10,0,20], "classnmodl_1_1parser_1_1_c_driver.html#a1cf17fe1a7891f67c7569a7d879c20eb":[0,10,0,19], "classnmodl_1_1parser_1_1_c_driver.html#a2bdc2e2d481d1ba1079ddf24cdcc7d7e":[0,10,0,23], -"classnmodl_1_1parser_1_1_c_driver.html#a33144d820e9f5efd51409bed76caf254":[0,10,0,6] +"classnmodl_1_1parser_1_1_c_driver.html#a33144d820e9f5efd51409bed76caf254":[0,10,0,6], +"classnmodl_1_1parser_1_1_c_driver.html#a43b1c0e96107027c6d4a268c996dd2af":[0,10,0,5], +"classnmodl_1_1parser_1_1_c_driver.html#a4fb325c260576853d5592e4ee6ca6faa":[0,10,0,8], +"classnmodl_1_1parser_1_1_c_driver.html#a55353a75468f49f5fa4f5487c82da999":[0,10,0,15], +"classnmodl_1_1parser_1_1_c_driver.html#a626072c49d90584e32f5cf790f85ae12":[0,10,0,21] }; diff --git a/doxygen/navtreeindex17.js b/doxygen/navtreeindex17.js index 65827a0ca..0f4990c02 100644 --- a/doxygen/navtreeindex17.js +++ b/doxygen/navtreeindex17.js @@ -1,9 +1,5 @@ var NAVTREEINDEX17 = { -"classnmodl_1_1parser_1_1_c_driver.html#a43b1c0e96107027c6d4a268c996dd2af":[0,10,0,5], -"classnmodl_1_1parser_1_1_c_driver.html#a4fb325c260576853d5592e4ee6ca6faa":[0,10,0,8], -"classnmodl_1_1parser_1_1_c_driver.html#a55353a75468f49f5fa4f5487c82da999":[0,10,0,15], -"classnmodl_1_1parser_1_1_c_driver.html#a626072c49d90584e32f5cf790f85ae12":[0,10,0,21], "classnmodl_1_1parser_1_1_c_driver.html#a6f5259ce939a3731bf4ba867fe5d3de2":[0,10,0,2], "classnmodl_1_1parser_1_1_c_driver.html#a70bae5440447490b0f44cdd21496f12a":[0,10,0,22], "classnmodl_1_1parser_1_1_c_driver.html#a7507503d5fa017de39a9c47f6990bf82":[0,10,0,24], @@ -249,5 +245,9 @@ var NAVTREEINDEX17 = "classnmodl_1_1symtab_1_1_symbol.html#aadc314effdeb0f5b74388f67fbddc38e":[0,5,2,2], "classnmodl_1_1symtab_1_1_symbol.html#aae1cf387d937ccc00fd470656f312822":[0,5,2,43], "classnmodl_1_1symtab_1_1_symbol.html#ab3b80977fd6850b7ec2e78ba419c850f":[0,5,2,60], -"classnmodl_1_1symtab_1_1_symbol.html#ab5d2ca019f85e27d9bc08e307fa96810":[0,5,2,55] +"classnmodl_1_1symtab_1_1_symbol.html#ab5d2ca019f85e27d9bc08e307fa96810":[0,5,2,55], +"classnmodl_1_1symtab_1_1_symbol.html#ab72dca24278ee2acc123d2b35a07b011":[0,5,2,15], +"classnmodl_1_1symtab_1_1_symbol.html#ab913950e6bc6b0b7472ebc529416826a":[0,5,2,19], +"classnmodl_1_1symtab_1_1_symbol.html#abae1cf9b33eb265702edfe78db01ce09":[0,5,2,35], +"classnmodl_1_1symtab_1_1_symbol.html#abe8a6c9be626c83b2a50860c7ebc10cc":[0,5,2,26] }; diff --git a/doxygen/navtreeindex18.js b/doxygen/navtreeindex18.js index fbfc604d2..42685b92b 100644 --- a/doxygen/navtreeindex18.js +++ b/doxygen/navtreeindex18.js @@ -1,9 +1,5 @@ var NAVTREEINDEX18 = { -"classnmodl_1_1symtab_1_1_symbol.html#ab72dca24278ee2acc123d2b35a07b011":[0,5,2,15], -"classnmodl_1_1symtab_1_1_symbol.html#ab913950e6bc6b0b7472ebc529416826a":[0,5,2,19], -"classnmodl_1_1symtab_1_1_symbol.html#abae1cf9b33eb265702edfe78db01ce09":[0,5,2,35], -"classnmodl_1_1symtab_1_1_symbol.html#abe8a6c9be626c83b2a50860c7ebc10cc":[0,5,2,26], "classnmodl_1_1symtab_1_1_symbol.html#ac0efce1b092e9f2194305e406aa94e1e":[0,5,2,41], "classnmodl_1_1symtab_1_1_symbol.html#ac609180bd29a9f1c820fb043e8298de6":[0,5,2,17], "classnmodl_1_1symtab_1_1_symbol.html#ad2246086ed41696f4429f3e9d97537e3":[0,5,2,9], @@ -249,5 +245,9 @@ var NAVTREEINDEX18 = "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a01ecf798e094e191622f57621f6e1a69":[2,0,0,10,4,103], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a03dc71c17b0f2865431957b099eb543d":[2,0,0,10,4,113], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a057eb89006b91c84f95fdb841f52edb1":[2,0,0,10,4,48], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0a4c0f2091fd2094c35ffd771ac9607b":[2,0,0,10,4,27] +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0a4c0f2091fd2094c35ffd771ac9607b":[2,0,0,10,4,27], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0c20b73e610f790c7bd861ba35300e99":[2,0,0,10,4,77], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0c5794d7de53f9518c0f7e8f4161074a":[2,0,0,10,4,90], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0cf27f9d4bd22b1f78eaa3f28d0d08e0":[2,0,0,10,4,41], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a191f39e3215e607d85e1ab21a0f4b867":[2,0,0,10,4,75] }; diff --git a/doxygen/navtreeindex19.js b/doxygen/navtreeindex19.js index f565b38ed..d7c068b0b 100644 --- a/doxygen/navtreeindex19.js +++ b/doxygen/navtreeindex19.js @@ -1,9 +1,5 @@ var NAVTREEINDEX19 = { -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0c20b73e610f790c7bd861ba35300e99":[2,0,0,10,4,77], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0c5794d7de53f9518c0f7e8f4161074a":[2,0,0,10,4,90], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a0cf27f9d4bd22b1f78eaa3f28d0d08e0":[2,0,0,10,4,41], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a191f39e3215e607d85e1ab21a0f4b867":[2,0,0,10,4,75], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a209c02aa1a9c3a88c57e6b1165e052d8":[2,0,0,10,4,16], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a2187b2e7f7e672c9b05a4a63c16e027e":[2,0,0,10,4,93], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a21be81fc6df4a364a0d96e019759a54c":[2,0,0,10,4,78], @@ -249,5 +245,9 @@ var NAVTREEINDEX19 = "classnmodl_1_1visitor_1_1_d_u_chain.html#a12502c553fecfaa951d3ea2dad483100":[2,0,0,10,7,3], "classnmodl_1_1visitor_1_1_d_u_chain.html#a2f4b9624fedf24761f69095f058fb030":[2,0,0,10,7,4], "classnmodl_1_1visitor_1_1_d_u_chain.html#a39c9ee470abcf0906a4739f8911fa517":[2,0,0,10,7,1], -"classnmodl_1_1visitor_1_1_d_u_chain.html#a551541d6522ffa0d64fc2391f05a345e":[2,0,0,10,7,6] +"classnmodl_1_1visitor_1_1_d_u_chain.html#a551541d6522ffa0d64fc2391f05a345e":[2,0,0,10,7,6], +"classnmodl_1_1visitor_1_1_d_u_chain.html#a5d83efe0af5f73421f4ec313b53e7b75":[2,0,0,10,7,2], +"classnmodl_1_1visitor_1_1_d_u_chain.html#ae0c54ec9a73d8d9d4ff25450121b33d4":[2,0,0,10,7,5], +"classnmodl_1_1visitor_1_1_d_u_chain.html#ae806d87e0597d4e94d2300071abd8ef4":[2,0,0,10,7,0], +"classnmodl_1_1visitor_1_1_d_u_instance.html":[2,0,0,10,8] }; diff --git a/doxygen/navtreeindex20.js b/doxygen/navtreeindex20.js index 819d30348..f2fb35188 100644 --- a/doxygen/navtreeindex20.js +++ b/doxygen/navtreeindex20.js @@ -1,9 +1,5 @@ var NAVTREEINDEX20 = { -"classnmodl_1_1visitor_1_1_d_u_chain.html#a5d83efe0af5f73421f4ec313b53e7b75":[2,0,0,10,7,2], -"classnmodl_1_1visitor_1_1_d_u_chain.html#ae0c54ec9a73d8d9d4ff25450121b33d4":[2,0,0,10,7,5], -"classnmodl_1_1visitor_1_1_d_u_chain.html#ae806d87e0597d4e94d2300071abd8ef4":[2,0,0,10,7,0], -"classnmodl_1_1visitor_1_1_d_u_instance.html":[2,0,0,10,8], "classnmodl_1_1visitor_1_1_d_u_instance.html#a0801173d998866460ca44a05ca7569a3":[2,0,0,10,8,0], "classnmodl_1_1visitor_1_1_d_u_instance.html#a34b8d0b76d04cfa93a2068c39c5b5a4e":[2,0,0,10,8,5], "classnmodl_1_1visitor_1_1_d_u_instance.html#a3d6774d8c7ab13f8eec0a0203d8d4119":[2,0,0,10,8,2], @@ -249,5 +245,9 @@ var NAVTREEINDEX20 = "classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a49ce6f4d0d54db9e8ae4c51b09750c35":[0,8,0,8,35], "classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a551c497d949835b6fccc59280c8eab42":[0,8,0,8,32], "classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a5afc449d9288ce63ae1c1643332e6616":[0,8,0,8,27], -"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a66933b21c147692c814bde07ef91974c":[0,8,0,8,25] +"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a66933b21c147692c814bde07ef91974c":[0,8,0,8,25], +"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a67f4831ccfd4dadd5ac5df220dcdcdbc":[0,8,0,8,8], +"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a682c5b6f2f3b4bd1b8393a9ba53b999a":[0,8,0,8,16], +"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a714c67b9ecc422beb71240f9fc43879c":[0,8,0,8,19], +"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a72550d8a5a75013331226a988041e95d":[0,8,0,8,21] }; diff --git a/doxygen/navtreeindex21.js b/doxygen/navtreeindex21.js index 9debe7203..fd7a9dd02 100644 --- a/doxygen/navtreeindex21.js +++ b/doxygen/navtreeindex21.js @@ -1,9 +1,5 @@ var NAVTREEINDEX21 = { -"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a67f4831ccfd4dadd5ac5df220dcdcdbc":[0,8,0,8,8], -"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a682c5b6f2f3b4bd1b8393a9ba53b999a":[0,8,0,8,16], -"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a714c67b9ecc422beb71240f9fc43879c":[0,8,0,8,19], -"classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a72550d8a5a75013331226a988041e95d":[0,8,0,8,21], "classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a8e438e633134150468e511df6af4d7e1":[0,8,0,8,18], "classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a93f67d6d1ee228862066c7bd5797930d":[0,8,0,8,42], "classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#a99e2c16a428c7c5afbafa1b9ebb0ae12":[0,8,0,8,10], @@ -249,5 +245,9 @@ var NAVTREEINDEX21 = "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a2edb2bb292fa63dac723d2d04d6d9262":[0,8,0,29,81], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a2ff8e777f789f72fbf69561c488f24dd":[0,8,0,29,21], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a30fe84b5cb97372efaa6207a2525c08d":[0,8,0,29,19], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a3864eecee521ea04de1046cef0d9a882":[0,8,0,29,1] +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a3864eecee521ea04de1046cef0d9a882":[0,8,0,29,1], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a39006dd767c9741e985a7fbd38788d30":[0,8,0,29,61], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a3b7c11deeb6e55d6834302091b9c8931":[0,8,0,29,85], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a3bafa4cc62fd3d59b671dd16a50e88cd":[0,8,0,29,99], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a424ad9a8f467fb633ce6a7484c61b6c7":[0,8,0,29,83] }; diff --git a/doxygen/navtreeindex22.js b/doxygen/navtreeindex22.js index 478c694f6..bc131fb9b 100644 --- a/doxygen/navtreeindex22.js +++ b/doxygen/navtreeindex22.js @@ -1,9 +1,5 @@ var NAVTREEINDEX22 = { -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a39006dd767c9741e985a7fbd38788d30":[0,8,0,29,61], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a3b7c11deeb6e55d6834302091b9c8931":[0,8,0,29,85], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a3bafa4cc62fd3d59b671dd16a50e88cd":[0,8,0,29,99], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a424ad9a8f467fb633ce6a7484c61b6c7":[0,8,0,29,83], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a4299ad2404c0be0ab0b4bec5d0a85961":[0,8,0,29,109], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a4327a5b3199d8b34b659777869a9e643":[0,8,0,29,20], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#a43b0e8a306f5bf44bcb066a6cbc987e5":[0,8,0,29,62], @@ -249,5 +245,9 @@ var NAVTREEINDEX22 = "classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#a940f00cf653680c1b2b7c4579b13c58f":[0,8,0,19,16], "classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#a9fa5e0545dc669559fcf1bbf6cee2a1e":[0,8,0,19,15], "classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#aa81170d1c99ba453577834168fdda92c":[0,8,0,19,3], -"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ab770833a4e466abe92dfe7b52f7ed4c3":[0,8,0,19,4] +"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ab770833a4e466abe92dfe7b52f7ed4c3":[0,8,0,19,4], +"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#abc957c52a1bf35110a7fffe8c5ae3ce4":[0,8,0,19,5], +"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ace4ca561f213e3c79ad43460e6c62f8a":[0,8,0,19,14], +"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ad6365771edeb1531c3da0d505378b76e":[0,8,0,19,12], +"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ad754daf2114abe5ea398320aeb9af943":[0,8,0,19,10] }; diff --git a/doxygen/navtreeindex23.js b/doxygen/navtreeindex23.js index 409333bdf..95d836d5d 100644 --- a/doxygen/navtreeindex23.js +++ b/doxygen/navtreeindex23.js @@ -1,9 +1,5 @@ var NAVTREEINDEX23 = { -"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#abc957c52a1bf35110a7fffe8c5ae3ce4":[0,8,0,19,5], -"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ace4ca561f213e3c79ad43460e6c62f8a":[0,8,0,19,14], -"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ad6365771edeb1531c3da0d505378b76e":[0,8,0,19,12], -"classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ad754daf2114abe5ea398320aeb9af943":[0,8,0,19,10], "classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#add7bdc7f6712c3205e28e0441a4cb465":[0,8,0,19,6], "classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ae1455d57d783f8a0e24bfb07951f2e46":[0,8,0,19,7], "classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#ae9e350f46a4215c0ee784d1e8e74d302":[0,8,0,19,9], @@ -249,5 +245,9 @@ var NAVTREEINDEX23 = "classnmodl_1_1visitor_1_1_visitor.html#a8bc5f981054f98230f241558be590e42":[0,8,0,31,24], "classnmodl_1_1visitor_1_1_visitor.html#a8c2770b4cedfc3489c2ca8762a0f229d":[0,8,0,31,2], "classnmodl_1_1visitor_1_1_visitor.html#a8e939e59938e1afd5c68d2cd2907c2f3":[0,8,0,31,98], -"classnmodl_1_1visitor_1_1_visitor.html#a8fe41cd709db609433f80880c01d3ed5":[0,8,0,31,87] +"classnmodl_1_1visitor_1_1_visitor.html#a8fe41cd709db609433f80880c01d3ed5":[0,8,0,31,87], +"classnmodl_1_1visitor_1_1_visitor.html#a929b4adae6aacc9fa39b3148b653c1a4":[0,8,0,31,95], +"classnmodl_1_1visitor_1_1_visitor.html#a949625fd83e34ea098b3767611f612ab":[0,8,0,31,3], +"classnmodl_1_1visitor_1_1_visitor.html#a97998555fbf9a6f1c322ea4f1c66268f":[0,8,0,31,62], +"classnmodl_1_1visitor_1_1_visitor.html#a9901bcf3072e77d5e5da43e95fa79476":[0,8,0,31,23] }; diff --git a/doxygen/navtreeindex24.js b/doxygen/navtreeindex24.js index e055eec2f..a28b8b7ab 100644 --- a/doxygen/navtreeindex24.js +++ b/doxygen/navtreeindex24.js @@ -1,9 +1,5 @@ var NAVTREEINDEX24 = { -"classnmodl_1_1visitor_1_1_visitor.html#a929b4adae6aacc9fa39b3148b653c1a4":[0,8,0,31,95], -"classnmodl_1_1visitor_1_1_visitor.html#a949625fd83e34ea098b3767611f612ab":[0,8,0,31,3], -"classnmodl_1_1visitor_1_1_visitor.html#a97998555fbf9a6f1c322ea4f1c66268f":[0,8,0,31,62], -"classnmodl_1_1visitor_1_1_visitor.html#a9901bcf3072e77d5e5da43e95fa79476":[0,8,0,31,23], "classnmodl_1_1visitor_1_1_visitor.html#a9a4b4a21e8c55bcbb4cb6f28bde77d99":[0,8,0,31,85], "classnmodl_1_1visitor_1_1_visitor.html#a9a6b7c18311015cdfbdba87b34f938cf":[0,8,0,31,99], "classnmodl_1_1visitor_1_1_visitor.html#a9b33819e39503ea08f023107d3419210":[0,8,0,31,76], @@ -249,5 +245,9 @@ var NAVTREEINDEX24 = "codegen__naming_8hpp.html#a150003bc181804be6c732f81f172a155":[3,0,1,1,12,2], "codegen__naming_8hpp.html#a17075cdc0d5eb824684e8a23b586715c":[3,0,1,1,12,48], "codegen__naming_8hpp.html#a19fc3dd0e36be8186ea6e0a4bd6c6660":[3,0,1,1,12,25], -"codegen__naming_8hpp.html#a1c3df50f11ecd03de051f01febaaed44":[3,0,1,1,12,21] +"codegen__naming_8hpp.html#a1c3df50f11ecd03de051f01febaaed44":[3,0,1,1,12,21], +"codegen__naming_8hpp.html#a1cbc7704c95e06b613efd121525893bd":[3,0,1,1,12,16], +"codegen__naming_8hpp.html#a1db378304b1b4c6ce0e1410895c179dd":[3,0,1,1,12,28], +"codegen__naming_8hpp.html#a1eba843c1c643b075a5d050a3b51e04b":[3,0,1,1,12,46], +"codegen__naming_8hpp.html#a294490e33ced4d6fa7f71dc8cff71927":[3,0,1,1,12,6] }; diff --git a/doxygen/navtreeindex25.js b/doxygen/navtreeindex25.js index d6099076b..8db73c02d 100644 --- a/doxygen/navtreeindex25.js +++ b/doxygen/navtreeindex25.js @@ -1,9 +1,5 @@ var NAVTREEINDEX25 = { -"codegen__naming_8hpp.html#a1cbc7704c95e06b613efd121525893bd":[3,0,1,1,12,16], -"codegen__naming_8hpp.html#a1db378304b1b4c6ce0e1410895c179dd":[3,0,1,1,12,28], -"codegen__naming_8hpp.html#a1eba843c1c643b075a5d050a3b51e04b":[3,0,1,1,12,46], -"codegen__naming_8hpp.html#a294490e33ced4d6fa7f71dc8cff71927":[3,0,1,1,12,6], "codegen__naming_8hpp.html#a2f9bd8ba3a4cd02ac98d5c34d53a9e10":[3,0,1,1,12,5], "codegen__naming_8hpp.html#a30bcd393b84cd89c6251460be772be41":[3,0,1,1,12,47], "codegen__naming_8hpp.html#a343317dffc3ceb9e924174d642ca07fe":[3,0,1,1,12,33], @@ -249,5 +245,9 @@ var NAVTREEINDEX25 = "extern__var_8hpp.html":[3,0,0,0,0,0,42], "extern__var_8hpp_source.html":[3,0,0,0,0,0,42], "external_8hpp.html":[3,0,0,0,0,0,43], -"external_8hpp_source.html":[3,0,0,0,0,0,43] +"external_8hpp_source.html":[3,0,0,0,0,0,43], +"factor__def_8hpp.html":[3,0,0,0,0,0,44], +"factor__def_8hpp_source.html":[3,0,0,0,0,0,44], +"file__library_8cpp.html":[3,0,1,10,4], +"file__library_8cpp_source.html":[3,0,1,10,4] }; diff --git a/doxygen/navtreeindex26.js b/doxygen/navtreeindex26.js index 62dac1a14..82cbd9c76 100644 --- a/doxygen/navtreeindex26.js +++ b/doxygen/navtreeindex26.js @@ -1,9 +1,5 @@ var NAVTREEINDEX26 = { -"factor__def_8hpp.html":[3,0,0,0,0,0,44], -"factor__def_8hpp_source.html":[3,0,0,0,0,0,44], -"file__library_8cpp.html":[3,0,1,10,4], -"file__library_8cpp_source.html":[3,0,1,10,4], "file__library_8hpp.html":[3,0,1,10,5], "file__library_8hpp_source.html":[3,0,1,10,5], "files.html":[3,0], @@ -31,8 +27,8 @@ var NAVTREEINDEX26 = "functions_e.html":[2,3,0,4], "functions_enum.html":[2,3,4], "functions_f.html":[2,3,0,5], -"functions_func.html":[2,3,1], "functions_func.html":[2,3,1,0], +"functions_func.html":[2,3,1], "functions_func_b.html":[2,3,1,1], "functions_func_c.html":[2,3,1,2], "functions_func_d.html":[2,3,1,3], @@ -108,8 +104,8 @@ var NAVTREEINDEX26 = "global__var__visitor_8cpp_source.html":[3,0,1,11,8], "global__var__visitor_8hpp.html":[3,0,1,11,9], "global__var__visitor_8hpp_source.html":[3,0,1,11,9], -"globals.html":[3,1,0], "globals.html":[3,1,0,0], +"globals.html":[3,1,0], "globals_b.html":[3,1,0,1], "globals_c.html":[3,1,0,2], "globals_d.html":[3,1,0,3], @@ -174,10 +170,10 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga1a3804b66c6c3c0e23fe0b08c9ce229e":[0,0,1,254], "group__ast__class.html#ga1a627463ee876f902fb2baa0775ec966":[0,0,1,154], "group__ast__class.html#ga1a627463ee876f902fb2baa0775ec966":[0,0,1,4,32], -"group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,4,35], "group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,157], -"group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,235], +"group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,4,35], "group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,4,113], +"group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,235], "group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,4,118], "group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,240], "group__ast__class.html#ga259f83364b843c691a85687f247244e7":[0,0,1,4,64], @@ -188,8 +184,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga2a8ed6832a20d3b6e5b400b6cb772ca8":[0,0,1,231], "group__ast__class.html#ga2a96d8e7cc4dd454135b86ffd4c456e7":[0,0,1,4,122], "group__ast__class.html#ga2a96d8e7cc4dd454135b86ffd4c456e7":[0,0,1,244], -"group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,4,95], "group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,217], +"group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,4,95], "group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,175], "group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,4,53], "group__ast__class.html#ga2eec2446794afeca55a7dbc822fd99ba":[0,0,1,4,69], @@ -202,8 +198,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga3b6381327cb9e25b740e855660a7ff3a":[0,0,1,4,43], "group__ast__class.html#ga3e1362838ed4cc6d1ab04e6a9fc86bf2":[0,0,1,4,108], "group__ast__class.html#ga3e1362838ed4cc6d1ab04e6a9fc86bf2":[0,0,1,230], -"group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,4,71], "group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,193], +"group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,4,71], "group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,141], "group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,4,19], "group__ast__class.html#ga4892777c5b32b112d588b05d07f28549":[0,0,1,4,14], @@ -216,24 +212,24 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga4efd89b3e621b205a36fb120b62b954b":[0,0,1,245], "group__ast__class.html#ga507524f2adabb5ace4f6943b0708448e":[0,0,1,4,84], "group__ast__class.html#ga507524f2adabb5ace4f6943b0708448e":[0,0,1,206], -"group__ast__class.html#ga5315152cdb0f8c1dcc759cdb1baef2e0":[0,0,1,4,131], "group__ast__class.html#ga5315152cdb0f8c1dcc759cdb1baef2e0":[0,0,1,253], +"group__ast__class.html#ga5315152cdb0f8c1dcc759cdb1baef2e0":[0,0,1,4,131], "group__ast__class.html#ga53d7bf2c18bac0edb78e1123e947988e":[0,0,1,222], "group__ast__class.html#ga53d7bf2c18bac0edb78e1123e947988e":[0,0,1,4,100], "group__ast__class.html#ga55e9704837cf41c797642b1f7c102dfc":[0,0,1,4,0], "group__ast__class.html#ga55e9704837cf41c797642b1f7c102dfc":[0,0,1,125], "group__ast__class.html#ga571f5c2475e8e6fbfd898f82e710960a":[0,0,1,4,39], "group__ast__class.html#ga571f5c2475e8e6fbfd898f82e710960a":[0,0,1,161], -"group__ast__class.html#ga5b2f7b1f3e25a7d8f70d21368f7c4bcc":[0,0,1,129], "group__ast__class.html#ga5b2f7b1f3e25a7d8f70d21368f7c4bcc":[0,0,1,4,7], +"group__ast__class.html#ga5b2f7b1f3e25a7d8f70d21368f7c4bcc":[0,0,1,129], "group__ast__class.html#ga5bbb1d563621926d689f8480d243d909":[0,0,1,4,4], "group__ast__class.html#ga5bbb1d563621926d689f8480d243d909":[0,0,1,126], "group__ast__class.html#ga5eed5c6969860fdf373a7b23dcf0653b":[0,0,1,190], "group__ast__class.html#ga5eed5c6969860fdf373a7b23dcf0653b":[0,0,1,4,68], "group__ast__class.html#ga6105e91f1ce07693b9df1e0162d8f5a4":[0,0,1,4,134], "group__ast__class.html#ga6105e91f1ce07693b9df1e0162d8f5a4":[0,0,1,256], -"group__ast__class.html#ga630659747411ec7b03685256c92dab8f":[0,0,1,226], "group__ast__class.html#ga630659747411ec7b03685256c92dab8f":[0,0,1,4,104], +"group__ast__class.html#ga630659747411ec7b03685256c92dab8f":[0,0,1,226], "group__ast__class.html#ga63717e8a77ff61eb334fd3389a3c354b":[0,0,1,229], "group__ast__class.html#ga63717e8a77ff61eb334fd3389a3c354b":[0,0,1,4,107], "group__ast__class.html#ga656b6af0e85f80cdaa43212b01108b42":[0,0,1,4,13], @@ -249,5 +245,9 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga6ca54bc2ec0698aa5a485be7c653781d":[0,0,1,4,141], "group__ast__class.html#ga6ca54bc2ec0698aa5a485be7c653781d":[0,0,1,263], "group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,4,46], -"group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,168] +"group__ast__class.html#ga6d8c02bfb7a35cf3ac7858e61f24bf00":[0,0,1,168], +"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,241], +"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,4,119], +"group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,220], +"group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,4,98] }; diff --git a/doxygen/navtreeindex27.js b/doxygen/navtreeindex27.js index 8927f0f48..1db5aa9e0 100644 --- a/doxygen/navtreeindex27.js +++ b/doxygen/navtreeindex27.js @@ -1,9 +1,5 @@ var NAVTREEINDEX27 = { -"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,241], -"group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,4,119], -"group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,220], -"group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,4,98], "group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,4,3], "group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,124], "group__ast__class.html#ga7bb648c89549d0a1440c348da8db48cd":[0,0,1,4,78], @@ -14,10 +10,10 @@ var NAVTREEINDEX27 = "group__ast__class.html#ga8805d1aa088c3daac32ec6f4313cf060":[0,0,1,4,117], "group__ast__class.html#ga894e17b916a5edfde8e6b624e9085ae1":[0,0,1,4,85], "group__ast__class.html#ga894e17b916a5edfde8e6b624e9085ae1":[0,0,1,207], -"group__ast__class.html#ga89dc3a73bef71b1d9dd6f379e4ca7801":[0,0,1,221], "group__ast__class.html#ga89dc3a73bef71b1d9dd6f379e4ca7801":[0,0,1,4,99], -"group__ast__class.html#ga8a32b8ca9796d4c6ff51fd651c1e410a":[0,0,1,237], +"group__ast__class.html#ga89dc3a73bef71b1d9dd6f379e4ca7801":[0,0,1,221], "group__ast__class.html#ga8a32b8ca9796d4c6ff51fd651c1e410a":[0,0,1,4,115], +"group__ast__class.html#ga8a32b8ca9796d4c6ff51fd651c1e410a":[0,0,1,237], "group__ast__class.html#ga8ae7b3772077532d180c376c149ca59b":[0,0,1,4,137], "group__ast__class.html#ga8ae7b3772077532d180c376c149ca59b":[0,0,1,259], "group__ast__class.html#ga8b7765bb1b32cac9e1d3cef796b747ac":[0,0,1,4,138], @@ -36,8 +32,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#ga948ddb22b25c884d62ab0df93dfe431a":[0,0,1,232], "group__ast__class.html#ga958228cd1a203da6fea17efac8165a59":[0,0,1,4,45], "group__ast__class.html#ga958228cd1a203da6fea17efac8165a59":[0,0,1,167], -"group__ast__class.html#ga9a9684461a0f1ce3adb845a0715b1b9e":[0,0,1,130], "group__ast__class.html#ga9a9684461a0f1ce3adb845a0715b1b9e":[0,0,1,4,8], +"group__ast__class.html#ga9a9684461a0f1ce3adb845a0715b1b9e":[0,0,1,130], "group__ast__class.html#ga9af56bff5b44e1074a94e9c357e255bf":[0,0,1,4,33], "group__ast__class.html#ga9af56bff5b44e1074a94e9c357e255bf":[0,0,1,155], "group__ast__class.html#gaa55f3ea9308348d5140290e34c4b06dd":[0,0,1,4,87], @@ -46,8 +42,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#gaa680ed2587655b4f6b771db6584b22cc":[0,0,1,4,74], "group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,188], "group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,4,66], -"group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,218], "group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,4,96], +"group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,218], "group__ast__class.html#gaa892d22eb06997da03dc7a433f14ba1e":[0,0,1,4,125], "group__ast__class.html#gaa892d22eb06997da03dc7a433f14ba1e":[0,0,1,247], "group__ast__class.html#gaa8f35f9c21bc016b4029f66b07052a19":[0,0,1,4,16], @@ -68,36 +64,36 @@ var NAVTREEINDEX27 = "group__ast__class.html#gab0ca0546b6c94aa502549453ff611811":[0,0,1,4,73], "group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,4,88], "group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,210], -"group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,187], "group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,4,65], +"group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,187], "group__ast__class.html#gab35a10b4c8f5ca2515f0bb122853e447":[0,0,1,4,38], "group__ast__class.html#gab35a10b4c8f5ca2515f0bb122853e447":[0,0,1,160], "group__ast__class.html#gab48e965f9bfc5beef90fec6c0d59b6ec":[0,0,1,4,89], "group__ast__class.html#gab48e965f9bfc5beef90fec6c0d59b6ec":[0,0,1,211], "group__ast__class.html#gab97c8fbc73008d36927a0377335bc0ba":[0,0,1,4,127], "group__ast__class.html#gab97c8fbc73008d36927a0377335bc0ba":[0,0,1,249], -"group__ast__class.html#gaba93060c77072b4da627b13e7ab5fbd8":[0,0,1,156], "group__ast__class.html#gaba93060c77072b4da627b13e7ab5fbd8":[0,0,1,4,34], +"group__ast__class.html#gaba93060c77072b4da627b13e7ab5fbd8":[0,0,1,156], "group__ast__class.html#gabcce17a4b7c2abd423cf2319dc492f24":[0,0,1,4,126], "group__ast__class.html#gabcce17a4b7c2abd423cf2319dc492f24":[0,0,1,248], "group__ast__class.html#gabdc81c1d11f50f067df4cf0d7746f110":[0,0,1,4,29], "group__ast__class.html#gabdc81c1d11f50f067df4cf0d7746f110":[0,0,1,151], -"group__ast__class.html#gabe0d8be79f0e0c0967da29d186c86c3c":[0,0,1,4,6], "group__ast__class.html#gabe0d8be79f0e0c0967da29d186c86c3c":[0,0,1,128], +"group__ast__class.html#gabe0d8be79f0e0c0967da29d186c86c3c":[0,0,1,4,6], "group__ast__class.html#gabf2f9f79aaa6163faccf95beec66c585":[0,0,1,4,86], "group__ast__class.html#gabf2f9f79aaa6163faccf95beec66c585":[0,0,1,208], "group__ast__class.html#gac02dd08abb8b9d2e817a1ae09297602b":[0,0,1,4,144], "group__ast__class.html#gac02dd08abb8b9d2e817a1ae09297602b":[0,0,1,267], -"group__ast__class.html#gac116c33a0a2c52eeb7b3f7121ee282fb":[0,0,1,4,27], "group__ast__class.html#gac116c33a0a2c52eeb7b3f7121ee282fb":[0,0,1,149], +"group__ast__class.html#gac116c33a0a2c52eeb7b3f7121ee282fb":[0,0,1,4,27], "group__ast__class.html#gac38a02afaac3a75f0c66f0d351bf9c04":[0,0,1,172], "group__ast__class.html#gac38a02afaac3a75f0c66f0d351bf9c04":[0,0,1,4,50], "group__ast__class.html#gac58c77a74f980986b6588a285c12d408":[0,0,1,185], "group__ast__class.html#gac58c77a74f980986b6588a285c12d408":[0,0,1,4,63], -"group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,4,111], "group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,233], -"group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,4,2], +"group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,4,111], "group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,123], +"group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,4,2], "group__ast__class.html#gac774fd9ccb62cfdba927225ef59a4de3":[0,0,1,225], "group__ast__class.html#gac774fd9ccb62cfdba927225ef59a4de3":[0,0,1,4,103], "group__ast__class.html#gac81ffb4a2c7ca8ce7527f2b8c3b9d403":[0,0,1,4,143], @@ -122,8 +118,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#gad1f90104022d3c27fc1111d3d75a7057":[0,0,1,189], "group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,4,30], "group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,152], -"group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,194], "group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,4,72], +"group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,194], "group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,4,17], "group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,139], "group__ast__class.html#gad9186bccf4349f4dc1b42448422151a5":[0,0,1,266], @@ -134,16 +130,16 @@ var NAVTREEINDEX27 = "group__ast__class.html#gad920ec3fd8147522e85d67bfacb8ebdd":[0,0,1,159], "group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,262], "group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,4,140], -"group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,4,94], "group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,216], +"group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,4,94], "group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,181], "group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,4,59], "group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,223], "group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,4,101], -"group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,4,81], "group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,203], -"group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,199], +"group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,4,81], "group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,4,77], +"group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,199], "group__ast__class.html#gae1ca73bd18179c2c3a1c3a2751043437":[0,0,1,4,130], "group__ast__class.html#gae1ca73bd18179c2c3a1c3a2751043437":[0,0,1,252], "group__ast__class.html#gae2d80677a97c3b1ac8690d73c74be890":[0,0,1,4,57], @@ -168,8 +164,8 @@ var NAVTREEINDEX27 = "group__ast__class.html#gaf59c475a99ee7363dc08790004763366":[0,0,1,178], "group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,144], "group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,4,22], -"group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,4,18], "group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,140], +"group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,4,18], "group__ast__class.html#gafedb2d6f0c7f3ea73c34947fed8a2d6b":[0,0,1,147], "group__ast__class.html#gafedb2d6f0c7f3ea73c34947fed8a2d6b":[0,0,1,4,25], "group__ast__prop.html":[0,0,0], @@ -249,5 +245,9 @@ var NAVTREEINDEX27 = "group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a4fb7ea683a98639d84f8d9b07c33a3a5":[0,0,2,0,121], "group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5134faf37f3fe1bb05273b5e517834dd":[0,0,2,0,85], "group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a517df820ec4c846300b1dea014500d0f":[0,0,2,0,117], -"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a527342100cc944bc5df6f18ad3a62a4a":[0,0,2,0,74] +"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a527342100cc944bc5df6f18ad3a62a4a":[0,0,2,0,74], +"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5335d3381381fc5e5c8a2ef39d82cc53":[0,0,2,0,77], +"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a575df32540d8128f5dc2968de4cceece":[0,0,2,0,86], +"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a59248ca9097a50a8f24de2a0c0d5354f":[0,0,2,0,39], +"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a595ffcc42d69b9b31afdd63557ee5d1e":[0,0,2,0,60] }; diff --git a/doxygen/navtreeindex28.js b/doxygen/navtreeindex28.js index 95f310431..26943787b 100644 --- a/doxygen/navtreeindex28.js +++ b/doxygen/navtreeindex28.js @@ -1,9 +1,5 @@ var NAVTREEINDEX28 = { -"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5335d3381381fc5e5c8a2ef39d82cc53":[0,0,2,0,77], -"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a575df32540d8128f5dc2968de4cceece":[0,0,2,0,86], -"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a59248ca9097a50a8f24de2a0c0d5354f":[0,0,2,0,39], -"group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a595ffcc42d69b9b31afdd63557ee5d1e":[0,0,2,0,60], "group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5d5cd46919fa987731fb2edefe0f2a0c":[0,0,2,0,7], "group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a5da0be2deed1a70402c02d66954e27f0":[0,0,2,0,24], "group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a63b588d5559f64f89a416e656880b949":[0,0,2,0,6], @@ -207,8 +203,8 @@ var NAVTREEINDEX28 = "group__ast__vec__type.html#gafcd60e4a0a5c7f255fe5fcb69597fb35":[0,0,3,103], "group__codegen.html":[0,1], "group__codegen__backends.html":[0,1,0], -"group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,8], "group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,3,118], +"group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,8], "group__codegen__backends.html#ga9dc150643b36d2a9087f4ab7c94325c7":[0,1,0,6], "group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160":[0,1,0,7], "group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160":[0,1,0,3,78], @@ -249,5 +245,9 @@ var NAVTREEINDEX28 = "group__lexer.html":[0,9], "group__parser.html":[0,10], "group__printer.html":[0,3], -"group__solver.html":[0,4] +"group__solver.html":[0,4], +"group__solver.html#ga0b8788299c392976f3159910e0af2e9c":[0,4,8], +"group__solver.html#ga2a36c7e8409472bead4d159274842d41":[0,4,7], +"group__solver.html#ga45a40394b3d577b79cde4e94e79cbcc0":[0,4,9], +"group__solver.html#ga4cefb4b50d39f5e46a64fb71ec1cae5a":[0,4,4] }; diff --git a/doxygen/navtreeindex29.js b/doxygen/navtreeindex29.js index d15591f73..73d0e86ee 100644 --- a/doxygen/navtreeindex29.js +++ b/doxygen/navtreeindex29.js @@ -1,9 +1,5 @@ var NAVTREEINDEX29 = { -"group__solver.html#ga0b8788299c392976f3159910e0af2e9c":[0,4,8], -"group__solver.html#ga2a36c7e8409472bead4d159274842d41":[0,4,7], -"group__solver.html#ga45a40394b3d577b79cde4e94e79cbcc0":[0,4,9], -"group__solver.html#ga4cefb4b50d39f5e46a64fb71ec1cae5a":[0,4,4], "group__solver.html#ga553e5133f871206a1ad6ab4fc10bde45":[0,4,5], "group__solver.html#ga71c2b3d219b9f05ab3faea6ed1e71fef":[0,4,0], "group__solver.html#ga73227f2ab37d3b7c9036f3fe7532da73":[0,4,3], @@ -15,25 +11,25 @@ var NAVTREEINDEX29 = "group__token.html":[0,2], "group__token__modtoken.html":[0,2,0], "group__token__test.html":[0,2,1], -"group__token__test.html#ga0da85adf566fc93b8d173fa4117ccb74":[3,0,2,0,3,0,3], "group__token__test.html#ga0da85adf566fc93b8d173fa4117ccb74":[0,2,1,3], +"group__token__test.html#ga0da85adf566fc93b8d173fa4117ccb74":[3,0,2,0,3,0,3], "group__token__test.html#ga46008ea4532600b05a677394c6600055":[0,2,1,2], "group__token__test.html#ga46008ea4532600b05a677394c6600055":[3,0,2,0,3,0,2], -"group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[0,2,1,1], "group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[3,0,2,0,3,0,1], -"group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[0,2,1,0], +"group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[0,2,1,1], "group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[3,0,2,0,3,0,0], +"group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[0,2,1,0], "group__units.html":[0,6], -"group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,8], "group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,1,4], +"group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,8], "group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,0,0], "group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,13], -"group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,1,7], "group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,15], +"group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,1,7], "group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,1,9], "group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,19], -"group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,1,10], "group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,20], +"group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,1,10], "group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,21], "group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,1,11], "group__units.html#ga4014c46fced93378dee7846b57211f6e":[0,6,18], @@ -48,15 +44,15 @@ var NAVTREEINDEX29 = "group__units.html#gaaae2d7f1693c0e7abc23003e753d65ec":[0,6,1,0], "group__units.html#gaac93a10252a81387387be4571bbed890":[0,6,1,2], "group__units.html#gaac93a10252a81387387be4571bbed890":[0,6,5], -"group__units.html#gabab997408892d209edc2e6207bcf6b3a":[0,6,14], "group__units.html#gabab997408892d209edc2e6207bcf6b3a":[0,6,0,1], +"group__units.html#gabab997408892d209edc2e6207bcf6b3a":[0,6,14], "group__units.html#gac26c7781e0924f73bac6a856f2c80217":[0,6,17], "group__units.html#gacf73317c537bff91a6631c0c4f4cded0":[0,6,16], "group__units.html#gacf73317c537bff91a6631c0c4f4cded0":[0,6,0,3], -"group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,1,1], "group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,12], -"group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,1,3], +"group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,1,1], "group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,7], +"group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,1,3], "group__utils.html":[0,7], "group__utils.html#ga08a8b444018d46999224618bb102b3e5":[0,7,9], "group__utils.html#ga09e2cad122ecf35cb2d5fbfc4b1daa2e":[0,7,10], @@ -249,5 +245,9 @@ var NAVTREEINDEX29 = "loop__unroll__visitor_8cpp.html":[3,0,1,11,26], "loop__unroll__visitor_8cpp.html#a29d224493529dd668adf0ccc5cc51ba8":[3,0,1,11,26,0], "loop__unroll__visitor_8cpp.html#a2b5db33bfc3c6c9d41c199ad73c3cea7":[3,0,1,11,26,1], -"loop__unroll__visitor_8cpp_source.html":[3,0,1,11,26] +"loop__unroll__visitor_8cpp_source.html":[3,0,1,11,26], +"loop__unroll__visitor_8hpp.html":[3,0,1,11,27], +"loop__unroll__visitor_8hpp_source.html":[3,0,1,11,27], +"misc_8cpp.html":[3,0,2,0,10,14], +"misc_8cpp.html#a0d8d557550ae7d835e6588c637b17a71":[3,0,2,0,10,14,2] }; diff --git a/doxygen/navtreeindex30.js b/doxygen/navtreeindex30.js index 1736175f3..a60700f82 100644 --- a/doxygen/navtreeindex30.js +++ b/doxygen/navtreeindex30.js @@ -1,9 +1,5 @@ var NAVTREEINDEX30 = { -"loop__unroll__visitor_8hpp.html":[3,0,1,11,27], -"loop__unroll__visitor_8hpp_source.html":[3,0,1,11,27], -"misc_8cpp.html":[3,0,2,0,10,14], -"misc_8cpp.html#a0d8d557550ae7d835e6588c637b17a71":[3,0,2,0,10,14,2], "misc_8cpp.html#a9f62deb1d160e64c58f491dc2b5469d6":[3,0,2,0,10,14,0], "misc_8cpp.html#aeb51055daca566cf8f103017335e80a1":[3,0,2,0,10,14,1], "misc_8cpp_source.html":[3,0,2,0,10,14], @@ -24,8 +20,8 @@ var NAVTREEINDEX30 = "mutex__unlock_8hpp_source.html":[3,0,0,0,0,0,71], "name_8hpp.html":[3,0,0,0,0,0,72], "name_8hpp_source.html":[3,0,0,0,0,0,72], -"namespacemembers.html":[1,1,0,0], "namespacemembers.html":[1,1,0], +"namespacemembers.html":[1,1,0,0], "namespacemembers_b.html":[1,1,0,1], "namespacemembers_c.html":[1,1,0,2], "namespacemembers_d.html":[1,1,0,3], @@ -54,10 +50,10 @@ var NAVTREEINDEX30 = "namespacemembers_w.html":[1,1,0,21], "namespacenmodl.html":[2,0,0], "namespacenmodl.html":[1,0,0], -"namespacenmodl_1_1ast.html":[1,0,0,0], "namespacenmodl_1_1ast.html":[2,0,0,0], -"namespacenmodl_1_1codegen.html":[1,0,0,1], +"namespacenmodl_1_1ast.html":[1,0,0,0], "namespacenmodl_1_1codegen.html":[2,0,0,1], +"namespacenmodl_1_1codegen.html":[1,0,0,1], "namespacenmodl_1_1codegen_1_1naming.html":[1,0,0,1,0], "namespacenmodl_1_1codegen_1_1utils.html":[1,0,0,1,1], "namespacenmodl_1_1crout.html":[1,0,0,2], @@ -69,24 +65,24 @@ var NAVTREEINDEX30 = "namespacenmodl_1_1parser.html":[2,0,0,3], "namespacenmodl_1_1parser_1_1diffeq.html":[2,0,0,3,0], "namespacenmodl_1_1parser_1_1diffeq.html":[1,0,0,6,0], -"namespacenmodl_1_1printer.html":[1,0,0,7], "namespacenmodl_1_1printer.html":[2,0,0,4], -"namespacenmodl_1_1pybind__wrappers.html":[1,0,0,8], +"namespacenmodl_1_1printer.html":[1,0,0,7], "namespacenmodl_1_1pybind__wrappers.html":[2,0,0,5], +"namespacenmodl_1_1pybind__wrappers.html":[1,0,0,8], "namespacenmodl_1_1stringutils.html":[1,0,0,9], "namespacenmodl_1_1symtab.html":[1,0,0,10], "namespacenmodl_1_1symtab.html":[2,0,0,6], "namespacenmodl_1_1symtab_1_1syminfo.html":[1,0,0,10,0], -"namespacenmodl_1_1test__utils.html":[2,0,0,7], "namespacenmodl_1_1test__utils.html":[1,0,0,11], -"namespacenmodl_1_1units.html":[2,0,0,8], +"namespacenmodl_1_1test__utils.html":[2,0,0,7], "namespacenmodl_1_1units.html":[1,0,0,12], -"namespacenmodl_1_1utils.html":[2,0,0,9], +"namespacenmodl_1_1units.html":[2,0,0,8], "namespacenmodl_1_1utils.html":[1,0,0,13], -"namespacenmodl_1_1visitor.html":[2,0,0,10], +"namespacenmodl_1_1utils.html":[2,0,0,9], "namespacenmodl_1_1visitor.html":[1,0,0,14], -"namespacenmodl_1_1visitor_1_1test.html":[1,0,0,14,0], +"namespacenmodl_1_1visitor.html":[2,0,0,10], "namespacenmodl_1_1visitor_1_1test.html":[2,0,0,10,0], +"namespacenmodl_1_1visitor_1_1test.html":[1,0,0,14,0], "namespaces.html":[1,0], "net__receive__block_8hpp.html":[3,0,0,0,0,0,73], "net__receive__block_8hpp_source.html":[3,0,0,0,0,0,73], @@ -249,5 +245,9 @@ var NAVTREEINDEX30 = "protect__statement_8hpp.html":[3,0,0,0,0,0,92], "protect__statement_8hpp_source.html":[3,0,0,0,0,0,92], "pyembed_8cpp.html":[3,0,1,6,1], -"pyembed_8cpp.html#a0f11fc9041193f4515afa19f33ab5df2":[3,0,1,6,1,2] +"pyembed_8cpp.html#a0f11fc9041193f4515afa19f33ab5df2":[3,0,1,6,1,2], +"pyembed_8cpp.html#a6df1d22fb5f09eccc23b9f399670cfd7":[3,0,1,6,1,0], +"pyembed_8cpp.html#a9063e80f8777300c93afde6e6f4c9cea":[3,0,1,6,1,1], +"pyembed_8cpp.html#a9677aab117939d005ba08f5658e996c3":[3,0,1,6,1,3], +"pyembed_8cpp_source.html":[3,0,1,6,1] }; diff --git a/doxygen/navtreeindex31.js b/doxygen/navtreeindex31.js index d58a71381..c6edab799 100644 --- a/doxygen/navtreeindex31.js +++ b/doxygen/navtreeindex31.js @@ -1,9 +1,5 @@ var NAVTREEINDEX31 = { -"pyembed_8cpp.html#a6df1d22fb5f09eccc23b9f399670cfd7":[3,0,1,6,1,0], -"pyembed_8cpp.html#a9063e80f8777300c93afde6e6f4c9cea":[3,0,1,6,1,1], -"pyembed_8cpp.html#a9677aab117939d005ba08f5658e996c3":[3,0,1,6,1,3], -"pyembed_8cpp_source.html":[3,0,1,6,1], "pyembed_8hpp.html":[3,0,1,6,2], "pyembed_8hpp_source.html":[3,0,1,6,2], "pynmodl_8cpp.html":[3,0,1,6,3], @@ -249,5 +245,9 @@ var NAVTREEINDEX31 = "structnmodl_1_1codegen_1_1_codegen_info.html#ad694e28bba6c82dd6fd2dcc652f10846":[0,1,1,6,56], "structnmodl_1_1codegen_1_1_codegen_info.html#ad7f2152ae0d0997d34a6335cddea5db1":[0,1,1,6,26], "structnmodl_1_1codegen_1_1_codegen_info.html#ae039255d27fcf43610151bb90a2fb25c":[0,1,1,6,2], -"structnmodl_1_1codegen_1_1_codegen_info.html#ae05c57438cf033efef981b2de6c34ed8":[0,1,1,6,37] +"structnmodl_1_1codegen_1_1_codegen_info.html#ae05c57438cf033efef981b2de6c34ed8":[0,1,1,6,37], +"structnmodl_1_1codegen_1_1_codegen_info.html#ae0ae57c15bffa577993551d4345276e3":[0,1,1,6,23], +"structnmodl_1_1codegen_1_1_codegen_info.html#ae6f18ddfee31d5a335b0421f24428a60":[0,1,1,6,9], +"structnmodl_1_1codegen_1_1_codegen_info.html#af49fe1ab8d7c35c937585ce7ac7992df":[0,1,1,6,70], +"structnmodl_1_1codegen_1_1_codegen_info.html#af61629cf3b042744e0ae3655e807e52a":[0,1,1,6,87] }; diff --git a/doxygen/navtreeindex32.js b/doxygen/navtreeindex32.js index 01a3bac66..2b560e90c 100644 --- a/doxygen/navtreeindex32.js +++ b/doxygen/navtreeindex32.js @@ -1,9 +1,5 @@ var NAVTREEINDEX32 = { -"structnmodl_1_1codegen_1_1_codegen_info.html#ae0ae57c15bffa577993551d4345276e3":[0,1,1,6,23], -"structnmodl_1_1codegen_1_1_codegen_info.html#ae6f18ddfee31d5a335b0421f24428a60":[0,1,1,6,9], -"structnmodl_1_1codegen_1_1_codegen_info.html#af49fe1ab8d7c35c937585ce7ac7992df":[0,1,1,6,70], -"structnmodl_1_1codegen_1_1_codegen_info.html#af61629cf3b042744e0ae3655e807e52a":[0,1,1,6,87], "structnmodl_1_1codegen_1_1_codegen_info.html#afbc429aec58b9dbf16f0db7fc2d1869a":[0,1,1,6,71], "structnmodl_1_1codegen_1_1_codegen_info.html#afbd7bbb54c12a07fce90d62325799810":[0,1,1,6,43], "structnmodl_1_1codegen_1_1_codegen_info.html#afda3a06d247507a8e4a90d9e14486320":[0,1,1,6,82], @@ -249,5 +245,9 @@ var NAVTREEINDEX32 = "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbaa6ecefaab5c08acc8f2f69a8d98afe9e":[3,0,1,8,4,3,3], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbaaa553f510cc3f449cdb246f8b31b0c16":[3,0,1,8,4,3,31], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbaaa68b373a676197603d94276c0970dd6":[3,0,1,8,4,3,18], -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbab42b3dbb719197d22c748fc74ac64ba4":[3,0,1,8,4,3,5] +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbab42b3dbb719197d22c748fc74ac64ba4":[3,0,1,8,4,3,5], +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac4ba8c72426a2ce5d391710cb72d933a":[3,0,1,8,4,3,26], +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac89e419cdec37c6436386d0ccee1096a":[3,0,1,8,4,3,4], +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac8de66f1a4787fe20ffdde46def4be3a":[3,0,1,8,4,3,23], +"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb1e09d4f29a44bf586491796c2373e5":[3,0,1,8,4,3,9] }; diff --git a/doxygen/navtreeindex33.js b/doxygen/navtreeindex33.js index 45270817e..ab8ff036f 100644 --- a/doxygen/navtreeindex33.js +++ b/doxygen/navtreeindex33.js @@ -1,9 +1,5 @@ var NAVTREEINDEX33 = { -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac4ba8c72426a2ce5d391710cb72d933a":[3,0,1,8,4,3,26], -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac89e419cdec37c6436386d0ccee1096a":[3,0,1,8,4,3,4], -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbac8de66f1a4787fe20ffdde46def4be3a":[3,0,1,8,4,3,23], -"symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb1e09d4f29a44bf586491796c2373e5":[3,0,1,8,4,3,9], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbacb2f7556254f071fb944800a31272b6b":[3,0,1,8,4,3,17], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbad1aabe136ab0db3618d96fc8bd0465b9":[3,0,1,8,4,3,7], "symbol__properties_8hpp.html#ad9b6b8559b36d0a500ef5110badcc4dbae5ca58838df33f0052301461a6c39606":[3,0,1,8,4,3,2], @@ -249,5 +245,9 @@ var NAVTREEINDEX33 = "verbatim_8hpp_source.html":[3,0,0,0,0,0,120], "verbatim__driver_8hpp.html":[3,0,1,4,14], "verbatim__driver_8hpp.html#a46229e87df41b4db138f47eeac6c3bfb":[3,0,1,4,14,0], -"verbatim__driver_8hpp_source.html":[3,0,1,4,14] +"verbatim__driver_8hpp_source.html":[3,0,1,4,14], +"verbatim__var__rename__visitor_8cpp.html":[3,0,1,11,53], +"verbatim__var__rename__visitor_8cpp_source.html":[3,0,1,11,53], +"verbatim__var__rename__visitor_8hpp.html":[3,0,1,11,54], +"verbatim__var__rename__visitor_8hpp_source.html":[3,0,1,11,54] }; diff --git a/doxygen/navtreeindex34.js b/doxygen/navtreeindex34.js index c58c66f8f..5bcf019ee 100644 --- a/doxygen/navtreeindex34.js +++ b/doxygen/navtreeindex34.js @@ -1,9 +1,5 @@ var NAVTREEINDEX34 = { -"verbatim__var__rename__visitor_8cpp.html":[3,0,1,11,53], -"verbatim__var__rename__visitor_8cpp_source.html":[3,0,1,11,53], -"verbatim__var__rename__visitor_8hpp.html":[3,0,1,11,54], -"verbatim__var__rename__visitor_8hpp_source.html":[3,0,1,11,54], "verbatim__visitor_8cpp.html":[3,0,1,11,55], "verbatim__visitor_8cpp_source.html":[3,0,1,11,55], "verbatim__visitor_8hpp.html":[3,0,1,11,56], diff --git a/doxygen/search/all_14.js b/doxygen/search/all_14.js index ecd8f2823..8e8460831 100644 --- a/doxygen/search/all_14.js +++ b/doxygen/search/all_14.js @@ -1,10 +1,10 @@ var searchData= [ ['v_2401',['v',['../struct_class_info.html#ad96673848ab1ba13aabf89ecf1abd6db',1,'ClassInfo']]], - ['valence_2402',['Valence',['../classnmodl_1_1ast_1_1_valence.html',1,'nmodl::ast::Valence'],['../structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533',1,'nmodl::codegen::Ion::valence()'],['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion::valence()'],['../classnmodl_1_1ast_1_1_valence.html#acbd1671653f567543a9e225643a0cc89',1,'nmodl::ast::Valence::Valence(Name *type, Double *value)'],['../classnmodl_1_1ast_1_1_valence.html#afb67d26bb621d2788662c5d0d4044181',1,'nmodl::ast::Valence::Valence(std::shared_ptr< Name > type, std::shared_ptr< Double > value)'],['../classnmodl_1_1ast_1_1_valence.html#af9c9657b95a55238325b4b9cce302099',1,'nmodl::ast::Valence::Valence(const Valence &obj)'],['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ad4c282fc67c65a77faf3d6bf6128a069',1,'nmodl::ast::VALENCE()']]], + ['valence_2402',['Valence',['../classnmodl_1_1ast_1_1_valence.html',1,'nmodl::ast::Valence'],['../classnmodl_1_1ast_1_1_valence.html#acbd1671653f567543a9e225643a0cc89',1,'nmodl::ast::Valence::Valence(Name *type, Double *value)'],['../classnmodl_1_1ast_1_1_valence.html#afb67d26bb621d2788662c5d0d4044181',1,'nmodl::ast::Valence::Valence(std::shared_ptr< Name > type, std::shared_ptr< Double > value)'],['../classnmodl_1_1ast_1_1_valence.html#af9c9657b95a55238325b4b9cce302099',1,'nmodl::ast::Valence::Valence(const Valence &obj)'],['../structnmodl_1_1codegen_1_1_ion.html#ab464eca5bf873be2df1ea2aaea2f0533',1,'nmodl::codegen::Ion::valence()'],['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion::valence()'],['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ad4c282fc67c65a77faf3d6bf6128a069',1,'nmodl::ast::VALENCE()']]], ['valence_2ehpp_2403',['valence.hpp',['../valence_8hpp.html',1,'']]], ['valencevector_2404',['ValenceVector',['../group__ast__vec__type.html#ga94c1f13db006ede6849398172ec460fa',1,'nmodl::ast']]], - ['value_2405',['value',['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()'],['../classnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor.html#a1e49fcb9c416a45a1607f335948228c1aecc2e9c313faddb07e7da223c1dc5c3f',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::VALUE()']]], + ['value_2405',['VALUE',['../classnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor.html#a1e49fcb9c416a45a1607f335948228c1aecc2e9c313faddb07e7da223c1dc5c3f',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::VALUE()'],['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()']]], ['values_2406',['values',['../structnmodl_1_1utils_1_1_perf_stat.html#a73b03ee433317593a5a8112f58aa0163',1,'nmodl::utils::PerfStat']]], ['var2dependants_2407',['var2dependants',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a64b0e5e760e0c33abe7fa555d77e9da0',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], ['var2statement_2408',['var2statement',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a5349e9d8a2ef3e8bbbd22a23a55eea36',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], diff --git a/doxygen/search/all_f.js b/doxygen/search/all_f.js index 62f034da8..c6f88b2e4 100644 --- a/doxygen/search/all_f.js +++ b/doxygen/search/all_f.js @@ -94,7 +94,7 @@ var searchData= ['print_5ffast_5fimem_5fcalculation_1688',['print_fast_imem_calculation',['../classnmodl_1_1codegen_1_1_codegen_acc_visitor.html#af58d26884131b0cc711887c549bc7957',1,'nmodl::codegen::CodegenAccVisitor::print_fast_imem_calculation()'],['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_fast_imem_calculation()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34492b32e18b9fbfd3ba01ba8ad85eb5',1,'nmodl::codegen::CodegenCppVisitor::print_fast_imem_calculation()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_fast_imem_calculation()']]], ['print_5ffirst_5fpointer_5fvar_5findex_5fgetter_1689',['print_first_pointer_var_index_getter',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], ['print_5ffirst_5frandom_5fvar_5findex_5fgetter_1690',['print_first_random_var_index_getter',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['print_5ffunction_1691',['print_function',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_function()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34',1,'nmodl::codegen::CodegenCppVisitor::print_function()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_function()']]], + ['print_5ffunction_1691',['print_function',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec5684647e34e9f3381635ab50ce4ed0',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5ffunction_5fcall_1692',['print_function_call',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad63b4318b5abd6b8c224fab70fe61081',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5ffunction_5fdeclaration_1693',['print_function_declaration',['../group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5ffunction_5for_5fprocedure_1694',['print_function_or_procedure',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab530015ada1f6f6299b526a32e277a0c',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_function_or_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9ec8d64ef0941d98af29b31060155c0b',1,'nmodl::codegen::CodegenCppVisitor::print_function_or_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c240b7ccb8aa19ad0cfca2e57fd8496',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_function_or_procedure()']]], @@ -182,7 +182,7 @@ var searchData= ['print_5fnum_5fvariable_5fgetter_1776',['print_num_variable_getter',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], ['print_5fpoint_5fprocess_5ffunction_5fdefinitions_1777',['print_point_process_function_definitions',['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aba63d80e4b1b15280a92ea120bc6160c',1,'nmodl::codegen::CodegenNeuronCppVisitor']]], ['print_5fprcellstate_5fmacros_1778',['print_prcellstate_macros',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a522261006f1cc94869ef15cd26b739da',1,'nmodl::codegen::CodegenCppVisitor']]], - ['print_5fprocedure_1779',['print_procedure',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff',1,'nmodl::codegen::CodegenCppVisitor::print_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_procedure()']]], + ['print_5fprocedure_1779',['print_procedure',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a60bf374a3063ccd280e46b7af0e48645',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5frhs_5fd_5fshadow_5fvariables_1780',['print_rhs_d_shadow_variables',['../classnmodl_1_1codegen_1_1_codegen_acc_visitor.html#ab2b1180f70d5559ced0633638dd14b5a',1,'nmodl::codegen::CodegenAccVisitor::print_rhs_d_shadow_variables()'],['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_rhs_d_shadow_variables()']]], ['print_5fsdlists_5finit_1781',['print_sdlists_init',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_sdlists_init()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34ae139e68f31b69fa73c9a84c2197e8',1,'nmodl::codegen::CodegenCppVisitor::print_sdlists_init()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_sdlists_init()']]], ['print_5fsend_5fevent_5fmove_1782',['print_send_event_move',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], diff --git a/doxygen/search/functions_f.js b/doxygen/search/functions_f.js index 05fa8ba2a..41bf41f1e 100644 --- a/doxygen/search/functions_f.js +++ b/doxygen/search/functions_f.js @@ -50,7 +50,7 @@ var searchData= ['print_5ffast_5fimem_5fcalculation_4121',['print_fast_imem_calculation',['../classnmodl_1_1codegen_1_1_codegen_acc_visitor.html#af58d26884131b0cc711887c549bc7957',1,'nmodl::codegen::CodegenAccVisitor::print_fast_imem_calculation()'],['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_fast_imem_calculation()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34492b32e18b9fbfd3ba01ba8ad85eb5',1,'nmodl::codegen::CodegenCppVisitor::print_fast_imem_calculation()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_fast_imem_calculation()']]], ['print_5ffirst_5fpointer_5fvar_5findex_5fgetter_4122',['print_first_pointer_var_index_getter',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], ['print_5ffirst_5frandom_5fvar_5findex_5fgetter_4123',['print_first_random_var_index_getter',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['print_5ffunction_4124',['print_function',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_function()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34',1,'nmodl::codegen::CodegenCppVisitor::print_function()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_function()']]], + ['print_5ffunction_4124',['print_function',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec5684647e34e9f3381635ab50ce4ed0',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5ffunction_5fcall_4125',['print_function_call',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad63b4318b5abd6b8c224fab70fe61081',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5ffunction_5fdeclaration_4126',['print_function_declaration',['../group__codegen__backends.html#gabf8cfdf6adba4da78b0d92b81d9ff160',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5ffunction_5for_5fprocedure_4127',['print_function_or_procedure',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab530015ada1f6f6299b526a32e277a0c',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_function_or_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9ec8d64ef0941d98af29b31060155c0b',1,'nmodl::codegen::CodegenCppVisitor::print_function_or_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c240b7ccb8aa19ad0cfca2e57fd8496',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_function_or_procedure()']]], @@ -138,7 +138,7 @@ var searchData= ['print_5fnum_5fvariable_5fgetter_4209',['print_num_variable_getter',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], ['print_5fpoint_5fprocess_5ffunction_5fdefinitions_4210',['print_point_process_function_definitions',['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aba63d80e4b1b15280a92ea120bc6160c',1,'nmodl::codegen::CodegenNeuronCppVisitor']]], ['print_5fprcellstate_5fmacros_4211',['print_prcellstate_macros',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a522261006f1cc94869ef15cd26b739da',1,'nmodl::codegen::CodegenCppVisitor']]], - ['print_5fprocedure_4212',['print_procedure',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff',1,'nmodl::codegen::CodegenCppVisitor::print_procedure()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_procedure()']]], + ['print_5fprocedure_4212',['print_procedure',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a60bf374a3063ccd280e46b7af0e48645',1,'nmodl::codegen::CodegenCppVisitor']]], ['print_5frhs_5fd_5fshadow_5fvariables_4213',['print_rhs_d_shadow_variables',['../classnmodl_1_1codegen_1_1_codegen_acc_visitor.html#ab2b1180f70d5559ced0633638dd14b5a',1,'nmodl::codegen::CodegenAccVisitor::print_rhs_d_shadow_variables()'],['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_rhs_d_shadow_variables()']]], ['print_5fsdlists_5finit_4214',['print_sdlists_init',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::print_sdlists_init()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34ae139e68f31b69fa73c9a84c2197e8',1,'nmodl::codegen::CodegenCppVisitor::print_sdlists_init()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a',1,'nmodl::codegen::CodegenNeuronCppVisitor::print_sdlists_init()']]], ['print_5fsend_5fevent_5fmove_4215',['print_send_event_move',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], diff --git a/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html b/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html index a2effb1a2..3b4e5c387 100644 --- a/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html +++ b/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html @@ -540,2764 +540,2737 @@
                      444 }
                      445 
                      446 
                      - -
                      448  print_function_procedure_helper(node);
                      -
                      449 }
                      -
                      450 
                      -
                      451 
                      - -
                      453  auto name = node.get_node_name();
                      -
                      454 
                      -
                      455  // name of return variable
                      -
                      456  std::string return_var;
                      -
                      457  if (info.function_uses_table(name)) {
                      -
                      458  return_var = "ret_f_" + name;
                      -
                      459  } else {
                      -
                      460  return_var = "ret_" + name;
                      -
                      461  }
                      -
                      462 
                      -
                      463  // first rename return variable name
                      -
                      464  auto block = node.get_statement_block().get();
                      -
                      465  RenameVisitor v(name, return_var);
                      -
                      466  block->accept(v);
                      -
                      467 
                      -
                      468  print_function_procedure_helper(node);
                      -
                      469 }
                      -
                      470 
                      -
                      471 
                      - -
                      473  auto name = node.get_node_name();
                      -
                      474  const auto& p = node.get_parameters();
                      -
                      475  auto params = internal_method_parameters();
                      -
                      476  for (const auto& i: p) {
                      -
                      477  params.emplace_back("", "double", "", i->get_node_name());
                      -
                      478  }
                      -
                      479  printer->fmt_line("double {}({})", method_name(name), get_parameter_str(params));
                      -
                      480  printer->push_block();
                      -
                      481  printer->fmt_line("double _arg[{}];", p.size());
                      -
                      482  for (size_t i = 0; i < p.size(); ++i) {
                      -
                      483  printer->fmt_line("_arg[{}] = {};", i, p[i]->get_node_name());
                      -
                      484  }
                      -
                      485  printer->fmt_line("return hoc_func_table({}, {}, _arg);",
                      -
                      486  get_variable_name(std::string("_ptable_" + name), true),
                      -
                      487  p.size());
                      -
                      488  printer->pop_block();
                      -
                      489 
                      -
                      490  printer->fmt_push_block("double table_{}()", method_name(name));
                      -
                      491  printer->fmt_line("hoc_spec_table(&{}, {});",
                      -
                      492  get_variable_name(std::string("_ptable_" + name)),
                      -
                      493  p.size());
                      -
                      494  printer->add_line("return 0.;");
                      -
                      495  printer->pop_block();
                      -
                      496 }
                      -
                      497 
                      -
                      498 
                      -
                      499 /****************************************************************************************/
                      -
                      500 /* Code-specific helper routines */
                      -
                      501 /****************************************************************************************/
                      + +
                      448  auto name = node.get_node_name();
                      +
                      449  const auto& p = node.get_parameters();
                      +
                      450  auto params = internal_method_parameters();
                      +
                      451  for (const auto& i: p) {
                      +
                      452  params.emplace_back("", "double", "", i->get_node_name());
                      +
                      453  }
                      +
                      454  printer->fmt_line("double {}({})", method_name(name), get_parameter_str(params));
                      +
                      455  printer->push_block();
                      +
                      456  printer->fmt_line("double _arg[{}];", p.size());
                      +
                      457  for (size_t i = 0; i < p.size(); ++i) {
                      +
                      458  printer->fmt_line("_arg[{}] = {};", i, p[i]->get_node_name());
                      +
                      459  }
                      +
                      460  printer->fmt_line("return hoc_func_table({}, {}, _arg);",
                      +
                      461  get_variable_name(std::string("_ptable_" + name), true),
                      +
                      462  p.size());
                      +
                      463  printer->pop_block();
                      +
                      464 
                      +
                      465  printer->fmt_push_block("double table_{}()", method_name(name));
                      +
                      466  printer->fmt_line("hoc_spec_table(&{}, {});",
                      +
                      467  get_variable_name(std::string("_ptable_" + name)),
                      +
                      468  p.size());
                      +
                      469  printer->add_line("return 0.;");
                      +
                      470  printer->pop_block();
                      +
                      471 }
                      +
                      472 
                      +
                      473 
                      +
                      474 /****************************************************************************************/
                      +
                      475 /* Code-specific helper routines */
                      +
                      476 /****************************************************************************************/
                      +
                      477 
                      +
                      478 void CodegenCoreneuronCppVisitor::add_variable_tqitem(std::vector<IndexVariableInfo>& variables) {
                      +
                      479  // for non-artificial cell, when net_receive buffering is enabled
                      +
                      480  // then tqitem is an offset
                      +
                      481  if (info.net_send_used) {
                      +
                      482  if (info.artificial_cell) {
                      +
                      483  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), true);
                      +
                      484  } else {
                      +
                      485  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
                      +
                      486  variables.back().is_constant = true;
                      +
                      487  }
                      +
                      488  info.tqitem_index = static_cast<int>(variables.size() - 1);
                      +
                      489  }
                      +
                      490 }
                      +
                      491 
                      + +
                      493  std::vector<IndexVariableInfo>& variables) {
                      +
                      494  /// note that this variable is not printed in neuron implementation
                      +
                      495  if (info.artificial_cell) {
                      +
                      496  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), true);
                      +
                      497  } else {
                      +
                      498  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
                      +
                      499  variables.back().is_constant = true;
                      +
                      500  }
                      +
                      501 }
                      502 
                      -
                      503 void CodegenCoreneuronCppVisitor::add_variable_tqitem(std::vector<IndexVariableInfo>& variables) {
                      -
                      504  // for non-artificial cell, when net_receive buffering is enabled
                      -
                      505  // then tqitem is an offset
                      -
                      506  if (info.net_send_used) {
                      -
                      507  if (info.artificial_cell) {
                      -
                      508  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), true);
                      -
                      509  } else {
                      -
                      510  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
                      -
                      511  variables.back().is_constant = true;
                      -
                      512  }
                      -
                      513  info.tqitem_index = static_cast<int>(variables.size() - 1);
                      -
                      514  }
                      -
                      515 }
                      -
                      516 
                      - -
                      518  std::vector<IndexVariableInfo>& variables) {
                      -
                      519  /// note that this variable is not printed in neuron implementation
                      -
                      520  if (info.artificial_cell) {
                      -
                      521  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), true);
                      -
                      522  } else {
                      -
                      523  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
                      -
                      524  variables.back().is_constant = true;
                      -
                      525  }
                      -
                      526 }
                      + +
                      504  return get_arg_str(internal_method_parameters());
                      +
                      505 }
                      +
                      506 
                      +
                      507 
                      +
                      508 /**
                      +
                      509  * @todo: figure out how to correctly handle qualifiers
                      +
                      510  */
                      + +
                      512  ParamVector params = {{"", "int", "", "id"},
                      +
                      513  {"", "int", "", "pnodecount"},
                      +
                      514  {"", fmt::format("{}*", instance_struct()), "", "inst"}};
                      +
                      515  if (ion_variable_struct_required()) {
                      +
                      516  params.emplace_back("", "IonCurVar&", "", "ionvar");
                      +
                      517  }
                      +
                      518  ParamVector other_params = {{"", "double*", "", "data"},
                      +
                      519  {"const ", "Datum*", "", "indexes"},
                      +
                      520  {"", "ThreadDatum*", "", "thread"},
                      +
                      521  {"", "NrnThread*", "", "nt"},
                      +
                      522  {"", "double", "", "v"}};
                      +
                      523  params.insert(params.end(), other_params.begin(), other_params.end());
                      +
                      524  return params;
                      +
                      525 }
                      +
                      526 
                      527 
                      - -
                      529  return get_arg_str(internal_method_parameters());
                      + +
                      529  return get_arg_str(external_method_parameters());
                      530 }
                      531 
                      -
                      532 
                      -
                      533 /**
                      -
                      534  * @todo: figure out how to correctly handle qualifiers
                      -
                      535  */
                      - -
                      537  ParamVector params = {{"", "int", "", "id"},
                      -
                      538  {"", "int", "", "pnodecount"},
                      -
                      539  {"", fmt::format("{}*", instance_struct()), "", "inst"}};
                      -
                      540  if (ion_variable_struct_required()) {
                      -
                      541  params.emplace_back("", "IonCurVar&", "", "ionvar");
                      -
                      542  }
                      -
                      543  ParamVector other_params = {{"", "double*", "", "data"},
                      -
                      544  {"const ", "Datum*", "", "indexes"},
                      -
                      545  {"", "ThreadDatum*", "", "thread"},
                      -
                      546  {"", "NrnThread*", "", "nt"},
                      -
                      547  {"", "double", "", "v"}};
                      -
                      548  params.insert(params.end(), other_params.begin(), other_params.end());
                      -
                      549  return params;
                      -
                      550 }
                      -
                      551 
                      -
                      552 
                      - -
                      554  return get_arg_str(external_method_parameters());
                      -
                      555 }
                      -
                      556 
                      +
                      532 
                      + +
                      534  bool table) noexcept {
                      +
                      535  ParamVector args = {{"", "int", "", "id"},
                      +
                      536  {"", "int", "", "pnodecount"},
                      +
                      537  {"", "double*", "", "data"},
                      +
                      538  {"", "Datum*", "", "indexes"},
                      +
                      539  {"", "ThreadDatum*", "", "thread"},
                      +
                      540  {"", "NrnThread*", "", "nt"},
                      +
                      541  {"", "Memb_list*", "", "ml"}};
                      +
                      542  if (table) {
                      +
                      543  args.emplace_back("", "int", "", "tml_id");
                      +
                      544  } else {
                      +
                      545  args.emplace_back("", "double", "", "v");
                      +
                      546  }
                      +
                      547  return args;
                      +
                      548 }
                      +
                      549 
                      +
                      550 
                      + +
                      552  if (ion_variable_struct_required()) {
                      +
                      553  return "id, pnodecount, ionvar, data, indexes, thread, nt, ml, v";
                      +
                      554  }
                      +
                      555  return "id, pnodecount, data, indexes, thread, nt, ml, v";
                      +
                      556 }
                      557 
                      - -
                      559  bool table) noexcept {
                      -
                      560  ParamVector args = {{"", "int", "", "id"},
                      -
                      561  {"", "int", "", "pnodecount"},
                      -
                      562  {"", "double*", "", "data"},
                      -
                      563  {"", "Datum*", "", "indexes"},
                      -
                      564  {"", "ThreadDatum*", "", "thread"},
                      -
                      565  {"", "NrnThread*", "", "nt"},
                      -
                      566  {"", "Memb_list*", "", "ml"}};
                      -
                      567  if (table) {
                      -
                      568  args.emplace_back("", "int", "", "tml_id");
                      -
                      569  } else {
                      -
                      570  args.emplace_back("", "double", "", "v");
                      -
                      571  }
                      -
                      572  return args;
                      -
                      573 }
                      -
                      574 
                      -
                      575 
                      - -
                      577  if (ion_variable_struct_required()) {
                      -
                      578  return "id, pnodecount, ionvar, data, indexes, thread, nt, ml, v";
                      -
                      579  }
                      -
                      580  return "id, pnodecount, data, indexes, thread, nt, ml, v";
                      -
                      581 }
                      -
                      582 
                      -
                      583 
                      -
                      584 /**
                      -
                      585  * Function call arguments when function or procedure is defined in the
                      -
                      586  * same mod file itself
                      -
                      587  */
                      - -
                      589  return get_arg_str(internal_method_parameters());
                      -
                      590 }
                      -
                      591 
                      -
                      592 
                      -
                      593 /**
                      -
                      594  * Replace commonly used variables in the verbatim blocks into their corresponding
                      -
                      595  * variable name in the new code generation backend.
                      -
                      596  */
                      - - -
                      599  name = naming::VERBATIM_VARIABLES_MAPPING.at(name);
                      -
                      600  }
                      -
                      601 
                      -
                      602  /**
                      -
                      603  * if function is defined the same mod file then the arguments must
                      -
                      604  * contain mechanism instance as well.
                      -
                      605  */
                      -
                      606  if (name == naming::THREAD_ARGS) {
                      -
                      607  if (internal_method_call_encountered) {
                      -
                      608  name = nrn_thread_internal_arguments();
                      -
                      609  internal_method_call_encountered = false;
                      -
                      610  } else {
                      -
                      611  name = nrn_thread_arguments();
                      -
                      612  }
                      -
                      613  }
                      -
                      614  if (name == naming::THREAD_ARGS_PROTO) {
                      -
                      615  name = get_parameter_str(external_method_parameters());
                      -
                      616  }
                      -
                      617  return name;
                      -
                      618 }
                      +
                      558 
                      +
                      559 /**
                      +
                      560  * Function call arguments when function or procedure is defined in the
                      +
                      561  * same mod file itself
                      +
                      562  */
                      + +
                      564  return get_arg_str(internal_method_parameters());
                      +
                      565 }
                      +
                      566 
                      +
                      567 
                      +
                      568 /**
                      +
                      569  * Replace commonly used variables in the verbatim blocks into their corresponding
                      +
                      570  * variable name in the new code generation backend.
                      +
                      571  */
                      + + +
                      574  name = naming::VERBATIM_VARIABLES_MAPPING.at(name);
                      +
                      575  }
                      +
                      576 
                      +
                      577  /**
                      +
                      578  * if function is defined the same mod file then the arguments must
                      +
                      579  * contain mechanism instance as well.
                      +
                      580  */
                      +
                      581  if (name == naming::THREAD_ARGS) {
                      +
                      582  if (internal_method_call_encountered) {
                      +
                      583  name = nrn_thread_internal_arguments();
                      +
                      584  internal_method_call_encountered = false;
                      +
                      585  } else {
                      +
                      586  name = nrn_thread_arguments();
                      +
                      587  }
                      +
                      588  }
                      +
                      589  if (name == naming::THREAD_ARGS_PROTO) {
                      +
                      590  name = get_parameter_str(external_method_parameters());
                      +
                      591  }
                      +
                      592  return name;
                      +
                      593 }
                      +
                      594 
                      +
                      595 
                      +
                      596 /**
                      +
                      597  * Processing commonly used constructs in the verbatim blocks.
                      +
                      598  * @todo : this is still ad-hoc and requires re-implementation to
                      +
                      599  * handle it more elegantly.
                      +
                      600  */
                      +
                      601 std::string CodegenCoreneuronCppVisitor::process_verbatim_text(std::string const& text) {
                      + +
                      603  driver.scan_string(text);
                      +
                      604  auto tokens = driver.all_tokens();
                      +
                      605  std::string result;
                      +
                      606  for (size_t i = 0; i < tokens.size(); i++) {
                      +
                      607  auto token = tokens[i];
                      +
                      608 
                      +
                      609  // check if we have function call in the verbatim block where
                      +
                      610  // function is defined in the same mod file
                      +
                      611  if (program_symtab->is_method_defined(token) && tokens[i + 1] == "(") {
                      +
                      612  internal_method_call_encountered = true;
                      +
                      613  }
                      +
                      614  result += process_verbatim_token(token);
                      +
                      615  }
                      +
                      616  return result;
                      +
                      617 }
                      +
                      618 
                      619 
                      -
                      620 
                      -
                      621 /**
                      -
                      622  * Processing commonly used constructs in the verbatim blocks.
                      -
                      623  * @todo : this is still ad-hoc and requires re-implementation to
                      -
                      624  * handle it more elegantly.
                      -
                      625  */
                      -
                      626 std::string CodegenCoreneuronCppVisitor::process_verbatim_text(std::string const& text) {
                      - -
                      628  driver.scan_string(text);
                      -
                      629  auto tokens = driver.all_tokens();
                      -
                      630  std::string result;
                      -
                      631  for (size_t i = 0; i < tokens.size(); i++) {
                      -
                      632  auto token = tokens[i];
                      -
                      633 
                      -
                      634  // check if we have function call in the verbatim block where
                      -
                      635  // function is defined in the same mod file
                      -
                      636  if (program_symtab->is_method_defined(token) && tokens[i + 1] == "(") {
                      -
                      637  internal_method_call_encountered = true;
                      -
                      638  }
                      -
                      639  result += process_verbatim_token(token);
                      -
                      640  }
                      -
                      641  return result;
                      -
                      642 }
                      -
                      643 
                      -
                      644 
                      - -
                      646  auto nrn_channel_info_var_name = get_channel_info_var_name();
                      -
                      647  auto nrn_cur = nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr";
                      -
                      648  auto nrn_state = nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr";
                      -
                      649  auto nrn_alloc = method_name(naming::NRN_ALLOC_METHOD);
                      -
                      650  auto nrn_init = method_name(naming::NRN_INIT_METHOD);
                      -
                      651  auto const nrn_private_constructor = method_name(naming::NRN_PRIVATE_CONSTRUCTOR_METHOD);
                      -
                      652  auto const nrn_private_destructor = method_name(naming::NRN_PRIVATE_DESTRUCTOR_METHOD);
                      -
                      653  return fmt::format("{}, {}, {}, nullptr, {}, {}, {}, {}, first_pointer_var_index()",
                      -
                      654  nrn_channel_info_var_name,
                      -
                      655  nrn_alloc,
                      -
                      656  nrn_cur,
                      -
                      657  nrn_state,
                      -
                      658  nrn_init,
                      -
                      659  nrn_private_constructor,
                      -
                      660  nrn_private_destructor);
                      -
                      661 }
                      -
                      662 
                      -
                      663 
                      - -
                      665  std::vector<ShadowUseStatement>& statements,
                      -
                      666  const Ion& ion,
                      -
                      667  const std::string& concentration) {
                      -
                      668  int index = 0;
                      -
                      669  if (ion.is_intra_cell_conc(concentration)) {
                      -
                      670  index = 1;
                      -
                      671  } else if (ion.is_extra_cell_conc(concentration)) {
                      -
                      672  index = 2;
                      -
                      673  } else {
                      -
                      674  /// \todo Unhandled case in neuron implementation
                      -
                      675  throw std::logic_error(fmt::format("codegen error for {} ion", ion.name));
                      -
                      676  }
                      -
                      677  auto ion_type_name = fmt::format("{}_type", ion.name);
                      -
                      678  auto lhs = fmt::format("int {}", ion_type_name);
                      -
                      679  auto op = "=";
                      -
                      680  auto rhs = get_variable_name(ion_type_name);
                      -
                      681  statements.push_back(ShadowUseStatement{lhs, op, rhs});
                      -
                      682 
                      -
                      683  auto ion_name = ion.name;
                      -
                      684  auto conc_var_name = get_variable_name(naming::ION_VARNAME_PREFIX + concentration);
                      -
                      685  auto style_var_name = get_variable_name("style_" + ion_name);
                      -
                      686  auto statement = fmt::format(
                      -
                      687  "nrn_wrote_conc({}_type,"
                      -
                      688  " &({}),"
                      -
                      689  " {},"
                      -
                      690  " {},"
                      -
                      691  " nrn_ion_global_map,"
                      -
                      692  " {},"
                      -
                      693  " nt->_ml_list[{}_type]->_nodecount_padded)",
                      -
                      694  ion_name,
                      -
                      695  conc_var_name,
                      -
                      696  index,
                      -
                      697  style_var_name,
                      -
                      698  get_variable_name(naming::CELSIUS_VARIABLE),
                      -
                      699  ion_name);
                      + +
                      621  auto nrn_channel_info_var_name = get_channel_info_var_name();
                      +
                      622  auto nrn_cur = nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr";
                      +
                      623  auto nrn_state = nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr";
                      +
                      624  auto nrn_alloc = method_name(naming::NRN_ALLOC_METHOD);
                      +
                      625  auto nrn_init = method_name(naming::NRN_INIT_METHOD);
                      +
                      626  auto const nrn_private_constructor = method_name(naming::NRN_PRIVATE_CONSTRUCTOR_METHOD);
                      +
                      627  auto const nrn_private_destructor = method_name(naming::NRN_PRIVATE_DESTRUCTOR_METHOD);
                      +
                      628  return fmt::format("{}, {}, {}, nullptr, {}, {}, {}, {}, first_pointer_var_index()",
                      +
                      629  nrn_channel_info_var_name,
                      +
                      630  nrn_alloc,
                      +
                      631  nrn_cur,
                      +
                      632  nrn_state,
                      +
                      633  nrn_init,
                      +
                      634  nrn_private_constructor,
                      +
                      635  nrn_private_destructor);
                      +
                      636 }
                      +
                      637 
                      +
                      638 
                      + +
                      640  std::vector<ShadowUseStatement>& statements,
                      +
                      641  const Ion& ion,
                      +
                      642  const std::string& concentration) {
                      +
                      643  int index = 0;
                      +
                      644  if (ion.is_intra_cell_conc(concentration)) {
                      +
                      645  index = 1;
                      +
                      646  } else if (ion.is_extra_cell_conc(concentration)) {
                      +
                      647  index = 2;
                      +
                      648  } else {
                      +
                      649  /// \todo Unhandled case in neuron implementation
                      +
                      650  throw std::logic_error(fmt::format("codegen error for {} ion", ion.name));
                      +
                      651  }
                      +
                      652  auto ion_type_name = fmt::format("{}_type", ion.name);
                      +
                      653  auto lhs = fmt::format("int {}", ion_type_name);
                      +
                      654  auto op = "=";
                      +
                      655  auto rhs = get_variable_name(ion_type_name);
                      +
                      656  statements.push_back(ShadowUseStatement{lhs, op, rhs});
                      +
                      657 
                      +
                      658  auto ion_name = ion.name;
                      +
                      659  auto conc_var_name = get_variable_name(naming::ION_VARNAME_PREFIX + concentration);
                      +
                      660  auto style_var_name = get_variable_name("style_" + ion_name);
                      +
                      661  auto statement = fmt::format(
                      +
                      662  "nrn_wrote_conc({}_type,"
                      +
                      663  " &({}),"
                      +
                      664  " {},"
                      +
                      665  " {},"
                      +
                      666  " nrn_ion_global_map,"
                      +
                      667  " {},"
                      +
                      668  " nt->_ml_list[{}_type]->_nodecount_padded)",
                      +
                      669  ion_name,
                      +
                      670  conc_var_name,
                      +
                      671  index,
                      +
                      672  style_var_name,
                      +
                      673  get_variable_name(naming::CELSIUS_VARIABLE),
                      +
                      674  ion_name);
                      +
                      675 
                      +
                      676  statements.push_back(ShadowUseStatement{statement, "", ""});
                      +
                      677 }
                      +
                      678 
                      +
                      679 
                      +
                      680 /****************************************************************************************/
                      +
                      681 /* Code-specific printing routines for code generation */
                      +
                      682 /****************************************************************************************/
                      +
                      683 
                      +
                      684 
                      + +
                      686  printer->add_newline(2);
                      +
                      687  printer->push_block("static inline int first_pointer_var_index()");
                      +
                      688  printer->fmt_line("return {};", info.first_pointer_var_index);
                      +
                      689  printer->pop_block();
                      +
                      690 }
                      +
                      691 
                      +
                      692 
                      + +
                      694  printer->add_newline(2);
                      +
                      695  printer->push_block("static inline int first_random_var_index()");
                      +
                      696  printer->fmt_line("return {};", info.first_random_var_index);
                      +
                      697  printer->pop_block();
                      +
                      698 }
                      +
                      699 
                      700 
                      -
                      701  statements.push_back(ShadowUseStatement{statement, "", ""});
                      -
                      702 }
                      -
                      703 
                      -
                      704 
                      -
                      705 /****************************************************************************************/
                      -
                      706 /* Code-specific printing routines for code generation */
                      -
                      707 /****************************************************************************************/
                      -
                      708 
                      -
                      709 
                      - -
                      711  printer->add_newline(2);
                      -
                      712  printer->push_block("static inline int first_pointer_var_index()");
                      -
                      713  printer->fmt_line("return {};", info.first_pointer_var_index);
                      -
                      714  printer->pop_block();
                      -
                      715 }
                      -
                      716 
                      -
                      717 
                      - -
                      719  printer->add_newline(2);
                      -
                      720  printer->push_block("static inline int first_random_var_index()");
                      -
                      721  printer->fmt_line("return {};", info.first_random_var_index);
                      -
                      722  printer->pop_block();
                      -
                      723 }
                      + +
                      702  printer->add_newline(2);
                      +
                      703  printer->push_block("static inline int float_variables_size()");
                      +
                      704  printer->fmt_line("return {};", float_variables_size());
                      +
                      705  printer->pop_block();
                      +
                      706 
                      +
                      707  printer->add_newline(2);
                      +
                      708  printer->push_block("static inline int int_variables_size()");
                      +
                      709  printer->fmt_line("return {};", int_variables_size());
                      +
                      710  printer->pop_block();
                      +
                      711 }
                      +
                      712 
                      +
                      713 
                      + +
                      715  if (!net_receive_exist()) {
                      +
                      716  return;
                      +
                      717  }
                      +
                      718  printer->add_newline(2);
                      +
                      719  printer->push_block("static inline int num_net_receive_args()");
                      +
                      720  printer->fmt_line("return {};", info.num_net_receive_parameters);
                      +
                      721  printer->pop_block();
                      +
                      722 }
                      +
                      723 
                      724 
                      -
                      725 
                      - -
                      727  printer->add_newline(2);
                      -
                      728  printer->push_block("static inline int float_variables_size()");
                      -
                      729  printer->fmt_line("return {};", float_variables_size());
                      + +
                      726  printer->add_newline(2);
                      +
                      727  printer->push_block("static inline int get_mech_type()");
                      +
                      728  // false => get it from the host-only global struct, not the instance structure
                      +
                      729  printer->fmt_line("return {};", get_variable_name("mech_type", false));
                      730  printer->pop_block();
                      -
                      731 
                      -
                      732  printer->add_newline(2);
                      -
                      733  printer->push_block("static inline int int_variables_size()");
                      -
                      734  printer->fmt_line("return {};", int_variables_size());
                      -
                      735  printer->pop_block();
                      -
                      736 }
                      -
                      737 
                      -
                      738 
                      - -
                      740  if (!net_receive_exist()) {
                      -
                      741  return;
                      -
                      742  }
                      -
                      743  printer->add_newline(2);
                      -
                      744  printer->push_block("static inline int num_net_receive_args()");
                      -
                      745  printer->fmt_line("return {};", info.num_net_receive_parameters);
                      -
                      746  printer->pop_block();
                      -
                      747 }
                      -
                      748 
                      +
                      731 }
                      +
                      732 
                      +
                      733 
                      + +
                      735  printer->add_newline(2);
                      +
                      736  printer->push_block("static inline Memb_list* get_memb_list(NrnThread* nt)");
                      +
                      737  printer->push_block("if (!nt->_ml_list)");
                      +
                      738  printer->add_line("return nullptr;");
                      +
                      739  printer->pop_block();
                      +
                      740  printer->add_line("return nt->_ml_list[get_mech_type()];");
                      +
                      741  printer->pop_block();
                      +
                      742 }
                      +
                      743 
                      +
                      744 
                      + +
                      746  printer->add_newline(2);
                      +
                      747  printer->push_block("namespace coreneuron");
                      +
                      748 }
                      749 
                      - -
                      751  printer->add_newline(2);
                      -
                      752  printer->push_block("static inline int get_mech_type()");
                      -
                      753  // false => get it from the host-only global struct, not the instance structure
                      -
                      754  printer->fmt_line("return {};", get_variable_name("mech_type", false));
                      -
                      755  printer->pop_block();
                      -
                      756 }
                      -
                      757 
                      -
                      758 
                      - -
                      760  printer->add_newline(2);
                      -
                      761  printer->push_block("static inline Memb_list* get_memb_list(NrnThread* nt)");
                      -
                      762  printer->push_block("if (!nt->_ml_list)");
                      -
                      763  printer->add_line("return nullptr;");
                      -
                      764  printer->pop_block();
                      -
                      765  printer->add_line("return nt->_ml_list[get_mech_type()];");
                      -
                      766  printer->pop_block();
                      -
                      767 }
                      -
                      768 
                      -
                      769 
                      - -
                      771  printer->add_newline(2);
                      -
                      772  printer->push_block("namespace coreneuron");
                      -
                      773 }
                      -
                      774 
                      +
                      750 
                      + +
                      752  printer->pop_block();
                      +
                      753 }
                      +
                      754 
                      +
                      755 
                      +
                      756 /**
                      +
                      757  * \details There are three types of thread variables currently considered:
                      +
                      758  * - top local thread variables
                      +
                      759  * - thread variables in the mod file
                      +
                      760  * - thread variables for solver
                      +
                      761  *
                      +
                      762  * These variables are allocated into different thread structures and have
                      +
                      763  * corresponding thread ids. Thread id start from 0. In mod2c implementation,
                      +
                      764  * thread_data_index is increased at various places and it is used to
                      +
                      765  * decide the index of thread.
                      +
                      766  */
                      + +
                      768  if (info.vectorize && info.derivimplicit_used()) {
                      +
                      769  int tid = info.derivimplicit_var_thread_id;
                      +
                      770  int list = info.derivimplicit_list_num;
                      +
                      771 
                      +
                      772  // clang-format off
                      +
                      773  printer->add_newline(2);
                      +
                      774  printer->add_line("/** thread specific helper routines for derivimplicit */");
                      775 
                      - -
                      777  printer->pop_block();
                      -
                      778 }
                      -
                      779 
                      -
                      780 
                      -
                      781 /**
                      -
                      782  * \details There are three types of thread variables currently considered:
                      -
                      783  * - top local thread variables
                      -
                      784  * - thread variables in the mod file
                      -
                      785  * - thread variables for solver
                      -
                      786  *
                      -
                      787  * These variables are allocated into different thread structures and have
                      -
                      788  * corresponding thread ids. Thread id start from 0. In mod2c implementation,
                      -
                      789  * thread_data_index is increased at various places and it is used to
                      -
                      790  * decide the index of thread.
                      -
                      791  */
                      - -
                      793  if (info.vectorize && info.derivimplicit_used()) {
                      -
                      794  int tid = info.derivimplicit_var_thread_id;
                      -
                      795  int list = info.derivimplicit_list_num;
                      -
                      796 
                      -
                      797  // clang-format off
                      -
                      798  printer->add_newline(2);
                      -
                      799  printer->add_line("/** thread specific helper routines for derivimplicit */");
                      -
                      800 
                      -
                      801  printer->add_newline(1);
                      -
                      802  printer->fmt_push_block("static inline int* deriv{}_advance(ThreadDatum* thread)", list);
                      -
                      803  printer->fmt_line("return &(thread[{}].i);", tid);
                      -
                      804  printer->pop_block();
                      -
                      805  printer->add_newline();
                      -
                      806 
                      -
                      807  printer->fmt_push_block("static inline int dith{}()", list);
                      -
                      808  printer->fmt_line("return {};", tid+1);
                      -
                      809  printer->pop_block();
                      -
                      810  printer->add_newline();
                      -
                      811 
                      -
                      812  printer->fmt_push_block("static inline void** newtonspace{}(ThreadDatum* thread)", list);
                      -
                      813  printer->fmt_line("return &(thread[{}]._pvoid);", tid+2);
                      -
                      814  printer->pop_block();
                      -
                      815  }
                      -
                      816 
                      -
                      817  if (info.vectorize && !info.thread_variables.empty()) {
                      -
                      818  printer->add_newline(2);
                      -
                      819  printer->add_line("/** tid for thread variables */");
                      -
                      820  printer->push_block("static inline int thread_var_tid()");
                      -
                      821  printer->fmt_line("return {};", info.thread_var_thread_id);
                      -
                      822  printer->pop_block();
                      -
                      823  }
                      -
                      824 
                      -
                      825  if (info.vectorize && !info.top_local_variables.empty()) {
                      -
                      826  printer->add_newline(2);
                      -
                      827  printer->add_line("/** tid for top local tread variables */");
                      -
                      828  printer->push_block("static inline int top_local_var_tid()");
                      -
                      829  printer->fmt_line("return {};", info.top_local_thread_id);
                      -
                      830  printer->pop_block();
                      -
                      831  }
                      -
                      832  // clang-format on
                      -
                      833 }
                      -
                      834 
                      -
                      835 
                      -
                      836 /****************************************************************************************/
                      -
                      837 /* Routines for returning variable name */
                      -
                      838 /****************************************************************************************/
                      -
                      839 
                      -
                      840 
                      - -
                      842  bool use_instance) const {
                      -
                      843  auto name = symbol->get_name();
                      -
                      844  auto dimension = symbol->get_length();
                      -
                      845  auto position = position_of_float_var(name);
                      -
                      846  if (symbol->is_array()) {
                      -
                      847  if (use_instance) {
                      -
                      848  return fmt::format("(inst->{}+id*{})", name, dimension);
                      -
                      849  }
                      -
                      850  return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                      -
                      851  }
                      -
                      852  if (use_instance) {
                      -
                      853  return fmt::format("inst->{}[id]", name);
                      -
                      854  }
                      -
                      855  return fmt::format("data[{}*pnodecount + id]", position);
                      -
                      856 }
                      -
                      857 
                      +
                      776  printer->add_newline(1);
                      +
                      777  printer->fmt_push_block("static inline int* deriv{}_advance(ThreadDatum* thread)", list);
                      +
                      778  printer->fmt_line("return &(thread[{}].i);", tid);
                      +
                      779  printer->pop_block();
                      +
                      780  printer->add_newline();
                      +
                      781 
                      +
                      782  printer->fmt_push_block("static inline int dith{}()", list);
                      +
                      783  printer->fmt_line("return {};", tid+1);
                      +
                      784  printer->pop_block();
                      +
                      785  printer->add_newline();
                      +
                      786 
                      +
                      787  printer->fmt_push_block("static inline void** newtonspace{}(ThreadDatum* thread)", list);
                      +
                      788  printer->fmt_line("return &(thread[{}]._pvoid);", tid+2);
                      +
                      789  printer->pop_block();
                      +
                      790  }
                      +
                      791 
                      +
                      792  if (info.vectorize && !info.thread_variables.empty()) {
                      +
                      793  printer->add_newline(2);
                      +
                      794  printer->add_line("/** tid for thread variables */");
                      +
                      795  printer->push_block("static inline int thread_var_tid()");
                      +
                      796  printer->fmt_line("return {};", info.thread_var_thread_id);
                      +
                      797  printer->pop_block();
                      +
                      798  }
                      +
                      799 
                      +
                      800  if (info.vectorize && !info.top_local_variables.empty()) {
                      +
                      801  printer->add_newline(2);
                      +
                      802  printer->add_line("/** tid for top local tread variables */");
                      +
                      803  printer->push_block("static inline int top_local_var_tid()");
                      +
                      804  printer->fmt_line("return {};", info.top_local_thread_id);
                      +
                      805  printer->pop_block();
                      +
                      806  }
                      +
                      807  // clang-format on
                      +
                      808 }
                      +
                      809 
                      +
                      810 
                      +
                      811 /****************************************************************************************/
                      +
                      812 /* Routines for returning variable name */
                      +
                      813 /****************************************************************************************/
                      +
                      814 
                      +
                      815 
                      + +
                      817  bool use_instance) const {
                      +
                      818  auto name = symbol->get_name();
                      +
                      819  auto dimension = symbol->get_length();
                      +
                      820  auto position = position_of_float_var(name);
                      +
                      821  if (symbol->is_array()) {
                      +
                      822  if (use_instance) {
                      +
                      823  return fmt::format("(inst->{}+id*{})", name, dimension);
                      +
                      824  }
                      +
                      825  return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                      +
                      826  }
                      +
                      827  if (use_instance) {
                      +
                      828  return fmt::format("inst->{}[id]", name);
                      +
                      829  }
                      +
                      830  return fmt::format("data[{}*pnodecount + id]", position);
                      +
                      831 }
                      +
                      832 
                      +
                      833 
                      + +
                      835  const std::string& name,
                      +
                      836  bool use_instance) const {
                      +
                      837  auto position = position_of_int_var(name);
                      +
                      838  // clang-format off
                      +
                      839  if (symbol.is_index) {
                      +
                      840  if (use_instance) {
                      +
                      841  return fmt::format("inst->{}[{}]", name, position);
                      +
                      842  }
                      +
                      843  return fmt::format("indexes[{}]", position);
                      +
                      844  }
                      +
                      845  if (symbol.is_integer) {
                      +
                      846  if (use_instance) {
                      +
                      847  return fmt::format("inst->{}[{}*pnodecount+id]", name, position);
                      +
                      848  }
                      +
                      849  return fmt::format("indexes[{}*pnodecount+id]", position);
                      +
                      850  }
                      +
                      851  if (use_instance) {
                      +
                      852  return fmt::format("inst->{}[indexes[{}*pnodecount + id]]", name, position);
                      +
                      853  }
                      +
                      854  auto data = symbol.is_vdata ? "_vdata" : "_data";
                      +
                      855  return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                      +
                      856  // clang-format on
                      +
                      857 }
                      858 
                      - -
                      860  const std::string& name,
                      -
                      861  bool use_instance) const {
                      -
                      862  auto position = position_of_int_var(name);
                      -
                      863  // clang-format off
                      -
                      864  if (symbol.is_index) {
                      -
                      865  if (use_instance) {
                      -
                      866  return fmt::format("inst->{}[{}]", name, position);
                      -
                      867  }
                      -
                      868  return fmt::format("indexes[{}]", position);
                      -
                      869  }
                      -
                      870  if (symbol.is_integer) {
                      -
                      871  if (use_instance) {
                      -
                      872  return fmt::format("inst->{}[{}*pnodecount+id]", name, position);
                      -
                      873  }
                      -
                      874  return fmt::format("indexes[{}*pnodecount+id]", position);
                      -
                      875  }
                      -
                      876  if (use_instance) {
                      -
                      877  return fmt::format("inst->{}[indexes[{}*pnodecount + id]]", name, position);
                      -
                      878  }
                      -
                      879  auto data = symbol.is_vdata ? "_vdata" : "_data";
                      -
                      880  return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                      -
                      881  // clang-format on
                      -
                      882 }
                      +
                      859 
                      + +
                      861  bool use_instance) const {
                      +
                      862  if (use_instance) {
                      +
                      863  return fmt::format("inst->{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                      +
                      864  } else {
                      +
                      865  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                      +
                      866  }
                      +
                      867 }
                      +
                      868 
                      +
                      869 
                      +
                      870 std::string CodegenCoreneuronCppVisitor::get_variable_name(const std::string& name,
                      +
                      871  bool use_instance) const {
                      +
                      872  const std::string& varname = update_if_ion_variable_name(name);
                      +
                      873 
                      +
                      874  // clang-format off
                      +
                      875  auto symbol_comparator = [&varname](const SymbolType& sym) {
                      +
                      876  return varname == sym->get_name();
                      +
                      877  };
                      +
                      878 
                      +
                      879  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                      +
                      880  return varname == var.symbol->get_name();
                      +
                      881  };
                      +
                      882  // clang-format on
                      883 
                      -
                      884 
                      - -
                      886  bool use_instance) const {
                      -
                      887  if (use_instance) {
                      -
                      888  return fmt::format("inst->{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                      -
                      889  } else {
                      -
                      890  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                      -
                      891  }
                      -
                      892 }
                      -
                      893 
                      -
                      894 
                      -
                      895 std::string CodegenCoreneuronCppVisitor::get_variable_name(const std::string& name,
                      -
                      896  bool use_instance) const {
                      -
                      897  const std::string& varname = update_if_ion_variable_name(name);
                      +
                      884  // float variable
                      +
                      885  auto f = std::find_if(codegen_float_variables.begin(),
                      +
                      886  codegen_float_variables.end(),
                      +
                      887  symbol_comparator);
                      +
                      888  if (f != codegen_float_variables.end()) {
                      +
                      889  return float_variable_name(*f, use_instance);
                      +
                      890  }
                      +
                      891 
                      +
                      892  // integer variable
                      +
                      893  auto i =
                      +
                      894  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                      +
                      895  if (i != codegen_int_variables.end()) {
                      +
                      896  return int_variable_name(*i, varname, use_instance);
                      +
                      897  }
                      898 
                      -
                      899  // clang-format off
                      -
                      900  auto symbol_comparator = [&varname](const SymbolType& sym) {
                      -
                      901  return varname == sym->get_name();
                      -
                      902  };
                      -
                      903 
                      -
                      904  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                      -
                      905  return varname == var.symbol->get_name();
                      -
                      906  };
                      -
                      907  // clang-format on
                      -
                      908 
                      -
                      909  // float variable
                      -
                      910  auto f = std::find_if(codegen_float_variables.begin(),
                      -
                      911  codegen_float_variables.end(),
                      -
                      912  symbol_comparator);
                      -
                      913  if (f != codegen_float_variables.end()) {
                      -
                      914  return float_variable_name(*f, use_instance);
                      +
                      899  // global variable
                      +
                      900  auto g = std::find_if(codegen_global_variables.begin(),
                      +
                      901  codegen_global_variables.end(),
                      +
                      902  symbol_comparator);
                      +
                      903  if (g != codegen_global_variables.end()) {
                      +
                      904  return global_variable_name(*g, use_instance);
                      +
                      905  }
                      +
                      906 
                      +
                      907  if (varname == naming::NTHREAD_DT_VARIABLE) {
                      +
                      908  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                      +
                      909  }
                      +
                      910 
                      +
                      911  // t in net_receive method is an argument to function and hence it should
                      +
                      912  // ne used instead of nt->_t which is current time of thread
                      +
                      913  if (varname == naming::NTHREAD_T_VARIABLE && !printing_net_receive) {
                      +
                      914  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                      915  }
                      916 
                      -
                      917  // integer variable
                      -
                      918  auto i =
                      -
                      919  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                      -
                      920  if (i != codegen_int_variables.end()) {
                      -
                      921  return int_variable_name(*i, varname, use_instance);
                      -
                      922  }
                      -
                      923 
                      -
                      924  // global variable
                      -
                      925  auto g = std::find_if(codegen_global_variables.begin(),
                      -
                      926  codegen_global_variables.end(),
                      -
                      927  symbol_comparator);
                      -
                      928  if (g != codegen_global_variables.end()) {
                      -
                      929  return global_variable_name(*g, use_instance);
                      -
                      930  }
                      -
                      931 
                      -
                      932  if (varname == naming::NTHREAD_DT_VARIABLE) {
                      -
                      933  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                      -
                      934  }
                      -
                      935 
                      -
                      936  // t in net_receive method is an argument to function and hence it should
                      -
                      937  // ne used instead of nt->_t which is current time of thread
                      -
                      938  if (varname == naming::NTHREAD_T_VARIABLE && !printing_net_receive) {
                      -
                      939  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                      -
                      940  }
                      +
                      917  auto const iter =
                      +
                      918  std::find_if(info.neuron_global_variables.begin(),
                      +
                      919  info.neuron_global_variables.end(),
                      +
                      920  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                      +
                      921  if (iter != info.neuron_global_variables.end()) {
                      +
                      922  std::string ret;
                      +
                      923  if (use_instance) {
                      +
                      924  ret = "*(inst->";
                      +
                      925  }
                      +
                      926  ret.append(varname);
                      +
                      927  if (use_instance) {
                      +
                      928  ret.append(")");
                      +
                      929  }
                      +
                      930  return ret;
                      +
                      931  }
                      +
                      932 
                      +
                      933  // otherwise return original name
                      +
                      934  return varname;
                      +
                      935 }
                      +
                      936 
                      +
                      937 
                      +
                      938 /****************************************************************************************/
                      +
                      939 /* Main printing routines for code generation */
                      +
                      940 /****************************************************************************************/
                      941 
                      -
                      942  auto const iter =
                      -
                      943  std::find_if(info.neuron_global_variables.begin(),
                      -
                      944  info.neuron_global_variables.end(),
                      -
                      945  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                      -
                      946  if (iter != info.neuron_global_variables.end()) {
                      -
                      947  std::string ret;
                      -
                      948  if (use_instance) {
                      -
                      949  ret = "*(inst->";
                      -
                      950  }
                      -
                      951  ret.append(varname);
                      -
                      952  if (use_instance) {
                      -
                      953  ret.append(")");
                      -
                      954  }
                      -
                      955  return ret;
                      -
                      956  }
                      -
                      957 
                      -
                      958  // otherwise return original name
                      -
                      959  return varname;
                      -
                      960 }
                      -
                      961 
                      -
                      962 
                      -
                      963 /****************************************************************************************/
                      -
                      964 /* Main printing routines for code generation */
                      -
                      965 /****************************************************************************************/
                      -
                      966 
                      -
                      967 
                      - -
                      969  printer->add_newline();
                      -
                      970  printer->add_multi_line(R"CODE(
                      -
                      971  #include <math.h>
                      -
                      972  #include <stdio.h>
                      -
                      973  #include <stdlib.h>
                      -
                      974  #include <string.h>
                      -
                      975  )CODE");
                      -
                      976 }
                      -
                      977 
                      -
                      978 
                      - -
                      980  printer->add_newline();
                      -
                      981  printer->add_multi_line(R"CODE(
                      -
                      982  #include <coreneuron/gpu/nrn_acc_manager.hpp>
                      -
                      983  #include <coreneuron/mechanism/mech/mod2c_core_thread.hpp>
                      -
                      984  #include <coreneuron/mechanism/register_mech.hpp>
                      -
                      985  #include <coreneuron/nrnconf.h>
                      -
                      986  #include <coreneuron/nrniv/nrniv_decl.h>
                      -
                      987  #include <coreneuron/sim/multicore.hpp>
                      -
                      988  #include <coreneuron/sim/scopmath/newton_thread.hpp>
                      -
                      989  #include <coreneuron/utils/ivocvect.hpp>
                      -
                      990  #include <coreneuron/utils/nrnoc_aux.hpp>
                      -
                      991  #include <coreneuron/utils/randoms/nrnran123.h>
                      -
                      992  )CODE");
                      -
                      993  if (info.eigen_newton_solver_exist) {
                      -
                      994  printer->add_multi_line(nmodl::solvers::newton_hpp);
                      -
                      995  }
                      -
                      996  if (info.eigen_linear_solver_exist) {
                      -
                      997  if (std::accumulate(info.state_vars.begin(),
                      -
                      998  info.state_vars.end(),
                      -
                      999  0,
                      -
                      1000  [](int l, const SymbolType& variable) {
                      -
                      1001  return l += variable->get_length();
                      -
                      1002  }) > 4) {
                      -
                      1003  printer->add_multi_line(nmodl::solvers::crout_hpp);
                      -
                      1004  } else {
                      -
                      1005  printer->add_line("#include <Eigen/Dense>");
                      -
                      1006  printer->add_line("#include <Eigen/LU>");
                      -
                      1007  }
                      -
                      1008  }
                      -
                      1009 }
                      -
                      1010 
                      -
                      1011 
                      - -
                      1013  if (info.primes_size == 0) {
                      -
                      1014  return;
                      -
                      1015  }
                      -
                      1016  const auto count_prime_variables = [](auto size, const SymbolType& symbol) {
                      -
                      1017  return size += symbol->get_length();
                      -
                      1018  };
                      -
                      1019  const auto prime_variables_by_order_size =
                      -
                      1020  std::accumulate(info.prime_variables_by_order.begin(),
                      -
                      1021  info.prime_variables_by_order.end(),
                      -
                      1022  0,
                      -
                      1023  count_prime_variables);
                      -
                      1024  if (info.primes_size != prime_variables_by_order_size) {
                      -
                      1025  throw std::runtime_error{
                      -
                      1026  fmt::format("primes_size = {} differs from prime_variables_by_order.size() = {}, "
                      -
                      1027  "this should not happen.",
                      -
                      1028  info.primes_size,
                      -
                      1029  info.prime_variables_by_order.size())};
                      -
                      1030  }
                      -
                      1031  auto const initializer_list = [&](auto const& primes, const char* prefix) -> std::string {
                      -
                      1032  if (!print_initializers) {
                      -
                      1033  return {};
                      -
                      1034  }
                      -
                      1035  std::string list{"{"};
                      -
                      1036  for (auto iter = primes.begin(); iter != primes.end(); ++iter) {
                      -
                      1037  auto const& prime = *iter;
                      -
                      1038  list.append(std::to_string(position_of_float_var(prefix + prime->get_name())));
                      -
                      1039  if (std::next(iter) != primes.end()) {
                      -
                      1040  list.append(", ");
                      -
                      1041  }
                      -
                      1042  }
                      -
                      1043  list.append("}");
                      -
                      1044  return list;
                      -
                      1045  };
                      -
                      1046  printer->fmt_line("int slist1[{}]{};",
                      -
                      1047  info.primes_size,
                      -
                      1048  initializer_list(info.prime_variables_by_order, ""));
                      -
                      1049  printer->fmt_line("int dlist1[{}]{};",
                      -
                      1050  info.primes_size,
                      -
                      1051  initializer_list(info.prime_variables_by_order, "D"));
                      -
                      1052  codegen_global_variables.push_back(make_symbol("slist1"));
                      -
                      1053  codegen_global_variables.push_back(make_symbol("dlist1"));
                      -
                      1054  // additional list for derivimplicit method
                      -
                      1055  if (info.derivimplicit_used()) {
                      -
                      1056  auto primes = program_symtab->get_variables_with_properties(NmodlType::prime_name);
                      -
                      1057  printer->fmt_line("int slist2[{}]{};", info.primes_size, initializer_list(primes, ""));
                      -
                      1058  codegen_global_variables.push_back(make_symbol("slist2"));
                      -
                      1059  }
                      -
                      1060 }
                      -
                      1061 
                      -
                      1062 
                      - -
                      1064  return ParamVector{{"", "NrnThread*", "", "nt"},
                      -
                      1065  {"", fmt::format("{}*", instance_struct()), "", "inst"},
                      -
                      1066  {"", "int", "", "id"},
                      -
                      1067  {"", "int", "", "pnodecount"},
                      -
                      1068  {"", "double", "", "v"},
                      -
                      1069  {"const ", "Datum*", "", "indexes"},
                      -
                      1070  {"", "double*", "", "data"},
                      -
                      1071  {"", "ThreadDatum*", "", "thread"}};
                      -
                      1072 }
                      +
                      942 
                      + +
                      944  printer->add_newline();
                      +
                      945  printer->add_multi_line(R"CODE(
                      +
                      946  #include <math.h>
                      +
                      947  #include <stdio.h>
                      +
                      948  #include <stdlib.h>
                      +
                      949  #include <string.h>
                      +
                      950  )CODE");
                      +
                      951 }
                      +
                      952 
                      +
                      953 
                      + +
                      955  printer->add_newline();
                      +
                      956  printer->add_multi_line(R"CODE(
                      +
                      957  #include <coreneuron/gpu/nrn_acc_manager.hpp>
                      +
                      958  #include <coreneuron/mechanism/mech/mod2c_core_thread.hpp>
                      +
                      959  #include <coreneuron/mechanism/register_mech.hpp>
                      +
                      960  #include <coreneuron/nrnconf.h>
                      +
                      961  #include <coreneuron/nrniv/nrniv_decl.h>
                      +
                      962  #include <coreneuron/sim/multicore.hpp>
                      +
                      963  #include <coreneuron/sim/scopmath/newton_thread.hpp>
                      +
                      964  #include <coreneuron/utils/ivocvect.hpp>
                      +
                      965  #include <coreneuron/utils/nrnoc_aux.hpp>
                      +
                      966  #include <coreneuron/utils/randoms/nrnran123.h>
                      +
                      967  )CODE");
                      +
                      968  if (info.eigen_newton_solver_exist) {
                      +
                      969  printer->add_multi_line(nmodl::solvers::newton_hpp);
                      +
                      970  }
                      +
                      971  if (info.eigen_linear_solver_exist) {
                      +
                      972  if (std::accumulate(info.state_vars.begin(),
                      +
                      973  info.state_vars.end(),
                      +
                      974  0,
                      +
                      975  [](int l, const SymbolType& variable) {
                      +
                      976  return l += variable->get_length();
                      +
                      977  }) > 4) {
                      +
                      978  printer->add_multi_line(nmodl::solvers::crout_hpp);
                      +
                      979  } else {
                      +
                      980  printer->add_line("#include <Eigen/Dense>");
                      +
                      981  printer->add_line("#include <Eigen/LU>");
                      +
                      982  }
                      +
                      983  }
                      +
                      984 }
                      +
                      985 
                      +
                      986 
                      +
                      987 void CodegenCoreneuronCppVisitor::print_sdlists_init(bool print_initializers) {
                      +
                      988  if (info.primes_size == 0) {
                      +
                      989  return;
                      +
                      990  }
                      +
                      991  const auto count_prime_variables = [](auto size, const SymbolType& symbol) {
                      +
                      992  return size += symbol->get_length();
                      +
                      993  };
                      +
                      994  const auto prime_variables_by_order_size =
                      +
                      995  std::accumulate(info.prime_variables_by_order.begin(),
                      +
                      996  info.prime_variables_by_order.end(),
                      +
                      997  0,
                      +
                      998  count_prime_variables);
                      +
                      999  if (info.primes_size != prime_variables_by_order_size) {
                      +
                      1000  throw std::runtime_error{
                      +
                      1001  fmt::format("primes_size = {} differs from prime_variables_by_order.size() = {}, "
                      +
                      1002  "this should not happen.",
                      +
                      1003  info.primes_size,
                      +
                      1004  info.prime_variables_by_order.size())};
                      +
                      1005  }
                      +
                      1006  auto const initializer_list = [&](auto const& primes, const char* prefix) -> std::string {
                      +
                      1007  if (!print_initializers) {
                      +
                      1008  return {};
                      +
                      1009  }
                      +
                      1010  std::string list{"{"};
                      +
                      1011  for (auto iter = primes.begin(); iter != primes.end(); ++iter) {
                      +
                      1012  auto const& prime = *iter;
                      +
                      1013  list.append(std::to_string(position_of_float_var(prefix + prime->get_name())));
                      +
                      1014  if (std::next(iter) != primes.end()) {
                      +
                      1015  list.append(", ");
                      +
                      1016  }
                      +
                      1017  }
                      +
                      1018  list.append("}");
                      +
                      1019  return list;
                      +
                      1020  };
                      +
                      1021  printer->fmt_line("int slist1[{}]{};",
                      +
                      1022  info.primes_size,
                      +
                      1023  initializer_list(info.prime_variables_by_order, ""));
                      +
                      1024  printer->fmt_line("int dlist1[{}]{};",
                      +
                      1025  info.primes_size,
                      +
                      1026  initializer_list(info.prime_variables_by_order, "D"));
                      +
                      1027  codegen_global_variables.push_back(make_symbol("slist1"));
                      +
                      1028  codegen_global_variables.push_back(make_symbol("dlist1"));
                      +
                      1029  // additional list for derivimplicit method
                      +
                      1030  if (info.derivimplicit_used()) {
                      +
                      1031  auto primes = program_symtab->get_variables_with_properties(NmodlType::prime_name);
                      +
                      1032  printer->fmt_line("int slist2[{}]{};", info.primes_size, initializer_list(primes, ""));
                      +
                      1033  codegen_global_variables.push_back(make_symbol("slist2"));
                      +
                      1034  }
                      +
                      1035 }
                      +
                      1036 
                      +
                      1037 
                      + +
                      1039  return ParamVector{{"", "NrnThread*", "", "nt"},
                      +
                      1040  {"", fmt::format("{}*", instance_struct()), "", "inst"},
                      +
                      1041  {"", "int", "", "id"},
                      +
                      1042  {"", "int", "", "pnodecount"},
                      +
                      1043  {"", "double", "", "v"},
                      +
                      1044  {"const ", "Datum*", "", "indexes"},
                      +
                      1045  {"", "double*", "", "data"},
                      +
                      1046  {"", "ThreadDatum*", "", "thread"}};
                      +
                      1047 }
                      +
                      1048 
                      +
                      1049 
                      +
                      1050 /**
                      +
                      1051  * \details Variables required for type of ion, type of point process etc. are
                      +
                      1052  * of static int type. For the C++ backend type, it's ok to have
                      +
                      1053  * these variables as file scoped static variables.
                      +
                      1054  *
                      +
                      1055  * Initial values of state variables (h0) are also defined as static
                      +
                      1056  * variables. Note that the state could be ion variable and it could
                      +
                      1057  * be also range variable. Hence lookup into symbol table before.
                      +
                      1058  *
                      +
                      1059  * When model is not vectorized (shouldn't be the case in coreneuron)
                      +
                      1060  * the top local variables become static variables.
                      +
                      1061  *
                      +
                      1062  * Note that static variables are already initialized to 0. We do the
                      +
                      1063  * same for some variables to keep same code as neuron.
                      +
                      1064  */
                      +
                      1065 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                      + +
                      1067  const auto value_initialize = print_initializers ? "{}" : "";
                      +
                      1068 
                      +
                      1069  auto float_type = default_float_data_type();
                      +
                      1070  printer->add_newline(2);
                      +
                      1071  printer->add_line("/** all global variables */");
                      +
                      1072  printer->fmt_push_block("struct {}", global_struct());
                      1073 
                      -
                      1074 
                      -
                      1075 /**
                      -
                      1076  * \details Variables required for type of ion, type of point process etc. are
                      -
                      1077  * of static int type. For the C++ backend type, it's ok to have
                      -
                      1078  * these variables as file scoped static variables.
                      -
                      1079  *
                      -
                      1080  * Initial values of state variables (h0) are also defined as static
                      -
                      1081  * variables. Note that the state could be ion variable and it could
                      -
                      1082  * be also range variable. Hence lookup into symbol table before.
                      -
                      1083  *
                      -
                      1084  * When model is not vectorized (shouldn't be the case in coreneuron)
                      -
                      1085  * the top local variables become static variables.
                      -
                      1086  *
                      -
                      1087  * Note that static variables are already initialized to 0. We do the
                      -
                      1088  * same for some variables to keep same code as neuron.
                      -
                      1089  */
                      -
                      1090 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                      - -
                      1092  const auto value_initialize = print_initializers ? "{}" : "";
                      +
                      1074  for (const auto& ion: info.ions) {
                      +
                      1075  auto name = fmt::format("{}_type", ion.name);
                      +
                      1076  printer->fmt_line("int {}{};", name, value_initialize);
                      +
                      1077  codegen_global_variables.push_back(make_symbol(name));
                      +
                      1078  }
                      +
                      1079 
                      +
                      1080  if (info.point_process) {
                      +
                      1081  printer->fmt_line("int point_type{};", value_initialize);
                      +
                      1082  codegen_global_variables.push_back(make_symbol("point_type"));
                      +
                      1083  }
                      +
                      1084 
                      +
                      1085  for (const auto& var: info.state_vars) {
                      +
                      1086  auto name = var->get_name() + "0";
                      +
                      1087  auto symbol = program_symtab->lookup(name);
                      +
                      1088  if (symbol == nullptr) {
                      +
                      1089  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                      +
                      1090  codegen_global_variables.push_back(make_symbol(name));
                      +
                      1091  }
                      +
                      1092  }
                      1093 
                      -
                      1094  auto float_type = default_float_data_type();
                      -
                      1095  printer->add_newline(2);
                      -
                      1096  printer->add_line("/** all global variables */");
                      -
                      1097  printer->fmt_push_block("struct {}", global_struct());
                      -
                      1098 
                      -
                      1099  for (const auto& ion: info.ions) {
                      -
                      1100  auto name = fmt::format("{}_type", ion.name);
                      -
                      1101  printer->fmt_line("int {}{};", name, value_initialize);
                      -
                      1102  codegen_global_variables.push_back(make_symbol(name));
                      -
                      1103  }
                      -
                      1104 
                      -
                      1105  if (info.point_process) {
                      -
                      1106  printer->fmt_line("int point_type{};", value_initialize);
                      -
                      1107  codegen_global_variables.push_back(make_symbol("point_type"));
                      -
                      1108  }
                      -
                      1109 
                      -
                      1110  for (const auto& var: info.state_vars) {
                      -
                      1111  auto name = var->get_name() + "0";
                      -
                      1112  auto symbol = program_symtab->lookup(name);
                      -
                      1113  if (symbol == nullptr) {
                      -
                      1114  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                      -
                      1115  codegen_global_variables.push_back(make_symbol(name));
                      -
                      1116  }
                      -
                      1117  }
                      -
                      1118 
                      -
                      1119  // Neuron and Coreneuron adds "v" to global variables when vectorize
                      -
                      1120  // is false. But as v is always local variable and passed as argument,
                      -
                      1121  // we don't need to use global variable v
                      -
                      1122 
                      -
                      1123  auto& top_locals = info.top_local_variables;
                      -
                      1124  if (!info.vectorize && !top_locals.empty()) {
                      -
                      1125  for (const auto& var: top_locals) {
                      -
                      1126  auto name = var->get_name();
                      -
                      1127  auto length = var->get_length();
                      -
                      1128  if (var->is_array()) {
                      -
                      1129  printer->fmt_line("{} {}[{}] /* TODO init top-local-array */;",
                      -
                      1130  float_type,
                      -
                      1131  name,
                      -
                      1132  length);
                      -
                      1133  } else {
                      -
                      1134  printer->fmt_line("{} {} /* TODO init top-local */;", float_type, name);
                      -
                      1135  }
                      -
                      1136  codegen_global_variables.push_back(var);
                      -
                      1137  }
                      -
                      1138  }
                      -
                      1139 
                      -
                      1140  if (!info.thread_variables.empty()) {
                      -
                      1141  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                      -
                      1142  printer->fmt_line("{} thread_data[{}] /* TODO init thread_data */;",
                      -
                      1143  float_type,
                      -
                      1144  info.thread_var_data_size);
                      -
                      1145  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                      -
                      1146  auto symbol = make_symbol("thread_data");
                      -
                      1147  symbol->set_as_array(info.thread_var_data_size);
                      -
                      1148  codegen_global_variables.push_back(symbol);
                      +
                      1094  // Neuron and Coreneuron adds "v" to global variables when vectorize
                      +
                      1095  // is false. But as v is always local variable and passed as argument,
                      +
                      1096  // we don't need to use global variable v
                      +
                      1097 
                      +
                      1098  auto& top_locals = info.top_local_variables;
                      +
                      1099  if (!info.vectorize && !top_locals.empty()) {
                      +
                      1100  for (const auto& var: top_locals) {
                      +
                      1101  auto name = var->get_name();
                      +
                      1102  auto length = var->get_length();
                      +
                      1103  if (var->is_array()) {
                      +
                      1104  printer->fmt_line("{} {}[{}] /* TODO init top-local-array */;",
                      +
                      1105  float_type,
                      +
                      1106  name,
                      +
                      1107  length);
                      +
                      1108  } else {
                      +
                      1109  printer->fmt_line("{} {} /* TODO init top-local */;", float_type, name);
                      +
                      1110  }
                      +
                      1111  codegen_global_variables.push_back(var);
                      +
                      1112  }
                      +
                      1113  }
                      +
                      1114 
                      +
                      1115  if (!info.thread_variables.empty()) {
                      +
                      1116  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                      +
                      1117  printer->fmt_line("{} thread_data[{}] /* TODO init thread_data */;",
                      +
                      1118  float_type,
                      +
                      1119  info.thread_var_data_size);
                      +
                      1120  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                      +
                      1121  auto symbol = make_symbol("thread_data");
                      +
                      1122  symbol->set_as_array(info.thread_var_data_size);
                      +
                      1123  codegen_global_variables.push_back(symbol);
                      +
                      1124  }
                      +
                      1125 
                      +
                      1126  // TODO: remove this entirely?
                      +
                      1127  printer->fmt_line("int reset{};", value_initialize);
                      +
                      1128  codegen_global_variables.push_back(make_symbol("reset"));
                      +
                      1129 
                      +
                      1130  printer->fmt_line("int mech_type{};", value_initialize);
                      +
                      1131  codegen_global_variables.push_back(make_symbol("mech_type"));
                      +
                      1132 
                      +
                      1133  for (const auto& var: info.global_variables) {
                      +
                      1134  auto name = var->get_name();
                      +
                      1135  auto length = var->get_length();
                      +
                      1136  if (var->is_array()) {
                      +
                      1137  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                      +
                      1138  } else {
                      +
                      1139  double value{};
                      +
                      1140  if (auto const& value_ptr = var->get_value()) {
                      +
                      1141  value = *value_ptr;
                      +
                      1142  }
                      +
                      1143  printer->fmt_line("{} {}{};",
                      +
                      1144  float_type,
                      +
                      1145  name,
                      +
                      1146  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      +
                      1147  }
                      +
                      1148  codegen_global_variables.push_back(var);
                      1149  }
                      1150 
                      -
                      1151  // TODO: remove this entirely?
                      -
                      1152  printer->fmt_line("int reset{};", value_initialize);
                      -
                      1153  codegen_global_variables.push_back(make_symbol("reset"));
                      -
                      1154 
                      -
                      1155  printer->fmt_line("int mech_type{};", value_initialize);
                      -
                      1156  codegen_global_variables.push_back(make_symbol("mech_type"));
                      -
                      1157 
                      -
                      1158  for (const auto& var: info.global_variables) {
                      -
                      1159  auto name = var->get_name();
                      -
                      1160  auto length = var->get_length();
                      -
                      1161  if (var->is_array()) {
                      -
                      1162  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                      -
                      1163  } else {
                      -
                      1164  double value{};
                      -
                      1165  if (auto const& value_ptr = var->get_value()) {
                      -
                      1166  value = *value_ptr;
                      -
                      1167  }
                      -
                      1168  printer->fmt_line("{} {}{};",
                      -
                      1169  float_type,
                      -
                      1170  name,
                      -
                      1171  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      -
                      1172  }
                      -
                      1173  codegen_global_variables.push_back(var);
                      -
                      1174  }
                      +
                      1151  for (const auto& var: info.constant_variables) {
                      +
                      1152  auto const name = var->get_name();
                      +
                      1153  auto* const value_ptr = var->get_value().get();
                      +
                      1154  double const value{value_ptr ? *value_ptr : 0};
                      +
                      1155  printer->fmt_line("{} {}{};",
                      +
                      1156  float_type,
                      +
                      1157  name,
                      +
                      1158  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      +
                      1159  codegen_global_variables.push_back(var);
                      +
                      1160  }
                      +
                      1161 
                      +
                      1162  print_sdlists_init(print_initializers);
                      +
                      1163 
                      +
                      1164  if (info.table_count > 0) {
                      +
                      1165  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                      +
                      1166  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      +
                      1167 
                      +
                      1168  for (const auto& block: info.functions_with_table) {
                      +
                      1169  const auto& name = block->get_node_name();
                      +
                      1170  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                      +
                      1171  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                      +
                      1172  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                      +
                      1173  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                      +
                      1174  }
                      1175 
                      -
                      1176  for (const auto& var: info.constant_variables) {
                      -
                      1177  auto const name = var->get_name();
                      -
                      1178  auto* const value_ptr = var->get_value().get();
                      -
                      1179  double const value{value_ptr ? *value_ptr : 0};
                      -
                      1180  printer->fmt_line("{} {}{};",
                      -
                      1181  float_type,
                      -
                      1182  name,
                      -
                      1183  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      -
                      1184  codegen_global_variables.push_back(var);
                      -
                      1185  }
                      -
                      1186 
                      -
                      1187  print_sdlists_init(print_initializers);
                      -
                      1188 
                      -
                      1189  if (info.table_count > 0) {
                      -
                      1190  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                      -
                      1191  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      -
                      1192 
                      -
                      1193  for (const auto& block: info.functions_with_table) {
                      -
                      1194  const auto& name = block->get_node_name();
                      -
                      1195  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                      -
                      1196  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                      -
                      1197  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                      -
                      1198  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                      -
                      1199  }
                      -
                      1200 
                      -
                      1201  for (const auto& variable: info.table_statement_variables) {
                      -
                      1202  auto const name = "t_" + variable->get_name();
                      -
                      1203  auto const num_values = variable->get_num_values();
                      -
                      1204  if (variable->is_array()) {
                      -
                      1205  int array_len = variable->get_length();
                      -
                      1206  printer->fmt_line(
                      -
                      1207  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                      -
                      1208  } else {
                      -
                      1209  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                      -
                      1210  }
                      -
                      1211  codegen_global_variables.push_back(make_symbol(name));
                      -
                      1212  }
                      -
                      1213  }
                      -
                      1214 
                      -
                      1215  for (const auto& f: info.function_tables) {
                      -
                      1216  printer->fmt_line("void* _ptable_{}{{}};", f->get_node_name());
                      -
                      1217  codegen_global_variables.push_back(make_symbol("_ptable_" + f->get_node_name()));
                      -
                      1218  }
                      -
                      1219 
                      -
                      1220  if (info.vectorize && info.thread_data_index) {
                      -
                      1221  printer->fmt_line("ThreadDatum ext_call_thread[{}]{};",
                      -
                      1222  info.thread_data_index,
                      -
                      1223  value_initialize);
                      -
                      1224  codegen_global_variables.push_back(make_symbol("ext_call_thread"));
                      -
                      1225  }
                      -
                      1226 
                      -
                      1227  printer->pop_block(";");
                      -
                      1228 
                      -
                      1229  print_global_var_struct_assertions();
                      -
                      1230  print_global_var_struct_decl();
                      -
                      1231 }
                      -
                      1232 
                      -
                      1233 
                      -
                      1234 /**
                      -
                      1235  * Print structs that encapsulate information about scalar and
                      -
                      1236  * vector elements of type global and thread variables.
                      -
                      1237  */
                      - -
                      1239  auto variable_printer =
                      -
                      1240  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                      -
                      1241  for (const auto& variable: variables) {
                      -
                      1242  if (variable->is_array() == if_array) {
                      -
                      1243  // false => do not use the instance struct, which is not
                      -
                      1244  // defined in the global declaration that we are printing
                      -
                      1245  auto name = get_variable_name(variable->get_name(), false);
                      -
                      1246  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                      -
                      1247  auto length = variable->get_length();
                      -
                      1248  if (if_vector) {
                      -
                      1249  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                      -
                      1250  } else {
                      -
                      1251  printer->fmt_line("{{{}, &{}}},", ename, name);
                      -
                      1252  }
                      -
                      1253  }
                      -
                      1254  }
                      -
                      1255  };
                      -
                      1256 
                      -
                      1257  auto globals = info.global_variables;
                      -
                      1258  auto thread_vars = info.thread_variables;
                      +
                      1176  for (const auto& variable: info.table_statement_variables) {
                      +
                      1177  auto const name = "t_" + variable->get_name();
                      +
                      1178  auto const num_values = variable->get_num_values();
                      +
                      1179  if (variable->is_array()) {
                      +
                      1180  int array_len = variable->get_length();
                      +
                      1181  printer->fmt_line(
                      +
                      1182  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                      +
                      1183  } else {
                      +
                      1184  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                      +
                      1185  }
                      +
                      1186  codegen_global_variables.push_back(make_symbol(name));
                      +
                      1187  }
                      +
                      1188  }
                      +
                      1189 
                      +
                      1190  for (const auto& f: info.function_tables) {
                      +
                      1191  printer->fmt_line("void* _ptable_{}{{}};", f->get_node_name());
                      +
                      1192  codegen_global_variables.push_back(make_symbol("_ptable_" + f->get_node_name()));
                      +
                      1193  }
                      +
                      1194 
                      +
                      1195  if (info.vectorize && info.thread_data_index) {
                      +
                      1196  printer->fmt_line("ThreadDatum ext_call_thread[{}]{};",
                      +
                      1197  info.thread_data_index,
                      +
                      1198  value_initialize);
                      +
                      1199  codegen_global_variables.push_back(make_symbol("ext_call_thread"));
                      +
                      1200  }
                      +
                      1201 
                      +
                      1202  printer->pop_block(";");
                      +
                      1203 
                      +
                      1204  print_global_var_struct_assertions();
                      +
                      1205  print_global_var_struct_decl();
                      +
                      1206 }
                      +
                      1207 
                      +
                      1208 
                      +
                      1209 /**
                      +
                      1210  * Print structs that encapsulate information about scalar and
                      +
                      1211  * vector elements of type global and thread variables.
                      +
                      1212  */
                      + +
                      1214  auto variable_printer =
                      +
                      1215  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                      +
                      1216  for (const auto& variable: variables) {
                      +
                      1217  if (variable->is_array() == if_array) {
                      +
                      1218  // false => do not use the instance struct, which is not
                      +
                      1219  // defined in the global declaration that we are printing
                      +
                      1220  auto name = get_variable_name(variable->get_name(), false);
                      +
                      1221  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                      +
                      1222  auto length = variable->get_length();
                      +
                      1223  if (if_vector) {
                      +
                      1224  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                      +
                      1225  } else {
                      +
                      1226  printer->fmt_line("{{{}, &{}}},", ename, name);
                      +
                      1227  }
                      +
                      1228  }
                      +
                      1229  }
                      +
                      1230  };
                      +
                      1231 
                      +
                      1232  auto globals = info.global_variables;
                      +
                      1233  auto thread_vars = info.thread_variables;
                      +
                      1234 
                      +
                      1235  if (info.table_count > 0) {
                      +
                      1236  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      +
                      1237  }
                      +
                      1238 
                      +
                      1239  printer->add_newline(2);
                      +
                      1240  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                      +
                      1241  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                      +
                      1242  printer->increase_indent();
                      +
                      1243  variable_printer(globals, false, false);
                      +
                      1244  variable_printer(thread_vars, false, false);
                      +
                      1245  printer->add_line("{nullptr, nullptr}");
                      +
                      1246  printer->decrease_indent();
                      +
                      1247  printer->add_line("};");
                      +
                      1248 
                      +
                      1249  printer->add_newline(2);
                      +
                      1250  printer->add_line("/** connect global (array) variables to hoc -- */");
                      +
                      1251  printer->add_line("static DoubVec hoc_vector_double[] = {");
                      +
                      1252  printer->increase_indent();
                      +
                      1253  variable_printer(globals, true, true);
                      +
                      1254  variable_printer(thread_vars, true, true);
                      +
                      1255  printer->add_line("{nullptr, nullptr, 0}");
                      +
                      1256  printer->decrease_indent();
                      +
                      1257  printer->add_line("};");
                      +
                      1258 }
                      1259 
                      -
                      1260  if (info.table_count > 0) {
                      -
                      1261  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      -
                      1262  }
                      -
                      1263 
                      -
                      1264  printer->add_newline(2);
                      -
                      1265  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                      -
                      1266  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                      -
                      1267  printer->increase_indent();
                      -
                      1268  variable_printer(globals, false, false);
                      -
                      1269  variable_printer(thread_vars, false, false);
                      -
                      1270  printer->add_line("{nullptr, nullptr}");
                      -
                      1271  printer->decrease_indent();
                      -
                      1272  printer->add_line("};");
                      -
                      1273 
                      -
                      1274  printer->add_newline(2);
                      -
                      1275  printer->add_line("/** connect global (array) variables to hoc -- */");
                      -
                      1276  printer->add_line("static DoubVec hoc_vector_double[] = {");
                      -
                      1277  printer->increase_indent();
                      -
                      1278  variable_printer(globals, true, true);
                      -
                      1279  variable_printer(thread_vars, true, true);
                      -
                      1280  printer->add_line("{nullptr, nullptr, 0}");
                      -
                      1281  printer->decrease_indent();
                      -
                      1282  printer->add_line("};");
                      -
                      1283 }
                      -
                      1284 
                      +
                      1260 
                      +
                      1261 /**
                      +
                      1262  * Return registration type for a given BEFORE/AFTER block
                      +
                      1263  * /param block A BEFORE/AFTER block being registered
                      +
                      1264  *
                      +
                      1265  * Depending on a block type i.e. BEFORE or AFTER and also type
                      +
                      1266  * of it's associated block i.e. BREAKPOINT, INITIAL, SOLVE and
                      +
                      1267  * STEP, the registration type (as an integer) is calculated.
                      +
                      1268  * These values are then interpreted by CoreNEURON internally.
                      +
                      1269  */
                      +
                      1270 static std::string get_register_type_for_ba_block(const ast::Block* block) {
                      +
                      1271  std::string register_type{};
                      +
                      1272  BAType ba_type{};
                      +
                      1273  /// before block have value 10 and after block 20
                      +
                      1274  if (block->is_before_block()) {
                      +
                      1275  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                      +
                      1276  register_type = "BAType::Before";
                      +
                      1277  ba_type =
                      +
                      1278  dynamic_cast<const ast::BeforeBlock*>(block)->get_bablock()->get_type()->get_value();
                      +
                      1279  } else {
                      +
                      1280  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                      +
                      1281  register_type = "BAType::After";
                      +
                      1282  ba_type =
                      +
                      1283  dynamic_cast<const ast::AfterBlock*>(block)->get_bablock()->get_type()->get_value();
                      +
                      1284  }
                      1285 
                      -
                      1286 /**
                      -
                      1287  * Return registration type for a given BEFORE/AFTER block
                      -
                      1288  * /param block A BEFORE/AFTER block being registered
                      -
                      1289  *
                      -
                      1290  * Depending on a block type i.e. BEFORE or AFTER and also type
                      -
                      1291  * of it's associated block i.e. BREAKPOINT, INITIAL, SOLVE and
                      -
                      1292  * STEP, the registration type (as an integer) is calculated.
                      -
                      1293  * These values are then interpreted by CoreNEURON internally.
                      -
                      1294  */
                      -
                      1295 static std::string get_register_type_for_ba_block(const ast::Block* block) {
                      -
                      1296  std::string register_type{};
                      -
                      1297  BAType ba_type{};
                      -
                      1298  /// before block have value 10 and after block 20
                      -
                      1299  if (block->is_before_block()) {
                      -
                      1300  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                      -
                      1301  register_type = "BAType::Before";
                      -
                      1302  ba_type =
                      -
                      1303  dynamic_cast<const ast::BeforeBlock*>(block)->get_bablock()->get_type()->get_value();
                      -
                      1304  } else {
                      -
                      1305  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                      -
                      1306  register_type = "BAType::After";
                      -
                      1307  ba_type =
                      -
                      1308  dynamic_cast<const ast::AfterBlock*>(block)->get_bablock()->get_type()->get_value();
                      -
                      1309  }
                      -
                      1310 
                      -
                      1311  /// associated blocks have different values (1 to 4) based on type.
                      -
                      1312  /// These values are based on neuron/coreneuron implementation details.
                      -
                      1313  if (ba_type == BATYPE_BREAKPOINT) {
                      -
                      1314  register_type += " + BAType::Breakpoint";
                      -
                      1315  } else if (ba_type == BATYPE_SOLVE) {
                      -
                      1316  register_type += " + BAType::Solve";
                      -
                      1317  } else if (ba_type == BATYPE_INITIAL) {
                      -
                      1318  register_type += " + BAType::Initial";
                      -
                      1319  } else if (ba_type == BATYPE_STEP) {
                      -
                      1320  register_type += " + BAType::Step";
                      -
                      1321  } else {
                      -
                      1322  throw std::runtime_error("Unhandled Before/After type encountered during code generation");
                      -
                      1323  }
                      -
                      1324  return register_type;
                      -
                      1325 }
                      -
                      1326 
                      -
                      1327 
                      -
                      1328 /**
                      -
                      1329  * \details Every mod file has register function to connect with the simulator.
                      -
                      1330  * Various information about mechanism and callbacks get registered with
                      -
                      1331  * the simulator using suffix_reg() function.
                      -
                      1332  *
                      -
                      1333  * Here are details:
                      -
                      1334  * - We should exclude that callback based on the solver, watch statements.
                      -
                      1335  * - If nrn_get_mechtype is < -1 means that mechanism is not used in the
                      -
                      1336  * context of neuron execution and hence could be ignored in coreneuron
                      -
                      1337  * execution.
                      -
                      1338  * - Ions are internally defined and their types can be queried similar to
                      -
                      1339  * other mechanisms.
                      -
                      1340  * - hoc_register_var may not be needed in the context of coreneuron
                      -
                      1341  * - We assume net receive buffer is on. This is because generated code is
                      -
                      1342  * compatible for cpu as well as gpu target.
                      -
                      1343  */
                      -
                      1344 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                      - -
                      1346  printer->add_newline(2);
                      -
                      1347  printer->add_line("/** register channel with the simulator */");
                      -
                      1348  printer->fmt_push_block("void _{}_reg()", info.mod_file);
                      -
                      1349 
                      -
                      1350  // type related information
                      -
                      1351  auto suffix = add_escape_quote(info.mod_suffix);
                      -
                      1352  printer->add_newline();
                      -
                      1353  printer->fmt_line("int mech_type = nrn_get_mechtype({});", suffix);
                      -
                      1354  printer->fmt_line("{} = mech_type;", get_variable_name("mech_type", false));
                      -
                      1355  printer->push_block("if (mech_type == -1)");
                      -
                      1356  printer->add_line("return;");
                      -
                      1357  printer->pop_block();
                      -
                      1358 
                      -
                      1359  printer->add_newline();
                      -
                      1360  printer->add_line("_nrn_layout_reg(mech_type, 0);"); // 0 for SoA
                      -
                      1361 
                      -
                      1362  // register mechanism
                      -
                      1363  const auto mech_arguments = register_mechanism_arguments();
                      -
                      1364  const auto number_of_thread_objects = num_thread_objects();
                      -
                      1365  if (info.point_process) {
                      -
                      1366  printer->fmt_line("point_register_mech({}, {}, {}, {});",
                      -
                      1367  mech_arguments,
                      -
                      1368  info.constructor_node ? method_name(naming::NRN_CONSTRUCTOR_METHOD)
                      -
                      1369  : "nullptr",
                      -
                      1370  info.destructor_node ? method_name(naming::NRN_DESTRUCTOR_METHOD)
                      -
                      1371  : "nullptr",
                      -
                      1372  number_of_thread_objects);
                      -
                      1373  } else {
                      -
                      1374  printer->fmt_line("register_mech({}, {});", mech_arguments, number_of_thread_objects);
                      -
                      1375  if (info.constructor_node) {
                      -
                      1376  printer->fmt_line("register_constructor({});",
                      -
                      1377  method_name(naming::NRN_CONSTRUCTOR_METHOD));
                      -
                      1378  }
                      -
                      1379  }
                      -
                      1380 
                      -
                      1381  // types for ion
                      -
                      1382  for (const auto& ion: info.ions) {
                      -
                      1383  printer->fmt_line("{} = nrn_get_mechtype({});",
                      -
                      1384  get_variable_name(ion.name + "_type", false),
                      -
                      1385  add_escape_quote(ion.name + "_ion"));
                      -
                      1386  }
                      -
                      1387  printer->add_newline();
                      -
                      1388 
                      -
                      1389  /*
                      -
                      1390  * Register callbacks for thread allocation and cleanup. Note that thread_data_index
                      -
                      1391  * represent total number of thread used minus 1 (i.e. index of last thread).
                      -
                      1392  */
                      -
                      1393  if (info.vectorize && (info.thread_data_index != 0)) {
                      -
                      1394  // false to avoid getting the copy from the instance structure
                      -
                      1395  printer->fmt_line("thread_mem_init({});", get_variable_name("ext_call_thread", false));
                      -
                      1396  }
                      +
                      1286  /// associated blocks have different values (1 to 4) based on type.
                      +
                      1287  /// These values are based on neuron/coreneuron implementation details.
                      +
                      1288  if (ba_type == BATYPE_BREAKPOINT) {
                      +
                      1289  register_type += " + BAType::Breakpoint";
                      +
                      1290  } else if (ba_type == BATYPE_SOLVE) {
                      +
                      1291  register_type += " + BAType::Solve";
                      +
                      1292  } else if (ba_type == BATYPE_INITIAL) {
                      +
                      1293  register_type += " + BAType::Initial";
                      +
                      1294  } else if (ba_type == BATYPE_STEP) {
                      +
                      1295  register_type += " + BAType::Step";
                      +
                      1296  } else {
                      +
                      1297  throw std::runtime_error("Unhandled Before/After type encountered during code generation");
                      +
                      1298  }
                      +
                      1299  return register_type;
                      +
                      1300 }
                      +
                      1301 
                      +
                      1302 
                      +
                      1303 /**
                      +
                      1304  * \details Every mod file has register function to connect with the simulator.
                      +
                      1305  * Various information about mechanism and callbacks get registered with
                      +
                      1306  * the simulator using suffix_reg() function.
                      +
                      1307  *
                      +
                      1308  * Here are details:
                      +
                      1309  * - We should exclude that callback based on the solver, watch statements.
                      +
                      1310  * - If nrn_get_mechtype is < -1 means that mechanism is not used in the
                      +
                      1311  * context of neuron execution and hence could be ignored in coreneuron
                      +
                      1312  * execution.
                      +
                      1313  * - Ions are internally defined and their types can be queried similar to
                      +
                      1314  * other mechanisms.
                      +
                      1315  * - hoc_register_var may not be needed in the context of coreneuron
                      +
                      1316  * - We assume net receive buffer is on. This is because generated code is
                      +
                      1317  * compatible for cpu as well as gpu target.
                      +
                      1318  */
                      +
                      1319 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                      + +
                      1321  printer->add_newline(2);
                      +
                      1322  printer->add_line("/** register channel with the simulator */");
                      +
                      1323  printer->fmt_push_block("void _{}_reg()", info.mod_file);
                      +
                      1324 
                      +
                      1325  // type related information
                      +
                      1326  auto suffix = add_escape_quote(info.mod_suffix);
                      +
                      1327  printer->add_newline();
                      +
                      1328  printer->fmt_line("int mech_type = nrn_get_mechtype({});", suffix);
                      +
                      1329  printer->fmt_line("{} = mech_type;", get_variable_name("mech_type", false));
                      +
                      1330  printer->push_block("if (mech_type == -1)");
                      +
                      1331  printer->add_line("return;");
                      +
                      1332  printer->pop_block();
                      +
                      1333 
                      +
                      1334  printer->add_newline();
                      +
                      1335  printer->add_line("_nrn_layout_reg(mech_type, 0);"); // 0 for SoA
                      +
                      1336 
                      +
                      1337  // register mechanism
                      +
                      1338  const auto mech_arguments = register_mechanism_arguments();
                      +
                      1339  const auto number_of_thread_objects = num_thread_objects();
                      +
                      1340  if (info.point_process) {
                      +
                      1341  printer->fmt_line("point_register_mech({}, {}, {}, {});",
                      +
                      1342  mech_arguments,
                      +
                      1343  info.constructor_node ? method_name(naming::NRN_CONSTRUCTOR_METHOD)
                      +
                      1344  : "nullptr",
                      +
                      1345  info.destructor_node ? method_name(naming::NRN_DESTRUCTOR_METHOD)
                      +
                      1346  : "nullptr",
                      +
                      1347  number_of_thread_objects);
                      +
                      1348  } else {
                      +
                      1349  printer->fmt_line("register_mech({}, {});", mech_arguments, number_of_thread_objects);
                      +
                      1350  if (info.constructor_node) {
                      +
                      1351  printer->fmt_line("register_constructor({});",
                      +
                      1352  method_name(naming::NRN_CONSTRUCTOR_METHOD));
                      +
                      1353  }
                      +
                      1354  }
                      +
                      1355 
                      +
                      1356  // types for ion
                      +
                      1357  for (const auto& ion: info.ions) {
                      +
                      1358  printer->fmt_line("{} = nrn_get_mechtype({});",
                      +
                      1359  get_variable_name(ion.name + "_type", false),
                      +
                      1360  add_escape_quote(ion.name + "_ion"));
                      +
                      1361  }
                      +
                      1362  printer->add_newline();
                      +
                      1363 
                      +
                      1364  /*
                      +
                      1365  * Register callbacks for thread allocation and cleanup. Note that thread_data_index
                      +
                      1366  * represent total number of thread used minus 1 (i.e. index of last thread).
                      +
                      1367  */
                      +
                      1368  if (info.vectorize && (info.thread_data_index != 0)) {
                      +
                      1369  // false to avoid getting the copy from the instance structure
                      +
                      1370  printer->fmt_line("thread_mem_init({});", get_variable_name("ext_call_thread", false));
                      +
                      1371  }
                      +
                      1372 
                      +
                      1373  if (!info.thread_variables.empty()) {
                      +
                      1374  printer->fmt_line("{} = 0;", get_variable_name("thread_data_in_use"));
                      +
                      1375  }
                      +
                      1376 
                      +
                      1377  if (info.thread_callback_register) {
                      +
                      1378  printer->add_line("_nrn_thread_reg0(mech_type, thread_mem_cleanup);");
                      +
                      1379  printer->add_line("_nrn_thread_reg1(mech_type, thread_mem_init);");
                      +
                      1380  }
                      +
                      1381 
                      +
                      1382  if (info.emit_table_thread()) {
                      +
                      1383  auto name = method_name("check_table_thread");
                      +
                      1384  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", name);
                      +
                      1385  }
                      +
                      1386 
                      +
                      1387  // register read/write callbacks for pointers
                      +
                      1388  if (info.bbcore_pointer_used) {
                      +
                      1389  printer->add_line("hoc_reg_bbcore_read(mech_type, bbcore_read);");
                      +
                      1390  printer->add_line("hoc_reg_bbcore_write(mech_type, bbcore_write);");
                      +
                      1391  }
                      +
                      1392 
                      +
                      1393  // register size of double and int elements
                      +
                      1394  // clang-format off
                      +
                      1395  printer->add_line("hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size());");
                      +
                      1396  // clang-format on
                      1397 
                      -
                      1398  if (!info.thread_variables.empty()) {
                      -
                      1399  printer->fmt_line("{} = 0;", get_variable_name("thread_data_in_use"));
                      -
                      1400  }
                      -
                      1401 
                      -
                      1402  if (info.thread_callback_register) {
                      -
                      1403  printer->add_line("_nrn_thread_reg0(mech_type, thread_mem_cleanup);");
                      -
                      1404  printer->add_line("_nrn_thread_reg1(mech_type, thread_mem_init);");
                      -
                      1405  }
                      -
                      1406 
                      -
                      1407  if (info.emit_table_thread()) {
                      -
                      1408  auto name = method_name("check_table_thread");
                      -
                      1409  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", name);
                      -
                      1410  }
                      -
                      1411 
                      -
                      1412  // register read/write callbacks for pointers
                      -
                      1413  if (info.bbcore_pointer_used) {
                      -
                      1414  printer->add_line("hoc_reg_bbcore_read(mech_type, bbcore_read);");
                      -
                      1415  printer->add_line("hoc_reg_bbcore_write(mech_type, bbcore_write);");
                      -
                      1416  }
                      -
                      1417 
                      -
                      1418  // register size of double and int elements
                      -
                      1419  // clang-format off
                      -
                      1420  printer->add_line("hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size());");
                      -
                      1421  // clang-format on
                      -
                      1422 
                      -
                      1423  // register semantics for index variables
                      -
                      1424  for (auto& semantic: info.semantics) {
                      -
                      1425  auto args =
                      -
                      1426  fmt::format("mech_type, {}, {}", semantic.index, add_escape_quote(semantic.name));
                      -
                      1427  printer->fmt_line("hoc_register_dparam_semantics({});", args);
                      -
                      1428  }
                      -
                      1429 
                      -
                      1430  if (info.is_watch_used()) {
                      -
                      1431  auto watch_fun = compute_method_name(BlockType::Watch);
                      -
                      1432  printer->fmt_line("hoc_register_watch_check({}, mech_type);", watch_fun);
                      +
                      1398  // register semantics for index variables
                      +
                      1399  for (auto& semantic: info.semantics) {
                      +
                      1400  auto args =
                      +
                      1401  fmt::format("mech_type, {}, {}", semantic.index, add_escape_quote(semantic.name));
                      +
                      1402  printer->fmt_line("hoc_register_dparam_semantics({});", args);
                      +
                      1403  }
                      +
                      1404 
                      +
                      1405  if (info.is_watch_used()) {
                      +
                      1406  auto watch_fun = compute_method_name(BlockType::Watch);
                      +
                      1407  printer->fmt_line("hoc_register_watch_check({}, mech_type);", watch_fun);
                      +
                      1408  }
                      +
                      1409 
                      +
                      1410  if (info.write_concentration) {
                      +
                      1411  printer->add_line("nrn_writes_conc(mech_type, 0);");
                      +
                      1412  }
                      +
                      1413 
                      +
                      1414  // register various information for point process type
                      +
                      1415  if (info.net_event_used) {
                      +
                      1416  printer->add_line("add_nrn_has_net_event(mech_type);");
                      +
                      1417  }
                      +
                      1418  if (info.artificial_cell) {
                      +
                      1419  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                      +
                      1420  }
                      +
                      1421  if (net_receive_buffering_required()) {
                      +
                      1422  printer->fmt_line("hoc_register_net_receive_buffering({}, mech_type);",
                      +
                      1423  method_name("net_buf_receive"));
                      +
                      1424  }
                      +
                      1425  if (info.num_net_receive_parameters != 0) {
                      +
                      1426  auto net_recv_init_arg = "nullptr";
                      +
                      1427  if (info.net_receive_initial_node != nullptr) {
                      +
                      1428  net_recv_init_arg = "net_init";
                      +
                      1429  }
                      +
                      1430  printer->fmt_line("set_pnt_receive(mech_type, {}, {}, num_net_receive_args());",
                      +
                      1431  method_name("net_receive"),
                      +
                      1432  net_recv_init_arg);
                      1433  }
                      -
                      1434 
                      -
                      1435  if (info.write_concentration) {
                      -
                      1436  printer->add_line("nrn_writes_conc(mech_type, 0);");
                      -
                      1437  }
                      -
                      1438 
                      -
                      1439  // register various information for point process type
                      -
                      1440  if (info.net_event_used) {
                      -
                      1441  printer->add_line("add_nrn_has_net_event(mech_type);");
                      -
                      1442  }
                      -
                      1443  if (info.artificial_cell) {
                      -
                      1444  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                      +
                      1434  if (info.for_netcon_used) {
                      +
                      1435  // index where information about FOR_NETCON is stored in the integer array
                      +
                      1436  const auto index =
                      +
                      1437  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                      +
                      1438  return a.name == naming::FOR_NETCON_SEMANTIC;
                      +
                      1439  })->index;
                      +
                      1440  printer->fmt_line("add_nrn_fornetcons(mech_type, {});", index);
                      +
                      1441  }
                      +
                      1442 
                      +
                      1443  if (info.net_event_used || info.net_send_used) {
                      +
                      1444  printer->add_line("hoc_register_net_send_buffering(mech_type);");
                      1445  }
                      -
                      1446  if (net_receive_buffering_required()) {
                      -
                      1447  printer->fmt_line("hoc_register_net_receive_buffering({}, mech_type);",
                      -
                      1448  method_name("net_buf_receive"));
                      -
                      1449  }
                      -
                      1450  if (info.num_net_receive_parameters != 0) {
                      -
                      1451  auto net_recv_init_arg = "nullptr";
                      -
                      1452  if (info.net_receive_initial_node != nullptr) {
                      -
                      1453  net_recv_init_arg = "net_init";
                      -
                      1454  }
                      -
                      1455  printer->fmt_line("set_pnt_receive(mech_type, {}, {}, num_net_receive_args());",
                      -
                      1456  method_name("net_receive"),
                      -
                      1457  net_recv_init_arg);
                      -
                      1458  }
                      -
                      1459  if (info.for_netcon_used) {
                      -
                      1460  // index where information about FOR_NETCON is stored in the integer array
                      -
                      1461  const auto index =
                      -
                      1462  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                      -
                      1463  return a.name == naming::FOR_NETCON_SEMANTIC;
                      -
                      1464  })->index;
                      -
                      1465  printer->fmt_line("add_nrn_fornetcons(mech_type, {});", index);
                      -
                      1466  }
                      -
                      1467 
                      -
                      1468  if (info.net_event_used || info.net_send_used) {
                      -
                      1469  printer->add_line("hoc_register_net_send_buffering(mech_type);");
                      -
                      1470  }
                      -
                      1471 
                      -
                      1472  /// register all before/after blocks
                      -
                      1473  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                      -
                      1474  // register type and associated function name for the block
                      -
                      1475  const auto& block = info.before_after_blocks[i];
                      -
                      1476  std::string register_type = get_register_type_for_ba_block(block);
                      -
                      1477  std::string function_name = method_name(fmt::format("nrn_before_after_{}", i));
                      -
                      1478  printer->fmt_line("hoc_reg_ba(mech_type, {}, {});", function_name, register_type);
                      +
                      1446 
                      +
                      1447  /// register all before/after blocks
                      +
                      1448  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                      +
                      1449  // register type and associated function name for the block
                      +
                      1450  const auto& block = info.before_after_blocks[i];
                      +
                      1451  std::string register_type = get_register_type_for_ba_block(block);
                      +
                      1452  std::string function_name = method_name(fmt::format("nrn_before_after_{}", i));
                      +
                      1453  printer->fmt_line("hoc_reg_ba(mech_type, {}, {});", function_name, register_type);
                      +
                      1454  }
                      +
                      1455 
                      +
                      1456  // register variables for hoc
                      +
                      1457  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL);");
                      +
                      1458  printer->pop_block();
                      +
                      1459 }
                      +
                      1460 
                      +
                      1461 
                      + +
                      1463  if (!info.thread_callback_register) {
                      +
                      1464  return;
                      +
                      1465  }
                      +
                      1466 
                      +
                      1467  // thread_mem_init callback
                      +
                      1468  printer->add_newline(2);
                      +
                      1469  printer->add_line("/** thread memory allocation callback */");
                      +
                      1470  printer->push_block("static void thread_mem_init(ThreadDatum* thread) ");
                      +
                      1471 
                      +
                      1472  if (info.vectorize && info.derivimplicit_used()) {
                      +
                      1473  printer->fmt_line("thread[dith{}()].pval = nullptr;", info.derivimplicit_list_num);
                      +
                      1474  }
                      +
                      1475  if (info.vectorize && (info.top_local_thread_size != 0)) {
                      +
                      1476  auto length = info.top_local_thread_size;
                      +
                      1477  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                      +
                      1478  printer->fmt_line("thread[top_local_var_tid()].pval = {};", allocation);
                      1479  }
                      -
                      1480 
                      -
                      1481  // register variables for hoc
                      -
                      1482  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL);");
                      -
                      1483  printer->pop_block();
                      -
                      1484 }
                      -
                      1485 
                      -
                      1486 
                      - -
                      1488  if (!info.thread_callback_register) {
                      -
                      1489  return;
                      -
                      1490  }
                      -
                      1491 
                      -
                      1492  // thread_mem_init callback
                      +
                      1480  if (info.thread_var_data_size != 0) {
                      +
                      1481  auto length = info.thread_var_data_size;
                      +
                      1482  auto thread_data = get_variable_name("thread_data");
                      +
                      1483  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                      +
                      1484  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                      +
                      1485  printer->fmt_push_block("if ({})", thread_data_in_use);
                      +
                      1486  printer->fmt_line("thread[thread_var_tid()].pval = {};", allocation);
                      +
                      1487  printer->chain_block("else");
                      +
                      1488  printer->fmt_line("thread[thread_var_tid()].pval = {};", thread_data);
                      +
                      1489  printer->fmt_line("{} = 1;", thread_data_in_use);
                      +
                      1490  printer->pop_block();
                      +
                      1491  }
                      +
                      1492  printer->pop_block();
                      1493  printer->add_newline(2);
                      -
                      1494  printer->add_line("/** thread memory allocation callback */");
                      -
                      1495  printer->push_block("static void thread_mem_init(ThreadDatum* thread) ");
                      -
                      1496 
                      -
                      1497  if (info.vectorize && info.derivimplicit_used()) {
                      -
                      1498  printer->fmt_line("thread[dith{}()].pval = nullptr;", info.derivimplicit_list_num);
                      -
                      1499  }
                      -
                      1500  if (info.vectorize && (info.top_local_thread_size != 0)) {
                      -
                      1501  auto length = info.top_local_thread_size;
                      -
                      1502  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                      -
                      1503  printer->fmt_line("thread[top_local_var_tid()].pval = {};", allocation);
                      -
                      1504  }
                      -
                      1505  if (info.thread_var_data_size != 0) {
                      -
                      1506  auto length = info.thread_var_data_size;
                      -
                      1507  auto thread_data = get_variable_name("thread_data");
                      -
                      1508  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                      -
                      1509  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                      -
                      1510  printer->fmt_push_block("if ({})", thread_data_in_use);
                      -
                      1511  printer->fmt_line("thread[thread_var_tid()].pval = {};", allocation);
                      -
                      1512  printer->chain_block("else");
                      -
                      1513  printer->fmt_line("thread[thread_var_tid()].pval = {};", thread_data);
                      -
                      1514  printer->fmt_line("{} = 1;", thread_data_in_use);
                      -
                      1515  printer->pop_block();
                      -
                      1516  }
                      -
                      1517  printer->pop_block();
                      -
                      1518  printer->add_newline(2);
                      -
                      1519 
                      -
                      1520 
                      -
                      1521  // thread_mem_cleanup callback
                      -
                      1522  printer->add_line("/** thread memory cleanup callback */");
                      -
                      1523  printer->push_block("static void thread_mem_cleanup(ThreadDatum* thread) ");
                      +
                      1494 
                      +
                      1495 
                      +
                      1496  // thread_mem_cleanup callback
                      +
                      1497  printer->add_line("/** thread memory cleanup callback */");
                      +
                      1498  printer->push_block("static void thread_mem_cleanup(ThreadDatum* thread) ");
                      +
                      1499 
                      +
                      1500  // clang-format off
                      +
                      1501  if (info.vectorize && info.derivimplicit_used()) {
                      +
                      1502  int n = info.derivimplicit_list_num;
                      +
                      1503  printer->fmt_line("free(thread[dith{}()].pval);", n);
                      +
                      1504  printer->fmt_line("nrn_destroy_newtonspace(static_cast<NewtonSpace*>(*newtonspace{}(thread)));", n);
                      +
                      1505  }
                      +
                      1506  // clang-format on
                      +
                      1507 
                      +
                      1508  if (info.top_local_thread_size != 0) {
                      +
                      1509  auto line = "free(thread[top_local_var_tid()].pval);";
                      +
                      1510  printer->add_line(line);
                      +
                      1511  }
                      +
                      1512  if (info.thread_var_data_size != 0) {
                      +
                      1513  auto thread_data = get_variable_name("thread_data");
                      +
                      1514  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                      +
                      1515  printer->fmt_push_block("if (thread[thread_var_tid()].pval == {})", thread_data);
                      +
                      1516  printer->fmt_line("{} = 0;", thread_data_in_use);
                      +
                      1517  printer->chain_block("else");
                      +
                      1518  printer->add_line("free(thread[thread_var_tid()].pval);");
                      +
                      1519  printer->pop_block();
                      +
                      1520  }
                      +
                      1521  printer->pop_block();
                      +
                      1522 }
                      +
                      1523 
                      1524 
                      -
                      1525  // clang-format off
                      -
                      1526  if (info.vectorize && info.derivimplicit_used()) {
                      -
                      1527  int n = info.derivimplicit_list_num;
                      -
                      1528  printer->fmt_line("free(thread[dith{}()].pval);", n);
                      -
                      1529  printer->fmt_line("nrn_destroy_newtonspace(static_cast<NewtonSpace*>(*newtonspace{}(thread)));", n);
                      -
                      1530  }
                      -
                      1531  // clang-format on
                      -
                      1532 
                      -
                      1533  if (info.top_local_thread_size != 0) {
                      -
                      1534  auto line = "free(thread[top_local_var_tid()].pval);";
                      -
                      1535  printer->add_line(line);
                      -
                      1536  }
                      -
                      1537  if (info.thread_var_data_size != 0) {
                      -
                      1538  auto thread_data = get_variable_name("thread_data");
                      -
                      1539  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                      -
                      1540  printer->fmt_push_block("if (thread[thread_var_tid()].pval == {})", thread_data);
                      -
                      1541  printer->fmt_line("{} = 0;", thread_data_in_use);
                      -
                      1542  printer->chain_block("else");
                      -
                      1543  printer->add_line("free(thread[thread_var_tid()].pval);");
                      -
                      1544  printer->pop_block();
                      + +
                      1526  auto const value_initialize = print_initializers ? "{}" : "";
                      +
                      1527  auto int_type = default_int_data_type();
                      +
                      1528  printer->add_newline(2);
                      +
                      1529  printer->add_line("/** all mechanism instance variables and global variables */");
                      +
                      1530  printer->fmt_push_block("struct {} ", instance_struct());
                      +
                      1531 
                      +
                      1532  for (auto const& [var, type]: info.neuron_global_variables) {
                      +
                      1533  auto const name = var->get_name();
                      +
                      1534  printer->fmt_line("{}* {}{};",
                      +
                      1535  type,
                      +
                      1536  name,
                      +
                      1537  print_initializers ? fmt::format("{{&coreneuron::{}}}", name)
                      +
                      1538  : std::string{});
                      +
                      1539  }
                      +
                      1540  for (auto& var: codegen_float_variables) {
                      +
                      1541  const auto& name = var->get_name();
                      +
                      1542  auto type = get_range_var_float_type(var);
                      +
                      1543  auto qualifier = is_constant_variable(name) ? "const " : "";
                      +
                      1544  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                      1545  }
                      -
                      1546  printer->pop_block();
                      -
                      1547 }
                      -
                      1548 
                      -
                      1549 
                      - -
                      1551  auto const value_initialize = print_initializers ? "{}" : "";
                      -
                      1552  auto int_type = default_int_data_type();
                      -
                      1553  printer->add_newline(2);
                      -
                      1554  printer->add_line("/** all mechanism instance variables and global variables */");
                      -
                      1555  printer->fmt_push_block("struct {} ", instance_struct());
                      -
                      1556 
                      -
                      1557  for (auto const& [var, type]: info.neuron_global_variables) {
                      -
                      1558  auto const name = var->get_name();
                      -
                      1559  printer->fmt_line("{}* {}{};",
                      -
                      1560  type,
                      -
                      1561  name,
                      -
                      1562  print_initializers ? fmt::format("{{&coreneuron::{}}}", name)
                      -
                      1563  : std::string{});
                      -
                      1564  }
                      -
                      1565  for (auto& var: codegen_float_variables) {
                      -
                      1566  const auto& name = var->get_name();
                      -
                      1567  auto type = get_range_var_float_type(var);
                      -
                      1568  auto qualifier = is_constant_variable(name) ? "const " : "";
                      -
                      1569  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                      +
                      1546  for (auto& var: codegen_int_variables) {
                      +
                      1547  const auto& name = var.symbol->get_name();
                      +
                      1548  if (var.is_index || var.is_integer) {
                      +
                      1549  auto qualifier = var.is_constant ? "const " : "";
                      +
                      1550  printer->fmt_line("{}{}* {}{};", qualifier, int_type, name, value_initialize);
                      +
                      1551  } else {
                      +
                      1552  auto qualifier = var.is_constant ? "const " : "";
                      +
                      1553  auto type = var.is_vdata ? "void*" : default_float_data_type();
                      +
                      1554  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                      +
                      1555  }
                      +
                      1556  }
                      +
                      1557 
                      +
                      1558  printer->fmt_line("{}* {}{};",
                      +
                      1559  global_struct(),
                      + +
                      1561  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                      +
                      1562  : std::string{});
                      +
                      1563  printer->pop_block(";");
                      +
                      1564 }
                      +
                      1565 
                      +
                      1566 
                      + +
                      1568  if (!ion_variable_struct_required()) {
                      +
                      1569  return;
                      1570  }
                      -
                      1571  for (auto& var: codegen_int_variables) {
                      -
                      1572  const auto& name = var.symbol->get_name();
                      -
                      1573  if (var.is_index || var.is_integer) {
                      -
                      1574  auto qualifier = var.is_constant ? "const " : "";
                      -
                      1575  printer->fmt_line("{}{}* {}{};", qualifier, int_type, name, value_initialize);
                      -
                      1576  } else {
                      -
                      1577  auto qualifier = var.is_constant ? "const " : "";
                      -
                      1578  auto type = var.is_vdata ? "void*" : default_float_data_type();
                      -
                      1579  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                      -
                      1580  }
                      -
                      1581  }
                      -
                      1582 
                      -
                      1583  printer->fmt_line("{}* {}{};",
                      -
                      1584  global_struct(),
                      - -
                      1586  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                      -
                      1587  : std::string{});
                      -
                      1588  printer->pop_block(";");
                      -
                      1589 }
                      +
                      1571  printer->add_newline(2);
                      +
                      1572  printer->add_line("/** ion write variables */");
                      +
                      1573  printer->push_block("struct IonCurVar");
                      +
                      1574 
                      +
                      1575  std::string float_type = default_float_data_type();
                      +
                      1576  std::vector<std::string> members;
                      +
                      1577 
                      +
                      1578  for (auto& ion: info.ions) {
                      +
                      1579  for (auto& var: ion.writes) {
                      +
                      1580  printer->fmt_line("{} {};", float_type, var);
                      +
                      1581  members.push_back(var);
                      +
                      1582  }
                      +
                      1583  }
                      +
                      1584  for (auto& var: info.currents) {
                      +
                      1585  if (!info.is_ion_variable(var)) {
                      +
                      1586  printer->fmt_line("{} {};", float_type, var);
                      +
                      1587  members.push_back(var);
                      +
                      1588  }
                      +
                      1589  }
                      1590 
                      -
                      1591 
                      - -
                      1593  if (!ion_variable_struct_required()) {
                      -
                      1594  return;
                      -
                      1595  }
                      -
                      1596  printer->add_newline(2);
                      -
                      1597  printer->add_line("/** ion write variables */");
                      -
                      1598  printer->push_block("struct IonCurVar");
                      -
                      1599 
                      -
                      1600  std::string float_type = default_float_data_type();
                      -
                      1601  std::vector<std::string> members;
                      -
                      1602 
                      -
                      1603  for (auto& ion: info.ions) {
                      -
                      1604  for (auto& var: ion.writes) {
                      -
                      1605  printer->fmt_line("{} {};", float_type, var);
                      -
                      1606  members.push_back(var);
                      +
                      1591  print_ion_var_constructor(members);
                      +
                      1592 
                      +
                      1593  printer->pop_block(";");
                      +
                      1594 }
                      +
                      1595 
                      +
                      1596 
                      + +
                      1598  const std::vector<std::string>& members) {
                      +
                      1599  // constructor
                      +
                      1600  printer->add_newline();
                      +
                      1601  printer->add_indent();
                      +
                      1602  printer->add_text("IonCurVar() : ");
                      +
                      1603  for (int i = 0; i < members.size(); i++) {
                      +
                      1604  printer->fmt_text("{}(0)", members[i]);
                      +
                      1605  if (i + 1 < members.size()) {
                      +
                      1606  printer->add_text(", ");
                      1607  }
                      1608  }
                      -
                      1609  for (auto& var: info.currents) {
                      -
                      1610  if (!info.is_ion_variable(var)) {
                      -
                      1611  printer->fmt_line("{} {};", float_type, var);
                      -
                      1612  members.push_back(var);
                      -
                      1613  }
                      -
                      1614  }
                      -
                      1615 
                      -
                      1616  print_ion_var_constructor(members);
                      +
                      1609  printer->add_text(" {}");
                      +
                      1610  printer->add_newline();
                      +
                      1611 }
                      +
                      1612 
                      +
                      1613 
                      + +
                      1615  printer->add_line("IonCurVar ionvar;");
                      +
                      1616 }
                      1617 
                      -
                      1618  printer->pop_block(";");
                      -
                      1619 }
                      -
                      1620 
                      -
                      1621 
                      - -
                      1623  const std::vector<std::string>& members) {
                      -
                      1624  // constructor
                      -
                      1625  printer->add_newline();
                      -
                      1626  printer->add_indent();
                      -
                      1627  printer->add_text("IonCurVar() : ");
                      -
                      1628  for (int i = 0; i < members.size(); i++) {
                      -
                      1629  printer->fmt_text("{}(0)", members[i]);
                      -
                      1630  if (i + 1 < members.size()) {
                      -
                      1631  printer->add_text(", ");
                      -
                      1632  }
                      -
                      1633  }
                      -
                      1634  printer->add_text(" {}");
                      -
                      1635  printer->add_newline();
                      +
                      1618 
                      + +
                      1620  // nothing for cpu
                      +
                      1621 }
                      +
                      1622 
                      +
                      1623 
                      + +
                      1625  auto type = float_data_type();
                      +
                      1626  printer->add_newline(2);
                      +
                      1627  printer->add_line("/** allocate and setup array for range variable */");
                      +
                      1628  printer->fmt_push_block("static inline {}* setup_range_variable(double* variable, int n)",
                      +
                      1629  type);
                      +
                      1630  printer->fmt_line("{0}* data = ({0}*) mem_alloc(n, sizeof({0}));", type);
                      +
                      1631  printer->push_block("for(size_t i = 0; i < n; i++)");
                      +
                      1632  printer->add_line("data[i] = variable[i];");
                      +
                      1633  printer->pop_block();
                      +
                      1634  printer->add_line("return data;");
                      +
                      1635  printer->pop_block();
                      1636 }
                      1637 
                      -
                      1638 
                      - -
                      1640  printer->add_line("IonCurVar ionvar;");
                      -
                      1641 }
                      -
                      1642 
                      -
                      1643 
                      - -
                      1645  // nothing for cpu
                      -
                      1646 }
                      -
                      1647 
                      -
                      1648 
                      - -
                      1650  auto type = float_data_type();
                      -
                      1651  printer->add_newline(2);
                      -
                      1652  printer->add_line("/** allocate and setup array for range variable */");
                      -
                      1653  printer->fmt_push_block("static inline {}* setup_range_variable(double* variable, int n)",
                      -
                      1654  type);
                      -
                      1655  printer->fmt_line("{0}* data = ({0}*) mem_alloc(n, sizeof({0}));", type);
                      -
                      1656  printer->push_block("for(size_t i = 0; i < n; i++)");
                      -
                      1657  printer->add_line("data[i] = variable[i];");
                      -
                      1658  printer->pop_block();
                      -
                      1659  printer->add_line("return data;");
                      -
                      1660  printer->pop_block();
                      -
                      1661 }
                      -
                      1662 
                      -
                      1663 
                      -
                      1664 /**
                      -
                      1665  * \details If floating point type like "float" is specified on command line then
                      -
                      1666  * we can't turn all variables to new type. This is because certain variables
                      -
                      1667  * are pointers to internal variables (e.g. ions). Hence, we check if given
                      -
                      1668  * variable can be safely converted to new type. If so, return new type.
                      -
                      1669  */
                      - -
                      1671  // clang-format off
                      -
                      1672  auto with = NmodlType::read_ion_var
                      -
                      1673  | NmodlType::write_ion_var
                      -
                      1674  | NmodlType::pointer_var
                      -
                      1675  | NmodlType::bbcore_pointer_var
                      -
                      1676  | NmodlType::extern_neuron_variable;
                      -
                      1677  // clang-format on
                      -
                      1678  bool need_default_type = symbol->has_any_property(with);
                      -
                      1679  if (need_default_type) {
                      -
                      1680  return default_float_data_type();
                      -
                      1681  }
                      -
                      1682  return float_data_type();
                      -
                      1683 }
                      -
                      1684 
                      -
                      1685 
                      - -
                      1687  if (range_variable_setup_required()) {
                      -
                      1688  print_setup_range_variable();
                      -
                      1689  }
                      -
                      1690 
                      -
                      1691  printer->add_newline();
                      -
                      1692  printer->add_line("// Allocate instance structure");
                      -
                      1693  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                      - -
                      1695  printer->add_line("assert(!ml->instance);");
                      -
                      1696  printer->add_line("assert(!ml->global_variables);");
                      -
                      1697  printer->add_line("assert(ml->global_variables_size == 0);");
                      -
                      1698  printer->fmt_line("auto* const inst = new {}{{}};", instance_struct());
                      -
                      1699  printer->fmt_line("assert(inst->{} == &{});",
                      - -
                      1701  global_struct_instance());
                      -
                      1702  printer->add_line("ml->instance = inst;");
                      -
                      1703  printer->fmt_line("ml->global_variables = inst->{};", naming::INST_GLOBAL_MEMBER);
                      -
                      1704  printer->fmt_line("ml->global_variables_size = sizeof({});", global_struct());
                      -
                      1705  printer->pop_block();
                      -
                      1706  printer->add_newline();
                      -
                      1707 
                      -
                      1708  auto const cast_inst_and_assert_validity = [&]() {
                      -
                      1709  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                      -
                      1710  printer->add_line("assert(inst);");
                      -
                      1711  printer->fmt_line("assert(inst->{});", naming::INST_GLOBAL_MEMBER);
                      -
                      1712  printer->fmt_line("assert(inst->{} == &{});",
                      - -
                      1714  global_struct_instance());
                      -
                      1715  printer->fmt_line("assert(inst->{} == ml->global_variables);", naming::INST_GLOBAL_MEMBER);
                      -
                      1716  printer->fmt_line("assert(ml->global_variables_size == sizeof({}));", global_struct());
                      -
                      1717  };
                      -
                      1718 
                      -
                      1719  // Must come before print_instance_struct_copy_to_device and
                      -
                      1720  // print_instance_struct_delete_from_device
                      -
                      1721  print_instance_struct_transfer_routine_declarations();
                      -
                      1722 
                      -
                      1723  printer->add_line("// Deallocate the instance structure");
                      -
                      1724  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                      - -
                      1726  cast_inst_and_assert_validity();
                      -
                      1727 
                      -
                      1728  // delete random streams
                      -
                      1729  if (info.random_variables.size()) {
                      -
                      1730  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                      -
                      1731  printer->add_line("int nodecount = ml->nodecount;");
                      -
                      1732  printer->add_line("Datum* indexes = ml->pdata;");
                      -
                      1733  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      1734  for (const auto& var: info.random_variables) {
                      -
                      1735  const auto& name = get_variable_name(var->get_name());
                      -
                      1736  printer->fmt_line("nrnran123_deletestream((nrnran123_State*){});", name);
                      -
                      1737  }
                      -
                      1738  printer->pop_block();
                      -
                      1739  }
                      -
                      1740  print_instance_struct_delete_from_device();
                      -
                      1741  printer->add_multi_line(R"CODE(
                      -
                      1742  delete inst;
                      -
                      1743  ml->instance = nullptr;
                      -
                      1744  ml->global_variables = nullptr;
                      -
                      1745  ml->global_variables_size = 0;
                      -
                      1746  )CODE");
                      -
                      1747  printer->pop_block();
                      -
                      1748  printer->add_newline();
                      -
                      1749 
                      -
                      1750 
                      -
                      1751  printer->add_line("/** initialize mechanism instance variables */");
                      -
                      1752  printer->push_block("static inline void setup_instance(NrnThread* nt, Memb_list* ml)");
                      -
                      1753  cast_inst_and_assert_validity();
                      -
                      1754 
                      -
                      1755  std::string stride;
                      -
                      1756  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                      -
                      1757  stride = "*pnodecount";
                      -
                      1758 
                      -
                      1759  printer->add_line("Datum* indexes = ml->pdata;");
                      -
                      1760 
                      -
                      1761  auto const float_type = default_float_data_type();
                      -
                      1762 
                      -
                      1763  int id = 0;
                      -
                      1764  std::vector<std::string> ptr_members{naming::INST_GLOBAL_MEMBER};
                      -
                      1765  for (auto const& [var, type]: info.neuron_global_variables) {
                      -
                      1766  ptr_members.push_back(var->get_name());
                      -
                      1767  }
                      -
                      1768  ptr_members.reserve(ptr_members.size() + codegen_float_variables.size() +
                      -
                      1769  codegen_int_variables.size());
                      -
                      1770  for (auto& var: codegen_float_variables) {
                      -
                      1771  auto name = var->get_name();
                      -
                      1772  auto range_var_type = get_range_var_float_type(var);
                      -
                      1773  if (float_type == range_var_type) {
                      -
                      1774  auto const variable = fmt::format("ml->data+{}{}", id, stride);
                      -
                      1775  printer->fmt_line("inst->{} = {};", name, variable);
                      -
                      1776  } else {
                      -
                      1777  // TODO what MOD file exercises this?
                      -
                      1778  printer->fmt_line("inst->{} = setup_range_variable(ml->data+{}{}, pnodecount);",
                      -
                      1779  name,
                      -
                      1780  id,
                      -
                      1781  stride);
                      -
                      1782  }
                      -
                      1783  ptr_members.push_back(std::move(name));
                      -
                      1784  id += var->get_length();
                      -
                      1785  }
                      -
                      1786 
                      -
                      1787  for (auto& var: codegen_int_variables) {
                      -
                      1788  auto name = var.symbol->get_name();
                      -
                      1789  auto const variable = [&var]() {
                      -
                      1790  if (var.is_index || var.is_integer) {
                      -
                      1791  return "ml->pdata";
                      -
                      1792  } else if (var.is_vdata) {
                      -
                      1793  return "nt->_vdata";
                      -
                      1794  } else {
                      -
                      1795  return "nt->_data";
                      -
                      1796  }
                      -
                      1797  }();
                      -
                      1798  printer->fmt_line("inst->{} = {};", name, variable);
                      -
                      1799  ptr_members.push_back(std::move(name));
                      -
                      1800  }
                      -
                      1801  print_instance_struct_copy_to_device();
                      -
                      1802  printer->pop_block(); // setup_instance
                      -
                      1803  printer->add_newline();
                      -
                      1804 
                      -
                      1805  print_instance_struct_transfer_routines(ptr_members);
                      -
                      1806 }
                      -
                      1807 
                      -
                      1808 
                      - -
                      1810  if (info.artificial_cell) {
                      -
                      1811  printer->add_line("double v = 0.0;");
                      -
                      1812  } else {
                      -
                      1813  printer->add_line("int node_id = node_index[id];");
                      -
                      1814  printer->add_line("double v = voltage[node_id];");
                      -
                      1815  print_v_unused();
                      -
                      1816  }
                      -
                      1817 
                      -
                      1818  if (ion_variable_struct_required()) {
                      -
                      1819  printer->add_line("IonCurVar ionvar;");
                      -
                      1820  }
                      -
                      1821 
                      -
                      1822  // read ion statements
                      -
                      1823  auto read_statements = ion_read_statements(BlockType::Initial);
                      -
                      1824  for (auto& statement: read_statements) {
                      -
                      1825  printer->add_line(statement);
                      -
                      1826  }
                      -
                      1827 
                      -
                      1828  // initialize state variables (excluding ion state)
                      -
                      1829  for (auto& var: info.state_vars) {
                      -
                      1830  auto name = var->get_name();
                      -
                      1831  if (!info.is_ionic_conc(name)) {
                      -
                      1832  auto lhs = get_variable_name(name);
                      -
                      1833  auto rhs = get_variable_name(name + "0");
                      -
                      1834  if (var->is_array()) {
                      -
                      1835  for (int i = 0; i < var->get_length(); ++i) {
                      -
                      1836  printer->fmt_line("{}[{}] = {};", lhs, i, rhs);
                      -
                      1837  }
                      -
                      1838  } else {
                      -
                      1839  printer->fmt_line("{} = {};", lhs, rhs);
                      -
                      1840  }
                      -
                      1841  }
                      +
                      1638 
                      +
                      1639 /**
                      +
                      1640  * \details If floating point type like "float" is specified on command line then
                      +
                      1641  * we can't turn all variables to new type. This is because certain variables
                      +
                      1642  * are pointers to internal variables (e.g. ions). Hence, we check if given
                      +
                      1643  * variable can be safely converted to new type. If so, return new type.
                      +
                      1644  */
                      + +
                      1646  // clang-format off
                      +
                      1647  auto with = NmodlType::read_ion_var
                      +
                      1648  | NmodlType::write_ion_var
                      +
                      1649  | NmodlType::pointer_var
                      +
                      1650  | NmodlType::bbcore_pointer_var
                      +
                      1651  | NmodlType::extern_neuron_variable;
                      +
                      1652  // clang-format on
                      +
                      1653  bool need_default_type = symbol->has_any_property(with);
                      +
                      1654  if (need_default_type) {
                      +
                      1655  return default_float_data_type();
                      +
                      1656  }
                      +
                      1657  return float_data_type();
                      +
                      1658 }
                      +
                      1659 
                      +
                      1660 
                      + +
                      1662  if (range_variable_setup_required()) {
                      +
                      1663  print_setup_range_variable();
                      +
                      1664  }
                      +
                      1665 
                      +
                      1666  printer->add_newline();
                      +
                      1667  printer->add_line("// Allocate instance structure");
                      +
                      1668  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                      + +
                      1670  printer->add_line("assert(!ml->instance);");
                      +
                      1671  printer->add_line("assert(!ml->global_variables);");
                      +
                      1672  printer->add_line("assert(ml->global_variables_size == 0);");
                      +
                      1673  printer->fmt_line("auto* const inst = new {}{{}};", instance_struct());
                      +
                      1674  printer->fmt_line("assert(inst->{} == &{});",
                      + +
                      1676  global_struct_instance());
                      +
                      1677  printer->add_line("ml->instance = inst;");
                      +
                      1678  printer->fmt_line("ml->global_variables = inst->{};", naming::INST_GLOBAL_MEMBER);
                      +
                      1679  printer->fmt_line("ml->global_variables_size = sizeof({});", global_struct());
                      +
                      1680  printer->pop_block();
                      +
                      1681  printer->add_newline();
                      +
                      1682 
                      +
                      1683  auto const cast_inst_and_assert_validity = [&]() {
                      +
                      1684  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                      +
                      1685  printer->add_line("assert(inst);");
                      +
                      1686  printer->fmt_line("assert(inst->{});", naming::INST_GLOBAL_MEMBER);
                      +
                      1687  printer->fmt_line("assert(inst->{} == &{});",
                      + +
                      1689  global_struct_instance());
                      +
                      1690  printer->fmt_line("assert(inst->{} == ml->global_variables);", naming::INST_GLOBAL_MEMBER);
                      +
                      1691  printer->fmt_line("assert(ml->global_variables_size == sizeof({}));", global_struct());
                      +
                      1692  };
                      +
                      1693 
                      +
                      1694  // Must come before print_instance_struct_copy_to_device and
                      +
                      1695  // print_instance_struct_delete_from_device
                      +
                      1696  print_instance_struct_transfer_routine_declarations();
                      +
                      1697 
                      +
                      1698  printer->add_line("// Deallocate the instance structure");
                      +
                      1699  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                      + +
                      1701  cast_inst_and_assert_validity();
                      +
                      1702 
                      +
                      1703  // delete random streams
                      +
                      1704  if (info.random_variables.size()) {
                      +
                      1705  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                      +
                      1706  printer->add_line("int nodecount = ml->nodecount;");
                      +
                      1707  printer->add_line("Datum* indexes = ml->pdata;");
                      +
                      1708  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1709  for (const auto& var: info.random_variables) {
                      +
                      1710  const auto& name = get_variable_name(var->get_name());
                      +
                      1711  printer->fmt_line("nrnran123_deletestream((nrnran123_State*){});", name);
                      +
                      1712  }
                      +
                      1713  printer->pop_block();
                      +
                      1714  }
                      +
                      1715  print_instance_struct_delete_from_device();
                      +
                      1716  printer->add_multi_line(R"CODE(
                      +
                      1717  delete inst;
                      +
                      1718  ml->instance = nullptr;
                      +
                      1719  ml->global_variables = nullptr;
                      +
                      1720  ml->global_variables_size = 0;
                      +
                      1721  )CODE");
                      +
                      1722  printer->pop_block();
                      +
                      1723  printer->add_newline();
                      +
                      1724 
                      +
                      1725 
                      +
                      1726  printer->add_line("/** initialize mechanism instance variables */");
                      +
                      1727  printer->push_block("static inline void setup_instance(NrnThread* nt, Memb_list* ml)");
                      +
                      1728  cast_inst_and_assert_validity();
                      +
                      1729 
                      +
                      1730  std::string stride;
                      +
                      1731  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                      +
                      1732  stride = "*pnodecount";
                      +
                      1733 
                      +
                      1734  printer->add_line("Datum* indexes = ml->pdata;");
                      +
                      1735 
                      +
                      1736  auto const float_type = default_float_data_type();
                      +
                      1737 
                      +
                      1738  int id = 0;
                      +
                      1739  std::vector<std::string> ptr_members{naming::INST_GLOBAL_MEMBER};
                      +
                      1740  for (auto const& [var, type]: info.neuron_global_variables) {
                      +
                      1741  ptr_members.push_back(var->get_name());
                      +
                      1742  }
                      +
                      1743  ptr_members.reserve(ptr_members.size() + codegen_float_variables.size() +
                      +
                      1744  codegen_int_variables.size());
                      +
                      1745  for (auto& var: codegen_float_variables) {
                      +
                      1746  auto name = var->get_name();
                      +
                      1747  auto range_var_type = get_range_var_float_type(var);
                      +
                      1748  if (float_type == range_var_type) {
                      +
                      1749  auto const variable = fmt::format("ml->data+{}{}", id, stride);
                      +
                      1750  printer->fmt_line("inst->{} = {};", name, variable);
                      +
                      1751  } else {
                      +
                      1752  // TODO what MOD file exercises this?
                      +
                      1753  printer->fmt_line("inst->{} = setup_range_variable(ml->data+{}{}, pnodecount);",
                      +
                      1754  name,
                      +
                      1755  id,
                      +
                      1756  stride);
                      +
                      1757  }
                      +
                      1758  ptr_members.push_back(std::move(name));
                      +
                      1759  id += var->get_length();
                      +
                      1760  }
                      +
                      1761 
                      +
                      1762  for (auto& var: codegen_int_variables) {
                      +
                      1763  auto name = var.symbol->get_name();
                      +
                      1764  auto const variable = [&var]() {
                      +
                      1765  if (var.is_index || var.is_integer) {
                      +
                      1766  return "ml->pdata";
                      +
                      1767  } else if (var.is_vdata) {
                      +
                      1768  return "nt->_vdata";
                      +
                      1769  } else {
                      +
                      1770  return "nt->_data";
                      +
                      1771  }
                      +
                      1772  }();
                      +
                      1773  printer->fmt_line("inst->{} = {};", name, variable);
                      +
                      1774  ptr_members.push_back(std::move(name));
                      +
                      1775  }
                      +
                      1776  print_instance_struct_copy_to_device();
                      +
                      1777  printer->pop_block(); // setup_instance
                      +
                      1778  printer->add_newline();
                      +
                      1779 
                      +
                      1780  print_instance_struct_transfer_routines(ptr_members);
                      +
                      1781 }
                      +
                      1782 
                      +
                      1783 
                      + +
                      1785  if (info.artificial_cell) {
                      +
                      1786  printer->add_line("double v = 0.0;");
                      +
                      1787  } else {
                      +
                      1788  printer->add_line("int node_id = node_index[id];");
                      +
                      1789  printer->add_line("double v = voltage[node_id];");
                      +
                      1790  print_v_unused();
                      +
                      1791  }
                      +
                      1792 
                      +
                      1793  if (ion_variable_struct_required()) {
                      +
                      1794  printer->add_line("IonCurVar ionvar;");
                      +
                      1795  }
                      +
                      1796 
                      +
                      1797  // read ion statements
                      +
                      1798  auto read_statements = ion_read_statements(BlockType::Initial);
                      +
                      1799  for (auto& statement: read_statements) {
                      +
                      1800  printer->add_line(statement);
                      +
                      1801  }
                      +
                      1802 
                      +
                      1803  // initialize state variables (excluding ion state)
                      +
                      1804  for (auto& var: info.state_vars) {
                      +
                      1805  auto name = var->get_name();
                      +
                      1806  if (!info.is_ionic_conc(name)) {
                      +
                      1807  auto lhs = get_variable_name(name);
                      +
                      1808  auto rhs = get_variable_name(name + "0");
                      +
                      1809  if (var->is_array()) {
                      +
                      1810  for (int i = 0; i < var->get_length(); ++i) {
                      +
                      1811  printer->fmt_line("{}[{}] = {};", lhs, i, rhs);
                      +
                      1812  }
                      +
                      1813  } else {
                      +
                      1814  printer->fmt_line("{} = {};", lhs, rhs);
                      +
                      1815  }
                      +
                      1816  }
                      +
                      1817  }
                      +
                      1818 
                      +
                      1819  // initial block
                      +
                      1820  if (node != nullptr) {
                      +
                      1821  const auto& block = node->get_statement_block();
                      +
                      1822  print_statement_block(*block, false, false);
                      +
                      1823  }
                      +
                      1824 
                      +
                      1825  // write ion statements
                      +
                      1826  auto write_statements = ion_write_statements(BlockType::Initial);
                      +
                      1827  for (auto& statement: write_statements) {
                      +
                      1828  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                      +
                      1829  printer->add_line(text);
                      +
                      1830  }
                      +
                      1831 }
                      +
                      1832 
                      +
                      1833 
                      + +
                      1835  BlockType type,
                      +
                      1836  const std::string& function_name) {
                      +
                      1837  std::string method;
                      +
                      1838  if (function_name.empty()) {
                      +
                      1839  method = compute_method_name(type);
                      +
                      1840  } else {
                      +
                      1841  method = function_name;
                      1842  }
                      -
                      1843 
                      -
                      1844  // initial block
                      -
                      1845  if (node != nullptr) {
                      -
                      1846  const auto& block = node->get_statement_block();
                      -
                      1847  print_statement_block(*block, false, false);
                      +
                      1843  auto args = "NrnThread* nt, Memb_list* ml, int type";
                      +
                      1844 
                      +
                      1845  // watch statement function doesn't have type argument
                      +
                      1846  if (type == BlockType::Watch) {
                      +
                      1847  args = "NrnThread* nt, Memb_list* ml";
                      1848  }
                      1849 
                      -
                      1850  // write ion statements
                      -
                      1851  auto write_statements = ion_write_statements(BlockType::Initial);
                      -
                      1852  for (auto& statement: write_statements) {
                      -
                      1853  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                      -
                      1854  printer->add_line(text);
                      -
                      1855  }
                      -
                      1856 }
                      -
                      1857 
                      -
                      1858 
                      - -
                      1860  BlockType type,
                      -
                      1861  const std::string& function_name) {
                      -
                      1862  std::string method;
                      -
                      1863  if (function_name.empty()) {
                      -
                      1864  method = compute_method_name(type);
                      -
                      1865  } else {
                      -
                      1866  method = function_name;
                      -
                      1867  }
                      -
                      1868  auto args = "NrnThread* nt, Memb_list* ml, int type";
                      -
                      1869 
                      -
                      1870  // watch statement function doesn't have type argument
                      -
                      1871  if (type == BlockType::Watch) {
                      -
                      1872  args = "NrnThread* nt, Memb_list* ml";
                      +
                      1850  print_global_method_annotation();
                      +
                      1851  printer->fmt_push_block("void {}({})", method, args);
                      +
                      1852  if (type != BlockType::Destructor && type != BlockType::Constructor) {
                      +
                      1853  // We do not (currently) support DESTRUCTOR and CONSTRUCTOR blocks
                      +
                      1854  // running anything on the GPU.
                      +
                      1855  print_kernel_data_present_annotation_block_begin();
                      +
                      1856  } else {
                      +
                      1857  /// TODO: Remove this when the code generation is propery done
                      +
                      1858  /// Related to https://github.com/BlueBrain/nmodl/issues/692
                      +
                      1859  printer->add_line("#ifndef CORENEURON_BUILD");
                      +
                      1860  }
                      +
                      1861  printer->add_multi_line(R"CODE(
                      +
                      1862  int nodecount = ml->nodecount;
                      +
                      1863  int pnodecount = ml->_nodecount_padded;
                      +
                      1864  const int* node_index = ml->nodeindices;
                      +
                      1865  double* data = ml->data;
                      +
                      1866  const double* voltage = nt->_actual_v;
                      +
                      1867  )CODE");
                      +
                      1868 
                      +
                      1869  if (type == BlockType::Equation) {
                      +
                      1870  printer->add_line("double* vec_rhs = nt->_actual_rhs;");
                      +
                      1871  printer->add_line("double* vec_d = nt->_actual_d;");
                      +
                      1872  print_rhs_d_shadow_variables();
                      1873  }
                      -
                      1874 
                      -
                      1875  print_global_method_annotation();
                      -
                      1876  printer->fmt_push_block("void {}({})", method, args);
                      -
                      1877  if (type != BlockType::Destructor && type != BlockType::Constructor) {
                      -
                      1878  // We do not (currently) support DESTRUCTOR and CONSTRUCTOR blocks
                      -
                      1879  // running anything on the GPU.
                      -
                      1880  print_kernel_data_present_annotation_block_begin();
                      -
                      1881  } else {
                      -
                      1882  /// TODO: Remove this when the code generation is propery done
                      -
                      1883  /// Related to https://github.com/BlueBrain/nmodl/issues/692
                      -
                      1884  printer->add_line("#ifndef CORENEURON_BUILD");
                      -
                      1885  }
                      -
                      1886  printer->add_multi_line(R"CODE(
                      -
                      1887  int nodecount = ml->nodecount;
                      -
                      1888  int pnodecount = ml->_nodecount_padded;
                      -
                      1889  const int* node_index = ml->nodeindices;
                      -
                      1890  double* data = ml->data;
                      -
                      1891  const double* voltage = nt->_actual_v;
                      -
                      1892  )CODE");
                      -
                      1893 
                      -
                      1894  if (type == BlockType::Equation) {
                      -
                      1895  printer->add_line("double* vec_rhs = nt->_actual_rhs;");
                      -
                      1896  printer->add_line("double* vec_d = nt->_actual_d;");
                      -
                      1897  print_rhs_d_shadow_variables();
                      -
                      1898  }
                      -
                      1899  printer->add_line("Datum* indexes = ml->pdata;");
                      -
                      1900  printer->add_line("ThreadDatum* thread = ml->_thread;");
                      -
                      1901 
                      -
                      1902  if (type == BlockType::Initial) {
                      -
                      1903  printer->add_newline();
                      -
                      1904  printer->add_line("setup_instance(nt, ml);");
                      -
                      1905  }
                      -
                      1906  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                      -
                      1907  printer->add_newline(1);
                      -
                      1908 }
                      +
                      1874  printer->add_line("Datum* indexes = ml->pdata;");
                      +
                      1875  printer->add_line("ThreadDatum* thread = ml->_thread;");
                      +
                      1876 
                      +
                      1877  if (type == BlockType::Initial) {
                      +
                      1878  printer->add_newline();
                      +
                      1879  printer->add_line("setup_instance(nt, ml);");
                      +
                      1880  }
                      +
                      1881  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                      +
                      1882  printer->add_newline(1);
                      +
                      1883 }
                      +
                      1884 
                      + +
                      1886  printer->add_newline(2);
                      +
                      1887  printer->add_line("/** initialize channel */");
                      +
                      1888 
                      +
                      1889  print_global_function_common_code(BlockType::Initial);
                      +
                      1890  if (info.derivimplicit_used()) {
                      +
                      1891  printer->add_newline();
                      +
                      1892  int nequation = info.num_equations;
                      +
                      1893  int list_num = info.derivimplicit_list_num;
                      +
                      1894  // clang-format off
                      +
                      1895  printer->fmt_line("int& deriv_advance_flag = *deriv{}_advance(thread);", list_num);
                      +
                      1896  printer->add_line("deriv_advance_flag = 0;");
                      +
                      1897  print_deriv_advance_flag_transfer_to_device();
                      +
                      1898  printer->fmt_line("auto ns = newtonspace{}(thread);", list_num);
                      +
                      1899  printer->fmt_line("auto& th = thread[dith{}()];", list_num);
                      +
                      1900  printer->push_block("if (*ns == nullptr)");
                      +
                      1901  printer->fmt_line("int vec_size = 2*{}*pnodecount*sizeof(double);", nequation);
                      +
                      1902  printer->fmt_line("double* vec = makevector(vec_size);", nequation);
                      +
                      1903  printer->fmt_line("th.pval = vec;", list_num);
                      +
                      1904  printer->fmt_line("*ns = nrn_cons_newtonspace({}, pnodecount);", nequation);
                      +
                      1905  print_newtonspace_transfer_to_device();
                      +
                      1906  printer->pop_block();
                      +
                      1907  // clang-format on
                      +
                      1908  }
                      1909 
                      - -
                      1911  printer->add_newline(2);
                      -
                      1912  printer->add_line("/** initialize channel */");
                      -
                      1913 
                      -
                      1914  print_global_function_common_code(BlockType::Initial);
                      -
                      1915  if (info.derivimplicit_used()) {
                      -
                      1916  printer->add_newline();
                      -
                      1917  int nequation = info.num_equations;
                      -
                      1918  int list_num = info.derivimplicit_list_num;
                      -
                      1919  // clang-format off
                      -
                      1920  printer->fmt_line("int& deriv_advance_flag = *deriv{}_advance(thread);", list_num);
                      -
                      1921  printer->add_line("deriv_advance_flag = 0;");
                      -
                      1922  print_deriv_advance_flag_transfer_to_device();
                      -
                      1923  printer->fmt_line("auto ns = newtonspace{}(thread);", list_num);
                      -
                      1924  printer->fmt_line("auto& th = thread[dith{}()];", list_num);
                      -
                      1925  printer->push_block("if (*ns == nullptr)");
                      -
                      1926  printer->fmt_line("int vec_size = 2*{}*pnodecount*sizeof(double);", nequation);
                      -
                      1927  printer->fmt_line("double* vec = makevector(vec_size);", nequation);
                      -
                      1928  printer->fmt_line("th.pval = vec;", list_num);
                      -
                      1929  printer->fmt_line("*ns = nrn_cons_newtonspace({}, pnodecount);", nequation);
                      -
                      1930  print_newtonspace_transfer_to_device();
                      -
                      1931  printer->pop_block();
                      -
                      1932  // clang-format on
                      +
                      1910  // update global variable as those might be updated via python/hoc API
                      +
                      1911  // NOTE: CoreNEURON has enough information to do this on its own, which
                      +
                      1912  // would be neater.
                      +
                      1913  print_global_variable_device_update_annotation();
                      +
                      1914 
                      +
                      1915  if (skip_init_check) {
                      +
                      1916  printer->push_block("if (_nrn_skip_initmodel == 0)");
                      +
                      1917  }
                      +
                      1918 
                      +
                      1919  if (!info.changed_dt.empty()) {
                      +
                      1920  printer->fmt_line("double _save_prev_dt = {};",
                      +
                      1921  get_variable_name(naming::NTHREAD_DT_VARIABLE));
                      +
                      1922  printer->fmt_line("{} = {};",
                      +
                      1923  get_variable_name(naming::NTHREAD_DT_VARIABLE),
                      +
                      1924  info.changed_dt);
                      +
                      1925  print_dt_update_to_device();
                      +
                      1926  }
                      +
                      1927 
                      +
                      1928  print_channel_iteration_block_parallel_hint(BlockType::Initial, info.initial_node);
                      +
                      1929  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1930 
                      +
                      1931  if (info.net_receive_node != nullptr) {
                      +
                      1932  printer->fmt_line("{} = -1e20;", get_variable_name("tsave"));
                      1933  }
                      1934 
                      -
                      1935  // update global variable as those might be updated via python/hoc API
                      -
                      1936  // NOTE: CoreNEURON has enough information to do this on its own, which
                      -
                      1937  // would be neater.
                      -
                      1938  print_global_variable_device_update_annotation();
                      -
                      1939 
                      -
                      1940  if (skip_init_check) {
                      -
                      1941  printer->push_block("if (_nrn_skip_initmodel == 0)");
                      -
                      1942  }
                      -
                      1943 
                      -
                      1944  if (!info.changed_dt.empty()) {
                      -
                      1945  printer->fmt_line("double _save_prev_dt = {};",
                      -
                      1946  get_variable_name(naming::NTHREAD_DT_VARIABLE));
                      -
                      1947  printer->fmt_line("{} = {};",
                      -
                      1948  get_variable_name(naming::NTHREAD_DT_VARIABLE),
                      -
                      1949  info.changed_dt);
                      -
                      1950  print_dt_update_to_device();
                      -
                      1951  }
                      -
                      1952 
                      -
                      1953  print_channel_iteration_block_parallel_hint(BlockType::Initial, info.initial_node);
                      -
                      1954  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      1955 
                      -
                      1956  if (info.net_receive_node != nullptr) {
                      -
                      1957  printer->fmt_line("{} = -1e20;", get_variable_name("tsave"));
                      -
                      1958  }
                      +
                      1935  print_initial_block(info.initial_node);
                      +
                      1936  printer->pop_block();
                      +
                      1937 
                      +
                      1938  if (!info.changed_dt.empty()) {
                      +
                      1939  printer->fmt_line("{} = _save_prev_dt;", get_variable_name(naming::NTHREAD_DT_VARIABLE));
                      +
                      1940  print_dt_update_to_device();
                      +
                      1941  }
                      +
                      1942 
                      +
                      1943  printer->pop_block();
                      +
                      1944 
                      +
                      1945  if (info.derivimplicit_used()) {
                      +
                      1946  printer->add_line("deriv_advance_flag = 1;");
                      +
                      1947  print_deriv_advance_flag_transfer_to_device();
                      +
                      1948  }
                      +
                      1949 
                      +
                      1950  if (info.net_send_used && !info.artificial_cell) {
                      +
                      1951  print_send_event_move();
                      +
                      1952  }
                      +
                      1953 
                      +
                      1954  print_kernel_data_present_annotation_block_end();
                      +
                      1955  if (skip_init_check) {
                      +
                      1956  printer->pop_block();
                      +
                      1957  }
                      +
                      1958 }
                      1959 
                      -
                      1960  print_initial_block(info.initial_node);
                      -
                      1961  printer->pop_block();
                      -
                      1962 
                      -
                      1963  if (!info.changed_dt.empty()) {
                      -
                      1964  printer->fmt_line("{} = _save_prev_dt;", get_variable_name(naming::NTHREAD_DT_VARIABLE));
                      -
                      1965  print_dt_update_to_device();
                      -
                      1966  }
                      -
                      1967 
                      -
                      1968  printer->pop_block();
                      -
                      1969 
                      -
                      1970  if (info.derivimplicit_used()) {
                      -
                      1971  printer->add_line("deriv_advance_flag = 1;");
                      -
                      1972  print_deriv_advance_flag_transfer_to_device();
                      -
                      1973  }
                      -
                      1974 
                      -
                      1975  if (info.net_send_used && !info.artificial_cell) {
                      -
                      1976  print_send_event_move();
                      -
                      1977  }
                      -
                      1978 
                      -
                      1979  print_kernel_data_present_annotation_block_end();
                      -
                      1980  if (skip_init_check) {
                      -
                      1981  printer->pop_block();
                      -
                      1982  }
                      -
                      1983 }
                      -
                      1984 
                      - -
                      1986  size_t block_id) {
                      -
                      1987  std::string ba_type;
                      -
                      1988  std::shared_ptr<ast::BABlock> ba_block;
                      + +
                      1961  size_t block_id) {
                      +
                      1962  std::string ba_type;
                      +
                      1963  std::shared_ptr<ast::BABlock> ba_block;
                      +
                      1964 
                      +
                      1965  if (node->is_before_block()) {
                      +
                      1966  ba_block = dynamic_cast<const ast::BeforeBlock*>(node)->get_bablock();
                      +
                      1967  ba_type = "BEFORE";
                      +
                      1968  } else {
                      +
                      1969  ba_block = dynamic_cast<const ast::AfterBlock*>(node)->get_bablock();
                      +
                      1970  ba_type = "AFTER";
                      +
                      1971  }
                      +
                      1972 
                      +
                      1973  std::string ba_block_type = ba_block->get_type()->eval();
                      +
                      1974 
                      +
                      1975  /// name of the before/after function
                      +
                      1976  std::string function_name = method_name(fmt::format("nrn_before_after_{}", block_id));
                      +
                      1977 
                      +
                      1978  /// print common function code like init/state/current
                      +
                      1979  printer->add_newline(2);
                      +
                      1980  printer->fmt_line("/** {} of block type {} # {} */", ba_type, ba_block_type, block_id);
                      +
                      1981  print_global_function_common_code(BlockType::BeforeAfter, function_name);
                      +
                      1982 
                      +
                      1983  print_channel_iteration_block_parallel_hint(BlockType::BeforeAfter, node);
                      +
                      1984  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1985 
                      +
                      1986  printer->add_line("int node_id = node_index[id];");
                      +
                      1987  printer->add_line("double v = voltage[node_id];");
                      +
                      1988  print_v_unused();
                      1989 
                      -
                      1990  if (node->is_before_block()) {
                      -
                      1991  ba_block = dynamic_cast<const ast::BeforeBlock*>(node)->get_bablock();
                      -
                      1992  ba_type = "BEFORE";
                      -
                      1993  } else {
                      -
                      1994  ba_block = dynamic_cast<const ast::AfterBlock*>(node)->get_bablock();
                      -
                      1995  ba_type = "AFTER";
                      -
                      1996  }
                      -
                      1997 
                      -
                      1998  std::string ba_block_type = ba_block->get_type()->eval();
                      -
                      1999 
                      -
                      2000  /// name of the before/after function
                      -
                      2001  std::string function_name = method_name(fmt::format("nrn_before_after_{}", block_id));
                      -
                      2002 
                      -
                      2003  /// print common function code like init/state/current
                      -
                      2004  printer->add_newline(2);
                      -
                      2005  printer->fmt_line("/** {} of block type {} # {} */", ba_type, ba_block_type, block_id);
                      -
                      2006  print_global_function_common_code(BlockType::BeforeAfter, function_name);
                      -
                      2007 
                      -
                      2008  print_channel_iteration_block_parallel_hint(BlockType::BeforeAfter, node);
                      -
                      2009  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      2010 
                      -
                      2011  printer->add_line("int node_id = node_index[id];");
                      -
                      2012  printer->add_line("double v = voltage[node_id];");
                      -
                      2013  print_v_unused();
                      -
                      2014 
                      -
                      2015  // read ion statements
                      -
                      2016  const auto& read_statements = ion_read_statements(BlockType::Equation);
                      -
                      2017  for (auto& statement: read_statements) {
                      -
                      2018  printer->add_line(statement);
                      -
                      2019  }
                      -
                      2020 
                      -
                      2021  /// print main body
                      -
                      2022  printer->add_indent();
                      -
                      2023  print_statement_block(*ba_block->get_statement_block());
                      -
                      2024  printer->add_newline();
                      +
                      1990  // read ion statements
                      +
                      1991  const auto& read_statements = ion_read_statements(BlockType::Equation);
                      +
                      1992  for (auto& statement: read_statements) {
                      +
                      1993  printer->add_line(statement);
                      +
                      1994  }
                      +
                      1995 
                      +
                      1996  /// print main body
                      +
                      1997  printer->add_indent();
                      +
                      1998  print_statement_block(*ba_block->get_statement_block());
                      +
                      1999  printer->add_newline();
                      +
                      2000 
                      +
                      2001  // write ion statements
                      +
                      2002  const auto& write_statements = ion_write_statements(BlockType::Equation);
                      +
                      2003  for (auto& statement: write_statements) {
                      +
                      2004  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      2005  printer->add_line(text);
                      +
                      2006  }
                      +
                      2007 
                      +
                      2008  /// loop end including data annotation block
                      +
                      2009  printer->pop_block();
                      +
                      2010  printer->pop_block();
                      +
                      2011  print_kernel_data_present_annotation_block_end();
                      +
                      2012 }
                      +
                      2013 
                      + +
                      2015  printer->add_newline(2);
                      +
                      2016  print_global_function_common_code(BlockType::Constructor);
                      +
                      2017  if (info.constructor_node != nullptr) {
                      +
                      2018  const auto& block = info.constructor_node->get_statement_block();
                      +
                      2019  print_statement_block(*block, false, false);
                      +
                      2020  }
                      +
                      2021  printer->add_line("#endif");
                      +
                      2022  printer->pop_block();
                      +
                      2023 }
                      +
                      2024 
                      2025 
                      -
                      2026  // write ion statements
                      -
                      2027  const auto& write_statements = ion_write_statements(BlockType::Equation);
                      -
                      2028  for (auto& statement: write_statements) {
                      -
                      2029  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      2030  printer->add_line(text);
                      -
                      2031  }
                      -
                      2032 
                      -
                      2033  /// loop end including data annotation block
                      -
                      2034  printer->pop_block();
                      -
                      2035  printer->pop_block();
                      -
                      2036  print_kernel_data_present_annotation_block_end();
                      -
                      2037 }
                      -
                      2038 
                      - -
                      2040  printer->add_newline(2);
                      -
                      2041  print_global_function_common_code(BlockType::Constructor);
                      -
                      2042  if (info.constructor_node != nullptr) {
                      -
                      2043  const auto& block = info.constructor_node->get_statement_block();
                      -
                      2044  print_statement_block(*block, false, false);
                      -
                      2045  }
                      -
                      2046  printer->add_line("#endif");
                      -
                      2047  printer->pop_block();
                      -
                      2048 }
                      -
                      2049 
                      -
                      2050 
                      - -
                      2052  printer->add_newline(2);
                      -
                      2053  print_global_function_common_code(BlockType::Destructor);
                      -
                      2054  if (info.destructor_node != nullptr) {
                      -
                      2055  const auto& block = info.destructor_node->get_statement_block();
                      -
                      2056  print_statement_block(*block, false, false);
                      -
                      2057  }
                      -
                      2058  printer->add_line("#endif");
                      -
                      2059  printer->pop_block();
                      -
                      2060 }
                      -
                      2061 
                      -
                      2062 
                      - -
                      2064  printer->add_newline(2);
                      -
                      2065  auto method = method_name(naming::NRN_ALLOC_METHOD);
                      -
                      2066  printer->fmt_push_block("static void {}(double* data, Datum* indexes, int type)", method);
                      -
                      2067  printer->add_line("// do nothing");
                      -
                      2068  printer->pop_block();
                      -
                      2069 }
                      -
                      2070 
                      -
                      2071 /**
                      -
                      2072  * \todo Number of watch could be more than number of statements
                      -
                      2073  * according to grammar. Check if this is correctly handled in neuron
                      -
                      2074  * and coreneuron.
                      -
                      2075  */
                      - -
                      2077  if (info.watch_statements.empty()) {
                      -
                      2078  return;
                      -
                      2079  }
                      + +
                      2027  printer->add_newline(2);
                      +
                      2028  print_global_function_common_code(BlockType::Destructor);
                      +
                      2029  if (info.destructor_node != nullptr) {
                      +
                      2030  const auto& block = info.destructor_node->get_statement_block();
                      +
                      2031  print_statement_block(*block, false, false);
                      +
                      2032  }
                      +
                      2033  printer->add_line("#endif");
                      +
                      2034  printer->pop_block();
                      +
                      2035 }
                      +
                      2036 
                      +
                      2037 
                      + +
                      2039  printer->add_newline(2);
                      +
                      2040  auto method = method_name(naming::NRN_ALLOC_METHOD);
                      +
                      2041  printer->fmt_push_block("static void {}(double* data, Datum* indexes, int type)", method);
                      +
                      2042  printer->add_line("// do nothing");
                      +
                      2043  printer->pop_block();
                      +
                      2044 }
                      +
                      2045 
                      +
                      2046 /**
                      +
                      2047  * \todo Number of watch could be more than number of statements
                      +
                      2048  * according to grammar. Check if this is correctly handled in neuron
                      +
                      2049  * and coreneuron.
                      +
                      2050  */
                      + +
                      2052  if (info.watch_statements.empty()) {
                      +
                      2053  return;
                      +
                      2054  }
                      +
                      2055 
                      +
                      2056  printer->add_newline(2);
                      +
                      2057  auto inst = fmt::format("{}* inst", instance_struct());
                      +
                      2058 
                      +
                      2059  printer->fmt_push_block(
                      +
                      2060  "static void nrn_watch_activate({}, int id, int pnodecount, int watch_id, "
                      +
                      2061  "double v, bool &watch_remove)",
                      +
                      2062  inst);
                      +
                      2063 
                      +
                      2064  // initialize all variables only during first watch statement
                      +
                      2065  printer->push_block("if (watch_remove == false)");
                      +
                      2066  for (int i = 0; i < info.watch_count; i++) {
                      +
                      2067  auto name = get_variable_name(fmt::format("watch{}", i + 1));
                      +
                      2068  printer->fmt_line("{} = 0;", name);
                      +
                      2069  }
                      +
                      2070  printer->add_line("watch_remove = true;");
                      +
                      2071  printer->pop_block();
                      +
                      2072 
                      +
                      2073  /**
                      +
                      2074  * \todo Similar to neuron/coreneuron we are using
                      +
                      2075  * first watch and ignoring rest.
                      +
                      2076  */
                      +
                      2077  for (int i = 0; i < info.watch_statements.size(); i++) {
                      +
                      2078  auto statement = info.watch_statements[i];
                      +
                      2079  printer->fmt_push_block("if (watch_id == {})", i);
                      2080 
                      -
                      2081  printer->add_newline(2);
                      -
                      2082  auto inst = fmt::format("{}* inst", instance_struct());
                      -
                      2083 
                      -
                      2084  printer->fmt_push_block(
                      -
                      2085  "static void nrn_watch_activate({}, int id, int pnodecount, int watch_id, "
                      -
                      2086  "double v, bool &watch_remove)",
                      -
                      2087  inst);
                      +
                      2081  auto varname = get_variable_name(fmt::format("watch{}", i + 1));
                      +
                      2082  printer->add_indent();
                      +
                      2083  printer->fmt_text("{} = 2 + (", varname);
                      +
                      2084  auto watch = statement->get_statements().front();
                      +
                      2085  watch->get_expression()->visit_children(*this);
                      +
                      2086  printer->add_text(");");
                      +
                      2087  printer->add_newline();
                      2088 
                      -
                      2089  // initialize all variables only during first watch statement
                      -
                      2090  printer->push_block("if (watch_remove == false)");
                      -
                      2091  for (int i = 0; i < info.watch_count; i++) {
                      -
                      2092  auto name = get_variable_name(fmt::format("watch{}", i + 1));
                      -
                      2093  printer->fmt_line("{} = 0;", name);
                      -
                      2094  }
                      -
                      2095  printer->add_line("watch_remove = true;");
                      -
                      2096  printer->pop_block();
                      -
                      2097 
                      -
                      2098  /**
                      -
                      2099  * \todo Similar to neuron/coreneuron we are using
                      -
                      2100  * first watch and ignoring rest.
                      -
                      2101  */
                      -
                      2102  for (int i = 0; i < info.watch_statements.size(); i++) {
                      -
                      2103  auto statement = info.watch_statements[i];
                      -
                      2104  printer->fmt_push_block("if (watch_id == {})", i);
                      -
                      2105 
                      -
                      2106  auto varname = get_variable_name(fmt::format("watch{}", i + 1));
                      -
                      2107  printer->add_indent();
                      -
                      2108  printer->fmt_text("{} = 2 + (", varname);
                      -
                      2109  auto watch = statement->get_statements().front();
                      -
                      2110  watch->get_expression()->visit_children(*this);
                      -
                      2111  printer->add_text(");");
                      -
                      2112  printer->add_newline();
                      +
                      2089  printer->pop_block();
                      +
                      2090  }
                      +
                      2091  printer->pop_block();
                      +
                      2092 }
                      +
                      2093 
                      +
                      2094 
                      +
                      2095 /**
                      +
                      2096  * \todo Similar to print_watch_activate, we are using only
                      +
                      2097  * first watch. need to verify with neuron/coreneuron about rest.
                      +
                      2098  */
                      + +
                      2100  if (info.watch_statements.empty()) {
                      +
                      2101  return;
                      +
                      2102  }
                      +
                      2103 
                      +
                      2104  printer->add_newline(2);
                      +
                      2105  printer->add_line("/** routine to check watch activation */");
                      +
                      2106  print_global_function_common_code(BlockType::Watch);
                      +
                      2107 
                      +
                      2108  // WATCH statements appears in NET_RECEIVE block and while printing
                      +
                      2109  // net_receive function we already check if it contains any MUTEX/PROTECT
                      +
                      2110  // constructs. As WATCH is not a top level block but list of statements,
                      +
                      2111  // we don't need to have ivdep pragma related check
                      +
                      2112  print_channel_iteration_block_parallel_hint(BlockType::Watch, nullptr);
                      2113 
                      -
                      2114  printer->pop_block();
                      -
                      2115  }
                      -
                      2116  printer->pop_block();
                      -
                      2117 }
                      -
                      2118 
                      -
                      2119 
                      -
                      2120 /**
                      -
                      2121  * \todo Similar to print_watch_activate, we are using only
                      -
                      2122  * first watch. need to verify with neuron/coreneuron about rest.
                      -
                      2123  */
                      - -
                      2125  if (info.watch_statements.empty()) {
                      -
                      2126  return;
                      -
                      2127  }
                      -
                      2128 
                      -
                      2129  printer->add_newline(2);
                      -
                      2130  printer->add_line("/** routine to check watch activation */");
                      -
                      2131  print_global_function_common_code(BlockType::Watch);
                      +
                      2114  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      2115 
                      +
                      2116  if (info.is_voltage_used_by_watch_statements()) {
                      +
                      2117  printer->add_line("int node_id = node_index[id];");
                      +
                      2118  printer->add_line("double v = voltage[node_id];");
                      +
                      2119  print_v_unused();
                      +
                      2120  }
                      +
                      2121 
                      +
                      2122  // flat to make sure only one WATCH statement can be triggered at a time
                      +
                      2123  printer->add_line("bool watch_untriggered = true;");
                      +
                      2124 
                      +
                      2125  for (int i = 0; i < info.watch_statements.size(); i++) {
                      +
                      2126  auto statement = info.watch_statements[i];
                      +
                      2127  const auto& watch = statement->get_statements().front();
                      +
                      2128  const auto& varname = get_variable_name(fmt::format("watch{}", i + 1));
                      +
                      2129 
                      +
                      2130  // start block 1
                      +
                      2131  printer->fmt_push_block("if ({}&2 && watch_untriggered)", varname);
                      2132 
                      -
                      2133  // WATCH statements appears in NET_RECEIVE block and while printing
                      -
                      2134  // net_receive function we already check if it contains any MUTEX/PROTECT
                      -
                      2135  // constructs. As WATCH is not a top level block but list of statements,
                      -
                      2136  // we don't need to have ivdep pragma related check
                      -
                      2137  print_channel_iteration_block_parallel_hint(BlockType::Watch, nullptr);
                      -
                      2138 
                      -
                      2139  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      2133  // start block 2
                      +
                      2134  printer->add_indent();
                      +
                      2135  printer->add_text("if (");
                      +
                      2136  watch->get_expression()->accept(*this);
                      +
                      2137  printer->add_text(") {");
                      +
                      2138  printer->add_newline();
                      +
                      2139  printer->increase_indent();
                      2140 
                      -
                      2141  if (info.is_voltage_used_by_watch_statements()) {
                      -
                      2142  printer->add_line("int node_id = node_index[id];");
                      -
                      2143  printer->add_line("double v = voltage[node_id];");
                      -
                      2144  print_v_unused();
                      -
                      2145  }
                      -
                      2146 
                      -
                      2147  // flat to make sure only one WATCH statement can be triggered at a time
                      -
                      2148  printer->add_line("bool watch_untriggered = true;");
                      -
                      2149 
                      -
                      2150  for (int i = 0; i < info.watch_statements.size(); i++) {
                      -
                      2151  auto statement = info.watch_statements[i];
                      -
                      2152  const auto& watch = statement->get_statements().front();
                      -
                      2153  const auto& varname = get_variable_name(fmt::format("watch{}", i + 1));
                      -
                      2154 
                      -
                      2155  // start block 1
                      -
                      2156  printer->fmt_push_block("if ({}&2 && watch_untriggered)", varname);
                      -
                      2157 
                      -
                      2158  // start block 2
                      -
                      2159  printer->add_indent();
                      -
                      2160  printer->add_text("if (");
                      -
                      2161  watch->get_expression()->accept(*this);
                      -
                      2162  printer->add_text(") {");
                      -
                      2163  printer->add_newline();
                      -
                      2164  printer->increase_indent();
                      -
                      2165 
                      -
                      2166  // start block 3
                      -
                      2167  printer->fmt_push_block("if (({}&1) == 0)", varname);
                      -
                      2168 
                      -
                      2169  printer->add_line("watch_untriggered = false;");
                      -
                      2170 
                      -
                      2171  const auto& tqitem = get_variable_name("tqitem");
                      -
                      2172  const auto& point_process = get_variable_name("point_process");
                      -
                      2173  printer->add_indent();
                      -
                      2174  printer->add_text("net_send_buffering(");
                      -
                      2175  const auto& t = get_variable_name("t");
                      -
                      2176  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, -1, {}, {}+0.0, ",
                      -
                      2177  tqitem,
                      -
                      2178  point_process,
                      -
                      2179  t);
                      -
                      2180  watch->get_value()->accept(*this);
                      -
                      2181  printer->add_text(");");
                      -
                      2182  printer->add_newline();
                      -
                      2183  printer->pop_block();
                      -
                      2184 
                      -
                      2185  printer->add_line(varname, " = 3;");
                      -
                      2186  // end block 3
                      -
                      2187 
                      -
                      2188  // start block 3
                      -
                      2189  printer->decrease_indent();
                      -
                      2190  printer->push_block("} else");
                      -
                      2191  printer->add_line(varname, " = 2;");
                      -
                      2192  printer->pop_block();
                      -
                      2193  // end block 3
                      -
                      2194 
                      -
                      2195  printer->pop_block();
                      -
                      2196  // end block 1
                      -
                      2197  }
                      -
                      2198 
                      -
                      2199  printer->pop_block();
                      -
                      2200  print_send_event_move();
                      -
                      2201  print_kernel_data_present_annotation_block_end();
                      -
                      2202  printer->pop_block();
                      -
                      2203 }
                      -
                      2204 
                      -
                      2205 
                      - -
                      2207  bool need_mech_inst) {
                      -
                      2208  printer->add_multi_line(R"CODE(
                      -
                      2209  int tid = pnt->_tid;
                      -
                      2210  int id = pnt->_i_instance;
                      -
                      2211  double v = 0;
                      -
                      2212  )CODE");
                      -
                      2213 
                      -
                      2214  if (info.artificial_cell || node.is_initial_block()) {
                      -
                      2215  printer->add_line("NrnThread* nt = nrn_threads + tid;");
                      -
                      2216  printer->add_line("Memb_list* ml = nt->_ml_list[pnt->_type];");
                      -
                      2217  }
                      -
                      2218  if (node.is_initial_block()) {
                      -
                      2219  print_kernel_data_present_annotation_block_begin();
                      -
                      2220  }
                      -
                      2221 
                      -
                      2222  printer->add_multi_line(R"CODE(
                      -
                      2223  int nodecount = ml->nodecount;
                      -
                      2224  int pnodecount = ml->_nodecount_padded;
                      -
                      2225  double* data = ml->data;
                      -
                      2226  double* weights = nt->weights;
                      -
                      2227  Datum* indexes = ml->pdata;
                      -
                      2228  ThreadDatum* thread = ml->_thread;
                      -
                      2229  )CODE");
                      -
                      2230  if (need_mech_inst) {
                      -
                      2231  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                      -
                      2232  }
                      -
                      2233 
                      -
                      2234  if (node.is_initial_block()) {
                      -
                      2235  print_net_init_acc_serial_annotation_block_begin();
                      -
                      2236  }
                      +
                      2141  // start block 3
                      +
                      2142  printer->fmt_push_block("if (({}&1) == 0)", varname);
                      +
                      2143 
                      +
                      2144  printer->add_line("watch_untriggered = false;");
                      +
                      2145 
                      +
                      2146  const auto& tqitem = get_variable_name("tqitem");
                      +
                      2147  const auto& point_process = get_variable_name("point_process");
                      +
                      2148  printer->add_indent();
                      +
                      2149  printer->add_text("net_send_buffering(");
                      +
                      2150  const auto& t = get_variable_name("t");
                      +
                      2151  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, -1, {}, {}+0.0, ",
                      +
                      2152  tqitem,
                      +
                      2153  point_process,
                      +
                      2154  t);
                      +
                      2155  watch->get_value()->accept(*this);
                      +
                      2156  printer->add_text(");");
                      +
                      2157  printer->add_newline();
                      +
                      2158  printer->pop_block();
                      +
                      2159 
                      +
                      2160  printer->add_line(varname, " = 3;");
                      +
                      2161  // end block 3
                      +
                      2162 
                      +
                      2163  // start block 3
                      +
                      2164  printer->decrease_indent();
                      +
                      2165  printer->push_block("} else");
                      +
                      2166  printer->add_line(varname, " = 2;");
                      +
                      2167  printer->pop_block();
                      +
                      2168  // end block 3
                      +
                      2169 
                      +
                      2170  printer->pop_block();
                      +
                      2171  // end block 1
                      +
                      2172  }
                      +
                      2173 
                      +
                      2174  printer->pop_block();
                      +
                      2175  print_send_event_move();
                      +
                      2176  print_kernel_data_present_annotation_block_end();
                      +
                      2177  printer->pop_block();
                      +
                      2178 }
                      +
                      2179 
                      +
                      2180 
                      + +
                      2182  bool need_mech_inst) {
                      +
                      2183  printer->add_multi_line(R"CODE(
                      +
                      2184  int tid = pnt->_tid;
                      +
                      2185  int id = pnt->_i_instance;
                      +
                      2186  double v = 0;
                      +
                      2187  )CODE");
                      +
                      2188 
                      +
                      2189  if (info.artificial_cell || node.is_initial_block()) {
                      +
                      2190  printer->add_line("NrnThread* nt = nrn_threads + tid;");
                      +
                      2191  printer->add_line("Memb_list* ml = nt->_ml_list[pnt->_type];");
                      +
                      2192  }
                      +
                      2193  if (node.is_initial_block()) {
                      +
                      2194  print_kernel_data_present_annotation_block_begin();
                      +
                      2195  }
                      +
                      2196 
                      +
                      2197  printer->add_multi_line(R"CODE(
                      +
                      2198  int nodecount = ml->nodecount;
                      +
                      2199  int pnodecount = ml->_nodecount_padded;
                      +
                      2200  double* data = ml->data;
                      +
                      2201  double* weights = nt->weights;
                      +
                      2202  Datum* indexes = ml->pdata;
                      +
                      2203  ThreadDatum* thread = ml->_thread;
                      +
                      2204  )CODE");
                      +
                      2205  if (need_mech_inst) {
                      +
                      2206  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                      +
                      2207  }
                      +
                      2208 
                      +
                      2209  if (node.is_initial_block()) {
                      +
                      2210  print_net_init_acc_serial_annotation_block_begin();
                      +
                      2211  }
                      +
                      2212 
                      +
                      2213  // rename variables but need to see if they are actually used
                      +
                      2214  auto parameters = info.net_receive_node->get_parameters();
                      +
                      2215  if (!parameters.empty()) {
                      +
                      2216  int i = 0;
                      +
                      2217  printer->add_newline();
                      +
                      2218  for (auto& parameter: parameters) {
                      +
                      2219  auto name = parameter->get_node_name();
                      +
                      2220  bool var_used = VarUsageVisitor().variable_used(node, "(*" + name + ")");
                      +
                      2221  if (var_used) {
                      +
                      2222  printer->fmt_line("double* {} = weights + weight_index + {};", name, i);
                      +
                      2223  RenameVisitor vr(name, "*" + name);
                      +
                      2224  node.visit_children(vr);
                      +
                      2225  }
                      +
                      2226  i++;
                      +
                      2227  }
                      +
                      2228  }
                      +
                      2229 }
                      +
                      2230 
                      +
                      2231 
                      + +
                      2233  auto const& arguments = node.get_arguments();
                      +
                      2234  const auto& tqitem = get_variable_name("tqitem");
                      +
                      2235  std::string weight_index = "weight_index";
                      +
                      2236  std::string pnt = "pnt";
                      2237 
                      -
                      2238  // rename variables but need to see if they are actually used
                      -
                      2239  auto parameters = info.net_receive_node->get_parameters();
                      -
                      2240  if (!parameters.empty()) {
                      -
                      2241  int i = 0;
                      -
                      2242  printer->add_newline();
                      -
                      2243  for (auto& parameter: parameters) {
                      -
                      2244  auto name = parameter->get_node_name();
                      -
                      2245  bool var_used = VarUsageVisitor().variable_used(node, "(*" + name + ")");
                      -
                      2246  if (var_used) {
                      -
                      2247  printer->fmt_line("double* {} = weights + weight_index + {};", name, i);
                      -
                      2248  RenameVisitor vr(name, "*" + name);
                      -
                      2249  node.visit_children(vr);
                      -
                      2250  }
                      -
                      2251  i++;
                      -
                      2252  }
                      -
                      2253  }
                      -
                      2254 }
                      -
                      2255 
                      -
                      2256 
                      - -
                      2258  auto const& arguments = node.get_arguments();
                      -
                      2259  const auto& tqitem = get_variable_name("tqitem");
                      -
                      2260  std::string weight_index = "weight_index";
                      -
                      2261  std::string pnt = "pnt";
                      +
                      2238  // for functions not generated from NET_RECEIVE blocks (i.e. top level INITIAL block)
                      +
                      2239  // the weight_index argument is 0.
                      +
                      2240  if (!printing_net_receive && !printing_net_init) {
                      +
                      2241  weight_index = "0";
                      +
                      2242  auto var = get_variable_name("point_process");
                      +
                      2243  if (info.artificial_cell) {
                      +
                      2244  pnt = "(Point_process*)" + var;
                      +
                      2245  }
                      +
                      2246  }
                      +
                      2247 
                      +
                      2248  // artificial cells don't use spike buffering
                      +
                      2249  // clang-format off
                      +
                      2250  if (info.artificial_cell) {
                      +
                      2251  printer->fmt_text("artcell_net_send(&{}, {}, {}, nt->_t+", tqitem, weight_index, pnt);
                      +
                      2252  } else {
                      +
                      2253  const auto& point_process = get_variable_name("point_process");
                      +
                      2254  const auto& t = get_variable_name("t");
                      +
                      2255  printer->add_text("net_send_buffering(");
                      +
                      2256  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, {}, {}, {}+", tqitem, weight_index, point_process, t);
                      +
                      2257  }
                      +
                      2258  // clang-format off
                      +
                      2259  print_vector_elements(arguments, ", ");
                      +
                      2260  printer->add_text(')');
                      +
                      2261 }
                      2262 
                      -
                      2263  // for functions not generated from NET_RECEIVE blocks (i.e. top level INITIAL block)
                      -
                      2264  // the weight_index argument is 0.
                      +
                      2263 
                      +
                      2265  if (!printing_net_receive && !printing_net_init) {
                      -
                      2266  weight_index = "0";
                      -
                      2267  auto var = get_variable_name("point_process");
                      -
                      2268  if (info.artificial_cell) {
                      -
                      2269  pnt = "(Point_process*)" + var;
                      -
                      2270  }
                      -
                      2271  }
                      -
                      2272 
                      -
                      2273  // artificial cells don't use spike buffering
                      -
                      2274  // clang-format off
                      -
                      2275  if (info.artificial_cell) {
                      -
                      2276  printer->fmt_text("artcell_net_send(&{}, {}, {}, nt->_t+", tqitem, weight_index, pnt);
                      -
                      2277  } else {
                      -
                      2278  const auto& point_process = get_variable_name("point_process");
                      -
                      2279  const auto& t = get_variable_name("t");
                      -
                      2280  printer->add_text("net_send_buffering(");
                      -
                      2281  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, {}, {}, {}+", tqitem, weight_index, point_process, t);
                      -
                      2282  }
                      -
                      2283  // clang-format off
                      -
                      2284  print_vector_elements(arguments, ", ");
                      -
                      2285  printer->add_text(')');
                      -
                      2286 }
                      -
                      2287 
                      -
                      2288 
                      - -
                      2290  if (!printing_net_receive && !printing_net_init) {
                      -
                      2291  throw std::runtime_error("Error : net_move only allowed in NET_RECEIVE block");
                      -
                      2292  }
                      -
                      2293 
                      -
                      2294  auto const& arguments = node.get_arguments();
                      -
                      2295  const auto& tqitem = get_variable_name("tqitem");
                      -
                      2296  std::string weight_index = "-1";
                      -
                      2297  std::string pnt = "pnt";
                      -
                      2298 
                      -
                      2299  // artificial cells don't use spike buffering
                      -
                      2300  // clang-format off
                      -
                      2301  if (info.artificial_cell) {
                      -
                      2302  printer->fmt_text("artcell_net_move(&{}, {}, ", tqitem, pnt);
                      -
                      2303  print_vector_elements(arguments, ", ");
                      -
                      2304  printer->add_text(")");
                      -
                      2305  } else {
                      -
                      2306  const auto& point_process = get_variable_name("point_process");
                      -
                      2307  printer->add_text("net_send_buffering(");
                      -
                      2308  printer->fmt_text("nt, ml->_net_send_buffer, 2, {}, {}, {}, ", tqitem, weight_index, point_process);
                      -
                      2309  print_vector_elements(arguments, ", ");
                      -
                      2310  printer->add_text(", 0.0");
                      -
                      2311  printer->add_text(")");
                      -
                      2312  }
                      -
                      2313 }
                      -
                      2314 
                      -
                      2315 
                      - -
                      2317  const auto& arguments = node.get_arguments();
                      -
                      2318  if (info.artificial_cell) {
                      -
                      2319  printer->add_text("net_event(pnt, ");
                      -
                      2320  print_vector_elements(arguments, ", ");
                      -
                      2321  } else {
                      -
                      2322  const auto& point_process = get_variable_name("point_process");
                      -
                      2323  printer->add_text("net_send_buffering(");
                      -
                      2324  printer->fmt_text("nt, ml->_net_send_buffer, 1, -1, -1, {}, ", point_process);
                      -
                      2325  print_vector_elements(arguments, ", ");
                      -
                      2326  printer->add_text(", 0.0");
                      -
                      2327  }
                      -
                      2328  printer->add_text(")");
                      -
                      2329 }
                      -
                      2330 
                      -
                      2331 /**
                      -
                      2332  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                      -
                      2333  *
                      -
                      2334  * Arguments to NET_RECEIVE block are packed and passed via weight vector. These
                      -
                      2335  * variables need to be replaced with corresponding pointer variable. For example,
                      -
                      2336  * if mod file is like
                      -
                      2337  *
                      -
                      2338  * \code{.mod}
                      -
                      2339  * NET_RECEIVE (weight, R){
                      -
                      2340  * INITIAL {
                      -
                      2341  * R=1
                      -
                      2342  * }
                      -
                      2343  * }
                      -
                      2344  * \endcode
                      -
                      2345  *
                      -
                      2346  * then generated code for initial block should be:
                      -
                      2347  *
                      -
                      2348  * \code{.cpp}
                      -
                      2349  * double* R = weights + weight_index + 0;
                      -
                      2350  * (*R) = 1.0;
                      -
                      2351  * \endcode
                      -
                      2352  *
                      -
                      2353  * So, the `R` in AST needs to be renamed with `(*R)`.
                      -
                      2354  */
                      -
                      2355 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node, const ast::Node& node) {
                      -
                      2356  const auto& parameters = net_receive_node.get_parameters();
                      -
                      2357  for (auto& parameter: parameters) {
                      -
                      2358  const auto& name = parameter->get_node_name();
                      -
                      2359  auto var_used = VarUsageVisitor().variable_used(node, name);
                      -
                      2360  if (var_used) {
                      -
                      2361  RenameVisitor vr(name, "(*" + name + ")");
                      -
                      2362  node.get_statement_block()->visit_children(vr);
                      -
                      2363  }
                      -
                      2364  }
                      -
                      2365 }
                      -
                      2366 
                      -
                      2367 
                      - -
                      2369  const auto node = info.net_receive_initial_node;
                      -
                      2370  if (node == nullptr) {
                      -
                      2371  return;
                      -
                      2372  }
                      +
                      2266  throw std::runtime_error("Error : net_move only allowed in NET_RECEIVE block");
                      +
                      2267  }
                      +
                      2268 
                      +
                      2269  auto const& arguments = node.get_arguments();
                      +
                      2270  const auto& tqitem = get_variable_name("tqitem");
                      +
                      2271  std::string weight_index = "-1";
                      +
                      2272  std::string pnt = "pnt";
                      +
                      2273 
                      +
                      2274  // artificial cells don't use spike buffering
                      +
                      2275  // clang-format off
                      +
                      2276  if (info.artificial_cell) {
                      +
                      2277  printer->fmt_text("artcell_net_move(&{}, {}, ", tqitem, pnt);
                      +
                      2278  print_vector_elements(arguments, ", ");
                      +
                      2279  printer->add_text(")");
                      +
                      2280  } else {
                      +
                      2281  const auto& point_process = get_variable_name("point_process");
                      +
                      2282  printer->add_text("net_send_buffering(");
                      +
                      2283  printer->fmt_text("nt, ml->_net_send_buffer, 2, {}, {}, {}, ", tqitem, weight_index, point_process);
                      +
                      2284  print_vector_elements(arguments, ", ");
                      +
                      2285  printer->add_text(", 0.0");
                      +
                      2286  printer->add_text(")");
                      +
                      2287  }
                      +
                      2288 }
                      +
                      2289 
                      +
                      2290 
                      + +
                      2292  const auto& arguments = node.get_arguments();
                      +
                      2293  if (info.artificial_cell) {
                      +
                      2294  printer->add_text("net_event(pnt, ");
                      +
                      2295  print_vector_elements(arguments, ", ");
                      +
                      2296  } else {
                      +
                      2297  const auto& point_process = get_variable_name("point_process");
                      +
                      2298  printer->add_text("net_send_buffering(");
                      +
                      2299  printer->fmt_text("nt, ml->_net_send_buffer, 1, -1, -1, {}, ", point_process);
                      +
                      2300  print_vector_elements(arguments, ", ");
                      +
                      2301  printer->add_text(", 0.0");
                      +
                      2302  }
                      +
                      2303  printer->add_text(")");
                      +
                      2304 }
                      +
                      2305 
                      +
                      2306 /**
                      +
                      2307  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                      +
                      2308  *
                      +
                      2309  * Arguments to NET_RECEIVE block are packed and passed via weight vector. These
                      +
                      2310  * variables need to be replaced with corresponding pointer variable. For example,
                      +
                      2311  * if mod file is like
                      +
                      2312  *
                      +
                      2313  * \code{.mod}
                      +
                      2314  * NET_RECEIVE (weight, R){
                      +
                      2315  * INITIAL {
                      +
                      2316  * R=1
                      +
                      2317  * }
                      +
                      2318  * }
                      +
                      2319  * \endcode
                      +
                      2320  *
                      +
                      2321  * then generated code for initial block should be:
                      +
                      2322  *
                      +
                      2323  * \code{.cpp}
                      +
                      2324  * double* R = weights + weight_index + 0;
                      +
                      2325  * (*R) = 1.0;
                      +
                      2326  * \endcode
                      +
                      2327  *
                      +
                      2328  * So, the `R` in AST needs to be renamed with `(*R)`.
                      +
                      2329  */
                      +
                      2330 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node, const ast::Node& node) {
                      +
                      2331  const auto& parameters = net_receive_node.get_parameters();
                      +
                      2332  for (auto& parameter: parameters) {
                      +
                      2333  const auto& name = parameter->get_node_name();
                      +
                      2334  auto var_used = VarUsageVisitor().variable_used(node, name);
                      +
                      2335  if (var_used) {
                      +
                      2336  RenameVisitor vr(name, "(*" + name + ")");
                      +
                      2337  node.get_statement_block()->visit_children(vr);
                      +
                      2338  }
                      +
                      2339  }
                      +
                      2340 }
                      +
                      2341 
                      +
                      2342 
                      + +
                      2344  const auto node = info.net_receive_initial_node;
                      +
                      2345  if (node == nullptr) {
                      +
                      2346  return;
                      +
                      2347  }
                      +
                      2348 
                      +
                      2349  // rename net_receive arguments used in the initial block of net_receive
                      +
                      2350  rename_net_receive_arguments(*info.net_receive_node, *node);
                      +
                      2351 
                      +
                      2352  printing_net_init = true;
                      +
                      2353  auto args = "Point_process* pnt, int weight_index, double flag";
                      +
                      2354  printer->add_newline(2);
                      +
                      2355  printer->add_line("/** initialize block for net receive */");
                      +
                      2356  printer->fmt_push_block("static void net_init({})", args);
                      +
                      2357  auto block = node->get_statement_block().get();
                      +
                      2358  if (block->get_statements().empty()) {
                      +
                      2359  printer->add_line("// do nothing");
                      +
                      2360  } else {
                      +
                      2361  print_net_receive_common_code(*node);
                      +
                      2362  print_statement_block(*block, false, false);
                      +
                      2363  if (node->is_initial_block()) {
                      +
                      2364  print_net_init_acc_serial_annotation_block_end();
                      +
                      2365  print_kernel_data_present_annotation_block_end();
                      +
                      2366  printer->add_line("auto& nsb = ml->_net_send_buffer;");
                      +
                      2367  print_net_send_buf_update_to_host();
                      +
                      2368  }
                      +
                      2369  }
                      +
                      2370  printer->pop_block();
                      +
                      2371  printing_net_init = false;
                      +
                      2372 }
                      2373 
                      -
                      2374  // rename net_receive arguments used in the initial block of net_receive
                      -
                      2375  rename_net_receive_arguments(*info.net_receive_node, *node);
                      -
                      2376 
                      -
                      2377  printing_net_init = true;
                      -
                      2378  auto args = "Point_process* pnt, int weight_index, double flag";
                      -
                      2379  printer->add_newline(2);
                      -
                      2380  printer->add_line("/** initialize block for net receive */");
                      -
                      2381  printer->fmt_push_block("static void net_init({})", args);
                      -
                      2382  auto block = node->get_statement_block().get();
                      -
                      2383  if (block->get_statements().empty()) {
                      -
                      2384  printer->add_line("// do nothing");
                      -
                      2385  } else {
                      -
                      2386  print_net_receive_common_code(*node);
                      -
                      2387  print_statement_block(*block, false, false);
                      -
                      2388  if (node->is_initial_block()) {
                      -
                      2389  print_net_init_acc_serial_annotation_block_end();
                      -
                      2390  print_kernel_data_present_annotation_block_end();
                      -
                      2391  printer->add_line("auto& nsb = ml->_net_send_buffer;");
                      -
                      2392  print_net_send_buf_update_to_host();
                      -
                      2393  }
                      -
                      2394  }
                      -
                      2395  printer->pop_block();
                      -
                      2396  printing_net_init = false;
                      -
                      2397 }
                      -
                      2398 
                      +
                      2374 
                      + +
                      2376  printer->add_newline();
                      +
                      2377  printer->add_line("NetSendBuffer_t* nsb = ml->_net_send_buffer;");
                      +
                      2378  print_net_send_buf_update_to_host();
                      +
                      2379  printer->push_block("for (int i=0; i < nsb->_cnt; i++)");
                      +
                      2380  printer->add_multi_line(R"CODE(
                      +
                      2381  int type = nsb->_sendtype[i];
                      +
                      2382  int tid = nt->id;
                      +
                      2383  double t = nsb->_nsb_t[i];
                      +
                      2384  double flag = nsb->_nsb_flag[i];
                      +
                      2385  int vdata_index = nsb->_vdata_index[i];
                      +
                      2386  int weight_index = nsb->_weight_index[i];
                      +
                      2387  int point_index = nsb->_pnt_index[i];
                      +
                      2388  net_sem_from_gpu(type, vdata_index, weight_index, tid, point_index, t, flag);
                      +
                      2389  )CODE");
                      +
                      2390  printer->pop_block();
                      +
                      2391  printer->add_line("nsb->_cnt = 0;");
                      +
                      2392  print_net_send_buf_count_update_to_device();
                      +
                      2393 }
                      +
                      2394 
                      +
                      2395 
                      + +
                      2397  return fmt::format("void {}(NrnThread* nt)", method_name("net_buf_receive"));
                      +
                      2398 }
                      2399 
                      - -
                      2401  printer->add_newline();
                      -
                      2402  printer->add_line("NetSendBuffer_t* nsb = ml->_net_send_buffer;");
                      -
                      2403  print_net_send_buf_update_to_host();
                      -
                      2404  printer->push_block("for (int i=0; i < nsb->_cnt; i++)");
                      -
                      2405  printer->add_multi_line(R"CODE(
                      -
                      2406  int type = nsb->_sendtype[i];
                      -
                      2407  int tid = nt->id;
                      -
                      2408  double t = nsb->_nsb_t[i];
                      -
                      2409  double flag = nsb->_nsb_flag[i];
                      -
                      2410  int vdata_index = nsb->_vdata_index[i];
                      -
                      2411  int weight_index = nsb->_weight_index[i];
                      -
                      2412  int point_index = nsb->_pnt_index[i];
                      -
                      2413  net_sem_from_gpu(type, vdata_index, weight_index, tid, point_index, t, flag);
                      -
                      2414  )CODE");
                      -
                      2415  printer->pop_block();
                      -
                      2416  printer->add_line("nsb->_cnt = 0;");
                      -
                      2417  print_net_send_buf_count_update_to_device();
                      -
                      2418 }
                      -
                      2419 
                      +
                      2400 
                      + +
                      2402  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                      +
                      2403  printer->push_block("if (!ml)");
                      +
                      2404  printer->add_line("return;");
                      +
                      2405  printer->pop_block();
                      +
                      2406  printer->add_newline();
                      +
                      2407 }
                      +
                      2408 
                      +
                      2409 
                      + +
                      2411  printer->add_line("int count = nrb->_displ_cnt;");
                      +
                      2412  print_channel_iteration_block_parallel_hint(BlockType::NetReceive, info.net_receive_node);
                      +
                      2413  printer->push_block("for (int i = 0; i < count; i++)");
                      +
                      2414 }
                      +
                      2415 
                      +
                      2416 
                      + +
                      2418  printer->pop_block();
                      +
                      2419 }
                      2420 
                      - -
                      2422  return fmt::format("void {}(NrnThread* nt)", method_name("net_buf_receive"));
                      -
                      2423 }
                      -
                      2424 
                      -
                      2425 
                      - -
                      2427  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                      -
                      2428  printer->push_block("if (!ml)");
                      -
                      2429  printer->add_line("return;");
                      -
                      2430  printer->pop_block();
                      -
                      2431  printer->add_newline();
                      -
                      2432 }
                      -
                      2433 
                      +
                      2421 
                      + +
                      2423  if (!net_receive_required() || info.artificial_cell) {
                      +
                      2424  return;
                      +
                      2425  }
                      +
                      2426  printer->add_newline(2);
                      +
                      2427  printer->push_block(net_receive_buffering_declaration());
                      +
                      2428 
                      +
                      2429  print_get_memb_list();
                      +
                      2430 
                      +
                      2431  const auto& net_receive = method_name("net_receive_kernel");
                      +
                      2432 
                      +
                      2433  print_kernel_data_present_annotation_block_begin();
                      2434 
                      - -
                      2436  printer->add_line("int count = nrb->_displ_cnt;");
                      -
                      2437  print_channel_iteration_block_parallel_hint(BlockType::NetReceive, info.net_receive_node);
                      -
                      2438  printer->push_block("for (int i = 0; i < count; i++)");
                      -
                      2439 }
                      -
                      2440 
                      -
                      2441 
                      - -
                      2443  printer->pop_block();
                      -
                      2444 }
                      -
                      2445 
                      -
                      2446 
                      - -
                      2448  if (!net_receive_required() || info.artificial_cell) {
                      -
                      2449  return;
                      -
                      2450  }
                      -
                      2451  printer->add_newline(2);
                      -
                      2452  printer->push_block(net_receive_buffering_declaration());
                      -
                      2453 
                      -
                      2454  print_get_memb_list();
                      -
                      2455 
                      -
                      2456  const auto& net_receive = method_name("net_receive_kernel");
                      -
                      2457 
                      -
                      2458  print_kernel_data_present_annotation_block_begin();
                      -
                      2459 
                      -
                      2460  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                      -
                      2461  if (need_mech_inst) {
                      -
                      2462  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                      -
                      2463  }
                      -
                      2464  print_net_receive_loop_begin();
                      -
                      2465  printer->add_line("int start = nrb->_displ[i];");
                      -
                      2466  printer->add_line("int end = nrb->_displ[i+1];");
                      -
                      2467  printer->push_block("for (int j = start; j < end; j++)");
                      -
                      2468  printer->add_multi_line(R"CODE(
                      -
                      2469  int index = nrb->_nrb_index[j];
                      -
                      2470  int offset = nrb->_pnt_index[index];
                      -
                      2471  double t = nrb->_nrb_t[index];
                      -
                      2472  int weight_index = nrb->_weight_index[index];
                      -
                      2473  double flag = nrb->_nrb_flag[index];
                      -
                      2474  Point_process* point_process = nt->pntprocs + offset;
                      -
                      2475  )CODE");
                      -
                      2476  printer->add_line(net_receive, "(t, point_process, inst, nt, ml, weight_index, flag);");
                      -
                      2477  printer->pop_block();
                      -
                      2478  print_net_receive_loop_end();
                      +
                      2435  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                      +
                      2436  if (need_mech_inst) {
                      +
                      2437  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                      +
                      2438  }
                      +
                      2439  print_net_receive_loop_begin();
                      +
                      2440  printer->add_line("int start = nrb->_displ[i];");
                      +
                      2441  printer->add_line("int end = nrb->_displ[i+1];");
                      +
                      2442  printer->push_block("for (int j = start; j < end; j++)");
                      +
                      2443  printer->add_multi_line(R"CODE(
                      +
                      2444  int index = nrb->_nrb_index[j];
                      +
                      2445  int offset = nrb->_pnt_index[index];
                      +
                      2446  double t = nrb->_nrb_t[index];
                      +
                      2447  int weight_index = nrb->_weight_index[index];
                      +
                      2448  double flag = nrb->_nrb_flag[index];
                      +
                      2449  Point_process* point_process = nt->pntprocs + offset;
                      +
                      2450  )CODE");
                      +
                      2451  printer->add_line(net_receive, "(t, point_process, inst, nt, ml, weight_index, flag);");
                      +
                      2452  printer->pop_block();
                      +
                      2453  print_net_receive_loop_end();
                      +
                      2454 
                      +
                      2455  print_device_stream_wait();
                      +
                      2456  printer->add_line("nrb->_displ_cnt = 0;");
                      +
                      2457  printer->add_line("nrb->_cnt = 0;");
                      +
                      2458 
                      +
                      2459  if (info.net_send_used || info.net_event_used) {
                      +
                      2460  print_send_event_move();
                      +
                      2461  }
                      +
                      2462 
                      +
                      2463  print_kernel_data_present_annotation_block_end();
                      +
                      2464  printer->pop_block();
                      +
                      2465 }
                      +
                      2466 
                      +
                      2467 
                      + +
                      2469  printer->add_line("i = nsb->_cnt++;");
                      +
                      2470 }
                      +
                      2471 
                      +
                      2472 
                      + +
                      2474  printer->push_block("if (i >= nsb->_size)");
                      +
                      2475  printer->add_line("nsb->grow();");
                      +
                      2476  printer->pop_block();
                      +
                      2477 }
                      +
                      2478 
                      2479 
                      -
                      2480  print_device_stream_wait();
                      -
                      2481  printer->add_line("nrb->_displ_cnt = 0;");
                      -
                      2482  printer->add_line("nrb->_cnt = 0;");
                      -
                      2483 
                      -
                      2484  if (info.net_send_used || info.net_event_used) {
                      -
                      2485  print_send_event_move();
                      -
                      2486  }
                      -
                      2487 
                      -
                      2488  print_kernel_data_present_annotation_block_end();
                      -
                      2489  printer->pop_block();
                      -
                      2490 }
                      -
                      2491 
                      -
                      2492 
                      - -
                      2494  printer->add_line("i = nsb->_cnt++;");
                      -
                      2495 }
                      -
                      2496 
                      -
                      2497 
                      - -
                      2499  printer->push_block("if (i >= nsb->_size)");
                      -
                      2500  printer->add_line("nsb->grow();");
                      -
                      2501  printer->pop_block();
                      -
                      2502 }
                      -
                      2503 
                      -
                      2504 
                      - -
                      2506  if (!net_send_buffer_required()) {
                      -
                      2507  return;
                      -
                      2508  }
                      -
                      2509 
                      -
                      2510  printer->add_newline(2);
                      -
                      2511  auto args =
                      -
                      2512  "const NrnThread* nt, NetSendBuffer_t* nsb, int type, int vdata_index, "
                      -
                      2513  "int weight_index, int point_index, double t, double flag";
                      -
                      2514  printer->fmt_push_block("static inline void net_send_buffering({})", args);
                      -
                      2515  printer->add_line("int i = 0;");
                      -
                      2516  print_net_send_buffering_cnt_update();
                      -
                      2517  print_net_send_buffering_grow();
                      -
                      2518  printer->push_block("if (i < nsb->_size)");
                      -
                      2519  printer->add_multi_line(R"CODE(
                      -
                      2520  nsb->_sendtype[i] = type;
                      -
                      2521  nsb->_vdata_index[i] = vdata_index;
                      -
                      2522  nsb->_weight_index[i] = weight_index;
                      -
                      2523  nsb->_pnt_index[i] = point_index;
                      -
                      2524  nsb->_nsb_t[i] = t;
                      -
                      2525  nsb->_nsb_flag[i] = flag;
                      -
                      2526  )CODE");
                      -
                      2527  printer->pop_block();
                      -
                      2528  printer->pop_block();
                      -
                      2529 }
                      -
                      2530 
                      -
                      2531 
                      - -
                      2533  if (!net_receive_required()) {
                      -
                      2534  return;
                      + +
                      2481  if (!net_send_buffer_required()) {
                      +
                      2482  return;
                      +
                      2483  }
                      +
                      2484 
                      +
                      2485  printer->add_newline(2);
                      +
                      2486  auto args =
                      +
                      2487  "const NrnThread* nt, NetSendBuffer_t* nsb, int type, int vdata_index, "
                      +
                      2488  "int weight_index, int point_index, double t, double flag";
                      +
                      2489  printer->fmt_push_block("static inline void net_send_buffering({})", args);
                      +
                      2490  printer->add_line("int i = 0;");
                      +
                      2491  print_net_send_buffering_cnt_update();
                      +
                      2492  print_net_send_buffering_grow();
                      +
                      2493  printer->push_block("if (i < nsb->_size)");
                      +
                      2494  printer->add_multi_line(R"CODE(
                      +
                      2495  nsb->_sendtype[i] = type;
                      +
                      2496  nsb->_vdata_index[i] = vdata_index;
                      +
                      2497  nsb->_weight_index[i] = weight_index;
                      +
                      2498  nsb->_pnt_index[i] = point_index;
                      +
                      2499  nsb->_nsb_t[i] = t;
                      +
                      2500  nsb->_nsb_flag[i] = flag;
                      +
                      2501  )CODE");
                      +
                      2502  printer->pop_block();
                      +
                      2503  printer->pop_block();
                      +
                      2504 }
                      +
                      2505 
                      +
                      2506 
                      + +
                      2508  if (!net_receive_required()) {
                      +
                      2509  return;
                      +
                      2510  }
                      +
                      2511 
                      +
                      2512  printing_net_receive = true;
                      +
                      2513  const auto node = info.net_receive_node;
                      +
                      2514 
                      +
                      2515  // rename net_receive arguments used in the block itself
                      +
                      2516  rename_net_receive_arguments(*info.net_receive_node, *node);
                      +
                      2517 
                      +
                      2518  std::string name;
                      +
                      2519  ParamVector params;
                      +
                      2520  if (!info.artificial_cell) {
                      +
                      2521  name = method_name("net_receive_kernel");
                      +
                      2522  params.emplace_back("", "double", "", "t");
                      +
                      2523  params.emplace_back("", "Point_process*", "", "pnt");
                      +
                      2524  params.emplace_back("", fmt::format("{}*", instance_struct()),
                      +
                      2525  "", "inst");
                      +
                      2526  params.emplace_back("", "NrnThread*", "", "nt");
                      +
                      2527  params.emplace_back("", "Memb_list*", "", "ml");
                      +
                      2528  params.emplace_back("", "int", "", "weight_index");
                      +
                      2529  params.emplace_back("", "double", "", "flag");
                      +
                      2530  } else {
                      +
                      2531  name = method_name("net_receive");
                      +
                      2532  params.emplace_back("", "Point_process*", "", "pnt");
                      +
                      2533  params.emplace_back("", "int", "", "weight_index");
                      +
                      2534  params.emplace_back("", "double", "", "flag");
                      2535  }
                      2536 
                      -
                      2537  printing_net_receive = true;
                      -
                      2538  const auto node = info.net_receive_node;
                      -
                      2539 
                      -
                      2540  // rename net_receive arguments used in the block itself
                      -
                      2541  rename_net_receive_arguments(*info.net_receive_node, *node);
                      -
                      2542 
                      -
                      2543  std::string name;
                      -
                      2544  ParamVector params;
                      -
                      2545  if (!info.artificial_cell) {
                      -
                      2546  name = method_name("net_receive_kernel");
                      -
                      2547  params.emplace_back("", "double", "", "t");
                      -
                      2548  params.emplace_back("", "Point_process*", "", "pnt");
                      -
                      2549  params.emplace_back("", fmt::format("{}*", instance_struct()),
                      -
                      2550  "", "inst");
                      -
                      2551  params.emplace_back("", "NrnThread*", "", "nt");
                      -
                      2552  params.emplace_back("", "Memb_list*", "", "ml");
                      -
                      2553  params.emplace_back("", "int", "", "weight_index");
                      -
                      2554  params.emplace_back("", "double", "", "flag");
                      -
                      2555  } else {
                      -
                      2556  name = method_name("net_receive");
                      -
                      2557  params.emplace_back("", "Point_process*", "", "pnt");
                      -
                      2558  params.emplace_back("", "int", "", "weight_index");
                      -
                      2559  params.emplace_back("", "double", "", "flag");
                      -
                      2560  }
                      +
                      2537  printer->add_newline(2);
                      +
                      2538  printer->fmt_push_block("static inline void {}({})", name, get_parameter_str(params));
                      +
                      2539  print_net_receive_common_code(*node, info.artificial_cell);
                      +
                      2540  if (info.artificial_cell) {
                      +
                      2541  printer->add_line("double t = nt->_t;");
                      +
                      2542  }
                      +
                      2543 
                      +
                      2544  // set voltage variable if it is used in the block (e.g. for WATCH statement)
                      +
                      2545  auto v_used = VarUsageVisitor().variable_used(*node->get_statement_block(), "v");
                      +
                      2546  if (v_used) {
                      +
                      2547  printer->add_line("int node_id = ml->nodeindices[id];");
                      +
                      2548  printer->add_line("v = nt->_actual_v[node_id];");
                      +
                      2549  }
                      +
                      2550 
                      +
                      2551  printer->fmt_line("{} = t;", get_variable_name("tsave"));
                      +
                      2552 
                      +
                      2553  if (info.is_watch_used()) {
                      +
                      2554  printer->add_line("bool watch_remove = false;");
                      +
                      2555  }
                      +
                      2556 
                      +
                      2557  printer->add_indent();
                      +
                      2558  node->get_statement_block()->accept(*this);
                      +
                      2559  printer->add_newline();
                      +
                      2560  printer->pop_block();
                      2561 
                      -
                      2562  printer->add_newline(2);
                      -
                      2563  printer->fmt_push_block("static inline void {}({})", name, get_parameter_str(params));
                      -
                      2564  print_net_receive_common_code(*node, info.artificial_cell);
                      -
                      2565  if (info.artificial_cell) {
                      -
                      2566  printer->add_line("double t = nt->_t;");
                      -
                      2567  }
                      -
                      2568 
                      -
                      2569  // set voltage variable if it is used in the block (e.g. for WATCH statement)
                      -
                      2570  auto v_used = VarUsageVisitor().variable_used(*node->get_statement_block(), "v");
                      -
                      2571  if (v_used) {
                      -
                      2572  printer->add_line("int node_id = ml->nodeindices[id];");
                      -
                      2573  printer->add_line("v = nt->_actual_v[node_id];");
                      -
                      2574  }
                      -
                      2575 
                      -
                      2576  printer->fmt_line("{} = t;", get_variable_name("tsave"));
                      -
                      2577 
                      -
                      2578  if (info.is_watch_used()) {
                      -
                      2579  printer->add_line("bool watch_remove = false;");
                      -
                      2580  }
                      -
                      2581 
                      -
                      2582  printer->add_indent();
                      -
                      2583  node->get_statement_block()->accept(*this);
                      -
                      2584  printer->add_newline();
                      -
                      2585  printer->pop_block();
                      -
                      2586 
                      -
                      2587  printing_net_receive = false;
                      -
                      2588 }
                      -
                      2589 
                      -
                      2590 
                      - -
                      2592  if (!net_receive_required()) {
                      -
                      2593  return;
                      -
                      2594  }
                      -
                      2595 
                      -
                      2596  printing_net_receive = true;
                      -
                      2597  if (!info.artificial_cell) {
                      -
                      2598  const auto& name = method_name("net_receive");
                      -
                      2599  ParamVector params = {
                      -
                      2600  {"", "Point_process*", "", "pnt"},
                      -
                      2601  {"", "int", "", "weight_index"},
                      -
                      2602  {"", "double", "", "flag"}};
                      -
                      2603  printer->add_newline(2);
                      -
                      2604  printer->fmt_push_block("static void {}({})", name, get_parameter_str(params));
                      -
                      2605  printer->add_line("NrnThread* nt = nrn_threads + pnt->_tid;");
                      -
                      2606  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                      -
                      2607  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                      -
                      2608  printer->push_block("if (nrb->_cnt >= nrb->_size)");
                      -
                      2609  printer->add_line("realloc_net_receive_buffer(nt, ml);");
                      -
                      2610  printer->pop_block();
                      -
                      2611  printer->add_multi_line(R"CODE(
                      -
                      2612  int id = nrb->_cnt;
                      -
                      2613  nrb->_pnt_index[id] = pnt-nt->pntprocs;
                      -
                      2614  nrb->_weight_index[id] = weight_index;
                      -
                      2615  nrb->_nrb_t[id] = nt->_t;
                      -
                      2616  nrb->_nrb_flag[id] = flag;
                      -
                      2617  nrb->_cnt++;
                      -
                      2618  )CODE");
                      -
                      2619  printer->pop_block();
                      -
                      2620  }
                      -
                      2621  printing_net_receive = false;
                      -
                      2622 }
                      -
                      2623 
                      -
                      2624 
                      -
                      2625 /**
                      -
                      2626  * \todo Data is not derived. Need to add instance into instance struct?
                      -
                      2627  * data used here is wrong in AoS because as in original implementation,
                      -
                      2628  * data is not incremented every iteration for AoS. May be better to derive
                      -
                      2629  * actual variable names? [resolved now?]
                      -
                      2630  * slist needs to added as local variable
                      -
                      2631  */
                      - -
                      2633  auto ext_args = external_method_arguments();
                      -
                      2634  auto ext_params = get_parameter_str(external_method_parameters());
                      -
                      2635  auto suffix = info.mod_suffix;
                      -
                      2636  auto list_num = info.derivimplicit_list_num;
                      -
                      2637  auto block_name = block.get_node_name();
                      -
                      2638  auto primes_size = info.primes_size;
                      -
                      2639  auto stride = "*pnodecount+id";
                      -
                      2640 
                      -
                      2641  printer->add_newline(2);
                      -
                      2642 
                      -
                      2643  printer->push_block("namespace");
                      -
                      2644  printer->fmt_push_block("struct _newton_{}_{}", block_name, info.mod_suffix);
                      -
                      2645  printer->fmt_push_block("int operator()({}) const", get_parameter_str(external_method_parameters()));
                      -
                      2646  auto const instance = fmt::format("auto* const inst = static_cast<{0}*>(ml->instance);",
                      -
                      2647  instance_struct());
                      -
                      2648  auto const slist1 = fmt::format("auto const& slist{} = {};",
                      -
                      2649  list_num,
                      -
                      2650  get_variable_name(fmt::format("slist{}", list_num)));
                      -
                      2651  auto const slist2 = fmt::format("auto& slist{} = {};",
                      -
                      2652  list_num + 1,
                      -
                      2653  get_variable_name(fmt::format("slist{}", list_num + 1)));
                      -
                      2654  auto const dlist1 = fmt::format("auto const& dlist{} = {};",
                      -
                      2655  list_num,
                      -
                      2656  get_variable_name(fmt::format("dlist{}", list_num)));
                      -
                      2657  auto const dlist2 = fmt::format(
                      -
                      2658  "double* dlist{} = static_cast<double*>(thread[dith{}()].pval) + ({}*pnodecount);",
                      -
                      2659  list_num + 1,
                      -
                      2660  list_num,
                      -
                      2661  info.primes_size);
                      -
                      2662  printer->add_line(instance);
                      -
                      2663  if (ion_variable_struct_required()) {
                      -
                      2664  print_ion_variable();
                      -
                      2665  }
                      -
                      2666  printer->fmt_line("double* savstate{} = static_cast<double*>(thread[dith{}()].pval);",
                      -
                      2667  list_num,
                      -
                      2668  list_num);
                      -
                      2669  printer->add_line(slist1);
                      -
                      2670  printer->add_line(dlist1);
                      -
                      2671  printer->add_line(dlist2);
                      -
                      2672 
                      -
                      2673  print_statement_block(*block.get_statement_block(), false, false);
                      -
                      2674 
                      -
                      2675  printer->add_line("int counter = -1;");
                      -
                      2676  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                      -
                      2677  printer->fmt_push_block("if (*deriv{}_advance(thread))", list_num);
                      -
                      2678  printer->fmt_line(
                      -
                      2679  "dlist{0}[(++counter){1}] = "
                      -
                      2680  "data[dlist{2}[i]{1}]-(data[slist{2}[i]{1}]-savstate{2}[i{1}])/nt->_dt;",
                      -
                      2681  list_num + 1,
                      -
                      2682  stride,
                      -
                      2683  list_num);
                      -
                      2684  printer->chain_block("else");
                      -
                      2685  printer->fmt_line("dlist{0}[(++counter){1}] = data[slist{2}[i]{1}]-savstate{2}[i{1}];",
                      -
                      2686  list_num + 1,
                      -
                      2687  stride,
                      -
                      2688  list_num);
                      -
                      2689  printer->pop_block();
                      -
                      2690  printer->pop_block();
                      -
                      2691  printer->add_line("return 0;");
                      -
                      2692  printer->pop_block(); // operator()
                      -
                      2693  printer->pop_block(";"); // struct
                      -
                      2694  printer->pop_block(); // namespace
                      -
                      2695  printer->add_newline();
                      -
                      2696  printer->fmt_push_block("int {}_{}({})", block_name, suffix, ext_params);
                      -
                      2697  printer->add_line(instance);
                      -
                      2698  printer->fmt_line("double* savstate{} = (double*) thread[dith{}()].pval;", list_num, list_num);
                      -
                      2699  printer->add_line(slist1);
                      -
                      2700  printer->add_line(slist2);
                      -
                      2701  printer->add_line(dlist2);
                      -
                      2702  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                      -
                      2703  printer->fmt_line("savstate{}[i{}] = data[slist{}[i]{}];", list_num, stride, list_num, stride);
                      -
                      2704  printer->pop_block();
                      -
                      2705  printer->fmt_line(
                      -
                      2706  "int reset = nrn_newton_thread(static_cast<NewtonSpace*>(*newtonspace{}(thread)), {}, "
                      -
                      2707  "slist{}, _newton_{}_{}{{}}, dlist{}, {});",
                      -
                      2708  list_num,
                      -
                      2709  primes_size,
                      -
                      2710  list_num + 1,
                      -
                      2711  block_name,
                      -
                      2712  suffix,
                      -
                      2713  list_num + 1,
                      -
                      2714  ext_args);
                      -
                      2715  printer->add_line("return reset;");
                      -
                      2716  printer->pop_block();
                      -
                      2717  printer->add_newline(2);
                      -
                      2718 }
                      -
                      2719 
                      -
                      2720 
                      - -
                      2722  // nothing to do on cpu
                      -
                      2723 }
                      -
                      2724 
                      -
                      2725 
                      -
                      2726 /****************************************************************************************/
                      -
                      2727 /* Print nrn_state routine */
                      -
                      2728 /****************************************************************************************/
                      -
                      2729 
                      -
                      2730 
                      - -
                      2732  if (!nrn_state_required()) {
                      -
                      2733  return;
                      -
                      2734  }
                      -
                      2735 
                      -
                      2736  printer->add_newline(2);
                      -
                      2737  printer->add_line("/** update state */");
                      -
                      2738  print_global_function_common_code(BlockType::State);
                      -
                      2739  print_channel_iteration_block_parallel_hint(BlockType::State, info.nrn_state_block);
                      -
                      2740  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      2741 
                      -
                      2742  printer->add_line("int node_id = node_index[id];");
                      -
                      2743  printer->add_line("double v = voltage[node_id];");
                      -
                      2744  print_v_unused();
                      -
                      2745 
                      -
                      2746  /**
                      -
                      2747  * \todo Eigen solver node also emits IonCurVar variable in the functor
                      -
                      2748  * but that shouldn't update ions in derivative block
                      -
                      2749  */
                      -
                      2750  if (ion_variable_struct_required()) {
                      -
                      2751  print_ion_variable();
                      -
                      2752  }
                      -
                      2753 
                      -
                      2754  auto read_statements = ion_read_statements(BlockType::State);
                      -
                      2755  for (auto& statement: read_statements) {
                      -
                      2756  printer->add_line(statement);
                      -
                      2757  }
                      -
                      2758 
                      -
                      2759  if (info.nrn_state_block) {
                      -
                      2760  info.nrn_state_block->visit_children(*this);
                      -
                      2761  }
                      -
                      2762 
                      -
                      2763  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                      -
                      2764  auto block = info.breakpoint_node->get_statement_block();
                      -
                      2765  print_statement_block(*block, false, false);
                      -
                      2766  }
                      -
                      2767 
                      -
                      2768  const auto& write_statements = ion_write_statements(BlockType::State);
                      -
                      2769  for (auto& statement: write_statements) {
                      -
                      2770  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                      -
                      2771  printer->add_line(text);
                      -
                      2772  }
                      -
                      2773  printer->pop_block();
                      -
                      2774 
                      -
                      2775  print_kernel_data_present_annotation_block_end();
                      -
                      2776 
                      -
                      2777  printer->pop_block();
                      -
                      2778 }
                      -
                      2779 
                      -
                      2780 
                      -
                      2781 /****************************************************************************************/
                      -
                      2782 /* Print nrn_cur related routines */
                      -
                      2783 /****************************************************************************************/
                      -
                      2784 
                      -
                      2785 
                      - -
                      2787  const auto& args = internal_method_parameters();
                      -
                      2788  const auto& block = node.get_statement_block();
                      -
                      2789  printer->add_newline(2);
                      -
                      2790  printer->fmt_push_block("inline double nrn_current_{}({})",
                      -
                      2791  info.mod_suffix,
                      -
                      2792  get_parameter_str(args));
                      -
                      2793  printer->add_line("double current = 0.0;");
                      -
                      2794  print_statement_block(*block, false, false);
                      -
                      2795  for (auto& current: info.currents) {
                      -
                      2796  const auto& name = get_variable_name(current);
                      -
                      2797  printer->fmt_line("current += {};", name);
                      -
                      2798  }
                      -
                      2799  printer->add_line("return current;");
                      -
                      2800  printer->pop_block();
                      -
                      2801 }
                      -
                      2802 
                      +
                      2562  printing_net_receive = false;
                      +
                      2563 }
                      +
                      2564 
                      +
                      2565 
                      + +
                      2567  if (!net_receive_required()) {
                      +
                      2568  return;
                      +
                      2569  }
                      +
                      2570 
                      +
                      2571  printing_net_receive = true;
                      +
                      2572  if (!info.artificial_cell) {
                      +
                      2573  const auto& name = method_name("net_receive");
                      +
                      2574  ParamVector params = {
                      +
                      2575  {"", "Point_process*", "", "pnt"},
                      +
                      2576  {"", "int", "", "weight_index"},
                      +
                      2577  {"", "double", "", "flag"}};
                      +
                      2578  printer->add_newline(2);
                      +
                      2579  printer->fmt_push_block("static void {}({})", name, get_parameter_str(params));
                      +
                      2580  printer->add_line("NrnThread* nt = nrn_threads + pnt->_tid;");
                      +
                      2581  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                      +
                      2582  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                      +
                      2583  printer->push_block("if (nrb->_cnt >= nrb->_size)");
                      +
                      2584  printer->add_line("realloc_net_receive_buffer(nt, ml);");
                      +
                      2585  printer->pop_block();
                      +
                      2586  printer->add_multi_line(R"CODE(
                      +
                      2587  int id = nrb->_cnt;
                      +
                      2588  nrb->_pnt_index[id] = pnt-nt->pntprocs;
                      +
                      2589  nrb->_weight_index[id] = weight_index;
                      +
                      2590  nrb->_nrb_t[id] = nt->_t;
                      +
                      2591  nrb->_nrb_flag[id] = flag;
                      +
                      2592  nrb->_cnt++;
                      +
                      2593  )CODE");
                      +
                      2594  printer->pop_block();
                      +
                      2595  }
                      +
                      2596  printing_net_receive = false;
                      +
                      2597 }
                      +
                      2598 
                      +
                      2599 
                      +
                      2600 /**
                      +
                      2601  * \todo Data is not derived. Need to add instance into instance struct?
                      +
                      2602  * data used here is wrong in AoS because as in original implementation,
                      +
                      2603  * data is not incremented every iteration for AoS. May be better to derive
                      +
                      2604  * actual variable names? [resolved now?]
                      +
                      2605  * slist needs to added as local variable
                      +
                      2606  */
                      + +
                      2608  auto ext_args = external_method_arguments();
                      +
                      2609  auto ext_params = get_parameter_str(external_method_parameters());
                      +
                      2610  auto suffix = info.mod_suffix;
                      +
                      2611  auto list_num = info.derivimplicit_list_num;
                      +
                      2612  auto block_name = block.get_node_name();
                      +
                      2613  auto primes_size = info.primes_size;
                      +
                      2614  auto stride = "*pnodecount+id";
                      +
                      2615 
                      +
                      2616  printer->add_newline(2);
                      +
                      2617 
                      +
                      2618  printer->push_block("namespace");
                      +
                      2619  printer->fmt_push_block("struct _newton_{}_{}", block_name, info.mod_suffix);
                      +
                      2620  printer->fmt_push_block("int operator()({}) const", get_parameter_str(external_method_parameters()));
                      +
                      2621  auto const instance = fmt::format("auto* const inst = static_cast<{0}*>(ml->instance);",
                      +
                      2622  instance_struct());
                      +
                      2623  auto const slist1 = fmt::format("auto const& slist{} = {};",
                      +
                      2624  list_num,
                      +
                      2625  get_variable_name(fmt::format("slist{}", list_num)));
                      +
                      2626  auto const slist2 = fmt::format("auto& slist{} = {};",
                      +
                      2627  list_num + 1,
                      +
                      2628  get_variable_name(fmt::format("slist{}", list_num + 1)));
                      +
                      2629  auto const dlist1 = fmt::format("auto const& dlist{} = {};",
                      +
                      2630  list_num,
                      +
                      2631  get_variable_name(fmt::format("dlist{}", list_num)));
                      +
                      2632  auto const dlist2 = fmt::format(
                      +
                      2633  "double* dlist{} = static_cast<double*>(thread[dith{}()].pval) + ({}*pnodecount);",
                      +
                      2634  list_num + 1,
                      +
                      2635  list_num,
                      +
                      2636  info.primes_size);
                      +
                      2637  printer->add_line(instance);
                      +
                      2638  if (ion_variable_struct_required()) {
                      +
                      2639  print_ion_variable();
                      +
                      2640  }
                      +
                      2641  printer->fmt_line("double* savstate{} = static_cast<double*>(thread[dith{}()].pval);",
                      +
                      2642  list_num,
                      +
                      2643  list_num);
                      +
                      2644  printer->add_line(slist1);
                      +
                      2645  printer->add_line(dlist1);
                      +
                      2646  printer->add_line(dlist2);
                      +
                      2647 
                      +
                      2648  print_statement_block(*block.get_statement_block(), false, false);
                      +
                      2649 
                      +
                      2650  printer->add_line("int counter = -1;");
                      +
                      2651  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                      +
                      2652  printer->fmt_push_block("if (*deriv{}_advance(thread))", list_num);
                      +
                      2653  printer->fmt_line(
                      +
                      2654  "dlist{0}[(++counter){1}] = "
                      +
                      2655  "data[dlist{2}[i]{1}]-(data[slist{2}[i]{1}]-savstate{2}[i{1}])/nt->_dt;",
                      +
                      2656  list_num + 1,
                      +
                      2657  stride,
                      +
                      2658  list_num);
                      +
                      2659  printer->chain_block("else");
                      +
                      2660  printer->fmt_line("dlist{0}[(++counter){1}] = data[slist{2}[i]{1}]-savstate{2}[i{1}];",
                      +
                      2661  list_num + 1,
                      +
                      2662  stride,
                      +
                      2663  list_num);
                      +
                      2664  printer->pop_block();
                      +
                      2665  printer->pop_block();
                      +
                      2666  printer->add_line("return 0;");
                      +
                      2667  printer->pop_block(); // operator()
                      +
                      2668  printer->pop_block(";"); // struct
                      +
                      2669  printer->pop_block(); // namespace
                      +
                      2670  printer->add_newline();
                      +
                      2671  printer->fmt_push_block("int {}_{}({})", block_name, suffix, ext_params);
                      +
                      2672  printer->add_line(instance);
                      +
                      2673  printer->fmt_line("double* savstate{} = (double*) thread[dith{}()].pval;", list_num, list_num);
                      +
                      2674  printer->add_line(slist1);
                      +
                      2675  printer->add_line(slist2);
                      +
                      2676  printer->add_line(dlist2);
                      +
                      2677  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                      +
                      2678  printer->fmt_line("savstate{}[i{}] = data[slist{}[i]{}];", list_num, stride, list_num, stride);
                      +
                      2679  printer->pop_block();
                      +
                      2680  printer->fmt_line(
                      +
                      2681  "int reset = nrn_newton_thread(static_cast<NewtonSpace*>(*newtonspace{}(thread)), {}, "
                      +
                      2682  "slist{}, _newton_{}_{}{{}}, dlist{}, {});",
                      +
                      2683  list_num,
                      +
                      2684  primes_size,
                      +
                      2685  list_num + 1,
                      +
                      2686  block_name,
                      +
                      2687  suffix,
                      +
                      2688  list_num + 1,
                      +
                      2689  ext_args);
                      +
                      2690  printer->add_line("return reset;");
                      +
                      2691  printer->pop_block();
                      +
                      2692  printer->add_newline(2);
                      +
                      2693 }
                      +
                      2694 
                      +
                      2695 
                      + +
                      2697  // nothing to do on cpu
                      +
                      2698 }
                      +
                      2699 
                      +
                      2700 
                      +
                      2701 /****************************************************************************************/
                      +
                      2702 /* Print nrn_state routine */
                      +
                      2703 /****************************************************************************************/
                      +
                      2704 
                      +
                      2705 
                      + +
                      2707  if (!nrn_state_required()) {
                      +
                      2708  return;
                      +
                      2709  }
                      +
                      2710 
                      +
                      2711  printer->add_newline(2);
                      +
                      2712  printer->add_line("/** update state */");
                      +
                      2713  print_global_function_common_code(BlockType::State);
                      +
                      2714  print_channel_iteration_block_parallel_hint(BlockType::State, info.nrn_state_block);
                      +
                      2715  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      2716 
                      +
                      2717  printer->add_line("int node_id = node_index[id];");
                      +
                      2718  printer->add_line("double v = voltage[node_id];");
                      +
                      2719  print_v_unused();
                      +
                      2720 
                      +
                      2721  /**
                      +
                      2722  * \todo Eigen solver node also emits IonCurVar variable in the functor
                      +
                      2723  * but that shouldn't update ions in derivative block
                      +
                      2724  */
                      +
                      2725  if (ion_variable_struct_required()) {
                      +
                      2726  print_ion_variable();
                      +
                      2727  }
                      +
                      2728 
                      +
                      2729  auto read_statements = ion_read_statements(BlockType::State);
                      +
                      2730  for (auto& statement: read_statements) {
                      +
                      2731  printer->add_line(statement);
                      +
                      2732  }
                      +
                      2733 
                      +
                      2734  if (info.nrn_state_block) {
                      +
                      2735  info.nrn_state_block->visit_children(*this);
                      +
                      2736  }
                      +
                      2737 
                      +
                      2738  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                      +
                      2739  auto block = info.breakpoint_node->get_statement_block();
                      +
                      2740  print_statement_block(*block, false, false);
                      +
                      2741  }
                      +
                      2742 
                      +
                      2743  const auto& write_statements = ion_write_statements(BlockType::State);
                      +
                      2744  for (auto& statement: write_statements) {
                      +
                      2745  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                      +
                      2746  printer->add_line(text);
                      +
                      2747  }
                      +
                      2748  printer->pop_block();
                      +
                      2749 
                      +
                      2750  print_kernel_data_present_annotation_block_end();
                      +
                      2751 
                      +
                      2752  printer->pop_block();
                      +
                      2753 }
                      +
                      2754 
                      +
                      2755 
                      +
                      2756 /****************************************************************************************/
                      +
                      2757 /* Print nrn_cur related routines */
                      +
                      2758 /****************************************************************************************/
                      +
                      2759 
                      +
                      2760 
                      + +
                      2762  const auto& args = internal_method_parameters();
                      +
                      2763  const auto& block = node.get_statement_block();
                      +
                      2764  printer->add_newline(2);
                      +
                      2765  printer->fmt_push_block("inline double nrn_current_{}({})",
                      +
                      2766  info.mod_suffix,
                      +
                      2767  get_parameter_str(args));
                      +
                      2768  printer->add_line("double current = 0.0;");
                      +
                      2769  print_statement_block(*block, false, false);
                      +
                      2770  for (auto& current: info.currents) {
                      +
                      2771  const auto& name = get_variable_name(current);
                      +
                      2772  printer->fmt_line("current += {};", name);
                      +
                      2773  }
                      +
                      2774  printer->add_line("return current;");
                      +
                      2775  printer->pop_block();
                      +
                      2776 }
                      +
                      2777 
                      +
                      2778 
                      + +
                      2780  const auto& block = node.get_statement_block();
                      +
                      2781  print_statement_block(*block, false, false);
                      +
                      2782  if (!info.currents.empty()) {
                      +
                      2783  std::string sum;
                      +
                      2784  for (const auto& current: info.currents) {
                      +
                      2785  auto var = breakpoint_current(current);
                      +
                      2786  sum += get_variable_name(var);
                      +
                      2787  if (&current != &info.currents.back()) {
                      +
                      2788  sum += "+";
                      +
                      2789  }
                      +
                      2790  }
                      +
                      2791  printer->fmt_line("double rhs = {};", sum);
                      +
                      2792  }
                      +
                      2793 
                      +
                      2794  std::string sum;
                      +
                      2795  for (const auto& conductance: info.conductances) {
                      +
                      2796  auto var = breakpoint_current(conductance.variable);
                      +
                      2797  sum += get_variable_name(var);
                      +
                      2798  if (&conductance != &info.conductances.back()) {
                      +
                      2799  sum += "+";
                      +
                      2800  }
                      +
                      2801  }
                      +
                      2802  printer->fmt_line("double g = {};", sum);
                      2803 
                      - -
                      2805  const auto& block = node.get_statement_block();
                      -
                      2806  print_statement_block(*block, false, false);
                      -
                      2807  if (!info.currents.empty()) {
                      -
                      2808  std::string sum;
                      -
                      2809  for (const auto& current: info.currents) {
                      -
                      2810  auto var = breakpoint_current(current);
                      -
                      2811  sum += get_variable_name(var);
                      -
                      2812  if (&current != &info.currents.back()) {
                      -
                      2813  sum += "+";
                      -
                      2814  }
                      -
                      2815  }
                      -
                      2816  printer->fmt_line("double rhs = {};", sum);
                      -
                      2817  }
                      -
                      2818 
                      -
                      2819  std::string sum;
                      -
                      2820  for (const auto& conductance: info.conductances) {
                      -
                      2821  auto var = breakpoint_current(conductance.variable);
                      -
                      2822  sum += get_variable_name(var);
                      -
                      2823  if (&conductance != &info.conductances.back()) {
                      -
                      2824  sum += "+";
                      -
                      2825  }
                      -
                      2826  }
                      -
                      2827  printer->fmt_line("double g = {};", sum);
                      -
                      2828 
                      -
                      2829  for (const auto& conductance: info.conductances) {
                      -
                      2830  if (!conductance.ion.empty()) {
                      -
                      2831  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion + "dv";
                      -
                      2832  const auto& rhs = get_variable_name(conductance.variable);
                      -
                      2833  const ShadowUseStatement statement{lhs, "+=", rhs};
                      -
                      2834  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      2835  printer->add_line(text);
                      -
                      2836  }
                      -
                      2837  }
                      -
                      2838 }
                      -
                      2839 
                      -
                      2840 
                      - -
                      2842  printer->fmt_line("double g = nrn_current_{}({}+0.001);",
                      -
                      2843  info.mod_suffix,
                      -
                      2844  internal_method_arguments());
                      -
                      2845  for (auto& ion: info.ions) {
                      -
                      2846  for (auto& var: ion.writes) {
                      -
                      2847  if (ion.is_ionic_current(var)) {
                      -
                      2848  const auto& name = get_variable_name(var);
                      -
                      2849  printer->fmt_line("double di{} = {};", ion.name, name);
                      -
                      2850  }
                      -
                      2851  }
                      -
                      2852  }
                      -
                      2853  printer->fmt_line("double rhs = nrn_current_{}({});",
                      -
                      2854  info.mod_suffix,
                      -
                      2855  internal_method_arguments());
                      -
                      2856  printer->add_line("g = (g-rhs)/0.001;");
                      -
                      2857  for (auto& ion: info.ions) {
                      -
                      2858  for (auto& var: ion.writes) {
                      -
                      2859  if (ion.is_ionic_current(var)) {
                      -
                      2860  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                      -
                      2861  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                      -
                      2862  if (info.point_process) {
                      -
                      2863  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      -
                      2864  rhs += fmt::format("*1.e2/{}", area);
                      -
                      2865  }
                      -
                      2866  const ShadowUseStatement statement{lhs, "+=", rhs};
                      -
                      2867  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      2868  printer->add_line(text);
                      -
                      2869  }
                      -
                      2870  }
                      -
                      2871  }
                      -
                      2872 }
                      -
                      2873 
                      +
                      2804  for (const auto& conductance: info.conductances) {
                      +
                      2805  if (!conductance.ion.empty()) {
                      +
                      2806  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion + "dv";
                      +
                      2807  const auto& rhs = get_variable_name(conductance.variable);
                      +
                      2808  const ShadowUseStatement statement{lhs, "+=", rhs};
                      +
                      2809  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      2810  printer->add_line(text);
                      +
                      2811  }
                      +
                      2812  }
                      +
                      2813 }
                      +
                      2814 
                      +
                      2815 
                      + +
                      2817  printer->fmt_line("double g = nrn_current_{}({}+0.001);",
                      +
                      2818  info.mod_suffix,
                      +
                      2819  internal_method_arguments());
                      +
                      2820  for (auto& ion: info.ions) {
                      +
                      2821  for (auto& var: ion.writes) {
                      +
                      2822  if (ion.is_ionic_current(var)) {
                      +
                      2823  const auto& name = get_variable_name(var);
                      +
                      2824  printer->fmt_line("double di{} = {};", ion.name, name);
                      +
                      2825  }
                      +
                      2826  }
                      +
                      2827  }
                      +
                      2828  printer->fmt_line("double rhs = nrn_current_{}({});",
                      +
                      2829  info.mod_suffix,
                      +
                      2830  internal_method_arguments());
                      +
                      2831  printer->add_line("g = (g-rhs)/0.001;");
                      +
                      2832  for (auto& ion: info.ions) {
                      +
                      2833  for (auto& var: ion.writes) {
                      +
                      2834  if (ion.is_ionic_current(var)) {
                      +
                      2835  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                      +
                      2836  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                      +
                      2837  if (info.point_process) {
                      +
                      2838  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      +
                      2839  rhs += fmt::format("*1.e2/{}", area);
                      +
                      2840  }
                      +
                      2841  const ShadowUseStatement statement{lhs, "+=", rhs};
                      +
                      2842  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      2843  printer->add_line(text);
                      +
                      2844  }
                      +
                      2845  }
                      +
                      2846  }
                      +
                      2847 }
                      +
                      2848 
                      +
                      2849 
                      + +
                      2851  printer->add_line("int node_id = node_index[id];");
                      +
                      2852  printer->add_line("double v = voltage[node_id];");
                      +
                      2853  print_v_unused();
                      +
                      2854  if (ion_variable_struct_required()) {
                      +
                      2855  print_ion_variable();
                      +
                      2856  }
                      +
                      2857 
                      +
                      2858  const auto& read_statements = ion_read_statements(BlockType::Equation);
                      +
                      2859  for (auto& statement: read_statements) {
                      +
                      2860  printer->add_line(statement);
                      +
                      2861  }
                      +
                      2862 
                      +
                      2863  if (info.conductances.empty()) {
                      +
                      2864  print_nrn_cur_non_conductance_kernel();
                      +
                      2865  } else {
                      +
                      2866  print_nrn_cur_conductance_kernel(node);
                      +
                      2867  }
                      +
                      2868 
                      +
                      2869  const auto& write_statements = ion_write_statements(BlockType::Equation);
                      +
                      2870  for (auto& statement: write_statements) {
                      +
                      2871  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      2872  printer->add_line(text);
                      +
                      2873  }
                      2874 
                      - -
                      2876  printer->add_line("int node_id = node_index[id];");
                      -
                      2877  printer->add_line("double v = voltage[node_id];");
                      -
                      2878  print_v_unused();
                      -
                      2879  if (ion_variable_struct_required()) {
                      -
                      2880  print_ion_variable();
                      -
                      2881  }
                      -
                      2882 
                      -
                      2883  const auto& read_statements = ion_read_statements(BlockType::Equation);
                      -
                      2884  for (auto& statement: read_statements) {
                      -
                      2885  printer->add_line(statement);
                      -
                      2886  }
                      -
                      2887 
                      -
                      2888  if (info.conductances.empty()) {
                      -
                      2889  print_nrn_cur_non_conductance_kernel();
                      -
                      2890  } else {
                      -
                      2891  print_nrn_cur_conductance_kernel(node);
                      -
                      2892  }
                      -
                      2893 
                      -
                      2894  const auto& write_statements = ion_write_statements(BlockType::Equation);
                      -
                      2895  for (auto& statement: write_statements) {
                      -
                      2896  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      2897  printer->add_line(text);
                      -
                      2898  }
                      -
                      2899 
                      -
                      2900  if (info.point_process) {
                      -
                      2901  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      -
                      2902  printer->fmt_line("double mfactor = 1.e2/{};", area);
                      -
                      2903  printer->add_line("g = g*mfactor;");
                      -
                      2904  printer->add_line("rhs = rhs*mfactor;");
                      +
                      2875  if (info.point_process) {
                      +
                      2876  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      +
                      2877  printer->fmt_line("double mfactor = 1.e2/{};", area);
                      +
                      2878  printer->add_line("g = g*mfactor;");
                      +
                      2879  printer->add_line("rhs = rhs*mfactor;");
                      +
                      2880  }
                      +
                      2881 
                      +
                      2882  print_g_unused();
                      +
                      2883 }
                      +
                      2884 
                      +
                      2885 
                      + +
                      2887  if (!info.electrode_current) {
                      +
                      2888  return;
                      +
                      2889  }
                      +
                      2890  std::string rhs, d;
                      +
                      2891  auto rhs_op = operator_for_rhs();
                      +
                      2892  auto d_op = operator_for_d();
                      +
                      2893  if (info.point_process) {
                      +
                      2894  rhs = "shadow_rhs[id]";
                      +
                      2895  d = "shadow_d[id]";
                      +
                      2896  } else {
                      +
                      2897  rhs = "rhs";
                      +
                      2898  d = "g";
                      +
                      2899  }
                      +
                      2900 
                      +
                      2901  printer->push_block("if (nt->nrn_fast_imem)");
                      +
                      2902  if (nrn_cur_reduction_loop_required()) {
                      +
                      2903  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      2904  printer->add_line("int node_id = node_index[id];");
                      2905  }
                      -
                      2906 
                      -
                      2907  print_g_unused();
                      -
                      2908 }
                      -
                      2909 
                      -
                      2910 
                      - -
                      2912  if (!info.electrode_current) {
                      -
                      2913  return;
                      -
                      2914  }
                      -
                      2915  std::string rhs, d;
                      -
                      2916  auto rhs_op = operator_for_rhs();
                      -
                      2917  auto d_op = operator_for_d();
                      -
                      2918  if (info.point_process) {
                      -
                      2919  rhs = "shadow_rhs[id]";
                      -
                      2920  d = "shadow_d[id]";
                      -
                      2921  } else {
                      -
                      2922  rhs = "rhs";
                      -
                      2923  d = "g";
                      -
                      2924  }
                      -
                      2925 
                      -
                      2926  printer->push_block("if (nt->nrn_fast_imem)");
                      -
                      2927  if (nrn_cur_reduction_loop_required()) {
                      -
                      2928  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      2929  printer->add_line("int node_id = node_index[id];");
                      -
                      2930  }
                      -
                      2931  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_rhs[node_id] {} {};", rhs_op, rhs);
                      -
                      2932  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_d[node_id] {} {};", d_op, d);
                      -
                      2933  if (nrn_cur_reduction_loop_required()) {
                      -
                      2934  printer->pop_block();
                      -
                      2935  }
                      -
                      2936  printer->pop_block();
                      -
                      2937 }
                      -
                      2938 
                      -
                      2939 
                      - -
                      2941  if (!nrn_cur_required()) {
                      -
                      2942  return;
                      -
                      2943  }
                      -
                      2944 
                      -
                      2945  if (info.conductances.empty()) {
                      -
                      2946  print_nrn_current(*info.breakpoint_node);
                      -
                      2947  }
                      -
                      2948 
                      -
                      2949  printer->add_newline(2);
                      -
                      2950  printer->add_line("/** update current */");
                      -
                      2951  print_global_function_common_code(BlockType::Equation);
                      -
                      2952  print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                      -
                      2953  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      2954  print_nrn_cur_kernel(*info.breakpoint_node);
                      -
                      2955  print_nrn_cur_matrix_shadow_update();
                      -
                      2956  if (!nrn_cur_reduction_loop_required()) {
                      -
                      2957  print_fast_imem_calculation();
                      -
                      2958  }
                      -
                      2959  printer->pop_block();
                      -
                      2960 
                      -
                      2961  if (nrn_cur_reduction_loop_required()) {
                      -
                      2962  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      2963  print_nrn_cur_matrix_shadow_reduction();
                      -
                      2964  printer->pop_block();
                      -
                      2965  print_fast_imem_calculation();
                      -
                      2966  }
                      -
                      2967 
                      -
                      2968  print_kernel_data_present_annotation_block_end();
                      -
                      2969  printer->pop_block();
                      -
                      2970 }
                      -
                      2971 
                      -
                      2972 
                      -
                      2973 /****************************************************************************************/
                      -
                      2974 /* Main code printing entry points */
                      -
                      2975 /****************************************************************************************/
                      +
                      2906  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_rhs[node_id] {} {};", rhs_op, rhs);
                      +
                      2907  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_d[node_id] {} {};", d_op, d);
                      +
                      2908  if (nrn_cur_reduction_loop_required()) {
                      +
                      2909  printer->pop_block();
                      +
                      2910  }
                      +
                      2911  printer->pop_block();
                      +
                      2912 }
                      +
                      2913 
                      +
                      2914 
                      + +
                      2916  if (!nrn_cur_required()) {
                      +
                      2917  return;
                      +
                      2918  }
                      +
                      2919 
                      +
                      2920  if (info.conductances.empty()) {
                      +
                      2921  print_nrn_current(*info.breakpoint_node);
                      +
                      2922  }
                      +
                      2923 
                      +
                      2924  printer->add_newline(2);
                      +
                      2925  printer->add_line("/** update current */");
                      +
                      2926  print_global_function_common_code(BlockType::Equation);
                      +
                      2927  print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                      +
                      2928  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      2929  print_nrn_cur_kernel(*info.breakpoint_node);
                      +
                      2930  print_nrn_cur_matrix_shadow_update();
                      +
                      2931  if (!nrn_cur_reduction_loop_required()) {
                      +
                      2932  print_fast_imem_calculation();
                      +
                      2933  }
                      +
                      2934  printer->pop_block();
                      +
                      2935 
                      +
                      2936  if (nrn_cur_reduction_loop_required()) {
                      +
                      2937  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      2938  print_nrn_cur_matrix_shadow_reduction();
                      +
                      2939  printer->pop_block();
                      +
                      2940  print_fast_imem_calculation();
                      +
                      2941  }
                      +
                      2942 
                      +
                      2943  print_kernel_data_present_annotation_block_end();
                      +
                      2944  printer->pop_block();
                      +
                      2945 }
                      +
                      2946 
                      +
                      2947 
                      +
                      2948 /****************************************************************************************/
                      +
                      2949 /* Main code printing entry points */
                      +
                      2950 /****************************************************************************************/
                      +
                      2951 
                      + +
                      2953  print_standard_includes();
                      +
                      2954  print_backend_includes();
                      +
                      2955  print_coreneuron_includes();
                      +
                      2956 }
                      +
                      2957 
                      +
                      2958 
                      + +
                      2960  print_first_pointer_var_index_getter();
                      +
                      2961  print_first_random_var_index_getter();
                      +
                      2962  print_net_receive_arg_size_getter();
                      +
                      2963  print_thread_getters();
                      +
                      2964  print_num_variable_getter();
                      +
                      2965  print_mech_type_getter();
                      +
                      2966  print_memb_list_getter();
                      +
                      2967 }
                      +
                      2968 
                      +
                      2969 
                      + +
                      2971  print_mechanism_global_var_structure(print_initializers);
                      +
                      2972  print_mechanism_range_var_structure(print_initializers);
                      +
                      2973  print_ion_var_structure();
                      +
                      2974 }
                      +
                      2975 
                      2976 
                      - -
                      2978  print_standard_includes();
                      -
                      2979  print_backend_includes();
                      -
                      2980  print_coreneuron_includes();
                      -
                      2981 }
                      -
                      2982 
                      -
                      2983 
                      - -
                      2985  print_first_pointer_var_index_getter();
                      -
                      2986  print_first_random_var_index_getter();
                      -
                      2987  print_net_receive_arg_size_getter();
                      -
                      2988  print_thread_getters();
                      -
                      2989  print_num_variable_getter();
                      -
                      2990  print_mech_type_getter();
                      -
                      2991  print_memb_list_getter();
                      -
                      2992 }
                      -
                      2993 
                      -
                      2994 
                      - -
                      2996  print_mechanism_global_var_structure(print_initializers);
                      -
                      2997  print_mechanism_range_var_structure(print_initializers);
                      -
                      2998  print_ion_var_structure();
                      -
                      2999 }
                      -
                      3000 
                      -
                      3001 
                      - -
                      3003  if (!info.vectorize) {
                      -
                      3004  return;
                      + +
                      2978  if (!info.vectorize) {
                      +
                      2979  return;
                      +
                      2980  }
                      +
                      2981  printer->add_multi_line(R"CODE(
                      +
                      2982  #if NRN_PRCELLSTATE
                      +
                      2983  inst->v_unused[id] = v;
                      +
                      2984  #endif
                      +
                      2985  )CODE");
                      +
                      2986 }
                      +
                      2987 
                      +
                      2988 
                      + +
                      2990  printer->add_multi_line(R"CODE(
                      +
                      2991  #if NRN_PRCELLSTATE
                      +
                      2992  inst->g_unused[id] = g;
                      +
                      2993  #endif
                      +
                      2994  )CODE");
                      +
                      2995 }
                      +
                      2996 
                      +
                      2997 
                      + +
                      2999  print_top_verbatim_blocks();
                      +
                      3000  for (const auto& procedure: info.procedures) {
                      +
                      3001  print_procedure(*procedure);
                      +
                      3002  }
                      +
                      3003  for (const auto& function: info.functions) {
                      +
                      3004  print_function(*function);
                      3005  }
                      -
                      3006  printer->add_multi_line(R"CODE(
                      -
                      3007  #if NRN_PRCELLSTATE
                      -
                      3008  inst->v_unused[id] = v;
                      -
                      3009  #endif
                      -
                      3010  )CODE");
                      -
                      3011 }
                      -
                      3012 
                      -
                      3013 
                      - -
                      3015  printer->add_multi_line(R"CODE(
                      -
                      3016  #if NRN_PRCELLSTATE
                      -
                      3017  inst->g_unused[id] = g;
                      -
                      3018  #endif
                      -
                      3019  )CODE");
                      -
                      3020 }
                      -
                      3021 
                      -
                      3022 
                      - -
                      3024  print_top_verbatim_blocks();
                      -
                      3025  for (const auto& procedure: info.procedures) {
                      -
                      3026  print_procedure(*procedure);
                      -
                      3027  }
                      -
                      3028  for (const auto& function: info.functions) {
                      -
                      3029  print_function(*function);
                      -
                      3030  }
                      -
                      3031  for (const auto& function: info.function_tables) {
                      -
                      3032  print_function_tables(*function);
                      -
                      3033  }
                      -
                      3034  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                      -
                      3035  print_before_after_block(info.before_after_blocks[i], i);
                      -
                      3036  }
                      -
                      3037  for (const auto& callback: info.derivimplicit_callbacks) {
                      -
                      3038  const auto& block = *callback->get_node_to_solve();
                      -
                      3039  print_derivimplicit_kernel(block);
                      -
                      3040  }
                      -
                      3041  print_net_send_buffering();
                      -
                      3042  print_net_init();
                      -
                      3043  print_watch_activate();
                      -
                      3044  print_watch_check();
                      -
                      3045  print_net_receive_kernel();
                      -
                      3046  print_net_receive();
                      -
                      3047  print_net_receive_buffering();
                      -
                      3048  print_nrn_init();
                      -
                      3049  print_nrn_cur();
                      -
                      3050  print_nrn_state();
                      -
                      3051 }
                      -
                      3052 
                      +
                      3006  for (const auto& function: info.function_tables) {
                      +
                      3007  print_function_tables(*function);
                      +
                      3008  }
                      +
                      3009  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                      +
                      3010  print_before_after_block(info.before_after_blocks[i], i);
                      +
                      3011  }
                      +
                      3012  for (const auto& callback: info.derivimplicit_callbacks) {
                      +
                      3013  const auto& block = *callback->get_node_to_solve();
                      +
                      3014  print_derivimplicit_kernel(block);
                      +
                      3015  }
                      +
                      3016  print_net_send_buffering();
                      +
                      3017  print_net_init();
                      +
                      3018  print_watch_activate();
                      +
                      3019  print_watch_check();
                      +
                      3020  print_net_receive_kernel();
                      +
                      3021  print_net_receive();
                      +
                      3022  print_net_receive_buffering();
                      +
                      3023  print_nrn_init();
                      +
                      3024  print_nrn_cur();
                      +
                      3025  print_nrn_state();
                      +
                      3026 }
                      +
                      3027 
                      +
                      3028 
                      + +
                      3030  print_backend_info();
                      +
                      3031  print_headers_include();
                      +
                      3032  print_namespace_start();
                      +
                      3033  print_nmodl_constants();
                      +
                      3034  print_prcellstate_macros();
                      +
                      3035  print_mechanism_info();
                      +
                      3036  print_data_structures(true);
                      +
                      3037  print_global_variables_for_hoc();
                      +
                      3038  print_common_getters();
                      +
                      3039  print_memory_allocation_routine();
                      +
                      3040  print_abort_routine();
                      +
                      3041  print_thread_memory_callbacks();
                      +
                      3042  print_instance_variable_setup();
                      +
                      3043  print_nrn_alloc();
                      +
                      3044  print_nrn_constructor();
                      +
                      3045  print_nrn_destructor();
                      +
                      3046  print_function_prototypes();
                      +
                      3047  print_functors_definitions();
                      +
                      3048  print_compute_functions();
                      +
                      3049  print_check_table_thread_function();
                      +
                      3050  print_mechanism_register();
                      +
                      3051  print_namespace_stop();
                      +
                      3052 }
                      3053 
                      - -
                      3055  print_backend_info();
                      -
                      3056  print_headers_include();
                      -
                      3057  print_namespace_start();
                      -
                      3058  print_nmodl_constants();
                      -
                      3059  print_prcellstate_macros();
                      -
                      3060  print_mechanism_info();
                      -
                      3061  print_data_structures(true);
                      -
                      3062  print_global_variables_for_hoc();
                      -
                      3063  print_common_getters();
                      -
                      3064  print_memory_allocation_routine();
                      -
                      3065  print_abort_routine();
                      -
                      3066  print_thread_memory_callbacks();
                      -
                      3067  print_instance_variable_setup();
                      -
                      3068  print_nrn_alloc();
                      -
                      3069  print_nrn_constructor();
                      -
                      3070  print_nrn_destructor();
                      -
                      3071  print_function_prototypes();
                      -
                      3072  print_functors_definitions();
                      -
                      3073  print_compute_functions();
                      -
                      3074  print_check_table_thread_function();
                      -
                      3075  print_mechanism_register();
                      -
                      3076  print_namespace_stop();
                      -
                      3077 }
                      -
                      3078 
                      -
                      3079 
                      -
                      3080 /****************************************************************************************/
                      -
                      3081 /* Overloaded visitor routines */
                      -
                      3082 /****************************************************************************************/
                      -
                      3083 
                      +
                      3054 
                      +
                      3055 /****************************************************************************************/
                      +
                      3056 /* Overloaded visitor routines */
                      +
                      3057 /****************************************************************************************/
                      +
                      3058 
                      +
                      3059 
                      + +
                      3061  printer->fmt_line("{}_{}({});",
                      +
                      3062  node.get_node_to_solve()->get_node_name(),
                      +
                      3063  info.mod_suffix,
                      +
                      3064  external_method_arguments());
                      +
                      3065 }
                      +
                      3066 
                      +
                      3067 
                      + +
                      3069  // For_netcon should take the same arguments as net_receive and apply the operations
                      +
                      3070  // in the block to the weights of the netcons. Since all the weights are on the same vector,
                      +
                      3071  // weights, we have a mask of operations that we apply iteratively, advancing the offset
                      +
                      3072  // to the next netcon.
                      +
                      3073  const auto& args = node.get_parameters();
                      +
                      3074  RenameVisitor v;
                      +
                      3075  const auto& statement_block = node.get_statement_block();
                      +
                      3076  for (size_t i_arg = 0; i_arg < args.size(); ++i_arg) {
                      +
                      3077  // sanitize node_name since we want to substitute names like (*w) as they are
                      +
                      3078  auto old_name =
                      +
                      3079  std::regex_replace(args[i_arg]->get_node_name(), regex_special_chars, R"(\$&)");
                      +
                      3080  const auto& new_name = fmt::format("weights[{} + nt->_fornetcon_weight_perm[i]]", i_arg);
                      +
                      3081  v.set(old_name, new_name);
                      +
                      3082  statement_block->accept(v);
                      +
                      3083  }
                      3084 
                      - -
                      3086  printer->fmt_line("{}_{}({});",
                      -
                      3087  node.get_node_to_solve()->get_node_name(),
                      -
                      3088  info.mod_suffix,
                      -
                      3089  external_method_arguments());
                      -
                      3090 }
                      -
                      3091 
                      -
                      3092 
                      - -
                      3094  // For_netcon should take the same arguments as net_receive and apply the operations
                      -
                      3095  // in the block to the weights of the netcons. Since all the weights are on the same vector,
                      -
                      3096  // weights, we have a mask of operations that we apply iteratively, advancing the offset
                      -
                      3097  // to the next netcon.
                      -
                      3098  const auto& args = node.get_parameters();
                      -
                      3099  RenameVisitor v;
                      -
                      3100  const auto& statement_block = node.get_statement_block();
                      -
                      3101  for (size_t i_arg = 0; i_arg < args.size(); ++i_arg) {
                      -
                      3102  // sanitize node_name since we want to substitute names like (*w) as they are
                      -
                      3103  auto old_name =
                      -
                      3104  std::regex_replace(args[i_arg]->get_node_name(), regex_special_chars, R"(\$&)");
                      -
                      3105  const auto& new_name = fmt::format("weights[{} + nt->_fornetcon_weight_perm[i]]", i_arg);
                      -
                      3106  v.set(old_name, new_name);
                      -
                      3107  statement_block->accept(v);
                      -
                      3108  }
                      -
                      3109 
                      -
                      3110  const auto index =
                      -
                      3111  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                      -
                      3112  return a.name == naming::FOR_NETCON_SEMANTIC;
                      -
                      3113  })->index;
                      -
                      3114 
                      -
                      3115  printer->fmt_text("const size_t offset = {}*pnodecount + id;", index);
                      -
                      3116  printer->add_newline();
                      -
                      3117  printer->add_line(
                      -
                      3118  "const size_t for_netcon_start = nt->_fornetcon_perm_indices[indexes[offset]];");
                      -
                      3119  printer->add_line(
                      -
                      3120  "const size_t for_netcon_end = nt->_fornetcon_perm_indices[indexes[offset] + 1];");
                      -
                      3121 
                      -
                      3122  printer->add_line("for (auto i = for_netcon_start; i < for_netcon_end; ++i) {");
                      -
                      3123  printer->increase_indent();
                      -
                      3124  print_statement_block(*statement_block, false, false);
                      -
                      3125  printer->decrease_indent();
                      -
                      3126 
                      -
                      3127  printer->add_line("}");
                      -
                      3128 }
                      -
                      3129 
                      -
                      3130 
                      - -
                      3132  printer->add_text(fmt::format("nrn_watch_activate(inst, id, pnodecount, {}, v, watch_remove)",
                      -
                      3133  current_watch_statement++));
                      -
                      3134 }
                      -
                      3135 
                      -
                      3136 } // namespace codegen
                      -
                      3137 } // namespace nmodl
                      +
                      3085  const auto index =
                      +
                      3086  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                      +
                      3087  return a.name == naming::FOR_NETCON_SEMANTIC;
                      +
                      3088  })->index;
                      +
                      3089 
                      +
                      3090  printer->fmt_text("const size_t offset = {}*pnodecount + id;", index);
                      +
                      3091  printer->add_newline();
                      +
                      3092  printer->add_line(
                      +
                      3093  "const size_t for_netcon_start = nt->_fornetcon_perm_indices[indexes[offset]];");
                      +
                      3094  printer->add_line(
                      +
                      3095  "const size_t for_netcon_end = nt->_fornetcon_perm_indices[indexes[offset] + 1];");
                      +
                      3096 
                      +
                      3097  printer->add_line("for (auto i = for_netcon_start; i < for_netcon_end; ++i) {");
                      +
                      3098  printer->increase_indent();
                      +
                      3099  print_statement_block(*statement_block, false, false);
                      +
                      3100  printer->decrease_indent();
                      +
                      3101 
                      +
                      3102  printer->add_line("}");
                      +
                      3103 }
                      +
                      3104 
                      +
                      3105 
                      + +
                      3107  printer->add_text(fmt::format("nrn_watch_activate(inst, id, pnodecount, {}, v, watch_remove)",
                      +
                      3108  current_watch_statement++));
                      +
                      3109 }
                      +
                      3110 
                      +
                      3111 } // namespace codegen
                      +
                      3112 } // namespace nmodl
                      -
                      void print_procedure(const ast::ProcedureBlock &node) override
                      Print NMODL procedure in target backend code.
                      Represents a BEFORE block in NMODL.
                      -
                      void print_coreneuron_includes()
                      Print includes from coreneuron.
                      -
                      virtual std::string net_receive_buffering_declaration()
                      Generate the target backend code for the net_receive_buffering function delcaration.
                      +
                      void print_coreneuron_includes()
                      Print includes from coreneuron.
                      +
                      virtual std::string net_receive_buffering_declaration()
                      Generate the target backend code for the net_receive_buffering function delcaration.
                      std::shared_ptr< Block > get_node_to_solve() const noexcept
                      Getter for member variable DerivimplicitCallback::node_to_solve.
                      virtual bool nrn_cur_reduction_loop_required()
                      Check if reduction block in nrn_cur required.
                      -
                      void print_net_move_call(const ast::FunctionCall &node) override
                      Print call to net_move.
                      +
                      void print_net_move_call(const ast::FunctionCall &node) override
                      Print call to net_move.
                      Base class for all AST node.
                      Definition: node.hpp:40
                      -
                      void print_mechanism_range_var_structure(bool print_initializers) override
                      Print the structure that wraps all range and int variables required for the NMODL.
                      +
                      void print_mechanism_range_var_structure(bool print_initializers) override
                      Print the structure that wraps all range and int variables required for the NMODL.
                      bool is_index
                      if this is pure index (e.g.
                      static constexpr char CELSIUS_VARIABLE[]
                      global temperature variable
                      virtual void print_net_send_buf_count_update_to_host() const
                      Print the code to update NetSendBuffer_t count from device to host.
                      void print_function_prototypes() override
                      Print function and procedures prototype declaration.
                      -
                      void print_namespace_stop() override
                      Prints the end of the coreneuron namespace.
                      +
                      void print_namespace_stop() override
                      Prints the end of the coreneuron namespace.
                      Helper to represent information about index/int variables.
                      -
                      void print_v_unused() const override
                      Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                      +
                      void print_v_unused() const override
                      Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                      DUState
                      Represent a state in Def-Use chain.
                      -
                      void print_derivimplicit_kernel(const ast::Block &block)
                      Print derivative kernel when derivimplicit method is used.
                      +
                      void print_derivimplicit_kernel(const ast::Block &block)
                      Print derivative kernel when derivimplicit method is used.
                      virtual void print_device_stream_wait() const
                      Print the code to synchronise/wait on stream specific to NrnThread.
                      @ Destructor
                      destructor block
                      @ MUTEX_UNLOCK
                      type of ast::MutexUnlock
                      virtual void print_net_send_buf_count_update_to_device() const
                      Print the code to update NetSendBuffer_t count from host to device.
                      BAType
                      enum type to distinguish BEFORE or AFTER blocks
                      Definition: ast_common.hpp:80
                      -
                      std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                      Determine the variable name for a global variable given its symbol.
                      +
                      std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                      Determine the variable name for a global variable given its symbol.
                      - -
                      virtual void print_newtonspace_transfer_to_device() const
                      Print code block to transfer newtonspace structure to device.
                      +
                      virtual void print_newtonspace_transfer_to_device() const
                      Print code block to transfer newtonspace structure to device.
                      constexpr char NRN_PRIVATE_DESTRUCTOR_METHOD[]
                      nrn_private_destructor method in generated code
                      -
                      void print_net_send_call(const ast::FunctionCall &node) override
                      Print call to net_send.
                      +
                      void print_net_send_call(const ast::FunctionCall &node) override
                      Print call to net_send.
                      static constexpr char POINT_PROCESS_VARIABLE[]
                      inbuilt neuron variable for point process
                      -
                      virtual void print_net_receive_loop_begin()
                      Print the code for the main net_receive loop.
                      +
                      virtual void print_net_receive_loop_begin()
                      Print the code for the main net_receive loop.
                      const ArgumentVector & get_parameters() const noexcept override
                      Getter for member variable FunctionTableBlock::parameters.
                      static constexpr char NTHREAD_D_SHADOW[]
                      shadow d variable in neuron thread structure
                      std::shared_ptr< symtab::Symbol > SymbolType
                      virtual void print_kernel_data_present_annotation_block_begin()
                      Print accelerator annotations indicating data presence on device.
                      -
                      void print_g_unused() const override
                      Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                      +
                      void print_g_unused() const override
                      Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                      const ArgumentVector & get_parameters() const noexcept override
                      Getter for member variable NetReceiveBlock::parameters.
                      @ MUTEX_LOCK
                      type of ast::MutexLock
                      - -
                      std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                      Determine the name of an int variable given its symbol.
                      -
                      void print_initial_block(const ast::InitialBlock *node)
                      Print initial block statements.
                      -
                      void print_net_receive_kernel()
                      Print net_receive kernel function definition.
                      -
                      void print_thread_getters()
                      Print the getter method for thread variables and ids.
                      + +
                      std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                      Determine the name of an int variable given its symbol.
                      +
                      void print_initial_block(const ast::InitialBlock *node)
                      Print initial block statements.
                      +
                      void print_net_receive_kernel()
                      Print net_receive kernel function definition.
                      +
                      void print_thread_getters()
                      Print the getter method for thread variables and ids.
                      std::string simulator_name() override
                      Name of the simulator the code was generated for.
                      -
                      void print_net_send_buffering()
                      Print kernel for buffering net_send events.
                      -
                      static std::string get_register_type_for_ba_block(const ast::Block *block)
                      Return registration type for a given BEFORE/AFTER block /param block A BEFORE/AFTER block being regis...
                      +
                      void print_net_send_buffering()
                      Print kernel for buffering net_send events.
                      +
                      static std::string get_register_type_for_ba_block(const ast::Block *block)
                      Return registration type for a given BEFORE/AFTER block /param block A BEFORE/AFTER block being regis...
                      encapsulates code generation backend implementations
                      Definition: ast_common.hpp:26
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable InitialBlock::statement_block.
                      @ index
                      index / int variables
                      -
                      void print_fast_imem_calculation() override
                      Print fast membrane current calculation code.
                      +
                      void print_fast_imem_calculation() override
                      Print fast membrane current calculation code.
                      virtual void print_dt_update_to_device() const
                      Print the code to update dt from host to device.
                      virtual void print_net_init_acc_serial_annotation_block_end()
                      Print accelerator kernels end annotation for net_init kernel.
                      -
                      const ParamVector external_method_parameters(bool table=false) noexcept override
                      Parameters for functions in generated code that are called back from external code.
                      +
                      const ParamVector external_method_parameters(bool table=false) noexcept override
                      Parameters for functions in generated code that are called back from external code.
                      Represent ions used in mod file.
                      static constexpr char NRN_CONSTRUCTOR_METHOD[]
                      nrn_constructor method in generated code
                      -
                      void print_net_init()
                      Print initial block in the net receive block.
                      -
                      void print_net_event_call(const ast::FunctionCall &node) override
                      Print call to net_event.
                      -
                      void print_nrn_destructor() override
                      Print nrn_destructor function definition.
                      -
                      void print_sdlists_init(bool print_initializers) override
                      - -
                      void print_send_event_move()
                      Print send event move block used in net receive as well as watch.
                      -
                      void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                      Generate Function call statement for nrn_wrote_conc.
                      +
                      void print_net_init()
                      Print initial block in the net receive block.
                      +
                      void print_net_event_call(const ast::FunctionCall &node) override
                      Print call to net_event.
                      +
                      void print_nrn_destructor() override
                      Print nrn_destructor function definition.
                      +
                      void print_sdlists_init(bool print_initializers) override
                      + +
                      void print_send_event_move()
                      Print send event move block used in net receive as well as watch.
                      +
                      void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                      Generate Function call statement for nrn_wrote_conc.
                      int get_prefixsum_from_name(const std::vector< T > &variables, const std::string &name)
                      std::string name
                      name of the ion
                      static constexpr char NTHREAD_DT_VARIABLE[]
                      dt variable in neuron thread structure
                      @@ -3305,20 +3278,20 @@
                      void print_atomic_reduction_pragma() override
                      Print atomic update pragma for reduction statements.
                      Check if variable is used in given block.
                      Implement string manipulation functions.
                      -
                      void print_global_variables_for_hoc() override
                      Print byte arrays that register scalar and vector variables for hoc interface.
                      +
                      void print_global_variables_for_hoc() override
                      Print byte arrays that register scalar and vector variables for hoc interface.
                      static constexpr char NODE_AREA_VARIABLE[]
                      inbuilt neuron variable for area of the compartment
                      -
                      void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
                      Print the common code section for net receive related methods.
                      -
                      void print_nrn_current(const ast::BreakpointBlock &node) override
                      Print the nrn_current kernel.
                      +
                      void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
                      Print the common code section for net receive related methods.
                      +
                      void print_nrn_current(const ast::BreakpointBlock &node) override
                      Print the nrn_current kernel.
                      virtual bool is_function_block() const noexcept
                      Check if the ast node is an instance of ast::FunctionBlock.
                      Definition: ast.cpp:142
                      static constexpr char NRN_ALLOC_METHOD[]
                      nrn_alloc method in generated code
                      bool is_integer
                      if this is an integer (e.g.
                      -
                      void print_first_pointer_var_index_getter()
                      Print the getter method for index position of first pointer variable.
                      -
                      void print_setup_range_variable()
                      Print the function that initialize range variable with different data type.
                      -
                      std::string internal_method_arguments() override
                      Arguments for functions that are defined and used internally.
                      +
                      void print_first_pointer_var_index_getter()
                      Print the getter method for index position of first pointer variable.
                      +
                      void print_setup_range_variable()
                      Print the function that initialize range variable with different data type.
                      +
                      std::string internal_method_arguments() override
                      Arguments for functions that are defined and used internally.
                      Class that binds all pieces together for parsing C verbatim blocks.
                      Definition: c11_driver.hpp:37
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable BreakpointBlock::statement_block.
                      -
                      std::string nrn_thread_arguments() const override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      -
                      void print_net_receive_arg_size_getter()
                      Print the getter method for getting number of arguments for net_receive.
                      +
                      std::string nrn_thread_arguments() const override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      +
                      void print_net_receive_arg_size_getter()
                      Print the getter method for getting number of arguments for net_receive.
                      Helper visitor to gather AST information to help code generation.
                      std::string get_node_name() const override
                      Return name of the node.
                      Definition: ast.cpp:3800
                      void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
                      Print nmodl function or procedure (common code)
                      @@ -3328,35 +3301,35 @@
                      Base class for all block scoped nodes.
                      Definition: block.hpp:41
                      Represents a INITIAL block in the NMODL.
                      virtual void print_nrn_cur_matrix_shadow_update()
                      Print the update to matrix elements with/without shadow vectors.
                      -
                      std::string register_mechanism_arguments() const override
                      Arguments for register_mech or point_register_mech function.
                      +
                      std::string register_mechanism_arguments() const override
                      Arguments for register_mech or point_register_mech function.
                      virtual void print_net_init_acc_serial_annotation_block_begin()
                      Print accelerator kernels begin annotation for net_init kernel.
                      virtual void print_deriv_advance_flag_transfer_to_device() const
                      Print the code to copy derivative advance flag to device.
                      -
                      void print_first_random_var_index_getter()
                      Print the getter method for index position of first RANDOM variable.
                      +
                      void print_first_random_var_index_getter()
                      Print the getter method for index position of first RANDOM variable.
                      static constexpr char NTHREAD_RHS_SHADOW[]
                      shadow rhs variable in neuron thread structure
                      Utility functions for visitors implementation.
                      @ Equation
                      breakpoint block
                      static constexpr char USE_TABLE_VARIABLE[]
                      global variable to indicate if table is used
                      Represent WATCH statement in NMODL.
                      -
                      virtual void print_before_after_block(const ast::Block *node, size_t block_id)
                      Print NMODL before / after block in target backend code.
                      +
                      virtual void print_before_after_block(const ast::Block *node, size_t block_id)
                      Print NMODL before / after block in target backend code.
                      Represents a BREAKPOINT block in NMODL.
                      nmodl::parser::UnitDriver driver
                      Definition: parser.cpp:28
                      -
                      const std::regex regex_special_chars
                      +
                      const std::regex regex_special_chars
                      Visitor for printing C++ code compatible with legacy api of CoreNEURON
                      static const std::unordered_map< std::string, std::string > VERBATIM_VARIABLES_MAPPING
                      commonly used variables in verbatim block and how they should be mapped to new code generation backen...
                      -
                      void print_ion_variable() override
                      Print the ion variable struct.
                      +
                      void print_ion_variable() override
                      Print the ion variable struct.
                      @ Constructor
                      constructor block
                      -
                      void print_ion_var_structure()
                      Print structure of ion variables used for local copies.
                      +
                      void print_ion_var_structure()
                      Print structure of ion variables used for local copies.
                      -
                      ParamVector internal_method_parameters() override
                      Parameters for internally defined functions.
                      +
                      ParamVector internal_method_parameters() override
                      Parameters for internally defined functions.
                      int position_of_int_var(const std::string &name) const override
                      Determine the position in the data array for a given int variable.
                      virtual void print_channel_iteration_block_parallel_hint(BlockType type, const ast::Block *block)
                      Print pragma annotations for channel iterations.
                      virtual bool is_constant_variable(const std::string &name) const
                      Check if variable is qualified as constant.
                      void print_function_procedure_helper(const ast::Block &node) override
                      Common helper function to help printing function or procedure blocks.
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable ForNetcon::statement_block.
                      Definition: for_netcon.hpp:185
                      -
                      void visit_for_netcon(const ast::ForNetcon &node) override
                      visit node of type ast::ForNetcon
                      -
                      void print_compute_functions() override
                      Print all compute functions for every backend.
                      -
                      void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                      Print the nrn_cur kernel with NMODL conductance keyword provisions.
                      +
                      void visit_for_netcon(const ast::ForNetcon &node) override
                      visit node of type ast::ForNetcon
                      +
                      void print_compute_functions() override
                      Print all compute functions for every backend.
                      +
                      void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                      Print the nrn_cur kernel with NMODL conductance keyword provisions.
                      Represent semantic information for index variable.
                      bool is_intra_cell_conc(const std::string &text) const
                      Check if variable name is internal cell concentration.
                      @@ -3370,12 +3343,11 @@
                      static constexpr char NRN_INIT_METHOD[]
                      nrn_init method in generated code
                      virtual void print_rhs_d_shadow_variables()
                      Print the setup method for setting matrix shadow vectors.
                      const ExpressionVector & get_arguments() const noexcept
                      Getter for member variable FunctionCall::arguments.
                      -
                      std::string process_verbatim_text(std::string const &text) override
                      Process a verbatim block for possible variable renaming.
                      +
                      std::string process_verbatim_text(std::string const &text) override
                      Process a verbatim block for possible variable renaming.
                      static constexpr char THREAD_ARGS[]
                      verbatim name of the variable for nrn thread arguments
                      -
                      void print_net_receive()
                      Print net_receive function definition.
                      -
                      static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                      Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                      +
                      void print_net_receive()
                      Print net_receive function definition.
                      +
                      static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                      Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                      bool optimize_ion_variable_copies() const override
                      Check if ion variable copies should be avoided.
                      -
                      void print_function(const ast::FunctionBlock &node) override
                      Print NMODL function in target backend code.
                      void print_top_verbatim_blocks()
                      Print top level (global scope) verbatim blocks.
                      Blindly rename given variable to new name
                      static constexpr char NRN_CUR_METHOD[]
                      nrn_cur method in generated code
                      @@ -3383,88 +3355,85 @@
                      static constexpr char TQITEM_VARIABLE[]
                      inbuilt neuron variable for tqitem process
                      void set(const std::string &old_name, std::string new_name)
                      std::vector< std::shared_ptr< const ast::Ast > > collect_nodes(const ast::Ast &node, const std::vector< ast::AstNodeType > &types)
                      traverse node recursively and collect nodes of given types
                      -
                      void print_mechanism_global_var_structure(bool print_initializers) override
                      Print the structure that wraps all global variables used in the NMODL.
                      +
                      void print_mechanism_global_var_structure(bool print_initializers) override
                      Print the structure that wraps all global variables used in the NMODL.
                      Visitor to return Def-Use chain for a given variable in the block/node
                      -
                      std::string get_node_name() const override
                      Return name of the node.
                      Definition: ast.cpp:3963
                      -
                      void print_nrn_constructor() override
                      Print nrn_constructor function definition.
                      +
                      void print_nrn_constructor() override
                      Print nrn_constructor function definition.
                      virtual void print_kernel_data_present_annotation_block_end()
                      Print matching block end of accelerator annotations for data presence on device.
                      -
                      void print_nrn_alloc() override
                      Print nrn_alloc function definition.
                      +
                      void print_nrn_alloc() override
                      Print nrn_alloc function definition.
                      virtual void print_nrn_cur_matrix_shadow_reduction()
                      Print the reduction to matrix elements from shadow vectors.
                      -
                      void print_memb_list_getter()
                      Print the getter method for returning membrane list from NrnThread.
                      - +
                      void print_memb_list_getter()
                      Print the getter method for returning membrane list from NrnThread.
                      +
                      static constexpr char INST_GLOBAL_MEMBER[]
                      instance struct member pointing to the global variable structure
                      @ PROTECT_STATEMENT
                      type of ast::ProtectStatement
                      -
                      void print_instance_variable_setup()
                      Print the function that initialize instance structure.
                      -
                      void print_nrn_init(bool skip_init_check=true)
                      Print the nrn_init function definition.
                      -
                      std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                      Determine variable name in the structure of mechanism properties.
                      +
                      void print_instance_variable_setup()
                      Print the function that initialize instance structure.
                      +
                      void print_nrn_init(bool skip_init_check=true)
                      Print the nrn_init function definition.
                      +
                      std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                      Determine variable name in the structure of mechanism properties.
                      NmodlType
                      NMODL variable properties.
                      -
                      void print_namespace_start() override
                      Prints the start of the coreneuron namespace.
                      +
                      void print_namespace_start() override
                      Prints the start of the coreneuron namespace.
                      @ BATYPE_BREAKPOINT
                      Definition: ast_common.hpp:80
                      virtual void print_abort_routine() const
                      Print backend specific abort routine.
                      const ArgumentVector & get_parameters() const noexcept override
                      Getter for member variable ForNetcon::parameters.
                      Definition: for_netcon.hpp:176
                      -
                      void print_nrn_cur() override
                      Print nrn_cur / current update function definition.
                      -
                      std::string get_range_var_float_type(const SymbolType &symbol)
                      Returns floating point type for given range variable symbol.
                      -
                      virtual void print_net_send_buffering_cnt_update() const
                      Print the code related to the update of NetSendBuffer_t cnt.
                      -
                      void print_thread_memory_callbacks()
                      Print thread related memory allocation and deallocation callbacks.
                      +
                      void print_nrn_cur() override
                      Print nrn_cur / current update function definition.
                      +
                      std::string get_range_var_float_type(const SymbolType &symbol)
                      Returns floating point type for given range variable symbol.
                      +
                      virtual void print_net_send_buffering_cnt_update() const
                      Print the code related to the update of NetSendBuffer_t cnt.
                      +
                      void print_thread_memory_callbacks()
                      Print thread related memory allocation and deallocation callbacks.
                      Represent a callback to NEURON's derivimplicit solver.
                      Represents ion write statement during code generation.
                      - -
                      void print_net_receive_buffering(bool need_mech_inst=true)
                      Print kernel for buffering net_receive events.
                      -
                      virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                      Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                      -
                      ParamVector functor_params() override
                      The parameters of the Newton solver "functor".
                      +
                      void print_net_receive_buffering(bool need_mech_inst=true)
                      Print kernel for buffering net_receive events.
                      +
                      virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                      Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                      +
                      ParamVector functor_params() override
                      The parameters of the Newton solver "functor".
                      Implement logger based on spdlog library.
                      bool is_vdata
                      if variable resides in vdata field of NrnThread typically true for bbcore pointer
                      -
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable FunctionBlock::statement_block.
                      BlockType
                      Helper to represent various block types.
                      -
                      void print_mechanism_register() override
                      Print the mechanism registration function.
                      +
                      void print_mechanism_register() override
                      Print the mechanism registration function.
                      virtual void print_global_method_annotation()
                      Print backend specific global method annotation.
                      static constexpr char NRN_STATE_METHOD[]
                      nrn_state method in generated code
                      -
                      void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                      Print main body of nrn_cur function.
                      +
                      void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                      Print main body of nrn_cur function.
                      Version information and units file path.
                      -
                      std::string nrn_thread_internal_arguments() override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      +
                      std::string nrn_thread_internal_arguments() override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      virtual void print_device_atomic_capture_annotation() const
                      Print pragma annotation for increase and capture of variable in automatic way.
                      -
                      void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
                      visit node of type ast::DerivimplicitCallback
                      -
                      virtual void print_get_memb_list()
                      Print the target backend code for defining and checking a local Memb_list variable.
                      -
                      void print_num_variable_getter()
                      Print the getter methods for float and integer variables count.
                      +
                      void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
                      visit node of type ast::DerivimplicitCallback
                      +
                      virtual void print_get_memb_list()
                      Print the target backend code for defining and checking a local Memb_list variable.
                      +
                      void print_num_variable_getter()
                      Print the getter methods for float and integer variables count.
                      virtual std::shared_ptr< StatementBlock > get_statement_block() const
                      Return associated statement block for the AST node.
                      Definition: ast.cpp:32
                      -
                      void print_standard_includes() override
                      Print standard C/C++ includes.
                      -
                      virtual void print_net_receive_loop_end()
                      Print the code for closing the main net_receive loop.
                      +
                      void print_standard_includes() override
                      Print standard C/C++ includes.
                      +
                      virtual void print_net_receive_loop_end()
                      Print the code for closing the main net_receive loop.
                      void visit_children(visitor::Visitor &v) override
                      visit children i.e.
                      Definition: ast.cpp:388
                      -
                      void print_mech_type_getter()
                      Print the getter method for returning mechtype.
                      +
                      void print_mech_type_getter()
                      Print the getter method for returning mechtype.
                      Represents a AFTER block in NMODL.
                      Definition: after_block.hpp:51
                      virtual bool is_before_block() const noexcept
                      Check if the ast node is an instance of ast::BeforeBlock.
                      Definition: ast.cpp:152
                      static constexpr char NTHREAD_T_VARIABLE[]
                      t variable in neuron thread structure
                      -
                      std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                      Determine the name of a float variable given its symbol.
                      -
                      virtual void print_global_variable_device_update_annotation()
                      Print the pragma annotation to update global variables from host to the device.
                      +
                      std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                      Determine the name of a float variable given its symbol.
                      +
                      virtual void print_global_variable_device_update_annotation()
                      Print the pragma annotation to update global variables from host to the device.
                      Blindly rename given variable to new name
                      @ State
                      derivative block
                      -
                      void print_function_tables(const ast::FunctionTableBlock &node)
                      Print NMODL function_table in target backend code.
                      +
                      void print_function_tables(const ast::FunctionTableBlock &node)
                      Print NMODL function_table in target backend code.
                      THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
                      -
                      void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
                      Add the variable tqitem during get_int_variables.
                      -
                      void visit_watch_statement(const ast::WatchStatement &node) override
                      visit node of type ast::WatchStatement
                      -
                      const std::string external_method_arguments() noexcept override
                      Arguments for external functions called from generated code.
                      -
                      void print_nrn_cur_non_conductance_kernel() override
                      Print the nrn_cur kernel without NMODL conductance keyword provisions.
                      +
                      void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
                      Add the variable tqitem during get_int_variables.
                      +
                      void visit_watch_statement(const ast::WatchStatement &node) override
                      visit node of type ast::WatchStatement
                      +
                      const std::string external_method_arguments() noexcept override
                      Arguments for external functions called from generated code.
                      +
                      void print_nrn_cur_non_conductance_kernel() override
                      Print the nrn_cur kernel without NMODL conductance keyword provisions.
                      bool variable_used(const ast::Node &node, std::string name)
                      virtual void print_backend_includes()
                      Print backend specific includes (none needed for C++ backend)
                      std::string process_verbatim_token(const std::string &token)
                      Process a token in a verbatim block for possible variable renaming.
                      -
                      void print_nrn_state() override
                      Print nrn_state / state update function definition.
                      -
                      void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
                      Add the variable point_process during get_int_variables.
                      +
                      void print_nrn_state() override
                      Print nrn_state / state update function definition.
                      +
                      void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
                      Add the variable point_process during get_int_variables.
                      static constexpr char NRN_DESTRUCTOR_METHOD[]
                      nrn_destructor method in generated code
                      -
                      void print_codegen_routines() override
                      Print entry point to code generation.
                      +
                      void print_codegen_routines() override
                      Print entry point to code generation.
                      - +
                      static constexpr char THREAD_ARGS_PROTO[]
                      verbatim name of the variable for nrn thread arguments in prototype
                      @ BeforeAfter
                      before / after block
                      -
                      virtual void print_net_send_buffering_grow()
                      Print statement that grows NetSendBuffering_t structure if needed.
                      +
                      virtual void print_net_send_buffering_grow()
                      Print statement that grows NetSendBuffering_t structure if needed.
                      constexpr char NRN_PRIVATE_CONSTRUCTOR_METHOD[]
                      nrn_private_constructor method in generated code
                      virtual std::string get_node_name() const
                      Return name of of the node.
                      Definition: ast.cpp:28
                      virtual void print_net_send_buf_update_to_host() const
                      Print the code to update NetSendBuffer_t from device to host.
                      Auto generated AST classes declaration.
                      -
                      void print_data_structures(bool print_initializers) override
                      Print all classes.
                      -
                      std::string replace_if_verbatim_variable(std::string name)
                      Replace commonly used verbatim variables.
                      -
                      virtual void print_ion_var_constructor(const std::vector< std::string > &members)
                      Print constructor of ion variables.
                      +
                      void print_data_structures(bool print_initializers) override
                      Print all classes.
                      +
                      std::string replace_if_verbatim_variable(std::string name)
                      Replace commonly used verbatim variables.
                      +
                      virtual void print_ion_var_constructor(const std::vector< std::string > &members)
                      Print constructor of ion variables.
                      int position_of_float_var(const std::string &name) const override
                      Determine the position in the data array for a given float variable.
                      std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
                      A vector of parameters represented by a 4-tuple of strings:
                      static constexpr char ION_VARNAME_PREFIX[]
                      prefix for ion variable
                      diff --git a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html index a71ebfd0c..ecf8e35a5 100644 --- a/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html +++ b/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html @@ -387,2013 +387,1987 @@
                      291 }
                      292 
                      293 
                      - -
                      295  print_function_procedure_helper(node);
                      -
                      296 }
                      -
                      297 
                      -
                      298 
                      - -
                      300  auto name = node.get_node_name();
                      -
                      301 
                      -
                      302  // name of return variable
                      -
                      303  std::string return_var;
                      -
                      304  if (info.function_uses_table(name)) {
                      -
                      305  return_var = "ret_f_" + name;
                      -
                      306  } else {
                      -
                      307  return_var = "ret_" + name;
                      -
                      308  }
                      -
                      309 
                      -
                      310  // first rename return variable name
                      -
                      311  auto block = node.get_statement_block().get();
                      -
                      312  RenameVisitor v(name, return_var);
                      -
                      313  block->accept(v);
                      -
                      314 
                      -
                      315  print_function_procedure_helper(node);
                      -
                      316 }
                      -
                      317 
                      - -
                      319  const ast::Block* function_or_procedure_block,
                      -
                      320  InterpreterWrapper wrapper_type) {
                      -
                      321  if (info.point_process && wrapper_type == InterpreterWrapper::Python) {
                      -
                      322  return;
                      -
                      323  }
                      -
                      324  const auto block_name = function_or_procedure_block->get_node_name();
                      -
                      325  if (info.point_process) {
                      -
                      326  printer->fmt_push_block("static double _hoc_{}(void* _vptr)", block_name);
                      -
                      327  } else if (wrapper_type == InterpreterWrapper::HOC) {
                      -
                      328  printer->fmt_push_block("static void _hoc_{}(void)", block_name);
                      -
                      329  } else {
                      -
                      330  printer->fmt_push_block("static double _npy_{}(Prop* _prop)", block_name);
                      -
                      331  }
                      -
                      332  printer->add_multi_line(R"CODE(
                      -
                      333  double _r{};
                      -
                      334  Datum* _ppvar;
                      -
                      335  Datum* _thread;
                      -
                      336  NrnThread* nt;
                      -
                      337  )CODE");
                      -
                      338  if (info.point_process) {
                      -
                      339  printer->add_multi_line(R"CODE(
                      -
                      340  auto* const _pnt = static_cast<Point_process*>(_vptr);
                      -
                      341  auto* const _p = _pnt->prop;
                      -
                      342  if (!_p) {
                      -
                      343  hoc_execerror("POINT_PROCESS data instance not valid", NULL);
                      -
                      344  }
                      -
                      345  _nrn_mechanism_cache_instance _lmc{_p};
                      -
                      346  size_t const id{};
                      -
                      347  _ppvar = _nrn_mechanism_access_dparam(_p);
                      -
                      348  _thread = _extcall_thread.data();
                      -
                      349  nt = static_cast<NrnThread*>(_pnt->_vnt);
                      -
                      350  )CODE");
                      -
                      351  } else if (wrapper_type == InterpreterWrapper::HOC) {
                      -
                      352  if (program_symtab->lookup(block_name)->has_all_properties(NmodlType::use_range_ptr_var)) {
                      -
                      353  printer->push_block("if (!_prop_id)");
                      -
                      354  printer->fmt_line(
                      -
                      355  "hoc_execerror(\"No data for {}_{}. Requires prior call to setdata_{} and that the "
                      -
                      356  "specified mechanism instance still be in existence.\", NULL);",
                      -
                      357  function_or_procedure_block->get_node_name(),
                      -
                      358  info.mod_suffix,
                      -
                      359  info.mod_suffix);
                      -
                      360  printer->pop_block();
                      -
                      361  printer->add_line("Prop* _local_prop = _extcall_prop;");
                      -
                      362  } else {
                      -
                      363  printer->add_line("Prop* _local_prop = _prop_id ? _extcall_prop : nullptr;");
                      -
                      364  }
                      -
                      365  printer->add_multi_line(R"CODE(
                      -
                      366  _nrn_mechanism_cache_instance _lmc{_local_prop};
                      -
                      367  size_t const id{};
                      -
                      368  _ppvar = _local_prop ? _nrn_mechanism_access_dparam(_local_prop) : nullptr;
                      -
                      369  _thread = _extcall_thread.data();
                      -
                      370  nt = nrn_threads;
                      -
                      371  )CODE");
                      -
                      372  } else { // wrapper_type == InterpreterWrapper::Python
                      -
                      373  printer->add_multi_line(R"CODE(
                      -
                      374  _nrn_mechanism_cache_instance _lmc{_prop};
                      -
                      375  size_t const id{};
                      -
                      376  _ppvar = _nrn_mechanism_access_dparam(_prop);
                      -
                      377  _thread = _extcall_thread.data();
                      -
                      378  nt = nrn_threads;
                      -
                      379  )CODE");
                      -
                      380  }
                      -
                      381  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      -
                      382  if (!codegen_thread_variables.empty()) {
                      -
                      383  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                      -
                      384  thread_variables_struct(),
                      -
                      385  info.thread_var_thread_id);
                      -
                      386  }
                      -
                      387  if (info.function_uses_table(block_name)) {
                      -
                      388  printer->fmt_line("{}({});",
                      -
                      389  table_update_function_name(block_name),
                      -
                      390  internal_method_arguments());
                      -
                      391  }
                      -
                      392  const auto get_func_call_str = [&]() {
                      -
                      393  const auto params = function_or_procedure_block->get_parameters();
                      -
                      394  const auto func_proc_name = block_name + "_" + info.mod_suffix;
                      -
                      395  auto func_call = fmt::format("{}({}", func_proc_name, internal_method_arguments());
                      -
                      396  for (int i = 0; i < params.size(); ++i) {
                      -
                      397  func_call.append(fmt::format(", *getarg({})", i + 1));
                      -
                      398  }
                      -
                      399  func_call.append(")");
                      -
                      400  return func_call;
                      -
                      401  };
                      -
                      402  if (function_or_procedure_block->is_function_block()) {
                      -
                      403  printer->add_indent();
                      -
                      404  printer->fmt_text("_r = {};", get_func_call_str());
                      -
                      405  printer->add_newline();
                      -
                      406  } else {
                      -
                      407  printer->add_line("_r = 1.;");
                      -
                      408  printer->fmt_line("{};", get_func_call_str());
                      -
                      409  }
                      -
                      410  if (info.point_process || wrapper_type != InterpreterWrapper::HOC) {
                      -
                      411  printer->add_line("return(_r);");
                      -
                      412  } else if (wrapper_type == InterpreterWrapper::HOC) {
                      -
                      413  printer->add_line("hoc_retpushx(_r);");
                      -
                      414  }
                      -
                      415  printer->pop_block();
                      -
                      416 }
                      -
                      417 
                      + +
                      295  const ast::Block* function_or_procedure_block,
                      +
                      296  InterpreterWrapper wrapper_type) {
                      +
                      297  if (info.point_process && wrapper_type == InterpreterWrapper::Python) {
                      +
                      298  return;
                      +
                      299  }
                      +
                      300  const auto block_name = function_or_procedure_block->get_node_name();
                      +
                      301  if (info.point_process) {
                      +
                      302  printer->fmt_push_block("static double _hoc_{}(void* _vptr)", block_name);
                      +
                      303  } else if (wrapper_type == InterpreterWrapper::HOC) {
                      +
                      304  printer->fmt_push_block("static void _hoc_{}(void)", block_name);
                      +
                      305  } else {
                      +
                      306  printer->fmt_push_block("static double _npy_{}(Prop* _prop)", block_name);
                      +
                      307  }
                      +
                      308  printer->add_multi_line(R"CODE(
                      +
                      309  double _r{};
                      +
                      310  Datum* _ppvar;
                      +
                      311  Datum* _thread;
                      +
                      312  NrnThread* nt;
                      +
                      313  )CODE");
                      +
                      314  if (info.point_process) {
                      +
                      315  printer->add_multi_line(R"CODE(
                      +
                      316  auto* const _pnt = static_cast<Point_process*>(_vptr);
                      +
                      317  auto* const _p = _pnt->prop;
                      +
                      318  if (!_p) {
                      +
                      319  hoc_execerror("POINT_PROCESS data instance not valid", NULL);
                      +
                      320  }
                      +
                      321  _nrn_mechanism_cache_instance _lmc{_p};
                      +
                      322  size_t const id{};
                      +
                      323  _ppvar = _nrn_mechanism_access_dparam(_p);
                      +
                      324  _thread = _extcall_thread.data();
                      +
                      325  nt = static_cast<NrnThread*>(_pnt->_vnt);
                      +
                      326  )CODE");
                      +
                      327  } else if (wrapper_type == InterpreterWrapper::HOC) {
                      +
                      328  if (program_symtab->lookup(block_name)->has_all_properties(NmodlType::use_range_ptr_var)) {
                      +
                      329  printer->push_block("if (!_prop_id)");
                      +
                      330  printer->fmt_line(
                      +
                      331  "hoc_execerror(\"No data for {}_{}. Requires prior call to setdata_{} and that the "
                      +
                      332  "specified mechanism instance still be in existence.\", NULL);",
                      +
                      333  function_or_procedure_block->get_node_name(),
                      +
                      334  info.mod_suffix,
                      +
                      335  info.mod_suffix);
                      +
                      336  printer->pop_block();
                      +
                      337  printer->add_line("Prop* _local_prop = _extcall_prop;");
                      +
                      338  } else {
                      +
                      339  printer->add_line("Prop* _local_prop = _prop_id ? _extcall_prop : nullptr;");
                      +
                      340  }
                      +
                      341  printer->add_multi_line(R"CODE(
                      +
                      342  _nrn_mechanism_cache_instance _lmc{_local_prop};
                      +
                      343  size_t const id{};
                      +
                      344  _ppvar = _local_prop ? _nrn_mechanism_access_dparam(_local_prop) : nullptr;
                      +
                      345  _thread = _extcall_thread.data();
                      +
                      346  nt = nrn_threads;
                      +
                      347  )CODE");
                      +
                      348  } else { // wrapper_type == InterpreterWrapper::Python
                      +
                      349  printer->add_multi_line(R"CODE(
                      +
                      350  _nrn_mechanism_cache_instance _lmc{_prop};
                      +
                      351  size_t const id{};
                      +
                      352  _ppvar = _nrn_mechanism_access_dparam(_prop);
                      +
                      353  _thread = _extcall_thread.data();
                      +
                      354  nt = nrn_threads;
                      +
                      355  )CODE");
                      +
                      356  }
                      +
                      357  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      +
                      358  if (!codegen_thread_variables.empty()) {
                      +
                      359  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                      +
                      360  thread_variables_struct(),
                      +
                      361  info.thread_var_thread_id);
                      +
                      362  }
                      +
                      363  if (info.function_uses_table(block_name)) {
                      +
                      364  printer->fmt_line("{}({});",
                      +
                      365  table_update_function_name(block_name),
                      +
                      366  internal_method_arguments());
                      +
                      367  }
                      +
                      368  const auto get_func_call_str = [&]() {
                      +
                      369  const auto params = function_or_procedure_block->get_parameters();
                      +
                      370  const auto func_proc_name = block_name + "_" + info.mod_suffix;
                      +
                      371  auto func_call = fmt::format("{}({}", func_proc_name, internal_method_arguments());
                      +
                      372  for (int i = 0; i < params.size(); ++i) {
                      +
                      373  func_call.append(fmt::format(", *getarg({})", i + 1));
                      +
                      374  }
                      +
                      375  func_call.append(")");
                      +
                      376  return func_call;
                      +
                      377  };
                      +
                      378  if (function_or_procedure_block->is_function_block()) {
                      +
                      379  printer->add_indent();
                      +
                      380  printer->fmt_text("_r = {};", get_func_call_str());
                      +
                      381  printer->add_newline();
                      +
                      382  } else {
                      +
                      383  printer->add_line("_r = 1.;");
                      +
                      384  printer->fmt_line("{};", get_func_call_str());
                      +
                      385  }
                      +
                      386  if (info.point_process || wrapper_type != InterpreterWrapper::HOC) {
                      +
                      387  printer->add_line("return(_r);");
                      +
                      388  } else if (wrapper_type == InterpreterWrapper::HOC) {
                      +
                      389  printer->add_line("hoc_retpushx(_r);");
                      +
                      390  }
                      +
                      391  printer->pop_block();
                      +
                      392 }
                      +
                      393 
                      +
                      394 
                      + +
                      396  for (const auto& procedure: info.procedures) {
                      +
                      397  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::HOC);
                      +
                      398  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::Python);
                      +
                      399  }
                      +
                      400  for (const auto& function: info.functions) {
                      +
                      401  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::HOC);
                      +
                      402  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::Python);
                      +
                      403  }
                      +
                      404 }
                      +
                      405 
                      +
                      406 
                      +
                      407 /****************************************************************************************/
                      +
                      408 /* Code-specific helper routines */
                      +
                      409 /****************************************************************************************/
                      +
                      410 
                      +
                      411 void CodegenNeuronCppVisitor::add_variable_tqitem(std::vector<IndexVariableInfo>& variables) {
                      +
                      412  if (info.net_send_used) {
                      +
                      413  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
                      +
                      414  variables.back().is_constant = true;
                      +
                      415  info.tqitem_index = static_cast<int>(variables.size() - 1);
                      +
                      416  }
                      +
                      417 }
                      418 
                      - -
                      420  for (const auto& procedure: info.procedures) {
                      -
                      421  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::HOC);
                      -
                      422  print_hoc_py_wrapper_function_body(procedure, InterpreterWrapper::Python);
                      -
                      423  }
                      -
                      424  for (const auto& function: info.functions) {
                      -
                      425  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::HOC);
                      -
                      426  print_hoc_py_wrapper_function_body(function, InterpreterWrapper::Python);
                      -
                      427  }
                      + +
                      420  std::vector<IndexVariableInfo>& variables) {
                      +
                      421  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
                      +
                      422  variables.back().is_constant = true;
                      +
                      423 }
                      +
                      424 
                      + +
                      426  const auto& args = internal_method_parameters();
                      +
                      427  return get_arg_str(args);
                      428 }
                      429 
                      430 
                      -
                      431 /****************************************************************************************/
                      -
                      432 /* Code-specific helper routines */
                      -
                      433 /****************************************************************************************/
                      -
                      434 
                      -
                      435 void CodegenNeuronCppVisitor::add_variable_tqitem(std::vector<IndexVariableInfo>& variables) {
                      -
                      436  if (info.net_send_used) {
                      -
                      437  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
                      -
                      438  variables.back().is_constant = true;
                      -
                      439  info.tqitem_index = static_cast<int>(variables.size() - 1);
                      + +
                      432  ParamVector params;
                      +
                      433  params.emplace_back("", "_nrn_mechanism_cache_range&", "", "_lmc");
                      +
                      434  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                      +
                      435  params.emplace_back("", "size_t", "", "id");
                      +
                      436  params.emplace_back("", "Datum*", "", "_ppvar");
                      +
                      437  params.emplace_back("", "Datum*", "", "_thread");
                      +
                      438  if (!codegen_thread_variables.empty()) {
                      +
                      439  params.emplace_back("", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars");
                      440  }
                      -
                      441 }
                      -
                      442 
                      - -
                      444  std::vector<IndexVariableInfo>& variables) {
                      -
                      445  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
                      -
                      446  variables.back().is_constant = true;
                      -
                      447 }
                      -
                      448 
                      - -
                      450  const auto& args = internal_method_parameters();
                      -
                      451  return get_arg_str(args);
                      -
                      452 }
                      -
                      453 
                      -
                      454 
                      - -
                      456  ParamVector params;
                      -
                      457  params.emplace_back("", "_nrn_mechanism_cache_range&", "", "_lmc");
                      -
                      458  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                      -
                      459  params.emplace_back("", "size_t", "", "id");
                      -
                      460  params.emplace_back("", "Datum*", "", "_ppvar");
                      -
                      461  params.emplace_back("", "Datum*", "", "_thread");
                      -
                      462  if (!codegen_thread_variables.empty()) {
                      -
                      463  params.emplace_back("", fmt::format("{}&", thread_variables_struct()), "", "_thread_vars");
                      -
                      464  }
                      -
                      465  params.emplace_back("", "NrnThread*", "", "nt");
                      -
                      466  return params;
                      -
                      467 }
                      -
                      468 
                      -
                      469 
                      -
                      470 /// TODO: Edit for NEURON
                      - -
                      472  return {};
                      -
                      473 }
                      -
                      474 
                      -
                      475 
                      -
                      476 /// TODO: Edit for NEURON
                      - -
                      478  bool table) noexcept {
                      +
                      441  params.emplace_back("", "NrnThread*", "", "nt");
                      +
                      442  return params;
                      +
                      443 }
                      +
                      444 
                      +
                      445 
                      +
                      446 /// TODO: Edit for NEURON
                      + +
                      448  return {};
                      +
                      449 }
                      +
                      450 
                      +
                      451 
                      +
                      452 /// TODO: Edit for NEURON
                      + +
                      454  bool table) noexcept {
                      +
                      455  return {};
                      +
                      456 }
                      +
                      457 
                      +
                      458 
                      +
                      459 /// TODO: Edit for NEURON
                      + +
                      461  return {};
                      +
                      462 }
                      +
                      463 
                      +
                      464 
                      +
                      465 /// TODO: Edit for NEURON
                      + +
                      467  return {};
                      +
                      468 }
                      +
                      469 
                      +
                      470 
                      +
                      471 /// TODO: Write for NEURON
                      +
                      472 std::string CodegenNeuronCppVisitor::process_verbatim_text(std::string const& text) {
                      +
                      473  return {};
                      +
                      474 }
                      +
                      475 
                      +
                      476 
                      +
                      477 /// TODO: Write for NEURON
                      +
                      479  return {};
                      -
                      480 }
                      +
                      480 };
                      481 
                      -
                      482 
                      -
                      483 /// TODO: Edit for NEURON
                      - -
                      485  return {};
                      +
                      482 
                      + +
                      484  const std::string& function_or_procedure_name) const {
                      +
                      485  return fmt::format("_hoc_{}", function_or_procedure_name);
                      486 }
                      487 
                      -
                      488 
                      -
                      489 /// TODO: Edit for NEURON
                      - -
                      491  return {};
                      -
                      492 }
                      -
                      493 
                      -
                      494 
                      -
                      495 /// TODO: Write for NEURON
                      -
                      496 std::string CodegenNeuronCppVisitor::process_verbatim_text(std::string const& text) {
                      -
                      497  return {};
                      -
                      498 }
                      -
                      499 
                      -
                      500 
                      -
                      501 /// TODO: Write for NEURON
                      - -
                      503  return {};
                      -
                      504 };
                      -
                      505 
                      -
                      506 
                      - -
                      508  const std::string& function_or_procedure_name) const {
                      -
                      509  return fmt::format("_hoc_{}", function_or_procedure_name);
                      -
                      510 }
                      -
                      511 
                      -
                      512 
                      - -
                      514  const std::string& function_or_procedure_name) const {
                      -
                      515  return fmt::format("static {} {}(void{})",
                      -
                      516  info.point_process ? "double" : "void",
                      -
                      517  hoc_function_name(function_or_procedure_name),
                      -
                      518  info.point_process ? "*" : "");
                      -
                      519 }
                      +
                      488 
                      + +
                      490  const std::string& function_or_procedure_name) const {
                      +
                      491  return fmt::format("static {} {}(void{})",
                      +
                      492  info.point_process ? "double" : "void",
                      +
                      493  hoc_function_name(function_or_procedure_name),
                      +
                      494  info.point_process ? "*" : "");
                      +
                      495 }
                      +
                      496 
                      +
                      497 
                      + +
                      499  const std::string& function_or_procedure_name) const {
                      +
                      500  return fmt::format("_npy_{}", function_or_procedure_name);
                      +
                      501 }
                      +
                      502 
                      +
                      503 
                      + +
                      505  const std::string& function_or_procedure_name) const {
                      +
                      506  return fmt::format("static double {}(Prop*)", py_function_name(function_or_procedure_name));
                      +
                      507 }
                      +
                      508 
                      +
                      509 
                      +
                      510 /****************************************************************************************/
                      +
                      511 /* Code-specific printing routines for code generation */
                      +
                      512 /****************************************************************************************/
                      +
                      513 
                      +
                      514 
                      + +
                      516  printer->add_newline(2);
                      +
                      517  printer->push_block("namespace neuron");
                      +
                      518 }
                      +
                      519 
                      520 
                      -
                      521 
                      - -
                      523  const std::string& function_or_procedure_name) const {
                      -
                      524  return fmt::format("_npy_{}", function_or_procedure_name);
                      -
                      525 }
                      -
                      526 
                      -
                      527 
                      - -
                      529  const std::string& function_or_procedure_name) const {
                      -
                      530  return fmt::format("static double {}(Prop*)", py_function_name(function_or_procedure_name));
                      -
                      531 }
                      -
                      532 
                      -
                      533 
                      -
                      534 /****************************************************************************************/
                      -
                      535 /* Code-specific printing routines for code generation */
                      -
                      536 /****************************************************************************************/
                      -
                      537 
                      -
                      538 
                      - -
                      540  printer->add_newline(2);
                      -
                      541  printer->push_block("namespace neuron");
                      -
                      542 }
                      -
                      543 
                      -
                      544 
                      - -
                      546  printer->pop_block();
                      -
                      547 }
                      -
                      548 
                      - -
                      550  std::vector<ShadowUseStatement>& statements,
                      -
                      551  const Ion& ion,
                      -
                      552  const std::string& /* concentration */) {
                      -
                      553  auto ion_name = ion.name;
                      -
                      554  int dparam_index = get_int_variable_index(fmt::format("style_{}", ion_name));
                      -
                      555 
                      -
                      556  auto style_name = fmt::format("_style_{}", ion_name);
                      -
                      557  auto style_stmt = fmt::format("int {} = *(_ppvar[{}].get<int*>())", style_name, dparam_index);
                      -
                      558  statements.push_back(ShadowUseStatement{style_stmt, "", ""});
                      -
                      559 
                      -
                      560 
                      -
                      561  auto wrote_conc_stmt = fmt::format("nrn_wrote_conc(_{}_sym, {}, {}, {}, {})",
                      -
                      562  ion_name,
                      -
                      563  get_variable_name(ion.rev_potential_pointer_name()),
                      -
                      564  get_variable_name(ion.intra_conc_pointer_name()),
                      -
                      565  get_variable_name(ion.extra_conc_pointer_name()),
                      -
                      566  style_name);
                      -
                      567  statements.push_back(ShadowUseStatement{wrote_conc_stmt, "", ""});
                      -
                      568 }
                      -
                      569 
                      -
                      570 /****************************************************************************************/
                      -
                      571 /* Routines for returning variable name */
                      -
                      572 /****************************************************************************************/
                      -
                      573 
                      -
                      574 
                      -
                      575 /// TODO: Edit for NEURON
                      - -
                      577  bool use_instance) const {
                      -
                      578  if (!use_instance) {
                      -
                      579  throw std::runtime_error("Printing non-instance variables is not implemented.");
                      -
                      580  }
                      -
                      581 
                      -
                      582  auto name = symbol->get_name();
                      -
                      583  auto dimension = symbol->get_length();
                      -
                      584  if (symbol->is_array()) {
                      -
                      585  return fmt::format("(inst.{}+id*{})", name, dimension);
                      -
                      586  } else {
                      -
                      587  return fmt::format("inst.{}[id]", name);
                      + +
                      522  printer->pop_block();
                      +
                      523 }
                      +
                      524 
                      + +
                      526  std::vector<ShadowUseStatement>& statements,
                      +
                      527  const Ion& ion,
                      +
                      528  const std::string& /* concentration */) {
                      +
                      529  auto ion_name = ion.name;
                      +
                      530  int dparam_index = get_int_variable_index(fmt::format("style_{}", ion_name));
                      +
                      531 
                      +
                      532  auto style_name = fmt::format("_style_{}", ion_name);
                      +
                      533  auto style_stmt = fmt::format("int {} = *(_ppvar[{}].get<int*>())", style_name, dparam_index);
                      +
                      534  statements.push_back(ShadowUseStatement{style_stmt, "", ""});
                      +
                      535 
                      +
                      536 
                      +
                      537  auto wrote_conc_stmt = fmt::format("nrn_wrote_conc(_{}_sym, {}, {}, {}, {})",
                      +
                      538  ion_name,
                      +
                      539  get_variable_name(ion.rev_potential_pointer_name()),
                      +
                      540  get_variable_name(ion.intra_conc_pointer_name()),
                      +
                      541  get_variable_name(ion.extra_conc_pointer_name()),
                      +
                      542  style_name);
                      +
                      543  statements.push_back(ShadowUseStatement{wrote_conc_stmt, "", ""});
                      +
                      544 }
                      +
                      545 
                      +
                      546 /****************************************************************************************/
                      +
                      547 /* Routines for returning variable name */
                      +
                      548 /****************************************************************************************/
                      +
                      549 
                      +
                      550 
                      +
                      551 /// TODO: Edit for NEURON
                      + +
                      553  bool use_instance) const {
                      +
                      554  if (!use_instance) {
                      +
                      555  throw std::runtime_error("Printing non-instance variables is not implemented.");
                      +
                      556  }
                      +
                      557 
                      +
                      558  auto name = symbol->get_name();
                      +
                      559  auto dimension = symbol->get_length();
                      +
                      560  if (symbol->is_array()) {
                      +
                      561  return fmt::format("(inst.{}+id*{})", name, dimension);
                      +
                      562  } else {
                      +
                      563  return fmt::format("inst.{}[id]", name);
                      +
                      564  }
                      +
                      565 }
                      +
                      566 
                      +
                      567 
                      + +
                      569  const std::string& name,
                      +
                      570  bool use_instance) const {
                      +
                      571  auto position = position_of_int_var(name);
                      +
                      572  if (symbol.is_index) {
                      +
                      573  if (use_instance) {
                      +
                      574  throw std::runtime_error("Not implemented. [wiejo]");
                      +
                      575  // return fmt::format("inst->{}[{}]", name, position);
                      +
                      576  }
                      +
                      577  throw std::runtime_error("Not implemented. [ncuwi]");
                      +
                      578  // return fmt::format("indexes[{}]", position);
                      +
                      579  }
                      +
                      580  if (symbol.is_integer) {
                      +
                      581  if (use_instance) {
                      +
                      582  return fmt::format("inst.{}[id]", name);
                      +
                      583  }
                      +
                      584  return fmt::format("_ppvar[{}]", position);
                      +
                      585  }
                      +
                      586  if (use_instance) {
                      +
                      587  return fmt::format("(*inst.{}[id])", name);
                      588  }
                      -
                      589 }
                      -
                      590 
                      -
                      591 
                      - -
                      593  const std::string& name,
                      -
                      594  bool use_instance) const {
                      -
                      595  auto position = position_of_int_var(name);
                      -
                      596  if (symbol.is_index) {
                      -
                      597  if (use_instance) {
                      -
                      598  throw std::runtime_error("Not implemented. [wiejo]");
                      -
                      599  // return fmt::format("inst->{}[{}]", name, position);
                      -
                      600  }
                      -
                      601  throw std::runtime_error("Not implemented. [ncuwi]");
                      -
                      602  // return fmt::format("indexes[{}]", position);
                      -
                      603  }
                      -
                      604  if (symbol.is_integer) {
                      -
                      605  if (use_instance) {
                      -
                      606  return fmt::format("inst.{}[id]", name);
                      -
                      607  }
                      -
                      608  return fmt::format("_ppvar[{}]", position);
                      -
                      609  }
                      -
                      610  if (use_instance) {
                      -
                      611  return fmt::format("(*inst.{}[id])", name);
                      -
                      612  }
                      -
                      613 
                      -
                      614  throw std::runtime_error("Not implemented. [nvueir]");
                      -
                      615  // auto data = symbol.is_vdata ? "_vdata" : "_data";
                      -
                      616  // return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                      -
                      617 }
                      -
                      618 
                      -
                      619 
                      - -
                      621  bool use_instance) const {
                      -
                      622  auto i_var = var_info.offset;
                      -
                      623  auto var_name = var_info.symbol->get_name();
                      -
                      624 
                      -
                      625  if (use_instance) {
                      -
                      626  if (var_info.symbol->is_array()) {
                      -
                      627  return fmt::format("(_thread_vars.{}_ptr(id))", var_name);
                      -
                      628  } else {
                      -
                      629  return fmt::format("_thread_vars.{}(id)", var_name);
                      -
                      630  }
                      -
                      631  } else {
                      -
                      632  if (var_info.symbol->is_array()) {
                      -
                      633  return fmt::format("({}.thread_data + {})", global_struct_instance(), i_var);
                      -
                      634  } else {
                      -
                      635  return fmt::format("{}.thread_data[{}]", global_struct_instance(), i_var);
                      -
                      636  }
                      -
                      637  }
                      -
                      638 }
                      -
                      639 
                      -
                      640 
                      - -
                      642  bool use_instance) const {
                      -
                      643  if (use_instance) {
                      -
                      644  return fmt::format("inst.{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                      -
                      645  } else {
                      -
                      646  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                      -
                      647  }
                      -
                      648 }
                      -
                      649 
                      +
                      589 
                      +
                      590  throw std::runtime_error("Not implemented. [nvueir]");
                      +
                      591  // auto data = symbol.is_vdata ? "_vdata" : "_data";
                      +
                      592  // return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                      +
                      593 }
                      +
                      594 
                      +
                      595 
                      + +
                      597  bool use_instance) const {
                      +
                      598  auto i_var = var_info.offset;
                      +
                      599  auto var_name = var_info.symbol->get_name();
                      +
                      600 
                      +
                      601  if (use_instance) {
                      +
                      602  if (var_info.symbol->is_array()) {
                      +
                      603  return fmt::format("(_thread_vars.{}_ptr(id))", var_name);
                      +
                      604  } else {
                      +
                      605  return fmt::format("_thread_vars.{}(id)", var_name);
                      +
                      606  }
                      +
                      607  } else {
                      +
                      608  if (var_info.symbol->is_array()) {
                      +
                      609  return fmt::format("({}.thread_data + {})", global_struct_instance(), i_var);
                      +
                      610  } else {
                      +
                      611  return fmt::format("{}.thread_data[{}]", global_struct_instance(), i_var);
                      +
                      612  }
                      +
                      613  }
                      +
                      614 }
                      +
                      615 
                      +
                      616 
                      + +
                      618  bool use_instance) const {
                      +
                      619  if (use_instance) {
                      +
                      620  return fmt::format("inst.{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                      +
                      621  } else {
                      +
                      622  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                      +
                      623  }
                      +
                      624 }
                      +
                      625 
                      +
                      626 
                      +
                      627 std::string CodegenNeuronCppVisitor::get_variable_name(const std::string& name,
                      +
                      628  bool use_instance) const {
                      +
                      629  const std::string& varname = update_if_ion_variable_name(name);
                      +
                      630 
                      +
                      631  auto name_comparator = [&varname](const auto& sym) { return varname == get_name(sym); };
                      +
                      632 
                      +
                      633  if (name == naming::POINT_PROCESS_VARIABLE) {
                      +
                      634  if (printing_net_receive) {
                      +
                      635  // In net_receive blocks, the point process is passed in as an
                      +
                      636  // argument called:
                      +
                      637  return "_pnt";
                      +
                      638  }
                      +
                      639  // The "integer variable" branch will pick up the correct `_ppvar` when
                      +
                      640  // not printing a NET_RECEIVE block.
                      +
                      641  }
                      +
                      642 
                      +
                      643  // float variable
                      +
                      644  auto f = std::find_if(codegen_float_variables.begin(),
                      +
                      645  codegen_float_variables.end(),
                      +
                      646  name_comparator);
                      +
                      647  if (f != codegen_float_variables.end()) {
                      +
                      648  return float_variable_name(*f, use_instance);
                      +
                      649  }
                      650 
                      -
                      651 std::string CodegenNeuronCppVisitor::get_variable_name(const std::string& name,
                      -
                      652  bool use_instance) const {
                      -
                      653  const std::string& varname = update_if_ion_variable_name(name);
                      -
                      654 
                      -
                      655  auto name_comparator = [&varname](const auto& sym) { return varname == get_name(sym); };
                      -
                      656 
                      -
                      657  if (name == naming::POINT_PROCESS_VARIABLE) {
                      -
                      658  if (printing_net_receive) {
                      -
                      659  // In net_receive blocks, the point process is passed in as an
                      -
                      660  // argument called:
                      -
                      661  return "_pnt";
                      -
                      662  }
                      -
                      663  // The "integer variable" branch will pick up the correct `_ppvar` when
                      -
                      664  // not printing a NET_RECEIVE block.
                      -
                      665  }
                      -
                      666 
                      -
                      667  // float variable
                      -
                      668  auto f = std::find_if(codegen_float_variables.begin(),
                      -
                      669  codegen_float_variables.end(),
                      -
                      670  name_comparator);
                      -
                      671  if (f != codegen_float_variables.end()) {
                      -
                      672  return float_variable_name(*f, use_instance);
                      -
                      673  }
                      -
                      674 
                      -
                      675  // integer variable
                      -
                      676  auto i =
                      -
                      677  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), name_comparator);
                      -
                      678  if (i != codegen_int_variables.end()) {
                      -
                      679  return int_variable_name(*i, varname, use_instance);
                      +
                      651  // integer variable
                      +
                      652  auto i =
                      +
                      653  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), name_comparator);
                      +
                      654  if (i != codegen_int_variables.end()) {
                      +
                      655  return int_variable_name(*i, varname, use_instance);
                      +
                      656  }
                      +
                      657 
                      +
                      658  // thread variable
                      +
                      659  auto t = std::find_if(codegen_thread_variables.begin(),
                      +
                      660  codegen_thread_variables.end(),
                      +
                      661  name_comparator);
                      +
                      662  if (t != codegen_thread_variables.end()) {
                      +
                      663  return thread_variable_name(*t, use_instance);
                      +
                      664  }
                      +
                      665 
                      +
                      666  // global variable
                      +
                      667  auto g = std::find_if(codegen_global_variables.begin(),
                      +
                      668  codegen_global_variables.end(),
                      +
                      669  name_comparator);
                      +
                      670  if (g != codegen_global_variables.end()) {
                      +
                      671  return global_variable_name(*g, use_instance);
                      +
                      672  }
                      +
                      673 
                      +
                      674  if (varname == naming::NTHREAD_DT_VARIABLE) {
                      +
                      675  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                      +
                      676  }
                      +
                      677 
                      +
                      678  if (varname == naming::NTHREAD_T_VARIABLE) {
                      +
                      679  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                      680  }
                      681 
                      -
                      682  // thread variable
                      -
                      683  auto t = std::find_if(codegen_thread_variables.begin(),
                      -
                      684  codegen_thread_variables.end(),
                      -
                      685  name_comparator);
                      -
                      686  if (t != codegen_thread_variables.end()) {
                      -
                      687  return thread_variable_name(*t, use_instance);
                      -
                      688  }
                      -
                      689 
                      -
                      690  // global variable
                      -
                      691  auto g = std::find_if(codegen_global_variables.begin(),
                      -
                      692  codegen_global_variables.end(),
                      -
                      693  name_comparator);
                      -
                      694  if (g != codegen_global_variables.end()) {
                      -
                      695  return global_variable_name(*g, use_instance);
                      +
                      682  auto const iter =
                      +
                      683  std::find_if(info.neuron_global_variables.begin(),
                      +
                      684  info.neuron_global_variables.end(),
                      +
                      685  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                      +
                      686  if (iter != info.neuron_global_variables.end()) {
                      +
                      687  std::string ret;
                      +
                      688  if (use_instance) {
                      +
                      689  ret = "*(inst.";
                      +
                      690  }
                      +
                      691  ret.append(varname);
                      +
                      692  if (use_instance) {
                      +
                      693  ret.append(")");
                      +
                      694  }
                      +
                      695  return ret;
                      696  }
                      697 
                      -
                      698  if (varname == naming::NTHREAD_DT_VARIABLE) {
                      -
                      699  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                      -
                      700  }
                      +
                      698  // otherwise return original name
                      +
                      699  return varname;
                      +
                      700 }
                      701 
                      -
                      702  if (varname == naming::NTHREAD_T_VARIABLE) {
                      -
                      703  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                      -
                      704  }
                      -
                      705 
                      -
                      706  auto const iter =
                      -
                      707  std::find_if(info.neuron_global_variables.begin(),
                      -
                      708  info.neuron_global_variables.end(),
                      -
                      709  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                      -
                      710  if (iter != info.neuron_global_variables.end()) {
                      -
                      711  std::string ret;
                      -
                      712  if (use_instance) {
                      -
                      713  ret = "*(inst.";
                      -
                      714  }
                      -
                      715  ret.append(varname);
                      -
                      716  if (use_instance) {
                      -
                      717  ret.append(")");
                      -
                      718  }
                      -
                      719  return ret;
                      +
                      702 
                      +
                      703 /****************************************************************************************/
                      +
                      704 /* Main printing routines for code generation */
                      +
                      705 /****************************************************************************************/
                      +
                      706 
                      +
                      707 
                      + +
                      709  printer->add_newline();
                      +
                      710  printer->add_multi_line(R"CODE(
                      +
                      711  #include <Eigen/Dense>
                      +
                      712  #include <Eigen/LU>
                      +
                      713  #include <math.h>
                      +
                      714  #include <stdio.h>
                      +
                      715  #include <stdlib.h>
                      +
                      716  #include <vector>
                      +
                      717  )CODE");
                      +
                      718  if (info.eigen_newton_solver_exist) {
                      +
                      719  printer->add_multi_line(nmodl::solvers::newton_hpp);
                      720  }
                      -
                      721 
                      -
                      722  // otherwise return original name
                      -
                      723  return varname;
                      -
                      724 }
                      -
                      725 
                      -
                      726 
                      -
                      727 /****************************************************************************************/
                      -
                      728 /* Main printing routines for code generation */
                      -
                      729 /****************************************************************************************/
                      -
                      730 
                      -
                      731 
                      - -
                      733  printer->add_newline();
                      -
                      734  printer->add_multi_line(R"CODE(
                      -
                      735  #include <Eigen/Dense>
                      -
                      736  #include <Eigen/LU>
                      -
                      737  #include <math.h>
                      -
                      738  #include <stdio.h>
                      -
                      739  #include <stdlib.h>
                      -
                      740  #include <vector>
                      -
                      741  )CODE");
                      -
                      742  if (info.eigen_newton_solver_exist) {
                      -
                      743  printer->add_multi_line(nmodl::solvers::newton_hpp);
                      -
                      744  }
                      -
                      745 }
                      -
                      746 
                      -
                      747 
                      - -
                      749  printer->add_newline();
                      -
                      750  printer->add_multi_line(R"CODE(
                      -
                      751  #include "mech_api.h"
                      -
                      752  #include "neuron/cache/mechanism_range.hpp"
                      -
                      753  #include "nrniv_mf.h"
                      -
                      754  #include "section_fwd.hpp"
                      -
                      755  )CODE");
                      -
                      756 }
                      -
                      757 
                      -
                      758 
                      -
                      759 void CodegenNeuronCppVisitor::print_sdlists_init([[maybe_unused]] bool print_initializers) {
                      -
                      760  /// _initlists() should only be called once by the mechanism registration function
                      -
                      761  /// (_<mod_file>_reg())
                      -
                      762  printer->add_newline(2);
                      -
                      763  printer->push_block("static void _initlists()");
                      -
                      764  for (auto i = 0; i < info.prime_variables_by_order.size(); ++i) {
                      -
                      765  const auto& prime_var = info.prime_variables_by_order[i];
                      -
                      766  /// TODO: Something similar needs to happen for slist/dlist2 but I don't know their usage at
                      -
                      767  // the moment
                      -
                      768  /// TODO: We have to do checks and add errors similar to nocmodl in the
                      -
                      769  // SemanticAnalysisVisitor
                      -
                      770  if (prime_var->is_array()) {
                      -
                      771  /// TODO: Needs a for loop here. Look at
                      -
                      772  // https://github.com/neuronsimulator/nrn/blob/df001a436bcb4e23d698afe66c2a513819a6bfe8/src/nmodl/deriv.cpp#L524
                      -
                      773  /// TODO: Also needs a test
                      -
                      774  printer->fmt_push_block("for (int _i = 0; _i < {}; ++_i)", prime_var->get_length());
                      -
                      775  printer->fmt_line("/* {}[{}] */", prime_var->get_name(), prime_var->get_length());
                      -
                      776  printer->fmt_line("_slist1[{}+_i] = {{{}, _i}};",
                      -
                      777  i,
                      -
                      778  position_of_float_var(prime_var->get_name()));
                      -
                      779  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                      -
                      780  printer->fmt_line("/* {}[{}] */", prime_var_deriv_name, prime_var->get_length());
                      -
                      781  printer->fmt_line("_dlist1[{}+_i] = {{{}, _i}};",
                      -
                      782  i,
                      -
                      783  position_of_float_var(prime_var_deriv_name));
                      -
                      784  printer->pop_block();
                      -
                      785  } else {
                      -
                      786  printer->fmt_line("/* {} */", prime_var->get_name());
                      -
                      787  printer->fmt_line("_slist1[{}] = {{{}, 0}};",
                      -
                      788  i,
                      -
                      789  position_of_float_var(prime_var->get_name()));
                      -
                      790  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                      -
                      791  printer->fmt_line("/* {} */", prime_var_deriv_name);
                      -
                      792  printer->fmt_line("_dlist1[{}] = {{{}, 0}};",
                      -
                      793  i,
                      -
                      794  position_of_float_var(prime_var_deriv_name));
                      -
                      795  }
                      +
                      721 }
                      +
                      722 
                      +
                      723 
                      + +
                      725  printer->add_newline();
                      +
                      726  printer->add_multi_line(R"CODE(
                      +
                      727  #include "mech_api.h"
                      +
                      728  #include "neuron/cache/mechanism_range.hpp"
                      +
                      729  #include "nrniv_mf.h"
                      +
                      730  #include "section_fwd.hpp"
                      +
                      731  )CODE");
                      +
                      732 }
                      +
                      733 
                      +
                      734 
                      +
                      735 void CodegenNeuronCppVisitor::print_sdlists_init([[maybe_unused]] bool print_initializers) {
                      +
                      736  /// _initlists() should only be called once by the mechanism registration function
                      +
                      737  /// (_<mod_file>_reg())
                      +
                      738  printer->add_newline(2);
                      +
                      739  printer->push_block("static void _initlists()");
                      +
                      740  for (auto i = 0; i < info.prime_variables_by_order.size(); ++i) {
                      +
                      741  const auto& prime_var = info.prime_variables_by_order[i];
                      +
                      742  /// TODO: Something similar needs to happen for slist/dlist2 but I don't know their usage at
                      +
                      743  // the moment
                      +
                      744  /// TODO: We have to do checks and add errors similar to nocmodl in the
                      +
                      745  // SemanticAnalysisVisitor
                      +
                      746  if (prime_var->is_array()) {
                      +
                      747  /// TODO: Needs a for loop here. Look at
                      +
                      748  // https://github.com/neuronsimulator/nrn/blob/df001a436bcb4e23d698afe66c2a513819a6bfe8/src/nmodl/deriv.cpp#L524
                      +
                      749  /// TODO: Also needs a test
                      +
                      750  printer->fmt_push_block("for (int _i = 0; _i < {}; ++_i)", prime_var->get_length());
                      +
                      751  printer->fmt_line("/* {}[{}] */", prime_var->get_name(), prime_var->get_length());
                      +
                      752  printer->fmt_line("_slist1[{}+_i] = {{{}, _i}};",
                      +
                      753  i,
                      +
                      754  position_of_float_var(prime_var->get_name()));
                      +
                      755  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                      +
                      756  printer->fmt_line("/* {}[{}] */", prime_var_deriv_name, prime_var->get_length());
                      +
                      757  printer->fmt_line("_dlist1[{}+_i] = {{{}, _i}};",
                      +
                      758  i,
                      +
                      759  position_of_float_var(prime_var_deriv_name));
                      +
                      760  printer->pop_block();
                      +
                      761  } else {
                      +
                      762  printer->fmt_line("/* {} */", prime_var->get_name());
                      +
                      763  printer->fmt_line("_slist1[{}] = {{{}, 0}};",
                      +
                      764  i,
                      +
                      765  position_of_float_var(prime_var->get_name()));
                      +
                      766  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                      +
                      767  printer->fmt_line("/* {} */", prime_var_deriv_name);
                      +
                      768  printer->fmt_line("_dlist1[{}] = {{{}, 0}};",
                      +
                      769  i,
                      +
                      770  position_of_float_var(prime_var_deriv_name));
                      +
                      771  }
                      +
                      772  }
                      +
                      773  printer->pop_block();
                      +
                      774 }
                      +
                      775 
                      + +
                      777  auto params = internal_method_parameters();
                      +
                      778  params.push_back({"", "double", "", "v"});
                      +
                      779 
                      +
                      780  return params;
                      +
                      781 }
                      +
                      782 
                      + +
                      784  const auto value_initialize = print_initializers ? "{}" : "";
                      +
                      785 
                      +
                      786  /// TODO: Print only global variables printed in NEURON
                      +
                      787  printer->add_newline(2);
                      +
                      788  printer->add_line("/* NEURON global variables */");
                      +
                      789  if (info.primes_size != 0) {
                      +
                      790  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
                      +
                      791  info.primes_size);
                      +
                      792  }
                      +
                      793 
                      +
                      794  for (const auto& ion: info.ions) {
                      +
                      795  printer->fmt_line("static Symbol* _{}_sym;", ion.name);
                      796  }
                      -
                      797  printer->pop_block();
                      -
                      798 }
                      +
                      797 
                      +
                      798  printer->add_line("static int mech_type;");
                      799 
                      - -
                      801  auto params = internal_method_parameters();
                      -
                      802  params.push_back({"", "double", "", "v"});
                      -
                      803 
                      -
                      804  return params;
                      -
                      805 }
                      -
                      806 
                      - -
                      808  const auto value_initialize = print_initializers ? "{}" : "";
                      -
                      809 
                      -
                      810  /// TODO: Print only global variables printed in NEURON
                      -
                      811  printer->add_newline(2);
                      -
                      812  printer->add_line("/* NEURON global variables */");
                      -
                      813  if (info.primes_size != 0) {
                      -
                      814  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
                      -
                      815  info.primes_size);
                      -
                      816  }
                      -
                      817 
                      -
                      818  for (const auto& ion: info.ions) {
                      -
                      819  printer->fmt_line("static Symbol* _{}_sym;", ion.name);
                      -
                      820  }
                      -
                      821 
                      -
                      822  printer->add_line("static int mech_type;");
                      -
                      823 
                      -
                      824  if (info.point_process) {
                      -
                      825  printer->add_line("static int _pointtype;");
                      -
                      826  } else {
                      -
                      827  printer->add_multi_line(R"CODE(
                      -
                      828  static Prop* _extcall_prop;
                      -
                      829  /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
                      -
                      830  static _nrn_non_owning_id_without_container _prop_id{};)CODE");
                      -
                      831  }
                      -
                      832 
                      -
                      833  printer->fmt_line("static int {} = {};",
                      - -
                      835  info.pointer_variables.size() > 0
                      -
                      836  ? static_cast<int>(info.pointer_variables.size())
                      -
                      837  : -1);
                      -
                      838 
                      -
                      839  printer->add_line("static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
                      +
                      800  if (info.point_process) {
                      +
                      801  printer->add_line("static int _pointtype;");
                      +
                      802  } else {
                      +
                      803  printer->add_multi_line(R"CODE(
                      +
                      804  static Prop* _extcall_prop;
                      +
                      805  /* _prop_id kind of shadows _extcall_prop to allow validity checking. */
                      +
                      806  static _nrn_non_owning_id_without_container _prop_id{};)CODE");
                      +
                      807  }
                      +
                      808 
                      +
                      809  printer->fmt_line("static int {} = {};",
                      + +
                      811  info.pointer_variables.size() > 0
                      +
                      812  ? static_cast<int>(info.pointer_variables.size())
                      +
                      813  : -1);
                      +
                      814 
                      +
                      815  printer->add_line("static _nrn_mechanism_std_vector<Datum> _extcall_thread;");
                      +
                      816 
                      +
                      817  // Start printing the CNRN-style global variables.
                      +
                      818  auto float_type = default_float_data_type();
                      +
                      819  printer->add_newline(2);
                      +
                      820  printer->add_line("/** all global variables */");
                      +
                      821  printer->fmt_push_block("struct {}", global_struct());
                      +
                      822 
                      +
                      823  if (!info.ions.empty()) {
                      +
                      824  // TODO implement these when needed.
                      +
                      825  }
                      +
                      826 
                      +
                      827  if (!info.vectorize && !info.top_local_variables.empty()) {
                      +
                      828  throw std::runtime_error("Not implemented, global vectorize something.");
                      +
                      829  }
                      +
                      830 
                      +
                      831  if (!info.thread_variables.empty()) {
                      +
                      832  size_t prefix_sum = 0;
                      +
                      833  for (size_t i = 0; i < info.thread_variables.size(); ++i) {
                      +
                      834  const auto& var = info.thread_variables[i];
                      +
                      835  codegen_thread_variables.push_back({var, i, prefix_sum});
                      +
                      836 
                      +
                      837  prefix_sum += var->get_length();
                      +
                      838  }
                      +
                      839  }
                      840 
                      -
                      841  // Start printing the CNRN-style global variables.
                      -
                      842  auto float_type = default_float_data_type();
                      -
                      843  printer->add_newline(2);
                      -
                      844  printer->add_line("/** all global variables */");
                      -
                      845  printer->fmt_push_block("struct {}", global_struct());
                      -
                      846 
                      -
                      847  if (!info.ions.empty()) {
                      -
                      848  // TODO implement these when needed.
                      -
                      849  }
                      -
                      850 
                      -
                      851  if (!info.vectorize && !info.top_local_variables.empty()) {
                      -
                      852  throw std::runtime_error("Not implemented, global vectorize something.");
                      -
                      853  }
                      -
                      854 
                      -
                      855  if (!info.thread_variables.empty()) {
                      -
                      856  size_t prefix_sum = 0;
                      -
                      857  for (size_t i = 0; i < info.thread_variables.size(); ++i) {
                      -
                      858  const auto& var = info.thread_variables[i];
                      -
                      859  codegen_thread_variables.push_back({var, i, prefix_sum});
                      -
                      860 
                      -
                      861  prefix_sum += var->get_length();
                      -
                      862  }
                      -
                      863  }
                      +
                      841  if (!info.top_local_variables.empty()) {
                      +
                      842  size_t prefix_sum = info.thread_var_data_size;
                      +
                      843  size_t n_thread_vars = codegen_thread_variables.size();
                      +
                      844  for (size_t i = 0; i < info.top_local_variables.size(); ++i) {
                      +
                      845  const auto& var = info.top_local_variables[i];
                      +
                      846  codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
                      +
                      847 
                      +
                      848  prefix_sum += var->get_length();
                      +
                      849  }
                      +
                      850  }
                      +
                      851 
                      +
                      852  if (!codegen_thread_variables.empty()) {
                      +
                      853  auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
                      +
                      854  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                      +
                      855  printer->fmt_line("{} thread_data[{}];", float_type, thread_data_size);
                      +
                      856 
                      +
                      857  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                      +
                      858 
                      +
                      859  auto symbol = make_symbol("thread_data");
                      +
                      860  symbol->set_as_array(thread_data_size);
                      +
                      861  codegen_global_variables.push_back(symbol);
                      +
                      862  }
                      +
                      863 
                      864 
                      -
                      865  if (!info.top_local_variables.empty()) {
                      -
                      866  size_t prefix_sum = info.thread_var_data_size;
                      -
                      867  size_t n_thread_vars = codegen_thread_variables.size();
                      -
                      868  for (size_t i = 0; i < info.top_local_variables.size(); ++i) {
                      -
                      869  const auto& var = info.top_local_variables[i];
                      -
                      870  codegen_thread_variables.push_back({var, n_thread_vars + i, prefix_sum});
                      -
                      871 
                      -
                      872  prefix_sum += var->get_length();
                      -
                      873  }
                      -
                      874  }
                      -
                      875 
                      -
                      876  if (!codegen_thread_variables.empty()) {
                      -
                      877  auto thread_data_size = info.thread_var_data_size + info.top_local_thread_size;
                      -
                      878  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                      -
                      879  printer->fmt_line("{} thread_data[{}];", float_type, thread_data_size);
                      -
                      880 
                      -
                      881  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                      -
                      882 
                      -
                      883  auto symbol = make_symbol("thread_data");
                      -
                      884  symbol->set_as_array(thread_data_size);
                      -
                      885  codegen_global_variables.push_back(symbol);
                      -
                      886  }
                      -
                      887 
                      -
                      888 
                      -
                      889  if (info.table_count > 0) {
                      -
                      890  // basically the same code as coreNEURON uses
                      -
                      891  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                      -
                      892  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      -
                      893 
                      -
                      894  for (const auto& block: info.functions_with_table) {
                      -
                      895  const auto& name = block->get_node_name();
                      -
                      896  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                      -
                      897  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                      -
                      898  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                      -
                      899  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                      -
                      900  }
                      -
                      901 
                      -
                      902  for (const auto& variable: info.table_statement_variables) {
                      -
                      903  auto const name = "t_" + variable->get_name();
                      -
                      904  auto const num_values = variable->get_num_values();
                      -
                      905  if (variable->is_array()) {
                      -
                      906  int array_len = variable->get_length();
                      -
                      907  printer->fmt_line(
                      -
                      908  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                      -
                      909  } else {
                      -
                      910  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                      -
                      911  }
                      -
                      912  codegen_global_variables.push_back(make_symbol(name));
                      -
                      913  }
                      -
                      914  }
                      -
                      915 
                      -
                      916  for (const auto& var: info.state_vars) {
                      -
                      917  auto name = var->get_name() + "0";
                      -
                      918  auto symbol = program_symtab->lookup(name);
                      -
                      919  if (symbol == nullptr) {
                      -
                      920  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                      -
                      921  codegen_global_variables.push_back(make_symbol(name));
                      -
                      922  }
                      -
                      923  }
                      -
                      924 
                      -
                      925  for (const auto& var: info.global_variables) {
                      -
                      926  auto name = var->get_name();
                      -
                      927  auto length = var->get_length();
                      -
                      928  if (var->is_array()) {
                      -
                      929  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                      -
                      930  } else {
                      -
                      931  double value{};
                      -
                      932  if (auto const& value_ptr = var->get_value()) {
                      -
                      933  value = *value_ptr;
                      -
                      934  }
                      -
                      935  printer->fmt_line("{} {}{};",
                      -
                      936  float_type,
                      -
                      937  name,
                      -
                      938  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      -
                      939  }
                      -
                      940  codegen_global_variables.push_back(var);
                      -
                      941  }
                      +
                      865  if (info.table_count > 0) {
                      +
                      866  // basically the same code as coreNEURON uses
                      +
                      867  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                      +
                      868  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      +
                      869 
                      +
                      870  for (const auto& block: info.functions_with_table) {
                      +
                      871  const auto& name = block->get_node_name();
                      +
                      872  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                      +
                      873  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                      +
                      874  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                      +
                      875  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                      +
                      876  }
                      +
                      877 
                      +
                      878  for (const auto& variable: info.table_statement_variables) {
                      +
                      879  auto const name = "t_" + variable->get_name();
                      +
                      880  auto const num_values = variable->get_num_values();
                      +
                      881  if (variable->is_array()) {
                      +
                      882  int array_len = variable->get_length();
                      +
                      883  printer->fmt_line(
                      +
                      884  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                      +
                      885  } else {
                      +
                      886  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                      +
                      887  }
                      +
                      888  codegen_global_variables.push_back(make_symbol(name));
                      +
                      889  }
                      +
                      890  }
                      +
                      891 
                      +
                      892  for (const auto& var: info.state_vars) {
                      +
                      893  auto name = var->get_name() + "0";
                      +
                      894  auto symbol = program_symtab->lookup(name);
                      +
                      895  if (symbol == nullptr) {
                      +
                      896  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                      +
                      897  codegen_global_variables.push_back(make_symbol(name));
                      +
                      898  }
                      +
                      899  }
                      +
                      900 
                      +
                      901  for (const auto& var: info.global_variables) {
                      +
                      902  auto name = var->get_name();
                      +
                      903  auto length = var->get_length();
                      +
                      904  if (var->is_array()) {
                      +
                      905  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                      +
                      906  } else {
                      +
                      907  double value{};
                      +
                      908  if (auto const& value_ptr = var->get_value()) {
                      +
                      909  value = *value_ptr;
                      +
                      910  }
                      +
                      911  printer->fmt_line("{} {}{};",
                      +
                      912  float_type,
                      +
                      913  name,
                      +
                      914  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      +
                      915  }
                      +
                      916  codegen_global_variables.push_back(var);
                      +
                      917  }
                      +
                      918 
                      +
                      919  for (const auto& var: info.constant_variables) {
                      +
                      920  auto const name = var->get_name();
                      +
                      921  auto* const value_ptr = var->get_value().get();
                      +
                      922  double const value{value_ptr ? *value_ptr : 0};
                      +
                      923  printer->fmt_line("{} {}{};",
                      +
                      924  float_type,
                      +
                      925  name,
                      +
                      926  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      +
                      927  codegen_global_variables.push_back(var);
                      +
                      928  }
                      +
                      929 
                      +
                      930 
                      +
                      931  // for (const auto& f: info.function_tables) {
                      +
                      932  if (!info.function_tables.empty()) {
                      +
                      933  throw std::runtime_error("Not implemented, global function tables.");
                      +
                      934  }
                      +
                      935 
                      +
                      936  if (info.vectorize && info.thread_data_index) {
                      +
                      937  // TODO compare CoreNEURON something extcall stuff.
                      +
                      938  // throw std::runtime_error("Not implemented, global vectorize something else.");
                      +
                      939  }
                      +
                      940 
                      +
                      941  printer->pop_block(";");
                      942 
                      -
                      943  for (const auto& var: info.constant_variables) {
                      -
                      944  auto const name = var->get_name();
                      -
                      945  auto* const value_ptr = var->get_value().get();
                      -
                      946  double const value{value_ptr ? *value_ptr : 0};
                      -
                      947  printer->fmt_line("{} {}{};",
                      -
                      948  float_type,
                      -
                      949  name,
                      -
                      950  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                      -
                      951  codegen_global_variables.push_back(var);
                      -
                      952  }
                      -
                      953 
                      -
                      954 
                      -
                      955  // for (const auto& f: info.function_tables) {
                      -
                      956  if (!info.function_tables.empty()) {
                      -
                      957  throw std::runtime_error("Not implemented, global function tables.");
                      -
                      958  }
                      -
                      959 
                      -
                      960  if (info.vectorize && info.thread_data_index) {
                      -
                      961  // TODO compare CoreNEURON something extcall stuff.
                      -
                      962  // throw std::runtime_error("Not implemented, global vectorize something else.");
                      -
                      963  }
                      -
                      964 
                      -
                      965  printer->pop_block(";");
                      -
                      966 
                      -
                      967  print_global_var_struct_assertions();
                      -
                      968  print_global_var_struct_decl();
                      -
                      969 
                      -
                      970  print_global_param_default_values();
                      -
                      971 }
                      -
                      972 
                      - -
                      974  printer->push_block("static std::vector<double> _parameter_defaults =");
                      -
                      975 
                      -
                      976  std::vector<std::string> defaults;
                      -
                      977  for (const auto& p: info.range_parameter_vars) {
                      -
                      978  double value = p->get_value() == nullptr ? 0.0 : *p->get_value();
                      -
                      979  defaults.push_back(fmt::format("{:g} /* {} */", value, p->get_name()));
                      -
                      980  }
                      -
                      981 
                      -
                      982  printer->add_multi_line(fmt::format("{}", fmt::join(defaults, ",\n")));
                      -
                      983  printer->pop_block(";");
                      -
                      984 }
                      -
                      985 
                      - -
                      987  auto variable_printer = [&](const std::vector<SymbolType>& variables, bool if_array) {
                      -
                      988  for (const auto& variable: variables) {
                      -
                      989  if (variable->is_array() == if_array) {
                      -
                      990  // false => do not use the instance struct, which is not
                      -
                      991  // defined in the global declaration that we are printing
                      -
                      992  auto name = get_variable_name(variable->get_name(), false);
                      -
                      993  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                      -
                      994  if (if_array) {
                      -
                      995  auto length = variable->get_length();
                      -
                      996  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                      -
                      997  } else {
                      -
                      998  printer->fmt_line("{{{}, &{}}},", ename, name);
                      -
                      999  }
                      -
                      1000  }
                      -
                      1001  }
                      -
                      1002  };
                      -
                      1003 
                      -
                      1004  auto globals = info.global_variables;
                      -
                      1005  auto thread_vars = info.thread_variables;
                      +
                      943  print_global_var_struct_assertions();
                      +
                      944  print_global_var_struct_decl();
                      +
                      945 
                      +
                      946  print_global_param_default_values();
                      +
                      947 }
                      +
                      948 
                      + +
                      950  printer->push_block("static std::vector<double> _parameter_defaults =");
                      +
                      951 
                      +
                      952  std::vector<std::string> defaults;
                      +
                      953  for (const auto& p: info.range_parameter_vars) {
                      +
                      954  double value = p->get_value() == nullptr ? 0.0 : *p->get_value();
                      +
                      955  defaults.push_back(fmt::format("{:g} /* {} */", value, p->get_name()));
                      +
                      956  }
                      +
                      957 
                      +
                      958  printer->add_multi_line(fmt::format("{}", fmt::join(defaults, ",\n")));
                      +
                      959  printer->pop_block(";");
                      +
                      960 }
                      +
                      961 
                      + +
                      963  auto variable_printer = [&](const std::vector<SymbolType>& variables, bool if_array) {
                      +
                      964  for (const auto& variable: variables) {
                      +
                      965  if (variable->is_array() == if_array) {
                      +
                      966  // false => do not use the instance struct, which is not
                      +
                      967  // defined in the global declaration that we are printing
                      +
                      968  auto name = get_variable_name(variable->get_name(), false);
                      +
                      969  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                      +
                      970  if (if_array) {
                      +
                      971  auto length = variable->get_length();
                      +
                      972  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                      +
                      973  } else {
                      +
                      974  printer->fmt_line("{{{}, &{}}},", ename, name);
                      +
                      975  }
                      +
                      976  }
                      +
                      977  }
                      +
                      978  };
                      +
                      979 
                      +
                      980  auto globals = info.global_variables;
                      +
                      981  auto thread_vars = info.thread_variables;
                      +
                      982 
                      +
                      983  if (info.table_count > 0) {
                      +
                      984  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      +
                      985  }
                      +
                      986 
                      +
                      987  printer->add_newline(2);
                      +
                      988  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                      +
                      989  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                      +
                      990  printer->increase_indent();
                      +
                      991  variable_printer(globals, false);
                      +
                      992  variable_printer(thread_vars, false);
                      +
                      993  printer->add_line("{nullptr, nullptr}");
                      +
                      994  printer->decrease_indent();
                      +
                      995  printer->add_line("};");
                      +
                      996 
                      +
                      997  printer->add_newline(2);
                      +
                      998  printer->add_line("/** connect global (array) variables to hoc -- */");
                      +
                      999  printer->add_line("static DoubVec hoc_vector_double[] = {");
                      +
                      1000  printer->increase_indent();
                      +
                      1001  variable_printer(globals, true);
                      +
                      1002  variable_printer(thread_vars, true);
                      +
                      1003  printer->add_line("{nullptr, nullptr, 0}");
                      +
                      1004  printer->decrease_indent();
                      +
                      1005  printer->add_line("};");
                      1006 
                      -
                      1007  if (info.table_count > 0) {
                      -
                      1008  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                      -
                      1009  }
                      -
                      1010 
                      -
                      1011  printer->add_newline(2);
                      -
                      1012  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                      -
                      1013  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                      -
                      1014  printer->increase_indent();
                      -
                      1015  variable_printer(globals, false);
                      -
                      1016  variable_printer(thread_vars, false);
                      -
                      1017  printer->add_line("{nullptr, nullptr}");
                      -
                      1018  printer->decrease_indent();
                      -
                      1019  printer->add_line("};");
                      -
                      1020 
                      -
                      1021  printer->add_newline(2);
                      -
                      1022  printer->add_line("/** connect global (array) variables to hoc -- */");
                      -
                      1023  printer->add_line("static DoubVec hoc_vector_double[] = {");
                      -
                      1024  printer->increase_indent();
                      -
                      1025  variable_printer(globals, true);
                      -
                      1026  variable_printer(thread_vars, true);
                      -
                      1027  printer->add_line("{nullptr, nullptr, 0}");
                      -
                      1028  printer->decrease_indent();
                      -
                      1029  printer->add_line("};");
                      -
                      1030 
                      -
                      1031  printer->add_newline(2);
                      -
                      1032  printer->add_line("/* declaration of user functions */");
                      -
                      1033  for (const auto& procedure: info.procedures) {
                      -
                      1034  const auto proc_name = procedure->get_node_name();
                      -
                      1035  printer->fmt_line("{};", hoc_function_signature(proc_name));
                      -
                      1036  }
                      -
                      1037  for (const auto& function: info.functions) {
                      -
                      1038  const auto func_name = function->get_node_name();
                      -
                      1039  printer->fmt_line("{};", hoc_function_signature(func_name));
                      -
                      1040  }
                      -
                      1041  if (!info.point_process) {
                      -
                      1042  for (const auto& procedure: info.procedures) {
                      -
                      1043  const auto proc_name = procedure->get_node_name();
                      -
                      1044  printer->fmt_line("{};", py_function_signature(proc_name));
                      -
                      1045  }
                      -
                      1046  for (const auto& function: info.functions) {
                      -
                      1047  const auto func_name = function->get_node_name();
                      -
                      1048  printer->fmt_line("{};", py_function_signature(func_name));
                      -
                      1049  }
                      -
                      1050  }
                      -
                      1051 
                      -
                      1052  printer->add_newline(2);
                      -
                      1053  printer->add_line("/* connect user functions to hoc names */");
                      -
                      1054  printer->add_line("static VoidFunc hoc_intfunc[] = {");
                      -
                      1055  printer->increase_indent();
                      -
                      1056  if (info.point_process) {
                      -
                      1057  printer->add_line("{0, 0}");
                      -
                      1058  printer->decrease_indent();
                      -
                      1059  printer->add_line("};");
                      -
                      1060  printer->add_line("static Member_func _member_func[] = {");
                      -
                      1061  printer->increase_indent();
                      -
                      1062  printer->add_multi_line(R"CODE(
                      -
                      1063  {"loc", _hoc_loc_pnt},
                      -
                      1064  {"has_loc", _hoc_has_loc},
                      -
                      1065  {"get_loc", _hoc_get_loc_pnt},)CODE");
                      -
                      1066  } else {
                      -
                      1067  printer->fmt_line("{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
                      -
                      1068  }
                      -
                      1069 
                      -
                      1070  for (const auto& procedure: info.procedures) {
                      -
                      1071  const auto proc_name = procedure->get_node_name();
                      -
                      1072  printer->fmt_line("{{\"{}{}\", {}}},",
                      -
                      1073  proc_name,
                      -
                      1074  info.rsuffix,
                      -
                      1075  hoc_function_name(proc_name));
                      +
                      1007  printer->add_newline(2);
                      +
                      1008  printer->add_line("/* declaration of user functions */");
                      +
                      1009  for (const auto& procedure: info.procedures) {
                      +
                      1010  const auto proc_name = procedure->get_node_name();
                      +
                      1011  printer->fmt_line("{};", hoc_function_signature(proc_name));
                      +
                      1012  }
                      +
                      1013  for (const auto& function: info.functions) {
                      +
                      1014  const auto func_name = function->get_node_name();
                      +
                      1015  printer->fmt_line("{};", hoc_function_signature(func_name));
                      +
                      1016  }
                      +
                      1017  if (!info.point_process) {
                      +
                      1018  for (const auto& procedure: info.procedures) {
                      +
                      1019  const auto proc_name = procedure->get_node_name();
                      +
                      1020  printer->fmt_line("{};", py_function_signature(proc_name));
                      +
                      1021  }
                      +
                      1022  for (const auto& function: info.functions) {
                      +
                      1023  const auto func_name = function->get_node_name();
                      +
                      1024  printer->fmt_line("{};", py_function_signature(func_name));
                      +
                      1025  }
                      +
                      1026  }
                      +
                      1027 
                      +
                      1028  printer->add_newline(2);
                      +
                      1029  printer->add_line("/* connect user functions to hoc names */");
                      +
                      1030  printer->add_line("static VoidFunc hoc_intfunc[] = {");
                      +
                      1031  printer->increase_indent();
                      +
                      1032  if (info.point_process) {
                      +
                      1033  printer->add_line("{0, 0}");
                      +
                      1034  printer->decrease_indent();
                      +
                      1035  printer->add_line("};");
                      +
                      1036  printer->add_line("static Member_func _member_func[] = {");
                      +
                      1037  printer->increase_indent();
                      +
                      1038  printer->add_multi_line(R"CODE(
                      +
                      1039  {"loc", _hoc_loc_pnt},
                      +
                      1040  {"has_loc", _hoc_has_loc},
                      +
                      1041  {"get_loc", _hoc_get_loc_pnt},)CODE");
                      +
                      1042  } else {
                      +
                      1043  printer->fmt_line("{{\"setdata_{}\", _hoc_setdata}},", info.mod_suffix);
                      +
                      1044  }
                      +
                      1045 
                      +
                      1046  for (const auto& procedure: info.procedures) {
                      +
                      1047  const auto proc_name = procedure->get_node_name();
                      +
                      1048  printer->fmt_line("{{\"{}{}\", {}}},",
                      +
                      1049  proc_name,
                      +
                      1050  info.rsuffix,
                      +
                      1051  hoc_function_name(proc_name));
                      +
                      1052  }
                      +
                      1053  for (const auto& function: info.functions) {
                      +
                      1054  const auto func_name = function->get_node_name();
                      +
                      1055  printer->fmt_line("{{\"{}{}\", {}}},",
                      +
                      1056  func_name,
                      +
                      1057  info.rsuffix,
                      +
                      1058  hoc_function_name(func_name));
                      +
                      1059  }
                      +
                      1060 
                      +
                      1061  printer->add_line("{nullptr, nullptr}");
                      +
                      1062  printer->decrease_indent();
                      +
                      1063  printer->add_line("};");
                      +
                      1064  if (!info.point_process) {
                      +
                      1065  printer->push_block("static NPyDirectMechFunc npy_direct_func_proc[] =");
                      +
                      1066  for (const auto& procedure: info.procedures) {
                      +
                      1067  const auto proc_name = procedure->get_node_name();
                      +
                      1068  printer->fmt_line("{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
                      +
                      1069  }
                      +
                      1070  for (const auto& function: info.functions) {
                      +
                      1071  const auto func_name = function->get_node_name();
                      +
                      1072  printer->fmt_line("{{\"{}\", {}}},", func_name, py_function_name(func_name));
                      +
                      1073  }
                      +
                      1074  printer->add_line("{nullptr, nullptr}");
                      +
                      1075  printer->pop_block(";");
                      1076  }
                      -
                      1077  for (const auto& function: info.functions) {
                      -
                      1078  const auto func_name = function->get_node_name();
                      -
                      1079  printer->fmt_line("{{\"{}{}\", {}}},",
                      -
                      1080  func_name,
                      -
                      1081  info.rsuffix,
                      -
                      1082  hoc_function_name(func_name));
                      -
                      1083  }
                      -
                      1084 
                      -
                      1085  printer->add_line("{nullptr, nullptr}");
                      -
                      1086  printer->decrease_indent();
                      -
                      1087  printer->add_line("};");
                      -
                      1088  if (!info.point_process) {
                      -
                      1089  printer->push_block("static NPyDirectMechFunc npy_direct_func_proc[] =");
                      -
                      1090  for (const auto& procedure: info.procedures) {
                      -
                      1091  const auto proc_name = procedure->get_node_name();
                      -
                      1092  printer->fmt_line("{{\"{}\", {}}},", proc_name, py_function_name(proc_name));
                      -
                      1093  }
                      -
                      1094  for (const auto& function: info.functions) {
                      -
                      1095  const auto func_name = function->get_node_name();
                      -
                      1096  printer->fmt_line("{{\"{}\", {}}},", func_name, py_function_name(func_name));
                      -
                      1097  }
                      -
                      1098  printer->add_line("{nullptr, nullptr}");
                      -
                      1099  printer->pop_block(";");
                      +
                      1077 }
                      +
                      1078 
                      + +
                      1080  /// TODO: Write this according to NEURON
                      +
                      1081  printer->add_newline(2);
                      +
                      1082  printer->add_line("/** register channel with the simulator */");
                      +
                      1083  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
                      +
                      1084  printer->add_line("_initlists();");
                      +
                      1085  printer->add_newline();
                      +
                      1086 
                      +
                      1087  for (const auto& ion: info.ions) {
                      +
                      1088  double valence = ion.valence.value_or(-10000.0);
                      +
                      1089  printer->fmt_line("ion_reg(\"{}\", {});", ion.name, valence);
                      +
                      1090  }
                      +
                      1091  if (!info.ions.empty()) {
                      +
                      1092  printer->add_newline();
                      +
                      1093  }
                      +
                      1094 
                      +
                      1095  for (const auto& ion: info.ions) {
                      +
                      1096  printer->fmt_line("_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
                      +
                      1097  }
                      +
                      1098  if (!info.ions.empty()) {
                      +
                      1099  printer->add_newline();
                      1100  }
                      -
                      1101 }
                      -
                      1102 
                      - -
                      1104  /// TODO: Write this according to NEURON
                      -
                      1105  printer->add_newline(2);
                      -
                      1106  printer->add_line("/** register channel with the simulator */");
                      -
                      1107  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
                      -
                      1108  printer->add_line("_initlists();");
                      -
                      1109  printer->add_newline();
                      -
                      1110 
                      -
                      1111  for (const auto& ion: info.ions) {
                      -
                      1112  double valence = ion.valence.value_or(-10000.0);
                      -
                      1113  printer->fmt_line("ion_reg(\"{}\", {});", ion.name, valence);
                      -
                      1114  }
                      -
                      1115  if (!info.ions.empty()) {
                      -
                      1116  printer->add_newline();
                      -
                      1117  }
                      -
                      1118 
                      -
                      1119  for (const auto& ion: info.ions) {
                      -
                      1120  printer->fmt_line("_{0}_sym = hoc_lookup(\"{0}_ion\");", ion.name);
                      -
                      1121  }
                      -
                      1122  if (!info.ions.empty()) {
                      -
                      1123  printer->add_newline();
                      -
                      1124  }
                      -
                      1125 
                      -
                      1126  const auto compute_functions_parameters =
                      -
                      1127  breakpoint_exist()
                      -
                      1128  ? fmt::format("{}, {}, {}",
                      -
                      1129  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
                      -
                      1130  method_name(naming::NRN_JACOB_METHOD),
                      -
                      1131  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
                      -
                      1132  : "nullptr, nullptr, nullptr";
                      -
                      1133  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
                      -
                      1134  get_channel_info_var_name(),
                      -
                      1135  method_name(naming::NRN_ALLOC_METHOD),
                      -
                      1136  compute_functions_parameters,
                      -
                      1137  method_name(naming::NRN_INIT_METHOD),
                      - -
                      1139  1 + info.thread_data_index);
                      -
                      1140  if (info.point_process) {
                      -
                      1141  printer->fmt_line(
                      -
                      1142  "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
                      -
                      1143  "_member_func);",
                      -
                      1144  register_mech_args);
                      -
                      1145  } else {
                      -
                      1146  printer->fmt_line("register_mech({});", register_mech_args);
                      -
                      1147  }
                      -
                      1148 
                      -
                      1149  /// type related information
                      -
                      1150  printer->add_newline();
                      -
                      1151  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
                      -
                      1152 
                      -
                      1153  printer->add_line("hoc_register_parm_default(mech_type, &_parameter_defaults);");
                      -
                      1154 
                      -
                      1155  // register the table-checking function
                      -
                      1156  if (info.table_count > 0) {
                      -
                      1157  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
                      -
                      1158  }
                      -
                      1159 
                      -
                      1160  /// Call _nrn_mechanism_register_data_fields() with the correct arguments
                      -
                      1161  /// Geenerated code follows the style underneath
                      -
                      1162  ///
                      -
                      1163  /// _nrn_mechanism_register_data_fields(mech_type,
                      -
                      1164  /// _nrn_mechanism_field<double>{"var_name"}, /* float var index 0 */
                      -
                      1165  /// ...
                      -
                      1166  /// );
                      -
                      1167  ///
                      -
                      1168  /// TODO: More things to add here
                      -
                      1169  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
                      -
                      1170  printer->increase_indent();
                      -
                      1171 
                      -
                      1172  const auto codegen_float_variables_size = codegen_float_variables.size();
                      -
                      1173  std::vector<std::string> mech_register_args;
                      -
                      1174 
                      -
                      1175  for (int i = 0; i < codegen_float_variables_size; ++i) {
                      -
                      1176  const auto& float_var = codegen_float_variables[i];
                      -
                      1177  if (float_var->is_array()) {
                      -
                      1178  mech_register_args.push_back(
                      -
                      1179  fmt::format("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
                      -
                      1180  float_var->get_name(),
                      -
                      1181  float_var->get_length(),
                      -
                      1182  i));
                      -
                      1183  } else {
                      -
                      1184  mech_register_args.push_back(fmt::format(
                      -
                      1185  "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
                      -
                      1186  }
                      -
                      1187  }
                      -
                      1188 
                      -
                      1189  const auto codegen_int_variables_size = codegen_int_variables.size();
                      -
                      1190  for (int i = 0; i < codegen_int_variables_size; ++i) {
                      -
                      1191  const auto& int_var = codegen_int_variables[i];
                      -
                      1192  const auto& name = int_var.symbol->get_name();
                      -
                      1193  if (i != info.semantics[i].index) {
                      -
                      1194  throw std::runtime_error("Broken logic.");
                      -
                      1195  }
                      -
                      1196 
                      -
                      1197  auto type = "double*";
                      -
                      1198  if (name == naming::POINT_PROCESS_VARIABLE) {
                      -
                      1199  type = "Point_process*";
                      -
                      1200  } else if (name == naming::TQITEM_VARIABLE) {
                      -
                      1201  type = "void*";
                      -
                      1202  } else if (stringutils::starts_with(name, "style_") &&
                      -
                      1203  stringutils::starts_with(info.semantics[i].name, "#") &&
                      -
                      1204  stringutils::ends_with(info.semantics[i].name, "_ion")) {
                      -
                      1205  type = "int*";
                      -
                      1206  }
                      -
                      1207 
                      -
                      1208  mech_register_args.push_back(
                      -
                      1209  fmt::format("_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
                      -
                      1210  type,
                      -
                      1211  name,
                      -
                      1212  info.semantics[i].name,
                      -
                      1213  i));
                      -
                      1214  }
                      -
                      1215  if (info.emit_cvode) {
                      -
                      1216  mech_register_args.push_back(
                      -
                      1217  "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
                      -
                      1218  }
                      -
                      1219 
                      -
                      1220  printer->add_multi_line(fmt::format("{}", fmt::join(mech_register_args, ",\n")));
                      -
                      1221 
                      -
                      1222  printer->decrease_indent();
                      -
                      1223  printer->add_line(");");
                      -
                      1224  printer->add_newline();
                      -
                      1225 
                      -
                      1226 
                      -
                      1227  printer->fmt_line("hoc_register_prop_size(mech_type, {}, {});",
                      -
                      1228  float_variables_size(),
                      -
                      1229  int_variables_size());
                      -
                      1230 
                      -
                      1231  for (int i = 0; i < codegen_int_variables_size; ++i) {
                      -
                      1232  if (i != info.semantics[i].index) {
                      -
                      1233  throw std::runtime_error("Broken logic.");
                      -
                      1234  }
                      -
                      1235 
                      -
                      1236  printer->fmt_line("hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
                      -
                      1237  i,
                      -
                      1238  info.semantics[i].name);
                      -
                      1239  }
                      -
                      1240 
                      -
                      1241  if (info.write_concentration) {
                      -
                      1242  printer->fmt_line("nrn_writes_conc(mech_type, 0);");
                      -
                      1243  }
                      -
                      1244 
                      -
                      1245  if (info.artificial_cell) {
                      -
                      1246  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                      -
                      1247  }
                      -
                      1248 
                      -
                      1249  if (info.net_event_used) {
                      -
                      1250  printer->fmt_line("add_nrn_has_net_event(mech_type);");
                      -
                      1251  }
                      -
                      1252 
                      -
                      1253  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
                      -
                      1254  if (!info.point_process) {
                      -
                      1255  printer->add_line("hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
                      -
                      1256  }
                      -
                      1257  if (info.net_receive_node) {
                      -
                      1258  printer->fmt_line("pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
                      -
                      1259  printer->fmt_line("pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
                      -
                      1260  }
                      -
                      1261 
                      -
                      1262  if (info.thread_callback_register) {
                      -
                      1263  printer->add_line("_nrn_thread_reg(mech_type, 1, thread_mem_init);");
                      -
                      1264  printer->add_line("_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
                      -
                      1265  }
                      -
                      1266 
                      +
                      1101 
                      +
                      1102  const auto compute_functions_parameters =
                      +
                      1103  breakpoint_exist()
                      +
                      1104  ? fmt::format("{}, {}, {}",
                      +
                      1105  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
                      +
                      1106  method_name(naming::NRN_JACOB_METHOD),
                      +
                      1107  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
                      +
                      1108  : "nullptr, nullptr, nullptr";
                      +
                      1109  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
                      +
                      1110  get_channel_info_var_name(),
                      +
                      1111  method_name(naming::NRN_ALLOC_METHOD),
                      +
                      1112  compute_functions_parameters,
                      +
                      1113  method_name(naming::NRN_INIT_METHOD),
                      + +
                      1115  1 + info.thread_data_index);
                      +
                      1116  if (info.point_process) {
                      +
                      1117  printer->fmt_line(
                      +
                      1118  "_pointtype = point_register_mech({}, _hoc_create_pnt, _hoc_destroy_pnt, "
                      +
                      1119  "_member_func);",
                      +
                      1120  register_mech_args);
                      +
                      1121  } else {
                      +
                      1122  printer->fmt_line("register_mech({});", register_mech_args);
                      +
                      1123  }
                      +
                      1124 
                      +
                      1125  /// type related information
                      +
                      1126  printer->add_newline();
                      +
                      1127  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
                      +
                      1128 
                      +
                      1129  printer->add_line("hoc_register_parm_default(mech_type, &_parameter_defaults);");
                      +
                      1130 
                      +
                      1131  // register the table-checking function
                      +
                      1132  if (info.table_count > 0) {
                      +
                      1133  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", table_thread_function_name());
                      +
                      1134  }
                      +
                      1135 
                      +
                      1136  /// Call _nrn_mechanism_register_data_fields() with the correct arguments
                      +
                      1137  /// Geenerated code follows the style underneath
                      +
                      1138  ///
                      +
                      1139  /// _nrn_mechanism_register_data_fields(mech_type,
                      +
                      1140  /// _nrn_mechanism_field<double>{"var_name"}, /* float var index 0 */
                      +
                      1141  /// ...
                      +
                      1142  /// );
                      +
                      1143  ///
                      +
                      1144  /// TODO: More things to add here
                      +
                      1145  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
                      +
                      1146  printer->increase_indent();
                      +
                      1147 
                      +
                      1148  const auto codegen_float_variables_size = codegen_float_variables.size();
                      +
                      1149  std::vector<std::string> mech_register_args;
                      +
                      1150 
                      +
                      1151  for (int i = 0; i < codegen_float_variables_size; ++i) {
                      +
                      1152  const auto& float_var = codegen_float_variables[i];
                      +
                      1153  if (float_var->is_array()) {
                      +
                      1154  mech_register_args.push_back(
                      +
                      1155  fmt::format("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */",
                      +
                      1156  float_var->get_name(),
                      +
                      1157  float_var->get_length(),
                      +
                      1158  i));
                      +
                      1159  } else {
                      +
                      1160  mech_register_args.push_back(fmt::format(
                      +
                      1161  "_nrn_mechanism_field<double>{{\"{}\"}} /* {} */", float_var->get_name(), i));
                      +
                      1162  }
                      +
                      1163  }
                      +
                      1164 
                      +
                      1165  const auto codegen_int_variables_size = codegen_int_variables.size();
                      +
                      1166  for (int i = 0; i < codegen_int_variables_size; ++i) {
                      +
                      1167  const auto& int_var = codegen_int_variables[i];
                      +
                      1168  const auto& name = int_var.symbol->get_name();
                      +
                      1169  if (i != info.semantics[i].index) {
                      +
                      1170  throw std::runtime_error("Broken logic.");
                      +
                      1171  }
                      +
                      1172 
                      +
                      1173  auto type = "double*";
                      +
                      1174  if (name == naming::POINT_PROCESS_VARIABLE) {
                      +
                      1175  type = "Point_process*";
                      +
                      1176  } else if (name == naming::TQITEM_VARIABLE) {
                      +
                      1177  type = "void*";
                      +
                      1178  } else if (stringutils::starts_with(name, "style_") &&
                      +
                      1179  stringutils::starts_with(info.semantics[i].name, "#") &&
                      +
                      1180  stringutils::ends_with(info.semantics[i].name, "_ion")) {
                      +
                      1181  type = "int*";
                      +
                      1182  }
                      +
                      1183 
                      +
                      1184  mech_register_args.push_back(
                      +
                      1185  fmt::format("_nrn_mechanism_field<{}>{{\"{}\", \"{}\"}} /* {} */",
                      +
                      1186  type,
                      +
                      1187  name,
                      +
                      1188  info.semantics[i].name,
                      +
                      1189  i));
                      +
                      1190  }
                      +
                      1191  if (info.emit_cvode) {
                      +
                      1192  mech_register_args.push_back(
                      +
                      1193  "_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
                      +
                      1194  }
                      +
                      1195 
                      +
                      1196  printer->add_multi_line(fmt::format("{}", fmt::join(mech_register_args, ",\n")));
                      +
                      1197 
                      +
                      1198  printer->decrease_indent();
                      +
                      1199  printer->add_line(");");
                      +
                      1200  printer->add_newline();
                      +
                      1201 
                      +
                      1202 
                      +
                      1203  printer->fmt_line("hoc_register_prop_size(mech_type, {}, {});",
                      +
                      1204  float_variables_size(),
                      +
                      1205  int_variables_size());
                      +
                      1206 
                      +
                      1207  for (int i = 0; i < codegen_int_variables_size; ++i) {
                      +
                      1208  if (i != info.semantics[i].index) {
                      +
                      1209  throw std::runtime_error("Broken logic.");
                      +
                      1210  }
                      +
                      1211 
                      +
                      1212  printer->fmt_line("hoc_register_dparam_semantics(mech_type, {}, \"{}\");",
                      +
                      1213  i,
                      +
                      1214  info.semantics[i].name);
                      +
                      1215  }
                      +
                      1216 
                      +
                      1217  if (info.write_concentration) {
                      +
                      1218  printer->fmt_line("nrn_writes_conc(mech_type, 0);");
                      +
                      1219  }
                      +
                      1220 
                      +
                      1221  if (info.artificial_cell) {
                      +
                      1222  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                      +
                      1223  }
                      +
                      1224 
                      +
                      1225  if (info.net_event_used) {
                      +
                      1226  printer->fmt_line("add_nrn_has_net_event(mech_type);");
                      +
                      1227  }
                      +
                      1228 
                      +
                      1229  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc);");
                      +
                      1230  if (!info.point_process) {
                      +
                      1231  printer->add_line("hoc_register_npy_direct(mech_type, npy_direct_func_proc);");
                      +
                      1232  }
                      +
                      1233  if (info.net_receive_node) {
                      +
                      1234  printer->fmt_line("pnt_receive[mech_type] = nrn_net_receive_{};", info.mod_suffix);
                      +
                      1235  printer->fmt_line("pnt_receive_size[mech_type] = {};", info.num_net_receive_parameters);
                      +
                      1236  }
                      +
                      1237 
                      +
                      1238  if (info.thread_callback_register) {
                      +
                      1239  printer->add_line("_nrn_thread_reg(mech_type, 1, thread_mem_init);");
                      +
                      1240  printer->add_line("_nrn_thread_reg(mech_type, 0, thread_mem_cleanup);");
                      +
                      1241  }
                      +
                      1242 
                      +
                      1243  printer->pop_block();
                      +
                      1244 }
                      +
                      1245 
                      +
                      1246 
                      + +
                      1248  if (!info.thread_callback_register) {
                      +
                      1249  return;
                      +
                      1250  }
                      +
                      1251 
                      +
                      1252  auto static_thread_data = get_variable_name("thread_data", false);
                      +
                      1253  auto inuse = get_variable_name("thread_data_in_use", false);
                      +
                      1254  auto thread_data_index = info.thread_var_thread_id;
                      +
                      1255  printer->push_block("static void thread_mem_init(Datum* _thread) ");
                      +
                      1256  printer->push_block(fmt::format("if({})", inuse));
                      +
                      1257  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
                      +
                      1258  thread_data_index,
                      +
                      1259  info.thread_var_data_size + info.top_local_thread_size);
                      +
                      1260  printer->pop_block();
                      +
                      1261  printer->push_block("else");
                      +
                      1262  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, {}}};",
                      +
                      1263  thread_data_index,
                      +
                      1264  static_thread_data);
                      +
                      1265  printer->fmt_line("{} = 1;", inuse);
                      +
                      1266  printer->pop_block();
                      1267  printer->pop_block();
                      -
                      1268 }
                      -
                      1269 
                      -
                      1270 
                      - -
                      1272  if (!info.thread_callback_register) {
                      -
                      1273  return;
                      -
                      1274  }
                      -
                      1275 
                      -
                      1276  auto static_thread_data = get_variable_name("thread_data", false);
                      -
                      1277  auto inuse = get_variable_name("thread_data_in_use", false);
                      -
                      1278  auto thread_data_index = info.thread_var_thread_id;
                      -
                      1279  printer->push_block("static void thread_mem_init(Datum* _thread) ");
                      -
                      1280  printer->push_block(fmt::format("if({})", inuse));
                      -
                      1281  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, new double[{}]{{}}}};",
                      -
                      1282  thread_data_index,
                      -
                      1283  info.thread_var_data_size + info.top_local_thread_size);
                      -
                      1284  printer->pop_block();
                      -
                      1285  printer->push_block("else");
                      -
                      1286  printer->fmt_line("_thread[{}] = {{neuron::container::do_not_search, {}}};",
                      -
                      1287  thread_data_index,
                      -
                      1288  static_thread_data);
                      -
                      1289  printer->fmt_line("{} = 1;", inuse);
                      -
                      1290  printer->pop_block();
                      -
                      1291  printer->pop_block();
                      -
                      1292 
                      -
                      1293  printer->push_block("static void thread_mem_cleanup(Datum* _thread) ");
                      -
                      1294  printer->fmt_line("double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
                      -
                      1295  printer->push_block(fmt::format("if(_thread_data_ptr == {})", static_thread_data));
                      -
                      1296  printer->fmt_line("{} = 0;", inuse);
                      -
                      1297  printer->pop_block();
                      -
                      1298  printer->push_block("else");
                      -
                      1299  printer->add_line("delete[] _thread_data_ptr;");
                      -
                      1300  printer->pop_block();
                      -
                      1301  printer->pop_block();
                      -
                      1302 }
                      -
                      1303 
                      -
                      1304 
                      - -
                      1306  for (auto const& [var, type]: info.neuron_global_variables) {
                      -
                      1307  auto const name = var->get_name();
                      -
                      1308  printer->fmt_line("extern {} {};", type, name);
                      -
                      1309  }
                      -
                      1310 }
                      -
                      1311 
                      - -
                      1313  auto const value_initialize = print_initializers ? "{}" : "";
                      -
                      1314  auto int_type = default_int_data_type();
                      -
                      1315  printer->add_newline(2);
                      -
                      1316  printer->add_line("/** all mechanism instance variables and global variables */");
                      -
                      1317  printer->fmt_push_block("struct {} ", instance_struct());
                      +
                      1268 
                      +
                      1269  printer->push_block("static void thread_mem_cleanup(Datum* _thread) ");
                      +
                      1270  printer->fmt_line("double * _thread_data_ptr = _thread[{}].get<double*>();", thread_data_index);
                      +
                      1271  printer->push_block(fmt::format("if(_thread_data_ptr == {})", static_thread_data));
                      +
                      1272  printer->fmt_line("{} = 0;", inuse);
                      +
                      1273  printer->pop_block();
                      +
                      1274  printer->push_block("else");
                      +
                      1275  printer->add_line("delete[] _thread_data_ptr;");
                      +
                      1276  printer->pop_block();
                      +
                      1277  printer->pop_block();
                      +
                      1278 }
                      +
                      1279 
                      +
                      1280 
                      + +
                      1282  for (auto const& [var, type]: info.neuron_global_variables) {
                      +
                      1283  auto const name = var->get_name();
                      +
                      1284  printer->fmt_line("extern {} {};", type, name);
                      +
                      1285  }
                      +
                      1286 }
                      +
                      1287 
                      + +
                      1289  auto const value_initialize = print_initializers ? "{}" : "";
                      +
                      1290  auto int_type = default_int_data_type();
                      +
                      1291  printer->add_newline(2);
                      +
                      1292  printer->add_line("/** all mechanism instance variables and global variables */");
                      +
                      1293  printer->fmt_push_block("struct {} ", instance_struct());
                      +
                      1294 
                      +
                      1295  for (auto const& [var, type]: info.neuron_global_variables) {
                      +
                      1296  auto const name = var->get_name();
                      +
                      1297  printer->fmt_line("{}* {}{};",
                      +
                      1298  type,
                      +
                      1299  name,
                      +
                      1300  print_initializers ? fmt::format("{{&::{}}}", name) : std::string{});
                      +
                      1301  }
                      +
                      1302  for (auto& var: codegen_float_variables) {
                      +
                      1303  const auto& name = var->get_name();
                      +
                      1304  printer->fmt_line("double* {}{};", name, value_initialize);
                      +
                      1305  }
                      +
                      1306  for (auto& var: codegen_int_variables) {
                      +
                      1307  const auto& name = var.symbol->get_name();
                      +
                      1308  if (name == naming::POINT_PROCESS_VARIABLE) {
                      +
                      1309  continue;
                      +
                      1310  } else if (var.is_index || var.is_integer) {
                      +
                      1311  // In NEURON we don't create caches for `int*`. Hence, do nothing.
                      +
                      1312  } else {
                      +
                      1313  auto qualifier = var.is_constant ? "const " : "";
                      +
                      1314  auto type = var.is_vdata ? "void*" : default_float_data_type();
                      +
                      1315  printer->fmt_line("{}{}* const* {}{};", qualifier, type, name, value_initialize);
                      +
                      1316  }
                      +
                      1317  }
                      1318 
                      -
                      1319  for (auto const& [var, type]: info.neuron_global_variables) {
                      -
                      1320  auto const name = var->get_name();
                      -
                      1321  printer->fmt_line("{}* {}{};",
                      -
                      1322  type,
                      -
                      1323  name,
                      -
                      1324  print_initializers ? fmt::format("{{&::{}}}", name) : std::string{});
                      -
                      1325  }
                      -
                      1326  for (auto& var: codegen_float_variables) {
                      -
                      1327  const auto& name = var->get_name();
                      -
                      1328  printer->fmt_line("double* {}{};", name, value_initialize);
                      -
                      1329  }
                      -
                      1330  for (auto& var: codegen_int_variables) {
                      -
                      1331  const auto& name = var.symbol->get_name();
                      -
                      1332  if (name == naming::POINT_PROCESS_VARIABLE) {
                      -
                      1333  continue;
                      -
                      1334  } else if (var.is_index || var.is_integer) {
                      -
                      1335  // In NEURON we don't create caches for `int*`. Hence, do nothing.
                      -
                      1336  } else {
                      -
                      1337  auto qualifier = var.is_constant ? "const " : "";
                      -
                      1338  auto type = var.is_vdata ? "void*" : default_float_data_type();
                      -
                      1339  printer->fmt_line("{}{}* const* {}{};", qualifier, type, name, value_initialize);
                      -
                      1340  }
                      -
                      1341  }
                      +
                      1319  printer->fmt_line("{}* {}{};",
                      +
                      1320  global_struct(),
                      + +
                      1322  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                      +
                      1323  : std::string{});
                      +
                      1324  printer->pop_block(";");
                      +
                      1325 }
                      +
                      1326 
                      + +
                      1328  printer->add_newline(2);
                      +
                      1329  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
                      +
                      1330  instance_struct(),
                      +
                      1331  info.mod_suffix);
                      +
                      1332  printer->fmt_push_block("return {}", instance_struct());
                      +
                      1333 
                      +
                      1334  std::vector<std::string> make_instance_args;
                      +
                      1335 
                      +
                      1336 
                      +
                      1337  for (auto const& [var, type]: info.neuron_global_variables) {
                      +
                      1338  auto const name = var->get_name();
                      +
                      1339  make_instance_args.push_back(fmt::format("&::{}", name));
                      +
                      1340  }
                      +
                      1341 
                      1342 
                      -
                      1343  printer->fmt_line("{}* {}{};",
                      -
                      1344  global_struct(),
                      - -
                      1346  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                      -
                      1347  : std::string{});
                      -
                      1348  printer->pop_block(";");
                      -
                      1349 }
                      -
                      1350 
                      - -
                      1352  printer->add_newline(2);
                      -
                      1353  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _lmc)",
                      -
                      1354  instance_struct(),
                      -
                      1355  info.mod_suffix);
                      -
                      1356  printer->fmt_push_block("return {}", instance_struct());
                      -
                      1357 
                      -
                      1358  std::vector<std::string> make_instance_args;
                      -
                      1359 
                      -
                      1360 
                      -
                      1361  for (auto const& [var, type]: info.neuron_global_variables) {
                      -
                      1362  auto const name = var->get_name();
                      -
                      1363  make_instance_args.push_back(fmt::format("&::{}", name));
                      -
                      1364  }
                      -
                      1365 
                      -
                      1366 
                      -
                      1367  const auto codegen_float_variables_size = codegen_float_variables.size();
                      -
                      1368  for (int i = 0; i < codegen_float_variables_size; ++i) {
                      -
                      1369  const auto& float_var = codegen_float_variables[i];
                      -
                      1370  if (float_var->is_array()) {
                      -
                      1371  make_instance_args.push_back(
                      -
                      1372  fmt::format("_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
                      -
                      1373  } else {
                      -
                      1374  make_instance_args.push_back(fmt::format("_lmc.template fpfield_ptr<{}>()", i));
                      -
                      1375  }
                      -
                      1376  }
                      +
                      1343  const auto codegen_float_variables_size = codegen_float_variables.size();
                      +
                      1344  for (int i = 0; i < codegen_float_variables_size; ++i) {
                      +
                      1345  const auto& float_var = codegen_float_variables[i];
                      +
                      1346  if (float_var->is_array()) {
                      +
                      1347  make_instance_args.push_back(
                      +
                      1348  fmt::format("_lmc.template data_array_ptr<{}, {}>()", i, float_var->get_length()));
                      +
                      1349  } else {
                      +
                      1350  make_instance_args.push_back(fmt::format("_lmc.template fpfield_ptr<{}>()", i));
                      +
                      1351  }
                      +
                      1352  }
                      +
                      1353 
                      +
                      1354  const auto codegen_int_variables_size = codegen_int_variables.size();
                      +
                      1355  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                      +
                      1356  const auto& var = codegen_int_variables[i];
                      +
                      1357  auto name = var.symbol->get_name();
                      +
                      1358  auto const variable = [&var, i]() -> std::string {
                      +
                      1359  if (var.is_index || var.is_integer) {
                      +
                      1360  return "";
                      +
                      1361  } else if (var.is_vdata) {
                      +
                      1362  return "";
                      +
                      1363  } else {
                      +
                      1364  return fmt::format("_lmc.template dptr_field_ptr<{}>()", i);
                      +
                      1365  }
                      +
                      1366  }();
                      +
                      1367  if (variable != "") {
                      +
                      1368  make_instance_args.push_back(variable);
                      +
                      1369  }
                      +
                      1370  }
                      +
                      1371 
                      +
                      1372  printer->add_multi_line(fmt::format("{}", fmt::join(make_instance_args, ",\n")));
                      +
                      1373 
                      +
                      1374  printer->pop_block(";");
                      +
                      1375  printer->pop_block();
                      +
                      1376 }
                      1377 
                      -
                      1378  const auto codegen_int_variables_size = codegen_int_variables.size();
                      -
                      1379  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                      -
                      1380  const auto& var = codegen_int_variables[i];
                      -
                      1381  auto name = var.symbol->get_name();
                      -
                      1382  auto const variable = [&var, i]() -> std::string {
                      -
                      1383  if (var.is_index || var.is_integer) {
                      -
                      1384  return "";
                      -
                      1385  } else if (var.is_vdata) {
                      -
                      1386  return "";
                      -
                      1387  } else {
                      -
                      1388  return fmt::format("_lmc.template dptr_field_ptr<{}>()", i);
                      -
                      1389  }
                      -
                      1390  }();
                      -
                      1391  if (variable != "") {
                      -
                      1392  make_instance_args.push_back(variable);
                      -
                      1393  }
                      -
                      1394  }
                      -
                      1395 
                      -
                      1396  printer->add_multi_line(fmt::format("{}", fmt::join(make_instance_args, ",\n")));
                      + +
                      1379  printer->add_newline(2);
                      +
                      1380  printer->fmt_push_block("struct {} ", node_data_struct());
                      +
                      1381 
                      +
                      1382  // Pointers to node variables
                      +
                      1383  printer->add_line("int const * nodeindices;");
                      +
                      1384  printer->add_line("double const * node_voltages;");
                      +
                      1385  printer->add_line("double * node_diagonal;");
                      +
                      1386  printer->add_line("double * node_rhs;");
                      +
                      1387  printer->add_line("int nodecount;");
                      +
                      1388 
                      +
                      1389  printer->pop_block(";");
                      +
                      1390 }
                      +
                      1391 
                      + +
                      1393  printer->add_newline(2);
                      +
                      1394  printer->fmt_push_block("static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
                      +
                      1395  node_data_struct(),
                      +
                      1396  info.mod_suffix);
                      1397 
                      -
                      1398  printer->pop_block(";");
                      -
                      1399  printer->pop_block();
                      -
                      1400 }
                      -
                      1401 
                      - -
                      1403  printer->add_newline(2);
                      -
                      1404  printer->fmt_push_block("struct {} ", node_data_struct());
                      -
                      1405 
                      -
                      1406  // Pointers to node variables
                      -
                      1407  printer->add_line("int const * nodeindices;");
                      -
                      1408  printer->add_line("double const * node_voltages;");
                      -
                      1409  printer->add_line("double * node_diagonal;");
                      -
                      1410  printer->add_line("double * node_rhs;");
                      -
                      1411  printer->add_line("int nodecount;");
                      -
                      1412 
                      -
                      1413  printer->pop_block(";");
                      -
                      1414 }
                      +
                      1398  std::vector<std::string> make_node_data_args = {"_ml_arg.nodeindices",
                      +
                      1399  "nt.node_voltage_storage()",
                      +
                      1400  "nt.node_d_storage()",
                      +
                      1401  "nt.node_rhs_storage()",
                      +
                      1402  "_ml_arg.nodecount"};
                      +
                      1403 
                      +
                      1404  printer->fmt_push_block("return {}", node_data_struct());
                      +
                      1405  printer->add_multi_line(fmt::format("{}", fmt::join(make_node_data_args, ",\n")));
                      +
                      1406 
                      +
                      1407  printer->pop_block(";");
                      +
                      1408  printer->pop_block();
                      +
                      1409 }
                      +
                      1410 
                      + +
                      1412  if (codegen_thread_variables.empty()) {
                      +
                      1413  return;
                      +
                      1414  }
                      1415 
                      - -
                      1417  printer->add_newline(2);
                      -
                      1418  printer->fmt_push_block("static {} make_node_data_{}(NrnThread& nt, Memb_list& _ml_arg)",
                      -
                      1419  node_data_struct(),
                      -
                      1420  info.mod_suffix);
                      -
                      1421 
                      -
                      1422  std::vector<std::string> make_node_data_args = {"_ml_arg.nodeindices",
                      -
                      1423  "nt.node_voltage_storage()",
                      -
                      1424  "nt.node_d_storage()",
                      -
                      1425  "nt.node_rhs_storage()",
                      -
                      1426  "_ml_arg.nodecount"};
                      -
                      1427 
                      -
                      1428  printer->fmt_push_block("return {}", node_data_struct());
                      -
                      1429  printer->add_multi_line(fmt::format("{}", fmt::join(make_node_data_args, ",\n")));
                      -
                      1430 
                      -
                      1431  printer->pop_block(";");
                      -
                      1432  printer->pop_block();
                      -
                      1433 }
                      +
                      1416  printer->add_newline(2);
                      +
                      1417  printer->fmt_push_block("struct {} ", thread_variables_struct());
                      +
                      1418  printer->add_line("double * thread_data;");
                      +
                      1419  printer->add_newline();
                      +
                      1420 
                      +
                      1421  std::string simd_width = "1";
                      +
                      1422 
                      +
                      1423 
                      +
                      1424  for (const auto& var_info: codegen_thread_variables) {
                      +
                      1425  printer->fmt_push_block("double * {}_ptr(size_t id)", var_info.symbol->get_name());
                      +
                      1426  printer->fmt_line("return thread_data + {} + (id % {});", var_info.offset, simd_width);
                      +
                      1427  printer->pop_block();
                      +
                      1428 
                      +
                      1429  printer->fmt_push_block("double & {}(size_t id)", var_info.symbol->get_name());
                      +
                      1430  printer->fmt_line("return thread_data[{} + (id % {})];", var_info.offset, simd_width);
                      +
                      1431  printer->pop_block();
                      +
                      1432  }
                      +
                      1433  printer->add_newline();
                      1434 
                      - -
                      1436  if (codegen_thread_variables.empty()) {
                      -
                      1437  return;
                      -
                      1438  }
                      -
                      1439 
                      -
                      1440  printer->add_newline(2);
                      -
                      1441  printer->fmt_push_block("struct {} ", thread_variables_struct());
                      -
                      1442  printer->add_line("double * thread_data;");
                      -
                      1443  printer->add_newline();
                      -
                      1444 
                      -
                      1445  std::string simd_width = "1";
                      -
                      1446 
                      -
                      1447 
                      -
                      1448  for (const auto& var_info: codegen_thread_variables) {
                      -
                      1449  printer->fmt_push_block("double * {}_ptr(size_t id)", var_info.symbol->get_name());
                      -
                      1450  printer->fmt_line("return thread_data + {} + (id % {});", var_info.offset, simd_width);
                      -
                      1451  printer->pop_block();
                      -
                      1452 
                      -
                      1453  printer->fmt_push_block("double & {}(size_t id)", var_info.symbol->get_name());
                      -
                      1454  printer->fmt_line("return thread_data[{} + (id % {})];", var_info.offset, simd_width);
                      -
                      1455  printer->pop_block();
                      -
                      1456  }
                      -
                      1457  printer->add_newline();
                      -
                      1458 
                      -
                      1459  printer->push_block(fmt::format("{}(double * const thread_data)", thread_variables_struct()));
                      -
                      1460  printer->fmt_line("this->thread_data = thread_data;");
                      -
                      1461  printer->pop_block();
                      -
                      1462 
                      -
                      1463  printer->pop_block(";");
                      -
                      1464 }
                      -
                      1465 
                      -
                      1466 
                      - -
                      1468  // read ion statements
                      -
                      1469  auto read_statements = ion_read_statements(BlockType::Initial);
                      -
                      1470  for (auto& statement: read_statements) {
                      -
                      1471  printer->add_line(statement);
                      -
                      1472  }
                      +
                      1435  printer->push_block(fmt::format("{}(double * const thread_data)", thread_variables_struct()));
                      +
                      1436  printer->fmt_line("this->thread_data = thread_data;");
                      +
                      1437  printer->pop_block();
                      +
                      1438 
                      +
                      1439  printer->pop_block(";");
                      +
                      1440 }
                      +
                      1441 
                      +
                      1442 
                      + +
                      1444  // read ion statements
                      +
                      1445  auto read_statements = ion_read_statements(BlockType::Initial);
                      +
                      1446  for (auto& statement: read_statements) {
                      +
                      1447  printer->add_line(statement);
                      +
                      1448  }
                      +
                      1449 
                      +
                      1450  // initial block
                      +
                      1451  if (node != nullptr) {
                      +
                      1452  const auto& block = node->get_statement_block();
                      +
                      1453  print_statement_block(*block, false, false);
                      +
                      1454  }
                      +
                      1455 
                      +
                      1456  // write ion statements
                      +
                      1457  auto write_statements = ion_write_statements(BlockType::Initial);
                      +
                      1458  for (auto& statement: write_statements) {
                      +
                      1459  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                      +
                      1460  printer->add_line(text);
                      +
                      1461  }
                      +
                      1462 }
                      +
                      1463 
                      +
                      1464 
                      + +
                      1466  const std::string& function_name) {
                      +
                      1467  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
                      +
                      1468  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                      +
                      1469  {"", "NrnThread*", "", "nt"},
                      +
                      1470  {"", "Memb_list*", "", "_ml_arg"},
                      +
                      1471  {"", "int", "", "_type"}};
                      +
                      1472  printer->fmt_push_block("void {}({})", method, get_parameter_str(args));
                      1473 
                      -
                      1474  // initial block
                      -
                      1475  if (node != nullptr) {
                      -
                      1476  const auto& block = node->get_statement_block();
                      -
                      1477  print_statement_block(*block, false, false);
                      -
                      1478  }
                      -
                      1479 
                      -
                      1480  // write ion statements
                      -
                      1481  auto write_statements = ion_write_statements(BlockType::Initial);
                      -
                      1482  for (auto& statement: write_statements) {
                      -
                      1483  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                      -
                      1484  printer->add_line(text);
                      -
                      1485  }
                      -
                      1486 }
                      +
                      1474  printer->add_line("_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                      +
                      1475  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      +
                      1476  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                      +
                      1477 
                      +
                      1478  printer->add_line("auto nodecount = _ml_arg->nodecount;");
                      +
                      1479  printer->add_line("auto* _thread = _ml_arg->_thread;");
                      +
                      1480  if (!codegen_thread_variables.empty()) {
                      +
                      1481  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                      +
                      1482  thread_variables_struct(),
                      +
                      1483  info.thread_var_thread_id);
                      +
                      1484  }
                      +
                      1485 }
                      +
                      1486 
                      1487 
                      -
                      1488 
                      - -
                      1490  const std::string& function_name) {
                      -
                      1491  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
                      -
                      1492  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                      -
                      1493  {"", "NrnThread*", "", "nt"},
                      -
                      1494  {"", "Memb_list*", "", "_ml_arg"},
                      -
                      1495  {"", "int", "", "_type"}};
                      -
                      1496  printer->fmt_push_block("void {}({})", method, get_parameter_str(args));
                      -
                      1497 
                      -
                      1498  printer->add_line("_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                      -
                      1499  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      -
                      1500  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                      +
                      1488 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
                      +
                      1489  printer->add_newline(2);
                      +
                      1490 
                      +
                      1491  print_global_function_common_code(BlockType::Initial);
                      +
                      1492 
                      +
                      1493  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1494 
                      +
                      1495  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                      +
                      1496  if (!info.artificial_cell) {
                      +
                      1497  printer->add_line("int node_id = node_data.nodeindices[id];");
                      +
                      1498  printer->add_line("auto v = node_data.node_voltages[node_id];");
                      +
                      1499  printer->fmt_line("inst.{}[id] = v;", naming::VOLTAGE_UNUSED_VARIABLE);
                      +
                      1500  }
                      1501 
                      -
                      1502  printer->add_line("auto nodecount = _ml_arg->nodecount;");
                      -
                      1503  printer->add_line("auto* _thread = _ml_arg->_thread;");
                      -
                      1504  if (!codegen_thread_variables.empty()) {
                      -
                      1505  printer->fmt_line("auto _thread_vars = {}(_thread[{}].get<double*>());",
                      -
                      1506  thread_variables_struct(),
                      -
                      1507  info.thread_var_thread_id);
                      -
                      1508  }
                      -
                      1509 }
                      +
                      1502  print_initial_block(info.initial_node);
                      +
                      1503  printer->pop_block();
                      +
                      1504 
                      +
                      1505  printer->pop_block();
                      +
                      1506 }
                      +
                      1507 
                      + +
                      1509  printer->add_newline(2);
                      1510 
                      -
                      1511 
                      -
                      1512 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
                      -
                      1513  printer->add_newline(2);
                      -
                      1514 
                      -
                      1515  print_global_function_common_code(BlockType::Initial);
                      -
                      1516 
                      -
                      1517  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      1518 
                      -
                      1519  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                      -
                      1520  if (!info.artificial_cell) {
                      -
                      1521  printer->add_line("int node_id = node_data.nodeindices[id];");
                      -
                      1522  printer->add_line("auto v = node_data.node_voltages[node_id];");
                      -
                      1523  printer->fmt_line("inst.{}[id] = v;", naming::VOLTAGE_UNUSED_VARIABLE);
                      -
                      1524  }
                      -
                      1525 
                      -
                      1526  print_initial_block(info.initial_node);
                      -
                      1527  printer->pop_block();
                      +
                      1511  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                      +
                      1512  {"", "NrnThread*", "", "nt"},
                      +
                      1513  {"", "Memb_list*", "", "_ml_arg"},
                      +
                      1514  {"", "int", "", "_type"}};
                      +
                      1515 
                      +
                      1516  printer->fmt_push_block("static void {}({})",
                      +
                      1517  method_name(naming::NRN_JACOB_METHOD),
                      +
                      1518  get_parameter_str(args)); // begin function
                      +
                      1519 
                      +
                      1520 
                      +
                      1521  printer->add_multi_line(
                      +
                      1522  "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                      +
                      1523 
                      +
                      1524  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      +
                      1525  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                      +
                      1526  printer->fmt_line("auto nodecount = _ml_arg->nodecount;");
                      +
                      1527  printer->push_block("for (int id = 0; id < nodecount; id++)"); // begin for
                      1528 
                      -
                      1529  printer->pop_block();
                      -
                      1530 }
                      -
                      1531 
                      - -
                      1533  printer->add_newline(2);
                      -
                      1534 
                      -
                      1535  ParamVector args = {{"", "const _nrn_model_sorted_token&", "", "_sorted_token"},
                      -
                      1536  {"", "NrnThread*", "", "nt"},
                      -
                      1537  {"", "Memb_list*", "", "_ml_arg"},
                      -
                      1538  {"", "int", "", "_type"}};
                      +
                      1529  if (breakpoint_exist()) {
                      +
                      1530  printer->add_line("int node_id = node_data.nodeindices[id];");
                      +
                      1531  printer->fmt_line("node_data.node_diagonal[node_id] += inst.{}[id];",
                      +
                      1532  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                      + +
                      1534  }
                      +
                      1535 
                      +
                      1536  printer->pop_block(); // end for
                      +
                      1537  printer->pop_block(); // end function
                      +
                      1538 }
                      1539 
                      -
                      1540  printer->fmt_push_block("static void {}({})",
                      -
                      1541  method_name(naming::NRN_JACOB_METHOD),
                      -
                      1542  get_parameter_str(args)); // begin function
                      -
                      1543 
                      -
                      1544 
                      -
                      1545  printer->add_multi_line(
                      -
                      1546  "_nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _type};");
                      -
                      1547 
                      -
                      1548  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      -
                      1549  printer->fmt_line("auto node_data = make_node_data_{}(*nt, *_ml_arg);", info.mod_suffix);
                      -
                      1550  printer->fmt_line("auto nodecount = _ml_arg->nodecount;");
                      -
                      1551  printer->push_block("for (int id = 0; id < nodecount; id++)"); // begin for
                      -
                      1552 
                      -
                      1553  if (breakpoint_exist()) {
                      -
                      1554  printer->add_line("int node_id = node_data.nodeindices[id];");
                      -
                      1555  printer->fmt_line("node_data.node_diagonal[node_id] += inst.{}[id];",
                      -
                      1556  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                      - -
                      1558  }
                      -
                      1559 
                      -
                      1560  printer->pop_block(); // end for
                      -
                      1561  printer->pop_block(); // end function
                      -
                      1562 }
                      -
                      1563 
                      -
                      1564 
                      -
                      1565 /// TODO: Edit for NEURON
                      - -
                      1567  return;
                      -
                      1568 }
                      -
                      1569 
                      -
                      1570 
                      -
                      1571 /// TODO: Edit for NEURON
                      - -
                      1573  return;
                      -
                      1574 }
                      -
                      1575 
                      -
                      1576 
                      -
                      1577 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
                      - -
                      1579  printer->add_newline(2);
                      -
                      1580 
                      -
                      1581  auto method = method_name(naming::NRN_ALLOC_METHOD);
                      -
                      1582  printer->fmt_push_block("static void {}(Prop* _prop)", method);
                      -
                      1583  printer->add_line("Datum *_ppvar = nullptr;");
                      -
                      1584 
                      -
                      1585  if (info.point_process) {
                      -
                      1586  printer->push_block("if (nrn_point_prop_)");
                      -
                      1587  printer->add_multi_line(R"CODE(
                      -
                      1588  _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
                      -
                      1589  _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
                      -
                      1590  )CODE");
                      -
                      1591  printer->chain_block("else");
                      -
                      1592  }
                      -
                      1593  if (info.semantic_variable_count) {
                      -
                      1594  printer->fmt_line("_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
                      -
                      1595  info.semantic_variable_count);
                      -
                      1596  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                      -
                      1597  }
                      -
                      1598  printer->add_multi_line(R"CODE(
                      -
                      1599  _nrn_mechanism_cache_instance _lmc{_prop};
                      -
                      1600  size_t const _iml = 0;
                      -
                      1601  )CODE");
                      -
                      1602  printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
                      -
                      1603  codegen_float_variables.size());
                      -
                      1604  if (float_variables_size()) {
                      -
                      1605  printer->add_line("/*initialize range parameters*/");
                      -
                      1606  for (size_t i_param = 0; i_param < info.range_parameter_vars.size(); ++i_param) {
                      -
                      1607  const auto var = info.range_parameter_vars[i_param];
                      -
                      1608  if (var->is_array()) {
                      -
                      1609  continue;
                      -
                      1610  }
                      -
                      1611  const auto& var_name = var->get_name();
                      -
                      1612  auto var_pos = position_of_float_var(var_name);
                      -
                      1613  double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();
                      -
                      1614 
                      -
                      1615  printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
                      -
                      1616  var_pos,
                      -
                      1617  fmt::format("_parameter_defaults[{}]", i_param),
                      -
                      1618  var_name);
                      -
                      1619  }
                      -
                      1620  }
                      -
                      1621  if (info.point_process) {
                      -
                      1622  printer->pop_block();
                      -
                      1623  }
                      -
                      1624 
                      -
                      1625  if (info.semantic_variable_count) {
                      -
                      1626  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                      -
                      1627  }
                      -
                      1628 
                      -
                      1629  const auto codegen_int_variables_size = codegen_int_variables.size();
                      -
                      1630 
                      -
                      1631  if (info.diam_used || info.area_used) {
                      -
                      1632  for (size_t i = 0; i < codegen_int_variables.size(); ++i) {
                      -
                      1633  auto var_info = codegen_int_variables[i];
                      -
                      1634  if (var_info.symbol->get_name() == naming::DIAM_VARIABLE) {
                      -
                      1635  printer->add_line("Symbol * morphology_sym = hoc_lookup(\"morphology\");");
                      -
                      1636  printer->fmt_line("Prop * morphology_prop = need_memb(morphology_sym);");
                      -
                      1637 
                      -
                      1638  printer->fmt_line(
                      -
                      1639  "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
                      -
                      1640  }
                      -
                      1641  if (var_info.symbol->get_name() == naming::AREA_VARIABLE) {
                      -
                      1642  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
                      -
                      1643  i);
                      -
                      1644  }
                      -
                      1645  }
                      -
                      1646  }
                      -
                      1647 
                      -
                      1648  for (const auto& ion: info.ions) {
                      -
                      1649  printer->fmt_line("Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
                      -
                      1650  printer->fmt_line("Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
                      -
                      1651 
                      -
                      1652  if (ion.is_exterior_conc_written()) {
                      -
                      1653  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 0);", ion.name);
                      -
                      1654  }
                      -
                      1655 
                      -
                      1656  if (ion.is_interior_conc_written()) {
                      -
                      1657  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 1);", ion.name);
                      -
                      1658  }
                      -
                      1659 
                      -
                      1660  int conc = ion.is_conc_written() ? 3 : int(ion.is_conc_read());
                      -
                      1661  int rev = ion.is_rev_written() ? 3 : int(ion.is_rev_read());
                      -
                      1662 
                      -
                      1663  printer->fmt_line("nrn_promote({}_prop, {}, {});", ion.name, conc, rev);
                      -
                      1664 
                      -
                      1665  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                      -
                      1666  const auto& var = codegen_int_variables[i];
                      -
                      1667 
                      -
                      1668  const std::string& var_name = var.symbol->get_name();
                      -
                      1669 
                      -
                      1670  if (stringutils::starts_with(var_name, "ion_")) {
                      -
                      1671  std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
                      -
                      1672  if (ion.is_ionic_variable(ion_var_name) ||
                      -
                      1673  ion.is_current_derivative(ion_var_name) || ion.is_rev_potential(ion_var_name)) {
                      -
                      1674  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
                      -
                      1675  i,
                      -
                      1676  ion.name,
                      -
                      1677  ion.variable_index(ion_var_name));
                      -
                      1678  }
                      -
                      1679  } else {
                      -
                      1680  if (ion.is_style(var_name)) {
                      -
                      1681  printer->fmt_line(
                      -
                      1682  "_ppvar[{}] = {{neuron::container::do_not_search, "
                      -
                      1683  "&(_nrn_mechanism_access_dparam({}_prop)[0].literal_value<int>())}};",
                      -
                      1684  i,
                      -
                      1685  ion.name);
                      -
                      1686  }
                      -
                      1687  }
                      -
                      1688  }
                      -
                      1689  }
                      +
                      1540 
                      +
                      1541 /// TODO: Edit for NEURON
                      + +
                      1543  return;
                      +
                      1544 }
                      +
                      1545 
                      +
                      1546 
                      +
                      1547 /// TODO: Edit for NEURON
                      + +
                      1549  return;
                      +
                      1550 }
                      +
                      1551 
                      +
                      1552 
                      +
                      1553 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
                      + +
                      1555  printer->add_newline(2);
                      +
                      1556 
                      +
                      1557  auto method = method_name(naming::NRN_ALLOC_METHOD);
                      +
                      1558  printer->fmt_push_block("static void {}(Prop* _prop)", method);
                      +
                      1559  printer->add_line("Datum *_ppvar = nullptr;");
                      +
                      1560 
                      +
                      1561  if (info.point_process) {
                      +
                      1562  printer->push_block("if (nrn_point_prop_)");
                      +
                      1563  printer->add_multi_line(R"CODE(
                      +
                      1564  _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_);
                      +
                      1565  _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_);
                      +
                      1566  )CODE");
                      +
                      1567  printer->chain_block("else");
                      +
                      1568  }
                      +
                      1569  if (info.semantic_variable_count) {
                      +
                      1570  printer->fmt_line("_ppvar = nrn_prop_datum_alloc(mech_type, {}, _prop);",
                      +
                      1571  info.semantic_variable_count);
                      +
                      1572  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                      +
                      1573  }
                      +
                      1574  printer->add_multi_line(R"CODE(
                      +
                      1575  _nrn_mechanism_cache_instance _lmc{_prop};
                      +
                      1576  size_t const _iml = 0;
                      +
                      1577  )CODE");
                      +
                      1578  printer->fmt_line("assert(_nrn_mechanism_get_num_vars(_prop) == {});",
                      +
                      1579  codegen_float_variables.size());
                      +
                      1580  if (float_variables_size()) {
                      +
                      1581  printer->add_line("/*initialize range parameters*/");
                      +
                      1582  for (size_t i_param = 0; i_param < info.range_parameter_vars.size(); ++i_param) {
                      +
                      1583  const auto var = info.range_parameter_vars[i_param];
                      +
                      1584  if (var->is_array()) {
                      +
                      1585  continue;
                      +
                      1586  }
                      +
                      1587  const auto& var_name = var->get_name();
                      +
                      1588  auto var_pos = position_of_float_var(var_name);
                      +
                      1589  double var_value = var->get_value() == nullptr ? 0.0 : *var->get_value();
                      +
                      1590 
                      +
                      1591  printer->fmt_line("_lmc.template fpfield<{}>(_iml) = {}; /* {} */",
                      +
                      1592  var_pos,
                      +
                      1593  fmt::format("_parameter_defaults[{}]", i_param),
                      +
                      1594  var_name);
                      +
                      1595  }
                      +
                      1596  }
                      +
                      1597  if (info.point_process) {
                      +
                      1598  printer->pop_block();
                      +
                      1599  }
                      +
                      1600 
                      +
                      1601  if (info.semantic_variable_count) {
                      +
                      1602  printer->add_line("_nrn_mechanism_access_dparam(_prop) = _ppvar;");
                      +
                      1603  }
                      +
                      1604 
                      +
                      1605  const auto codegen_int_variables_size = codegen_int_variables.size();
                      +
                      1606 
                      +
                      1607  if (info.diam_used || info.area_used) {
                      +
                      1608  for (size_t i = 0; i < codegen_int_variables.size(); ++i) {
                      +
                      1609  auto var_info = codegen_int_variables[i];
                      +
                      1610  if (var_info.symbol->get_name() == naming::DIAM_VARIABLE) {
                      +
                      1611  printer->add_line("Symbol * morphology_sym = hoc_lookup(\"morphology\");");
                      +
                      1612  printer->fmt_line("Prop * morphology_prop = need_memb(morphology_sym);");
                      +
                      1613 
                      +
                      1614  printer->fmt_line(
                      +
                      1615  "_ppvar[{}] = _nrn_mechanism_get_param_handle(morphology_prop, 0);", i);
                      +
                      1616  }
                      +
                      1617  if (var_info.symbol->get_name() == naming::AREA_VARIABLE) {
                      +
                      1618  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_area_handle(nrn_alloc_node_);",
                      +
                      1619  i);
                      +
                      1620  }
                      +
                      1621  }
                      +
                      1622  }
                      +
                      1623 
                      +
                      1624  for (const auto& ion: info.ions) {
                      +
                      1625  printer->fmt_line("Symbol * {}_sym = hoc_lookup(\"{}_ion\");", ion.name, ion.name);
                      +
                      1626  printer->fmt_line("Prop * {}_prop = need_memb({}_sym);", ion.name, ion.name);
                      +
                      1627 
                      +
                      1628  if (ion.is_exterior_conc_written()) {
                      +
                      1629  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 0);", ion.name);
                      +
                      1630  }
                      +
                      1631 
                      +
                      1632  if (ion.is_interior_conc_written()) {
                      +
                      1633  printer->fmt_line("nrn_check_conc_write(_prop, {}_prop, 1);", ion.name);
                      +
                      1634  }
                      +
                      1635 
                      +
                      1636  int conc = ion.is_conc_written() ? 3 : int(ion.is_conc_read());
                      +
                      1637  int rev = ion.is_rev_written() ? 3 : int(ion.is_rev_read());
                      +
                      1638 
                      +
                      1639  printer->fmt_line("nrn_promote({}_prop, {}, {});", ion.name, conc, rev);
                      +
                      1640 
                      +
                      1641  for (size_t i = 0; i < codegen_int_variables_size; ++i) {
                      +
                      1642  const auto& var = codegen_int_variables[i];
                      +
                      1643 
                      +
                      1644  const std::string& var_name = var.symbol->get_name();
                      +
                      1645 
                      +
                      1646  if (stringutils::starts_with(var_name, "ion_")) {
                      +
                      1647  std::string ion_var_name = std::string(var_name.begin() + 4, var_name.end());
                      +
                      1648  if (ion.is_ionic_variable(ion_var_name) ||
                      +
                      1649  ion.is_current_derivative(ion_var_name) || ion.is_rev_potential(ion_var_name)) {
                      +
                      1650  printer->fmt_line("_ppvar[{}] = _nrn_mechanism_get_param_handle({}_prop, {});",
                      +
                      1651  i,
                      +
                      1652  ion.name,
                      +
                      1653  ion.variable_index(ion_var_name));
                      +
                      1654  }
                      +
                      1655  } else {
                      +
                      1656  if (ion.is_style(var_name)) {
                      +
                      1657  printer->fmt_line(
                      +
                      1658  "_ppvar[{}] = {{neuron::container::do_not_search, "
                      +
                      1659  "&(_nrn_mechanism_access_dparam({}_prop)[0].literal_value<int>())}};",
                      +
                      1660  i,
                      +
                      1661  ion.name);
                      +
                      1662  }
                      +
                      1663  }
                      +
                      1664  }
                      +
                      1665  }
                      +
                      1666 
                      +
                      1667  /// TODO: CONSTRUCTOR call
                      +
                      1668 
                      +
                      1669  printer->pop_block();
                      +
                      1670 }
                      +
                      1671 
                      +
                      1672 
                      +
                      1673 /****************************************************************************************/
                      +
                      1674 /* Print nrn_state routine */
                      +
                      1675 /****************************************************************************************/
                      +
                      1676 
                      +
                      1677 /// TODO: Edit for NEURON
                      + +
                      1679  if (!nrn_state_required()) {
                      +
                      1680  return;
                      +
                      1681  }
                      +
                      1682 
                      +
                      1683  printer->add_newline(2);
                      +
                      1684  print_global_function_common_code(BlockType::State);
                      +
                      1685 
                      +
                      1686  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1687  printer->add_line("int node_id = node_data.nodeindices[id];");
                      +
                      1688  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                      +
                      1689  printer->add_line("auto v = node_data.node_voltages[node_id];");
                      1690 
                      -
                      1691  /// TODO: CONSTRUCTOR call
                      -
                      1692 
                      -
                      1693  printer->pop_block();
                      -
                      1694 }
                      -
                      1695 
                      -
                      1696 
                      -
                      1697 /****************************************************************************************/
                      -
                      1698 /* Print nrn_state routine */
                      -
                      1699 /****************************************************************************************/
                      -
                      1700 
                      -
                      1701 /// TODO: Edit for NEURON
                      - -
                      1703  if (!nrn_state_required()) {
                      -
                      1704  return;
                      -
                      1705  }
                      -
                      1706 
                      -
                      1707  printer->add_newline(2);
                      -
                      1708  print_global_function_common_code(BlockType::State);
                      -
                      1709 
                      -
                      1710  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      1711  printer->add_line("int node_id = node_data.nodeindices[id];");
                      -
                      1712  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                      -
                      1713  printer->add_line("auto v = node_data.node_voltages[node_id];");
                      -
                      1714 
                      -
                      1715  /**
                      -
                      1716  * \todo Eigen solver node also emits IonCurVar variable in the functor
                      -
                      1717  * but that shouldn't update ions in derivative block
                      -
                      1718  */
                      -
                      1719  if (ion_variable_struct_required()) {
                      -
                      1720  throw std::runtime_error("Not implemented.");
                      -
                      1721  }
                      +
                      1691  /**
                      +
                      1692  * \todo Eigen solver node also emits IonCurVar variable in the functor
                      +
                      1693  * but that shouldn't update ions in derivative block
                      +
                      1694  */
                      +
                      1695  if (ion_variable_struct_required()) {
                      +
                      1696  throw std::runtime_error("Not implemented.");
                      +
                      1697  }
                      +
                      1698 
                      +
                      1699  auto read_statements = ion_read_statements(BlockType::State);
                      +
                      1700  for (auto& statement: read_statements) {
                      +
                      1701  printer->add_line(statement);
                      +
                      1702  }
                      +
                      1703 
                      +
                      1704  if (info.nrn_state_block) {
                      +
                      1705  info.nrn_state_block->visit_children(*this);
                      +
                      1706  }
                      +
                      1707 
                      +
                      1708  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                      +
                      1709  auto block = info.breakpoint_node->get_statement_block();
                      +
                      1710  print_statement_block(*block, false, false);
                      +
                      1711  }
                      +
                      1712 
                      +
                      1713  const auto& write_statements = ion_write_statements(BlockType::State);
                      +
                      1714  for (auto& statement: write_statements) {
                      +
                      1715  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                      +
                      1716  printer->add_line(text);
                      +
                      1717  }
                      +
                      1718 
                      +
                      1719  printer->pop_block();
                      +
                      1720  printer->pop_block();
                      +
                      1721 }
                      1722 
                      -
                      1723  auto read_statements = ion_read_statements(BlockType::State);
                      -
                      1724  for (auto& statement: read_statements) {
                      -
                      1725  printer->add_line(statement);
                      -
                      1726  }
                      +
                      1723 
                      +
                      1724 /****************************************************************************************/
                      +
                      1725 /* Print nrn_cur related routines */
                      +
                      1726 /****************************************************************************************/
                      1727 
                      -
                      1728  if (info.nrn_state_block) {
                      -
                      1729  info.nrn_state_block->visit_children(*this);
                      -
                      1730  }
                      + +
                      1729  return get_arg_str(nrn_current_parameters());
                      +
                      1730 }
                      1731 
                      -
                      1732  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                      -
                      1733  auto block = info.breakpoint_node->get_statement_block();
                      -
                      1734  print_statement_block(*block, false, false);
                      -
                      1735  }
                      -
                      1736 
                      -
                      1737  const auto& write_statements = ion_write_statements(BlockType::State);
                      -
                      1738  for (auto& statement: write_statements) {
                      -
                      1739  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                      -
                      1740  printer->add_line(text);
                      -
                      1741  }
                      +
                      1732 
                      + +
                      1734  if (ion_variable_struct_required()) {
                      +
                      1735  throw std::runtime_error("Not implemented.");
                      +
                      1736  }
                      +
                      1737 
                      +
                      1738  ParamVector params = {{"", "_nrn_mechanism_cache_range&", "", "_lmc"},
                      +
                      1739  {"", "NrnThread*", "", "nt"},
                      +
                      1740  {"", "Datum*", "", "_ppvar"},
                      +
                      1741  {"", "Datum*", "", "_thread"}};
                      1742 
                      -
                      1743  printer->pop_block();
                      -
                      1744  printer->pop_block();
                      -
                      1745 }
                      -
                      1746 
                      -
                      1747 
                      -
                      1748 /****************************************************************************************/
                      -
                      1749 /* Print nrn_cur related routines */
                      -
                      1750 /****************************************************************************************/
                      -
                      1751 
                      - -
                      1753  return get_arg_str(nrn_current_parameters());
                      -
                      1754 }
                      -
                      1755 
                      -
                      1756 
                      - -
                      1758  if (ion_variable_struct_required()) {
                      -
                      1759  throw std::runtime_error("Not implemented.");
                      -
                      1760  }
                      -
                      1761 
                      -
                      1762  ParamVector params = {{"", "_nrn_mechanism_cache_range&", "", "_lmc"},
                      -
                      1763  {"", "NrnThread*", "", "nt"},
                      -
                      1764  {"", "Datum*", "", "_ppvar"},
                      -
                      1765  {"", "Datum*", "", "_thread"}};
                      -
                      1766 
                      -
                      1767  if (info.thread_callback_register) {
                      -
                      1768  auto type_name = fmt::format("{}&", thread_variables_struct());
                      -
                      1769  params.emplace_back("", type_name, "", "_thread_vars");
                      -
                      1770  }
                      -
                      1771  params.emplace_back("", "size_t", "", "id");
                      -
                      1772  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                      -
                      1773  params.emplace_back("", fmt::format("{}&", node_data_struct()), "", "node_data");
                      -
                      1774  params.emplace_back("", "double", "", "v");
                      -
                      1775  return params;
                      -
                      1776 }
                      -
                      1777 
                      -
                      1778 
                      -
                      1779 /// TODO: Edit for NEURON
                      - -
                      1781  const auto& args = nrn_current_parameters();
                      -
                      1782  const auto& block = node.get_statement_block();
                      -
                      1783  printer->add_newline(2);
                      -
                      1784  printer->fmt_push_block("inline double nrn_current_{}({})",
                      -
                      1785  info.mod_suffix,
                      -
                      1786  get_parameter_str(args));
                      -
                      1787  printer->add_line("double current = 0.0;");
                      -
                      1788  print_statement_block(*block, false, false);
                      -
                      1789  for (auto& current: info.currents) {
                      -
                      1790  const auto& name = get_variable_name(current);
                      -
                      1791  printer->fmt_line("current += {};", name);
                      -
                      1792  }
                      -
                      1793  printer->add_line("return current;");
                      -
                      1794  printer->pop_block();
                      -
                      1795 }
                      -
                      1796 
                      -
                      1797 
                      -
                      1798 /// TODO: Edit for NEURON
                      - -
                      1800  const auto& block = node.get_statement_block();
                      -
                      1801  print_statement_block(*block, false, false);
                      -
                      1802  if (!info.currents.empty()) {
                      -
                      1803  std::string sum;
                      -
                      1804  for (const auto& current: info.currents) {
                      -
                      1805  auto var = breakpoint_current(current);
                      -
                      1806  sum += get_variable_name(var);
                      -
                      1807  if (&current != &info.currents.back()) {
                      -
                      1808  sum += "+";
                      -
                      1809  }
                      -
                      1810  }
                      -
                      1811  printer->fmt_line("double rhs = {};", sum);
                      -
                      1812  }
                      -
                      1813 
                      -
                      1814  std::string sum;
                      -
                      1815  for (const auto& conductance: info.conductances) {
                      -
                      1816  auto var = breakpoint_current(conductance.variable);
                      -
                      1817  sum += get_variable_name(var);
                      -
                      1818  if (&conductance != &info.conductances.back()) {
                      -
                      1819  sum += "+";
                      -
                      1820  }
                      -
                      1821  }
                      -
                      1822  printer->fmt_line("double g = {};", sum);
                      -
                      1823 
                      -
                      1824  for (const auto& conductance: info.conductances) {
                      -
                      1825  if (!conductance.ion.empty()) {
                      -
                      1826  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion +
                      -
                      1827  "dv";
                      -
                      1828  const auto& rhs = get_variable_name(conductance.variable);
                      -
                      1829  const ShadowUseStatement statement{lhs, "+=", rhs};
                      -
                      1830  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      1831  printer->add_line(text);
                      -
                      1832  }
                      -
                      1833  }
                      -
                      1834 }
                      -
                      1835 
                      -
                      1836 
                      -
                      1837 /// TODO: Edit for NEURON
                      - -
                      1839  printer->fmt_line("double I1 = nrn_current_{}({}+0.001);",
                      -
                      1840  info.mod_suffix,
                      -
                      1841  nrn_current_arguments());
                      -
                      1842  for (auto& ion: info.ions) {
                      -
                      1843  for (auto& var: ion.writes) {
                      -
                      1844  if (ion.is_ionic_current(var)) {
                      -
                      1845  const auto& name = get_variable_name(var);
                      -
                      1846  printer->fmt_line("double di{} = {};", ion.name, name);
                      -
                      1847  }
                      -
                      1848  }
                      -
                      1849  }
                      -
                      1850  printer->fmt_line("double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
                      -
                      1851  printer->add_line("double rhs = I0;");
                      -
                      1852 
                      -
                      1853  printer->add_line("double g = (I1-I0)/0.001;");
                      -
                      1854  for (auto& ion: info.ions) {
                      -
                      1855  for (auto& var: ion.writes) {
                      -
                      1856  if (ion.is_ionic_current(var)) {
                      -
                      1857  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                      -
                      1858  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                      -
                      1859  if (info.point_process) {
                      -
                      1860  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      -
                      1861  rhs += fmt::format("*1.e2/{}", area);
                      -
                      1862  }
                      -
                      1863  const ShadowUseStatement statement{lhs, "+=", rhs};
                      -
                      1864  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      1865  printer->add_line(text);
                      -
                      1866  }
                      -
                      1867  }
                      +
                      1743  if (info.thread_callback_register) {
                      +
                      1744  auto type_name = fmt::format("{}&", thread_variables_struct());
                      +
                      1745  params.emplace_back("", type_name, "", "_thread_vars");
                      +
                      1746  }
                      +
                      1747  params.emplace_back("", "size_t", "", "id");
                      +
                      1748  params.emplace_back("", fmt::format("{}&", instance_struct()), "", "inst");
                      +
                      1749  params.emplace_back("", fmt::format("{}&", node_data_struct()), "", "node_data");
                      +
                      1750  params.emplace_back("", "double", "", "v");
                      +
                      1751  return params;
                      +
                      1752 }
                      +
                      1753 
                      +
                      1754 
                      +
                      1755 /// TODO: Edit for NEURON
                      + +
                      1757  const auto& args = nrn_current_parameters();
                      +
                      1758  const auto& block = node.get_statement_block();
                      +
                      1759  printer->add_newline(2);
                      +
                      1760  printer->fmt_push_block("inline double nrn_current_{}({})",
                      +
                      1761  info.mod_suffix,
                      +
                      1762  get_parameter_str(args));
                      +
                      1763  printer->add_line("double current = 0.0;");
                      +
                      1764  print_statement_block(*block, false, false);
                      +
                      1765  for (auto& current: info.currents) {
                      +
                      1766  const auto& name = get_variable_name(current);
                      +
                      1767  printer->fmt_line("current += {};", name);
                      +
                      1768  }
                      +
                      1769  printer->add_line("return current;");
                      +
                      1770  printer->pop_block();
                      +
                      1771 }
                      +
                      1772 
                      +
                      1773 
                      +
                      1774 /// TODO: Edit for NEURON
                      + +
                      1776  const auto& block = node.get_statement_block();
                      +
                      1777  print_statement_block(*block, false, false);
                      +
                      1778  if (!info.currents.empty()) {
                      +
                      1779  std::string sum;
                      +
                      1780  for (const auto& current: info.currents) {
                      +
                      1781  auto var = breakpoint_current(current);
                      +
                      1782  sum += get_variable_name(var);
                      +
                      1783  if (&current != &info.currents.back()) {
                      +
                      1784  sum += "+";
                      +
                      1785  }
                      +
                      1786  }
                      +
                      1787  printer->fmt_line("double rhs = {};", sum);
                      +
                      1788  }
                      +
                      1789 
                      +
                      1790  std::string sum;
                      +
                      1791  for (const auto& conductance: info.conductances) {
                      +
                      1792  auto var = breakpoint_current(conductance.variable);
                      +
                      1793  sum += get_variable_name(var);
                      +
                      1794  if (&conductance != &info.conductances.back()) {
                      +
                      1795  sum += "+";
                      +
                      1796  }
                      +
                      1797  }
                      +
                      1798  printer->fmt_line("double g = {};", sum);
                      +
                      1799 
                      +
                      1800  for (const auto& conductance: info.conductances) {
                      +
                      1801  if (!conductance.ion.empty()) {
                      +
                      1802  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion +
                      +
                      1803  "dv";
                      +
                      1804  const auto& rhs = get_variable_name(conductance.variable);
                      +
                      1805  const ShadowUseStatement statement{lhs, "+=", rhs};
                      +
                      1806  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      1807  printer->add_line(text);
                      +
                      1808  }
                      +
                      1809  }
                      +
                      1810 }
                      +
                      1811 
                      +
                      1812 
                      +
                      1813 /// TODO: Edit for NEURON
                      + +
                      1815  printer->fmt_line("double I1 = nrn_current_{}({}+0.001);",
                      +
                      1816  info.mod_suffix,
                      +
                      1817  nrn_current_arguments());
                      +
                      1818  for (auto& ion: info.ions) {
                      +
                      1819  for (auto& var: ion.writes) {
                      +
                      1820  if (ion.is_ionic_current(var)) {
                      +
                      1821  const auto& name = get_variable_name(var);
                      +
                      1822  printer->fmt_line("double di{} = {};", ion.name, name);
                      +
                      1823  }
                      +
                      1824  }
                      +
                      1825  }
                      +
                      1826  printer->fmt_line("double I0 = nrn_current_{}({});", info.mod_suffix, nrn_current_arguments());
                      +
                      1827  printer->add_line("double rhs = I0;");
                      +
                      1828 
                      +
                      1829  printer->add_line("double g = (I1-I0)/0.001;");
                      +
                      1830  for (auto& ion: info.ions) {
                      +
                      1831  for (auto& var: ion.writes) {
                      +
                      1832  if (ion.is_ionic_current(var)) {
                      +
                      1833  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                      +
                      1834  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                      +
                      1835  if (info.point_process) {
                      +
                      1836  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      +
                      1837  rhs += fmt::format("*1.e2/{}", area);
                      +
                      1838  }
                      +
                      1839  const ShadowUseStatement statement{lhs, "+=", rhs};
                      +
                      1840  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      1841  printer->add_line(text);
                      +
                      1842  }
                      +
                      1843  }
                      +
                      1844  }
                      +
                      1845 }
                      +
                      1846 
                      +
                      1847 
                      +
                      1848 /// TODO: Edit for NEURON
                      + +
                      1850  printer->add_line("int node_id = node_data.nodeindices[id];");
                      +
                      1851  printer->add_line("double v = node_data.node_voltages[node_id];");
                      +
                      1852  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                      +
                      1853  const auto& read_statements = ion_read_statements(BlockType::Equation);
                      +
                      1854  for (auto& statement: read_statements) {
                      +
                      1855  printer->add_line(statement);
                      +
                      1856  }
                      +
                      1857 
                      +
                      1858  if (info.conductances.empty()) {
                      +
                      1859  print_nrn_cur_non_conductance_kernel();
                      +
                      1860  } else {
                      +
                      1861  print_nrn_cur_conductance_kernel(node);
                      +
                      1862  }
                      +
                      1863 
                      +
                      1864  const auto& write_statements = ion_write_statements(BlockType::Equation);
                      +
                      1865  for (auto& statement: write_statements) {
                      +
                      1866  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                      +
                      1867  printer->add_line(text);
                      1868  }
                      -
                      1869 }
                      -
                      1870 
                      -
                      1871 
                      -
                      1872 /// TODO: Edit for NEURON
                      - -
                      1874  printer->add_line("int node_id = node_data.nodeindices[id];");
                      -
                      1875  printer->add_line("double v = node_data.node_voltages[node_id];");
                      -
                      1876  printer->add_line("auto* _ppvar = _ml_arg->pdata[id];");
                      -
                      1877  const auto& read_statements = ion_read_statements(BlockType::Equation);
                      -
                      1878  for (auto& statement: read_statements) {
                      -
                      1879  printer->add_line(statement);
                      -
                      1880  }
                      -
                      1881 
                      -
                      1882  if (info.conductances.empty()) {
                      -
                      1883  print_nrn_cur_non_conductance_kernel();
                      -
                      1884  } else {
                      -
                      1885  print_nrn_cur_conductance_kernel(node);
                      -
                      1886  }
                      -
                      1887 
                      -
                      1888  const auto& write_statements = ion_write_statements(BlockType::Equation);
                      -
                      1889  for (auto& statement: write_statements) {
                      -
                      1890  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                      -
                      1891  printer->add_line(text);
                      -
                      1892  }
                      -
                      1893 
                      -
                      1894  if (info.point_process) {
                      -
                      1895  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      -
                      1896  printer->fmt_line("double mfactor = 1.e2/{};", area);
                      -
                      1897  printer->add_line("g = g*mfactor;");
                      -
                      1898  printer->add_line("rhs = rhs*mfactor;");
                      -
                      1899  }
                      -
                      1900 
                      -
                      1901  // print_g_unused();
                      -
                      1902 }
                      -
                      1903 
                      -
                      1904 
                      -
                      1905 /// TODO: Edit for NEURON
                      - -
                      1907  return;
                      -
                      1908 }
                      -
                      1909 
                      -
                      1910 
                      -
                      1911 /// TODO: Edit for NEURON
                      - -
                      1913  if (!nrn_cur_required()) {
                      -
                      1914  return;
                      +
                      1869 
                      +
                      1870  if (info.point_process) {
                      +
                      1871  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                      +
                      1872  printer->fmt_line("double mfactor = 1.e2/{};", area);
                      +
                      1873  printer->add_line("g = g*mfactor;");
                      +
                      1874  printer->add_line("rhs = rhs*mfactor;");
                      +
                      1875  }
                      +
                      1876 
                      +
                      1877  // print_g_unused();
                      +
                      1878 }
                      +
                      1879 
                      +
                      1880 
                      +
                      1881 /// TODO: Edit for NEURON
                      + +
                      1883  return;
                      +
                      1884 }
                      +
                      1885 
                      +
                      1886 
                      +
                      1887 /// TODO: Edit for NEURON
                      + +
                      1889  if (!nrn_cur_required()) {
                      +
                      1890  return;
                      +
                      1891  }
                      +
                      1892 
                      +
                      1893  if (info.conductances.empty()) {
                      +
                      1894  print_nrn_current(*info.breakpoint_node);
                      +
                      1895  }
                      +
                      1896 
                      +
                      1897  printer->add_newline(2);
                      +
                      1898  printer->add_line("/** update current */");
                      +
                      1899  print_global_function_common_code(BlockType::Equation);
                      +
                      1900  // print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                      +
                      1901  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1902  print_nrn_cur_kernel(*info.breakpoint_node);
                      +
                      1903  // print_nrn_cur_matrix_shadow_update();
                      +
                      1904  // if (!nrn_cur_reduction_loop_required()) {
                      +
                      1905  // print_fast_imem_calculation();
                      +
                      1906  // }
                      +
                      1907 
                      +
                      1908 
                      +
                      1909  printer->add_line("node_data.node_rhs[node_id] -= rhs;");
                      +
                      1910 
                      +
                      1911  if (breakpoint_exist()) {
                      +
                      1912  printer->fmt_line("inst.{}[id] = g;",
                      +
                      1913  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                      +
                      1915  }
                      -
                      1916 
                      -
                      1917  if (info.conductances.empty()) {
                      -
                      1918  print_nrn_current(*info.breakpoint_node);
                      -
                      1919  }
                      -
                      1920 
                      -
                      1921  printer->add_newline(2);
                      -
                      1922  printer->add_line("/** update current */");
                      -
                      1923  print_global_function_common_code(BlockType::Equation);
                      -
                      1924  // print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                      -
                      1925  printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      1926  print_nrn_cur_kernel(*info.breakpoint_node);
                      -
                      1927  // print_nrn_cur_matrix_shadow_update();
                      -
                      1928  // if (!nrn_cur_reduction_loop_required()) {
                      -
                      1929  // print_fast_imem_calculation();
                      -
                      1930  // }
                      -
                      1931 
                      -
                      1932 
                      -
                      1933  printer->add_line("node_data.node_rhs[node_id] -= rhs;");
                      -
                      1934 
                      -
                      1935  if (breakpoint_exist()) {
                      -
                      1936  printer->fmt_line("inst.{}[id] = g;",
                      -
                      1937  info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
                      - -
                      1939  }
                      -
                      1940  printer->pop_block();
                      -
                      1941 
                      -
                      1942  // if (nrn_cur_reduction_loop_required()) {
                      -
                      1943  // printer->push_block("for (int id = 0; id < nodecount; id++)");
                      -
                      1944  // print_nrn_cur_matrix_shadow_reduction();
                      -
                      1945  // printer->pop_block();
                      -
                      1946  // print_fast_imem_calculation();
                      -
                      1947  // }
                      -
                      1948 
                      -
                      1949  // print_kernel_data_present_annotation_block_end();
                      -
                      1950  printer->pop_block();
                      -
                      1951 }
                      -
                      1952 
                      -
                      1953 
                      -
                      1954 /****************************************************************************************/
                      -
                      1955 /* Main code printing entry points */
                      -
                      1956 /****************************************************************************************/
                      -
                      1957 
                      - -
                      1959  print_standard_includes();
                      -
                      1960  print_neuron_includes();
                      -
                      1961 
                      -
                      1962  if (info.thread_callback_register) {
                      -
                      1963  printer->add_line("extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
                      -
                      1964  }
                      -
                      1965 }
                      -
                      1966 
                      -
                      1967 
                      - -
                      1969  print_global_macros();
                      -
                      1970  print_mechanism_variables_macros();
                      -
                      1971 
                      -
                      1972  printer->add_line("extern Node* nrn_alloc_node_;");
                      -
                      1973 }
                      -
                      1974 
                      -
                      1975 
                      - +
                      1916  printer->pop_block();
                      +
                      1917 
                      +
                      1918  // if (nrn_cur_reduction_loop_required()) {
                      +
                      1919  // printer->push_block("for (int id = 0; id < nodecount; id++)");
                      +
                      1920  // print_nrn_cur_matrix_shadow_reduction();
                      +
                      1921  // printer->pop_block();
                      +
                      1922  // print_fast_imem_calculation();
                      +
                      1923  // }
                      +
                      1924 
                      +
                      1925  // print_kernel_data_present_annotation_block_end();
                      +
                      1926  printer->pop_block();
                      +
                      1927 }
                      +
                      1928 
                      +
                      1929 
                      +
                      1930 /****************************************************************************************/
                      +
                      1931 /* Main code printing entry points */
                      +
                      1932 /****************************************************************************************/
                      +
                      1933 
                      + +
                      1935  print_standard_includes();
                      +
                      1936  print_neuron_includes();
                      +
                      1937 
                      +
                      1938  if (info.thread_callback_register) {
                      +
                      1939  printer->add_line("extern void _nrn_thread_reg(int, int, void(*)(Datum*));");
                      +
                      1940  }
                      +
                      1941 }
                      +
                      1942 
                      +
                      1943 
                      + +
                      1945  print_global_macros();
                      +
                      1946  print_mechanism_variables_macros();
                      +
                      1947 
                      +
                      1948  printer->add_line("extern Node* nrn_alloc_node_;");
                      +
                      1949 }
                      +
                      1950 
                      +
                      1951 
                      + +
                      1953  printer->add_newline();
                      +
                      1954  printer->add_line("/* NEURON global macro definitions */");
                      +
                      1955  if (info.vectorize) {
                      +
                      1956  printer->add_multi_line(R"CODE(
                      +
                      1957  /* VECTORIZED */
                      +
                      1958  #define NRN_VECTORIZED 1
                      +
                      1959  )CODE");
                      +
                      1960  } else {
                      +
                      1961  printer->add_multi_line(R"CODE(
                      +
                      1962  /* NOT VECTORIZED */
                      +
                      1963  #define NRN_VECTORIZED 0
                      +
                      1964  )CODE");
                      +
                      1965  }
                      +
                      1966 }
                      +
                      1967 
                      +
                      1968 
                      + +
                      1970  printer->add_newline();
                      +
                      1971  printer->add_line("static constexpr auto number_of_datum_variables = ",
                      +
                      1972  std::to_string(int_variables_size()),
                      +
                      1973  ";");
                      +
                      1974  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
                      +
                      1975  std::to_string(codegen_float_variables.size()),
                      +
                      1976  ";");
                      1977  printer->add_newline();
                      -
                      1978  printer->add_line("/* NEURON global macro definitions */");
                      -
                      1979  if (info.vectorize) {
                      -
                      1980  printer->add_multi_line(R"CODE(
                      -
                      1981  /* VECTORIZED */
                      -
                      1982  #define NRN_VECTORIZED 1
                      -
                      1983  )CODE");
                      -
                      1984  } else {
                      -
                      1985  printer->add_multi_line(R"CODE(
                      -
                      1986  /* NOT VECTORIZED */
                      -
                      1987  #define NRN_VECTORIZED 0
                      -
                      1988  )CODE");
                      -
                      1989  }
                      -
                      1990 }
                      -
                      1991 
                      -
                      1992 
                      - -
                      1994  printer->add_newline();
                      -
                      1995  printer->add_line("static constexpr auto number_of_datum_variables = ",
                      -
                      1996  std::to_string(int_variables_size()),
                      -
                      1997  ";");
                      -
                      1998  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
                      -
                      1999  std::to_string(codegen_float_variables.size()),
                      -
                      2000  ";");
                      -
                      2001  printer->add_newline();
                      -
                      2002  printer->add_multi_line(R"CODE(
                      -
                      2003  namespace {
                      -
                      2004  template <typename T>
                      -
                      2005  using _nrn_mechanism_std_vector = std::vector<T>;
                      -
                      2006  using _nrn_model_sorted_token = neuron::model_sorted_token;
                      -
                      2007  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
                      -
                      2008  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
                      -
                      2009  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
                      -
                      2010  template <typename T>
                      -
                      2011  using _nrn_mechanism_field = neuron::mechanism::field<T>;
                      -
                      2012  template <typename... Args>
                      -
                      2013  void _nrn_mechanism_register_data_fields(Args&&... args) {
                      -
                      2014  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
                      -
                      2015  }
                      -
                      2016  } // namespace
                      -
                      2017  )CODE");
                      -
                      2018 
                      -
                      2019  if (info.point_process) {
                      -
                      2020  printer->add_line("extern Prop* nrn_point_prop_;");
                      -
                      2021  } else {
                      -
                      2022  printer->add_line("Prop* hoc_getdata_range(int type);");
                      -
                      2023  }
                      -
                      2024  /// TODO: More prints here?
                      -
                      2025  // for registration of tables
                      -
                      2026  if (info.table_count > 0) {
                      -
                      2027  printer->add_line("void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
                      -
                      2028  }
                      -
                      2029 }
                      -
                      2030 
                      -
                      2031 
                      -
                      2032 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
                      -
                      2033  print_mechanism_global_var_structure(print_initializers);
                      -
                      2034  print_mechanism_range_var_structure(print_initializers);
                      -
                      2035  print_node_data_structure(print_initializers);
                      -
                      2036  print_thread_variables_structure(print_initializers);
                      -
                      2037  print_make_instance();
                      -
                      2038  print_make_node_data();
                      -
                      2039 }
                      -
                      2040 
                      -
                      2041 
                      - -
                      2043  if (!info.vectorize) {
                      -
                      2044  return;
                      -
                      2045  }
                      -
                      2046  printer->add_multi_line(R"CODE(
                      -
                      2047  #if NRN_PRCELLSTATE
                      -
                      2048  inst->v_unused[id] = v;
                      -
                      2049  #endif
                      -
                      2050  )CODE");
                      -
                      2051 }
                      -
                      2052 
                      -
                      2053 
                      - -
                      2055  printer->add_multi_line(R"CODE(
                      -
                      2056  #if NRN_PRCELLSTATE
                      -
                      2057  inst->g_unused[id] = g;
                      -
                      2058  #endif
                      -
                      2059  )CODE");
                      -
                      2060 }
                      -
                      2061 
                      -
                      2062 
                      -
                      2063 /// TODO: Edit for NEURON
                      - -
                      2065  print_hoc_py_wrapper_function_definitions();
                      -
                      2066  for (const auto& procedure: info.procedures) {
                      -
                      2067  print_procedure(*procedure);
                      -
                      2068  }
                      -
                      2069  for (const auto& function: info.functions) {
                      -
                      2070  print_function(*function);
                      -
                      2071  }
                      -
                      2072  print_nrn_init();
                      -
                      2073  print_nrn_cur();
                      -
                      2074  print_nrn_state();
                      -
                      2075  print_nrn_jacob();
                      -
                      2076  print_net_receive();
                      -
                      2077 }
                      -
                      2078 
                      -
                      2079 
                      -
                      2080 /// TODO: Edit for NEURON
                      - -
                      2082  print_backend_info();
                      -
                      2083  print_headers_include();
                      -
                      2084  print_macro_definitions();
                      -
                      2085  print_neuron_global_variable_declarations();
                      -
                      2086  print_namespace_start();
                      -
                      2087  print_nmodl_constants();
                      -
                      2088  print_prcellstate_macros();
                      -
                      2089  print_mechanism_info();
                      -
                      2090  print_data_structures(true);
                      -
                      2091  print_nrn_alloc();
                      -
                      2092  print_function_prototypes();
                      -
                      2093  print_functors_definitions();
                      -
                      2094  print_global_variables_for_hoc();
                      -
                      2095  print_thread_memory_callbacks();
                      -
                      2096  print_compute_functions(); // only nrn_cur and nrn_state
                      -
                      2097  print_sdlists_init(true);
                      -
                      2098  print_mechanism_register();
                      -
                      2099  print_namespace_stop();
                      -
                      2100 }
                      -
                      2101 
                      - -
                      2103  throw std::runtime_error("Not implemented.");
                      -
                      2104 }
                      -
                      2105 
                      -
                      2106 
                      - -
                      2108  auto const& arguments = node.get_arguments();
                      -
                      2109 
                      -
                      2110  if (printing_net_init) {
                      -
                      2111  throw std::runtime_error("Not implemented. [jfiwoei]");
                      -
                      2112  }
                      -
                      2113 
                      -
                      2114  std::string weight_pointer = "nullptr";
                      -
                      2115  auto point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                      -
                      2116  /* use_instance */ false);
                      -
                      2117  if (!printing_net_receive) {
                      -
                      2118  point_process += ".get<Point_process*>()";
                      -
                      2119  }
                      -
                      2120  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                      -
                      2121 
                      -
                      2122  printer->fmt_text("{}(/* tqitem */ &{}, {}, {}, {} + ",
                      -
                      2123  info.artificial_cell ? "artcell_net_send" : "net_send",
                      -
                      2124  tqitem,
                      -
                      2125  weight_pointer,
                      -
                      2126  point_process,
                      -
                      2127  get_variable_name("t"));
                      -
                      2128  print_vector_elements(arguments, ", ");
                      -
                      2129  printer->add_text(')');
                      -
                      2130 }
                      -
                      2131 
                      - -
                      2133  const auto& point_process = get_variable_name("point_process", /* use_instance */ false);
                      -
                      2134  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                      -
                      2135 
                      -
                      2136  printer->fmt_text("{}(/* tqitem */ &{}, {}, ",
                      -
                      2137  info.artificial_cell ? "artcell_net_move" : "net_move",
                      -
                      2138  tqitem,
                      -
                      2139  point_process);
                      -
                      2140 
                      -
                      2141  print_vector_elements(node.get_arguments(), ", ");
                      -
                      2142  printer->add_text(')');
                      -
                      2143 }
                      -
                      2144 
                      - -
                      2146  const auto& point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                      -
                      2147  /* use_instance */ false);
                      -
                      2148  printer->fmt_text("net_event({}, t)", point_process);
                      -
                      2149 }
                      -
                      2150 
                      -
                      2151 /**
                      -
                      2152  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                      -
                      2153  *
                      -
                      2154  * \code{.mod}
                      -
                      2155  * NET_RECEIVE (weight, R){
                      -
                      2156  * x = R
                      -
                      2157  * }
                      -
                      2158  * \endcode
                      -
                      2159  *
                      -
                      2160  * then generated code should be:
                      -
                      2161  *
                      -
                      2162  * \code{.cpp}
                      -
                      2163  * x[id] = _args[1];
                      -
                      2164  * \endcode
                      -
                      2165  *
                      -
                      2166  * So, the `R` in AST needs to be renamed with `_args[1]`.
                      -
                      2167  */
                      -
                      2168 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node,
                      -
                      2169  const ast::Node& node) {
                      -
                      2170  const auto& parameters = net_receive_node.get_parameters();
                      -
                      2171 
                      -
                      2172  auto n_parameters = parameters.size();
                      -
                      2173  for (size_t i = 0; i < n_parameters; ++i) {
                      -
                      2174  const auto& name = parameters[i]->get_node_name();
                      -
                      2175  auto var_used = VarUsageVisitor().variable_used(node, name);
                      -
                      2176  if (var_used) {
                      -
                      2177  RenameVisitor vr(name, fmt::format("_args[{}]", i));
                      -
                      2178  node.get_statement_block()->visit_children(vr);
                      -
                      2179  }
                      -
                      2180  }
                      -
                      2181 }
                      -
                      2182 
                      - -
                      2184  printing_net_receive = true;
                      -
                      2185  auto node = info.net_receive_node;
                      -
                      2186  if (!node) {
                      -
                      2187  return;
                      -
                      2188  }
                      -
                      2189 
                      -
                      2190  ParamVector args = {{"", "Point_process*", "", "_pnt"},
                      -
                      2191  {"", "double*", "", "_args"},
                      -
                      2192  {"", "double", "", "flag"}};
                      -
                      2193 
                      -
                      2194  printer->fmt_push_block("static void nrn_net_receive_{}({})",
                      -
                      2195  info.mod_suffix,
                      -
                      2196  get_parameter_str(args));
                      -
                      2197 
                      -
                      2198  rename_net_receive_arguments(*node, *node);
                      -
                      2199 
                      -
                      2200  printer->add_line("_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
                      -
                      2201  printer->add_line("auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
                      -
                      2202  printer->add_line("auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
                      -
                      2203 
                      -
                      2204  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      -
                      2205  printer->fmt_line("// nocmodl has a nullptr dereference for thread variables.");
                      -
                      2206  printer->fmt_line("// NMODL will fail to compile at a later point, because of");
                      -
                      2207  printer->fmt_line("// missing '_thread_vars'.");
                      -
                      2208  printer->fmt_line("Datum * _thread = nullptr;");
                      -
                      2209 
                      -
                      2210  printer->add_line("size_t id = 0;");
                      -
                      2211  printer->add_line("double t = nt->_t;");
                      -
                      2212 
                      -
                      2213  print_statement_block(*node->get_statement_block(), false, false);
                      -
                      2214 
                      -
                      2215  printer->add_newline();
                      -
                      2216  printer->pop_block();
                      -
                      2217  printing_net_receive = false;
                      -
                      2218 }
                      -
                      2219 
                      -
                      2220 
                      -
                      2221 /****************************************************************************************/
                      -
                      2222 /* Overloaded visitor routines */
                      -
                      2223 /****************************************************************************************/
                      -
                      2224 
                      -
                      2225 /// TODO: Edit for NEURON
                      - -
                      2227  return;
                      -
                      2228 }
                      -
                      2229 
                      -
                      2230 
                      -
                      2231 } // namespace codegen
                      -
                      2232 } // namespace nmodl
                      +
                      1978  printer->add_multi_line(R"CODE(
                      +
                      1979  namespace {
                      +
                      1980  template <typename T>
                      +
                      1981  using _nrn_mechanism_std_vector = std::vector<T>;
                      +
                      1982  using _nrn_model_sorted_token = neuron::model_sorted_token;
                      +
                      1983  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
                      +
                      1984  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
                      +
                      1985  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
                      +
                      1986  template <typename T>
                      +
                      1987  using _nrn_mechanism_field = neuron::mechanism::field<T>;
                      +
                      1988  template <typename... Args>
                      +
                      1989  void _nrn_mechanism_register_data_fields(Args&&... args) {
                      +
                      1990  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
                      +
                      1991  }
                      +
                      1992  } // namespace
                      +
                      1993  )CODE");
                      +
                      1994 
                      +
                      1995  if (info.point_process) {
                      +
                      1996  printer->add_line("extern Prop* nrn_point_prop_;");
                      +
                      1997  } else {
                      +
                      1998  printer->add_line("Prop* hoc_getdata_range(int type);");
                      +
                      1999  }
                      +
                      2000  /// TODO: More prints here?
                      +
                      2001  // for registration of tables
                      +
                      2002  if (info.table_count > 0) {
                      +
                      2003  printer->add_line("void _nrn_thread_table_reg(int, nrn_thread_table_check_t);");
                      +
                      2004  }
                      +
                      2005 }
                      +
                      2006 
                      +
                      2007 
                      +
                      2008 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
                      +
                      2009  print_mechanism_global_var_structure(print_initializers);
                      +
                      2010  print_mechanism_range_var_structure(print_initializers);
                      +
                      2011  print_node_data_structure(print_initializers);
                      +
                      2012  print_thread_variables_structure(print_initializers);
                      +
                      2013  print_make_instance();
                      +
                      2014  print_make_node_data();
                      +
                      2015 }
                      +
                      2016 
                      +
                      2017 
                      + +
                      2019  if (!info.vectorize) {
                      +
                      2020  return;
                      +
                      2021  }
                      +
                      2022  printer->add_multi_line(R"CODE(
                      +
                      2023  #if NRN_PRCELLSTATE
                      +
                      2024  inst->v_unused[id] = v;
                      +
                      2025  #endif
                      +
                      2026  )CODE");
                      +
                      2027 }
                      +
                      2028 
                      +
                      2029 
                      + +
                      2031  printer->add_multi_line(R"CODE(
                      +
                      2032  #if NRN_PRCELLSTATE
                      +
                      2033  inst->g_unused[id] = g;
                      +
                      2034  #endif
                      +
                      2035  )CODE");
                      +
                      2036 }
                      +
                      2037 
                      +
                      2038 
                      +
                      2039 /// TODO: Edit for NEURON
                      + +
                      2041  print_hoc_py_wrapper_function_definitions();
                      +
                      2042  for (const auto& procedure: info.procedures) {
                      +
                      2043  print_procedure(*procedure);
                      +
                      2044  }
                      +
                      2045  for (const auto& function: info.functions) {
                      +
                      2046  print_function(*function);
                      +
                      2047  }
                      +
                      2048  print_nrn_init();
                      +
                      2049  print_nrn_cur();
                      +
                      2050  print_nrn_state();
                      +
                      2051  print_nrn_jacob();
                      +
                      2052  print_net_receive();
                      +
                      2053 }
                      +
                      2054 
                      +
                      2055 
                      +
                      2056 /// TODO: Edit for NEURON
                      + +
                      2058  print_backend_info();
                      +
                      2059  print_headers_include();
                      +
                      2060  print_macro_definitions();
                      +
                      2061  print_neuron_global_variable_declarations();
                      +
                      2062  print_namespace_start();
                      +
                      2063  print_nmodl_constants();
                      +
                      2064  print_prcellstate_macros();
                      +
                      2065  print_mechanism_info();
                      +
                      2066  print_data_structures(true);
                      +
                      2067  print_nrn_alloc();
                      +
                      2068  print_function_prototypes();
                      +
                      2069  print_functors_definitions();
                      +
                      2070  print_global_variables_for_hoc();
                      +
                      2071  print_thread_memory_callbacks();
                      +
                      2072  print_compute_functions(); // only nrn_cur and nrn_state
                      +
                      2073  print_sdlists_init(true);
                      +
                      2074  print_mechanism_register();
                      +
                      2075  print_namespace_stop();
                      +
                      2076 }
                      +
                      2077 
                      + +
                      2079  throw std::runtime_error("Not implemented.");
                      +
                      2080 }
                      +
                      2081 
                      +
                      2082 
                      + +
                      2084  auto const& arguments = node.get_arguments();
                      +
                      2085 
                      +
                      2086  if (printing_net_init) {
                      +
                      2087  throw std::runtime_error("Not implemented. [jfiwoei]");
                      +
                      2088  }
                      +
                      2089 
                      +
                      2090  std::string weight_pointer = "nullptr";
                      +
                      2091  auto point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                      +
                      2092  /* use_instance */ false);
                      +
                      2093  if (!printing_net_receive) {
                      +
                      2094  point_process += ".get<Point_process*>()";
                      +
                      2095  }
                      +
                      2096  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                      +
                      2097 
                      +
                      2098  printer->fmt_text("{}(/* tqitem */ &{}, {}, {}, {} + ",
                      +
                      2099  info.artificial_cell ? "artcell_net_send" : "net_send",
                      +
                      2100  tqitem,
                      +
                      2101  weight_pointer,
                      +
                      2102  point_process,
                      +
                      2103  get_variable_name("t"));
                      +
                      2104  print_vector_elements(arguments, ", ");
                      +
                      2105  printer->add_text(')');
                      +
                      2106 }
                      +
                      2107 
                      + +
                      2109  const auto& point_process = get_variable_name("point_process", /* use_instance */ false);
                      +
                      2110  const auto& tqitem = get_variable_name("tqitem", /* use_instance */ false);
                      +
                      2111 
                      +
                      2112  printer->fmt_text("{}(/* tqitem */ &{}, {}, ",
                      +
                      2113  info.artificial_cell ? "artcell_net_move" : "net_move",
                      +
                      2114  tqitem,
                      +
                      2115  point_process);
                      +
                      2116 
                      +
                      2117  print_vector_elements(node.get_arguments(), ", ");
                      +
                      2118  printer->add_text(')');
                      +
                      2119 }
                      +
                      2120 
                      + +
                      2122  const auto& point_process = get_variable_name(naming::POINT_PROCESS_VARIABLE,
                      +
                      2123  /* use_instance */ false);
                      +
                      2124  printer->fmt_text("net_event({}, t)", point_process);
                      +
                      2125 }
                      +
                      2126 
                      +
                      2127 /**
                      +
                      2128  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                      +
                      2129  *
                      +
                      2130  * \code{.mod}
                      +
                      2131  * NET_RECEIVE (weight, R){
                      +
                      2132  * x = R
                      +
                      2133  * }
                      +
                      2134  * \endcode
                      +
                      2135  *
                      +
                      2136  * then generated code should be:
                      +
                      2137  *
                      +
                      2138  * \code{.cpp}
                      +
                      2139  * x[id] = _args[1];
                      +
                      2140  * \endcode
                      +
                      2141  *
                      +
                      2142  * So, the `R` in AST needs to be renamed with `_args[1]`.
                      +
                      2143  */
                      +
                      2144 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node,
                      +
                      2145  const ast::Node& node) {
                      +
                      2146  const auto& parameters = net_receive_node.get_parameters();
                      +
                      2147 
                      +
                      2148  auto n_parameters = parameters.size();
                      +
                      2149  for (size_t i = 0; i < n_parameters; ++i) {
                      +
                      2150  const auto& name = parameters[i]->get_node_name();
                      +
                      2151  auto var_used = VarUsageVisitor().variable_used(node, name);
                      +
                      2152  if (var_used) {
                      +
                      2153  RenameVisitor vr(name, fmt::format("_args[{}]", i));
                      +
                      2154  node.get_statement_block()->visit_children(vr);
                      +
                      2155  }
                      +
                      2156  }
                      +
                      2157 }
                      +
                      2158 
                      + +
                      2160  printing_net_receive = true;
                      +
                      2161  auto node = info.net_receive_node;
                      +
                      2162  if (!node) {
                      +
                      2163  return;
                      +
                      2164  }
                      +
                      2165 
                      +
                      2166  ParamVector args = {{"", "Point_process*", "", "_pnt"},
                      +
                      2167  {"", "double*", "", "_args"},
                      +
                      2168  {"", "double", "", "flag"}};
                      +
                      2169 
                      +
                      2170  printer->fmt_push_block("static void nrn_net_receive_{}({})",
                      +
                      2171  info.mod_suffix,
                      +
                      2172  get_parameter_str(args));
                      +
                      2173 
                      +
                      2174  rename_net_receive_arguments(*node, *node);
                      +
                      2175 
                      +
                      2176  printer->add_line("_nrn_mechanism_cache_instance _lmc{_pnt->prop};");
                      +
                      2177  printer->add_line("auto * nt = static_cast<NrnThread*>(_pnt->_vnt);");
                      +
                      2178  printer->add_line("auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);");
                      +
                      2179 
                      +
                      2180  printer->fmt_line("auto inst = make_instance_{}(_lmc);", info.mod_suffix);
                      +
                      2181  printer->fmt_line("// nocmodl has a nullptr dereference for thread variables.");
                      +
                      2182  printer->fmt_line("// NMODL will fail to compile at a later point, because of");
                      +
                      2183  printer->fmt_line("// missing '_thread_vars'.");
                      +
                      2184  printer->fmt_line("Datum * _thread = nullptr;");
                      +
                      2185 
                      +
                      2186  printer->add_line("size_t id = 0;");
                      +
                      2187  printer->add_line("double t = nt->_t;");
                      +
                      2188 
                      +
                      2189  print_statement_block(*node->get_statement_block(), false, false);
                      +
                      2190 
                      +
                      2191  printer->add_newline();
                      +
                      2192  printer->pop_block();
                      +
                      2193  printing_net_receive = false;
                      +
                      2194 }
                      +
                      2195 
                      +
                      2196 
                      +
                      2197 /****************************************************************************************/
                      +
                      2198 /* Overloaded visitor routines */
                      +
                      2199 /****************************************************************************************/
                      +
                      2200 
                      +
                      2201 /// TODO: Edit for NEURON
                      + +
                      2203  return;
                      +
                      2204 }
                      +
                      2205 
                      +
                      2206 
                      +
                      2207 } // namespace codegen
                      +
                      2208 } // namespace nmodl
                      static bool starts_with(const std::string &haystack, const std::string &needle)
                      Check if haystack starts with needle.
                      -
                      void print_nrn_destructor() override
                      Print nrn_destructor function definition.
                      +
                      void print_nrn_destructor() override
                      Print nrn_destructor function definition.
                      Base class for all AST node.
                      Definition: node.hpp:40
                      bool is_index
                      if this is pure index (e.g.
                      -
                      void print_nrn_cur_non_conductance_kernel() override
                      Print the nrn_cur kernel without NMODL conductance keyword provisions.
                      -
                      std::string py_function_signature(const std::string &function_or_procedure_name) const
                      Get the signature of the npy <func_or_proc_name> function.
                      +
                      void print_nrn_cur_non_conductance_kernel() override
                      Print the nrn_cur kernel without NMODL conductance keyword provisions.
                      +
                      std::string py_function_signature(const std::string &function_or_procedure_name) const
                      Get the signature of the npy <func_or_proc_name> function.
                      Helper to represent information about index/int variables.
                      -
                      void print_nrn_cur() override
                      Print nrn_cur / current update function definition.
                      -
                      void print_macro_definitions()
                      Print all NEURON macros.
                      - -
                      void print_net_event_call(const ast::FunctionCall &node) override
                      Print call to net_event.
                      +
                      void print_nrn_cur() override
                      Print nrn_cur / current update function definition.
                      +
                      void print_macro_definitions()
                      Print all NEURON macros.
                      +
                      void print_net_event_call(const ast::FunctionCall &node) override
                      Print call to net_event.
                      static constexpr char POINT_PROCESS_VARIABLE[]
                      inbuilt neuron variable for point process
                      -
                      void print_neuron_includes()
                      Print includes from NEURON.
                      +
                      void print_neuron_includes()
                      Print includes from NEURON.
                      static constexpr char NRN_JACOB_METHOD[]
                      nrn_jacob method in generated code
                      -
                      void print_nrn_init(bool skip_init_check=true)
                      Print the nrn_init function definition.
                      +
                      void print_nrn_init(bool skip_init_check=true)
                      Print the nrn_init function definition.
                      -
                      void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
                      -
                      std::string internal_method_arguments() override
                      Arguments for functions that are defined and used internally.
                      +
                      void print_hoc_py_wrapper_function_body(const ast::Block *function_or_procedure_block, InterpreterWrapper wrapper_type)
                      +
                      std::string internal_method_arguments() override
                      Arguments for functions that are defined and used internally.
                      std::shared_ptr< symtab::Symbol > SymbolType
                      -
                      void print_nrn_alloc() override
                      Print nrn_alloc function definition.
                      +
                      void print_nrn_alloc() override
                      Print nrn_alloc function definition.
                      static constexpr char VOLTAGE_UNUSED_VARIABLE[]
                      range variable for voltage when unused (for vectorized model)
                      -
                      std::string register_mechanism_arguments() const override
                      Arguments for register_mech or point_register_mech function.
                      +
                      std::string register_mechanism_arguments() const override
                      Arguments for register_mech or point_register_mech function.
                      int position_of_int_var(const std::string &name) const override
                      Determine the position in the data array for a given int variable.
                      const ArgumentVector & get_parameters() const noexcept override
                      Getter for member variable NetReceiveBlock::parameters.
                      - +
                      std::string table_thread_function_name() const
                      Name of the threaded table checking function.
                      bool optimize_ion_variable_copies() const override
                      Check if ion variable copies should be avoided.
                      -
                      std::string hoc_function_name(const std::string &function_or_procedure_name) const
                      All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
                      +
                      std::string hoc_function_name(const std::string &function_or_procedure_name) const
                      All functions and procedures need a hoc <func_or_proc_name> to be available to the HOC interpreter.
                      encapsulates code generation backend implementations
                      Definition: ast_common.hpp:26
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable InitialBlock::statement_block.
                      -
                      std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                      Determine the variable name for a global variable given its symbol.
                      +
                      std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                      Determine the variable name for a global variable given its symbol.
                      Represent ions used in mod file.
                      -
                      std::string nrn_thread_internal_arguments() override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      +
                      std::string nrn_thread_internal_arguments() override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      Visitor for printing C++ code compatible with legacy api of NEURON
                      std::string backend_name() const override
                      Name of the code generation backend.
                      -
                      std::string process_verbatim_text(std::string const &text) override
                      Process a verbatim block for possible variable renaming.
                      - -
                      void print_global_param_default_values()
                      Print global struct with default value of RANGE PARAMETERs.
                      +
                      std::string process_verbatim_text(std::string const &text) override
                      Process a verbatim block for possible variable renaming.
                      + +
                      void print_global_param_default_values()
                      Print global struct with default value of RANGE PARAMETERs.
                      std::string name
                      name of the ion
                      static constexpr char NTHREAD_DT_VARIABLE[]
                      dt variable in neuron thread structure
                      -
                      void print_g_unused() const override
                      Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                      -
                      void visit_watch_statement(const ast::WatchStatement &node) override
                      TODO: Edit for NEURON.
                      +
                      void print_g_unused() const override
                      Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                      +
                      void visit_watch_statement(const ast::WatchStatement &node) override
                      TODO: Edit for NEURON.
                      virtual bool is_procedure_block() const noexcept
                      Check if the ast node is an instance of ast::ProcedureBlock.
                      Definition: ast.cpp:144
                      -
                      void print_net_send_call(const ast::FunctionCall &node) override
                      Print call to net_send.
                      +
                      void print_net_send_call(const ast::FunctionCall &node) override
                      Print call to net_send.
                      Check if variable is used in given block.
                      Implement string manipulation functions.
                      -
                      void print_net_move_call(const ast::FunctionCall &node) override
                      Print call to net_move.
                      -
                      std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
                      Determine the C++ string to print for thread variables.
                      +
                      void print_net_move_call(const ast::FunctionCall &node) override
                      Print call to net_move.
                      +
                      std::string thread_variable_name(const ThreadVariableInfo &var_info, bool use_instance=true) const
                      Determine the C++ string to print for thread variables.
                      static constexpr char NODE_AREA_VARIABLE[]
                      inbuilt neuron variable for area of the compartment
                      -
                      void print_nrn_state() override
                      Print nrn_state / state update function definition.
                      +
                      void print_nrn_state() override
                      Print nrn_state / state update function definition.
                      virtual bool is_function_block() const noexcept
                      Check if the ast node is an instance of ast::FunctionBlock.
                      Definition: ast.cpp:142
                      static constexpr char NRN_ALLOC_METHOD[]
                      nrn_alloc method in generated code
                      -
                      void print_initial_block(const ast::InitialBlock *node)
                      Print the initial block.
                      +
                      void print_initial_block(const ast::InitialBlock *node)
                      Print the initial block.
                      bool is_integer
                      if this is an integer (e.g.
                      -
                      void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                      Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                      -
                      std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                      Determine the name of a float variable given its symbol.
                      +
                      void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                      Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                      +
                      std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                      Determine the name of a float variable given its symbol.
                      std::string extra_conc_pointer_name() const
                      -
                      void print_function(const ast::FunctionBlock &node) override
                      Print NMODL function in target backend code.
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable BreakpointBlock::statement_block.
                      - +
                      std::string rev_potential_pointer_name() const
                      -
                      void print_v_unused() const override
                      Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                      - +
                      void print_v_unused() const override
                      Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                      +
                      static constexpr char CONDUCTANCE_VARIABLE[]
                      range variable for conductance
                      -
                      ParamVector functor_params() override
                      The parameters of the Newton solver "functor".
                      +
                      ParamVector functor_params() override
                      The parameters of the Newton solver "functor".
                      Visitor for printing C++ code compatible with legacy api of CoreNEURON
                      Check if variable is used in given block.
                      @@ -2404,95 +2378,91 @@
                      @ Equation
                      breakpoint block
                      static constexpr char USE_TABLE_VARIABLE[]
                      global variable to indicate if table is used
                      Represent WATCH statement in NMODL.
                      -
                      void print_neuron_global_variable_declarations()
                      Print extern declarations for neuron global variables.
                      +
                      void print_neuron_global_variable_declarations()
                      Print extern declarations for neuron global variables.
                      Represents a BREAKPOINT block in NMODL.
                      -
                      void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                      Print the nrn_cur kernel with NMODL conductance keyword provisions.
                      -
                      std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                      Determine the name of an int variable given its symbol.
                      +
                      void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                      Print the nrn_cur kernel with NMODL conductance keyword provisions.
                      +
                      std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                      Determine the name of an int variable given its symbol.
                      InterpreterWrapper
                      Enum to switch between HOC and Python wrappers for functions and procedures defined in mechanisms.
                      -
                      void print_global_variables_for_hoc() override
                      Print byte arrays that register scalar and vector variables for hoc interface.
                      -
                      void print_standard_includes() override
                      Print standard C/C++ includes.
                      -
                      void print_mechanism_range_var_structure(bool print_initializers) override
                      Print the structure that wraps all range and int variables required for the NMODL.
                      -
                      void print_procedure(const ast::ProcedureBlock &node) override
                      Print NMODL procedure in target backend code.
                      -
                      void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
                      Add the variable tqitem during get_int_variables.
                      -
                      std::string hoc_function_signature(const std::string &function_or_procedure_name) const
                      Get the signature of the hoc <func_or_proc_name> function.
                      -
                      void print_namespace_start() override
                      Prints the start of the neuron namespace.
                      -
                      void print_thread_variables_structure(bool print_initializers)
                      Print the data structure used to access thread variables.
                      +
                      void print_global_variables_for_hoc() override
                      Print byte arrays that register scalar and vector variables for hoc interface.
                      +
                      void print_standard_includes() override
                      Print standard C/C++ includes.
                      +
                      void print_mechanism_range_var_structure(bool print_initializers) override
                      Print the structure that wraps all range and int variables required for the NMODL.
                      +
                      void add_variable_tqitem(std::vector< IndexVariableInfo > &variables) override
                      Add the variable tqitem during get_int_variables.
                      +
                      std::string hoc_function_signature(const std::string &function_or_procedure_name) const
                      Get the signature of the hoc <func_or_proc_name> function.
                      +
                      void print_namespace_start() override
                      Prints the start of the neuron namespace.
                      +
                      void print_thread_variables_structure(bool print_initializers)
                      Print the data structure used to access thread variables.
                      std::string to_string(const T &obj)
                      -
                      void print_compute_functions() override
                      Print all compute functions for every backend.
                      +
                      void print_compute_functions() override
                      Print all compute functions for every backend.
                      static constexpr char NRN_INIT_METHOD[]
                      nrn_init method in generated code
                      const ExpressionVector & get_arguments() const noexcept
                      Getter for member variable FunctionCall::arguments.
                      -
                      void print_thread_memory_callbacks()
                      Print thread variable (de-)initialization functions.
                      -
                      static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                      Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                      -
                      void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                      Print main body of nrn_cur function.
                      +
                      void print_thread_memory_callbacks()
                      Print thread variable (de-)initialization functions.
                      +
                      static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                      Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                      +
                      void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                      Print main body of nrn_cur function.
                      Blindly rename given variable to new name
                      static constexpr char NRN_CUR_METHOD[]
                      nrn_cur method in generated code
                      -
                      void print_mechanism_register() override
                      Print the mechanism registration function.
                      +
                      void print_mechanism_register() override
                      Print the mechanism registration function.
                      Implement utility functions for codegen visitors.
                      static constexpr char TQITEM_VARIABLE[]
                      inbuilt neuron variable for tqitem process
                      -
                      void print_nrn_jacob()
                      Print nrn_jacob function definition.
                      +
                      void print_nrn_jacob()
                      Print nrn_jacob function definition.
                      -
                      void print_fast_imem_calculation() override
                      Print fast membrane current calculation code.
                      -
                      void print_data_structures(bool print_initializers) override
                      Print all classes.
                      -
                      std::string get_node_name() const override
                      Return name of the node.
                      Definition: ast.cpp:3963
                      -
                      void print_sdlists_init(bool print_initializers) override
                      -
                      const std::string external_method_arguments() noexcept override
                      Arguments for external functions called from generated code.
                      -
                      std::string py_function_name(const std::string &function_or_procedure_name) const
                      In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
                      +
                      void print_fast_imem_calculation() override
                      Print fast membrane current calculation code.
                      +
                      void print_data_structures(bool print_initializers) override
                      Print all classes.
                      +
                      void print_sdlists_init(bool print_initializers) override
                      +
                      const std::string external_method_arguments() noexcept override
                      Arguments for external functions called from generated code.
                      +
                      std::string py_function_name(const std::string &function_or_procedure_name) const
                      In non POINT_PROCESS mechanisms all functions and procedures need a py <func_or_proc_name> to be avai...
                      size_t offset
                      The global variables ahead of this one require offset doubles to store.
                      -
                      void print_node_data_structure(bool print_initializers)
                      Print the structure that wraps all node variables required for the NMODL.
                      +
                      void print_node_data_structure(bool print_initializers)
                      Print the structure that wraps all node variables required for the NMODL.
                      static constexpr char INST_GLOBAL_MEMBER[]
                      instance struct member pointing to the global variable structure
                      -
                      void print_make_instance() const
                      Print make_*_instance.
                      +
                      void print_make_instance() const
                      Print make_*_instance.
                      void print_atomic_reduction_pragma() override
                      Print atomic update pragma for reduction statements.
                      NmodlType
                      NMODL variable properties.
                      -
                      void print_namespace_stop() override
                      Prints the end of the neuron namespace.
                      +
                      void print_namespace_stop() override
                      Prints the end of the neuron namespace.
                      void print_setdata_functions()
                      Print NEURON functions related to setting global variables of the mechanism.
                      std::string get_name(const std::shared_ptr< symtab::Symbol > &sym)
                      Represents ion write statement during code generation.
                      - -
                      void print_mechanism_variables_macros()
                      Print mechanism variables' related macros.
                      -
                      void print_nrn_constructor() override
                      Print nrn_constructor function definition.
                      +
                      void print_mechanism_variables_macros()
                      Print mechanism variables' related macros.
                      +
                      void print_nrn_constructor() override
                      Print nrn_constructor function definition.
                      void print_check_table_function_prototypes()
                      Print all check_* function declarations.
                      -
                      std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                      Getter for member variable FunctionBlock::statement_block.
                      BlockType
                      Helper to represent various block types.
                      -
                      void print_headers_include() override
                      Print all includes.
                      -
                      const ParamVector external_method_parameters(bool table=false) noexcept override
                      Parameters for functions in generated code that are called back from external code.
                      +
                      void print_headers_include() override
                      Print all includes.
                      +
                      const ParamVector external_method_parameters(bool table=false) noexcept override
                      Parameters for functions in generated code that are called back from external code.
                      void print_function_or_procedure(const ast::Block &node, const std::string &name, const std::unordered_set< CppObjectSpecifier > &specifiers={ CppObjectSpecifier::Inline}) override
                      Print nmodl function or procedure (common code)
                      static constexpr char NRN_STATE_METHOD[]
                      nrn_state method in generated code
                      const std::shared_ptr< symtab::Symbol > symbol
                      Version information and units file path.
                      -
                      void print_nrn_current(const ast::BreakpointBlock &node) override
                      Print the nrn_current kernel.
                      +
                      void print_nrn_current(const ast::BreakpointBlock &node) override
                      Print the nrn_current kernel.
                      int position_of_float_var(const std::string &name) const override
                      Determine the position in the data array for a given float variable.
                      -
                      std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                      Determine variable name in the structure of mechanism properties.
                      +
                      std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                      Determine variable name in the structure of mechanism properties.
                      static constexpr char AREA_VARIABLE[]
                      similar to node_area but user can explicitly declare it as area
                      -
                      void print_make_node_data() const
                      Print make_*_node_data.
                      +
                      void print_make_node_data() const
                      Print make_*_node_data.
                      virtual std::shared_ptr< StatementBlock > get_statement_block() const
                      Return associated statement block for the AST node.
                      Definition: ast.cpp:32
                      std::string simulator_name() override
                      Name of the simulator the code was generated for.
                      void print_function_procedure_helper(const ast::Block &node) override
                      Common helper function to help printing function or procedure blocks.
                      static constexpr char NTHREAD_T_VARIABLE[]
                      t variable in neuron thread structure
                      -
                      void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
                      Add the variable point_process during get_int_variables.
                      +
                      void add_variable_point_process(std::vector< IndexVariableInfo > &variables) override
                      Add the variable point_process during get_int_variables.
                      Blindly rename given variable to new name
                      @ State
                      derivative block
                      static constexpr char DIAM_VARIABLE[]
                      inbuilt neuron variable for diameter of the compartment
                      virtual const ArgumentVector & get_parameters() const
                      Definition: block.hpp:50
                      bool variable_used(const ast::Node &node, std::string name)
                      -
                      std::string nrn_thread_arguments() const override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      +
                      std::string nrn_thread_arguments() const override
                      Arguments for "_threadargs_" macro in neuron implementation.
                      static bool ends_with(const std::string &haystack, const std::string &needle)
                      Check if haystack ends with needle.
                      static constexpr char CONDUCTANCE_UNUSED_VARIABLE[]
                      range variable when conductance is not used (for vectorized model)
                      -
                      void print_codegen_routines() override
                      Print entry point to code generation.
                      +
                      void print_codegen_routines() override
                      Print entry point to code generation.
                      -
                      void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                      Generate Function call statement for nrn_wrote_conc.
                      +
                      void append_conc_write_statements(std::vector< ShadowUseStatement > &statements, const Ion &ion, const std::string &concentration) override
                      Generate Function call statement for nrn_wrote_conc.
                      static constexpr char NRN_POINTERINDEX[]
                      hoc_nrnpointerindex name
                      -
                      ParamVector internal_method_parameters() override
                      Parameters for internally defined functions.
                      +
                      ParamVector internal_method_parameters() override
                      Parameters for internally defined functions.
                      int get_index_from_name(const std::vector< T > &variables, const std::string &name)
                      virtual std::string get_node_name() const
                      Return name of of the node.
                      Definition: ast.cpp:28
                      Auto generated AST classes declaration.
                      -
                      void print_net_receive()
                      Print net_receive call-back.
                      +
                      void print_net_receive()
                      Print net_receive call-back.
                      void print_function_prototypes() override
                      Print function and procedures prototype declaration.
                      -
                      void print_mechanism_global_var_structure(bool print_initializers) override
                      Print the structure that wraps all global variables used in the NMODL.
                      -
                      void print_global_macros()
                      Print NEURON global variable macros.
                      +
                      void print_mechanism_global_var_structure(bool print_initializers) override
                      Print the structure that wraps all global variables used in the NMODL.
                      +
                      void print_global_macros()
                      Print NEURON global variable macros.
                      std::string intra_conc_pointer_name() const
                      std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
                      A vector of parameters represented by a 4-tuple of strings:
                      static constexpr char ION_VARNAME_PREFIX[]
                      prefix for ion variable
                      diff --git a/doxygen/src_2main_8cpp_source.html b/doxygen/src_2main_8cpp_source.html index 6a2efe68e..dc990f9bf 100644 --- a/doxygen/src_2main_8cpp_source.html +++ b/doxygen/src_2main_8cpp_source.html @@ -751,7 +751,7 @@
                      Visitor to inline local procedure and function calls
                      Version information and units file path.
                      -
                      void visit_program(const ast::Program &program) override
                      Main and only member function to call after creating an instance of this class.
                      +
                      void visit_program(const ast::Program &program) override
                      Main and only member function to call after creating an instance of this class.
                      Represents top level AST node for whole NMODL input.
                      Definition: program.hpp:39
                      THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
                      diff --git a/notebooks/nmodl-kinetic-schemes.ipynb b/notebooks/nmodl-kinetic-schemes.ipynb index ebe9e1c14..32869976f 100644 --- a/notebooks/nmodl-kinetic-schemes.ipynb +++ b/notebooks/nmodl-kinetic-schemes.ipynb @@ -152,10 +152,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:24.854031Z", - "iopub.status.busy": "2024-08-05T09:19:24.853825Z", - "iopub.status.idle": "2024-08-05T09:19:25.664461Z", - "shell.execute_reply": "2024-08-05T09:19:25.663557Z" + "iopub.execute_input": "2024-08-05T13:00:05.207156Z", + "iopub.status.busy": "2024-08-05T13:00:05.206719Z", + "iopub.status.idle": "2024-08-05T13:00:05.998045Z", + "shell.execute_reply": "2024-08-05T13:00:05.997231Z" } }, "outputs": [], @@ -169,10 +169,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.667784Z", - "iopub.status.busy": "2024-08-05T09:19:25.667535Z", - "iopub.status.idle": "2024-08-05T09:19:25.698328Z", - "shell.execute_reply": "2024-08-05T09:19:25.697660Z" + "iopub.execute_input": "2024-08-05T13:00:06.001197Z", + "iopub.status.busy": "2024-08-05T13:00:06.000937Z", + "iopub.status.idle": "2024-08-05T13:00:06.030689Z", + "shell.execute_reply": "2024-08-05T13:00:06.030071Z" } }, "outputs": [], @@ -277,10 +277,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.701473Z", - "iopub.status.busy": "2024-08-05T09:19:25.701139Z", - "iopub.status.idle": "2024-08-05T09:19:25.706208Z", - "shell.execute_reply": "2024-08-05T09:19:25.705520Z" + "iopub.execute_input": "2024-08-05T13:00:06.033465Z", + "iopub.status.busy": "2024-08-05T13:00:06.033068Z", + "iopub.status.idle": "2024-08-05T13:00:06.037918Z", + "shell.execute_reply": "2024-08-05T13:00:06.037262Z" } }, "outputs": [ @@ -323,10 +323,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.738836Z", - "iopub.status.busy": "2024-08-05T09:19:25.738306Z", - "iopub.status.idle": "2024-08-05T09:19:25.742826Z", - "shell.execute_reply": "2024-08-05T09:19:25.742072Z" + "iopub.execute_input": "2024-08-05T13:00:06.068233Z", + "iopub.status.busy": "2024-08-05T13:00:06.067667Z", + "iopub.status.idle": "2024-08-05T13:00:06.071834Z", + "shell.execute_reply": "2024-08-05T13:00:06.071214Z" } }, "outputs": [ @@ -367,10 +367,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.745547Z", - "iopub.status.busy": "2024-08-05T09:19:25.745105Z", - "iopub.status.idle": "2024-08-05T09:19:25.749286Z", - "shell.execute_reply": "2024-08-05T09:19:25.748587Z" + "iopub.execute_input": "2024-08-05T13:00:06.074312Z", + "iopub.status.busy": "2024-08-05T13:00:06.073932Z", + "iopub.status.idle": "2024-08-05T13:00:06.077466Z", + "shell.execute_reply": "2024-08-05T13:00:06.076809Z" }, "scrolled": true }, @@ -412,10 +412,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.751821Z", - "iopub.status.busy": "2024-08-05T09:19:25.751393Z", - "iopub.status.idle": "2024-08-05T09:19:25.755554Z", - "shell.execute_reply": "2024-08-05T09:19:25.754848Z" + "iopub.execute_input": "2024-08-05T13:00:06.079992Z", + "iopub.status.busy": "2024-08-05T13:00:06.079615Z", + "iopub.status.idle": "2024-08-05T13:00:06.083269Z", + "shell.execute_reply": "2024-08-05T13:00:06.082610Z" }, "scrolled": true }, @@ -459,10 +459,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:25.758084Z", - "iopub.status.busy": "2024-08-05T09:19:25.757692Z", - "iopub.status.idle": "2024-08-05T09:19:25.762620Z", - "shell.execute_reply": "2024-08-05T09:19:25.761948Z" + "iopub.execute_input": "2024-08-05T13:00:06.085636Z", + "iopub.status.busy": "2024-08-05T13:00:06.085293Z", + "iopub.status.idle": "2024-08-05T13:00:06.089631Z", + "shell.execute_reply": "2024-08-05T13:00:06.088981Z" } }, "outputs": [ diff --git a/notebooks/nmodl-python-tutorial.ipynb b/notebooks/nmodl-python-tutorial.ipynb index 24cc8950d..fa4fa6b28 100644 --- a/notebooks/nmodl-python-tutorial.ipynb +++ b/notebooks/nmodl-python-tutorial.ipynb @@ -30,10 +30,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:30.917463Z", - "iopub.status.busy": "2024-08-05T09:19:30.917267Z", - "iopub.status.idle": "2024-08-05T09:19:31.708403Z", - "shell.execute_reply": "2024-08-05T09:19:31.707646Z" + "iopub.execute_input": "2024-08-05T13:00:14.487341Z", + "iopub.status.busy": "2024-08-05T13:00:14.487142Z", + "iopub.status.idle": "2024-08-05T13:00:15.298221Z", + "shell.execute_reply": "2024-08-05T13:00:15.297480Z" } }, "outputs": [], @@ -63,10 +63,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.711418Z", - "iopub.status.busy": "2024-08-05T09:19:31.711208Z", - "iopub.status.idle": "2024-08-05T09:19:31.738887Z", - "shell.execute_reply": "2024-08-05T09:19:31.738200Z" + "iopub.execute_input": "2024-08-05T13:00:15.301364Z", + "iopub.status.busy": "2024-08-05T13:00:15.301141Z", + "iopub.status.idle": "2024-08-05T13:00:15.328742Z", + "shell.execute_reply": "2024-08-05T13:00:15.328119Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.741646Z", - "iopub.status.busy": "2024-08-05T09:19:31.741435Z", - "iopub.status.idle": "2024-08-05T09:19:31.745187Z", - "shell.execute_reply": "2024-08-05T09:19:31.744554Z" + "iopub.execute_input": "2024-08-05T13:00:15.331289Z", + "iopub.status.busy": "2024-08-05T13:00:15.331077Z", + "iopub.status.idle": "2024-08-05T13:00:15.334589Z", + "shell.execute_reply": "2024-08-05T13:00:15.333995Z" } }, "outputs": [], @@ -152,10 +152,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.747667Z", - "iopub.status.busy": "2024-08-05T09:19:31.747282Z", - "iopub.status.idle": "2024-08-05T09:19:31.751249Z", - "shell.execute_reply": "2024-08-05T09:19:31.750710Z" + "iopub.execute_input": "2024-08-05T13:00:15.336984Z", + "iopub.status.busy": "2024-08-05T13:00:15.336787Z", + "iopub.status.idle": "2024-08-05T13:00:15.340434Z", + "shell.execute_reply": "2024-08-05T13:00:15.339834Z" } }, "outputs": [], @@ -183,10 +183,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.753638Z", - "iopub.status.busy": "2024-08-05T09:19:31.753438Z", - "iopub.status.idle": "2024-08-05T09:19:31.757028Z", - "shell.execute_reply": "2024-08-05T09:19:31.756380Z" + "iopub.execute_input": "2024-08-05T13:00:15.342731Z", + "iopub.status.busy": "2024-08-05T13:00:15.342539Z", + "iopub.status.idle": "2024-08-05T13:00:15.346563Z", + "shell.execute_reply": "2024-08-05T13:00:15.345829Z" } }, "outputs": [ @@ -235,10 +235,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.759477Z", - "iopub.status.busy": "2024-08-05T09:19:31.759267Z", - "iopub.status.idle": "2024-08-05T09:19:31.763225Z", - "shell.execute_reply": "2024-08-05T09:19:31.762696Z" + "iopub.execute_input": "2024-08-05T13:00:15.349102Z", + "iopub.status.busy": "2024-08-05T13:00:15.348729Z", + "iopub.status.idle": "2024-08-05T13:00:15.352622Z", + "shell.execute_reply": "2024-08-05T13:00:15.351985Z" } }, "outputs": [], @@ -260,10 +260,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.765583Z", - "iopub.status.busy": "2024-08-05T09:19:31.765208Z", - "iopub.status.idle": "2024-08-05T09:19:31.769169Z", - "shell.execute_reply": "2024-08-05T09:19:31.768513Z" + "iopub.execute_input": "2024-08-05T13:00:15.354937Z", + "iopub.status.busy": "2024-08-05T13:00:15.354599Z", + "iopub.status.idle": "2024-08-05T13:00:15.358158Z", + "shell.execute_reply": "2024-08-05T13:00:15.357542Z" } }, "outputs": [ @@ -297,10 +297,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.771749Z", - "iopub.status.busy": "2024-08-05T09:19:31.771367Z", - "iopub.status.idle": "2024-08-05T09:19:31.778514Z", - "shell.execute_reply": "2024-08-05T09:19:31.777844Z" + "iopub.execute_input": "2024-08-05T13:00:15.360796Z", + "iopub.status.busy": "2024-08-05T13:00:15.360318Z", + "iopub.status.idle": "2024-08-05T13:00:15.367442Z", + "shell.execute_reply": "2024-08-05T13:00:15.366819Z" } }, "outputs": [ @@ -365,10 +365,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.781202Z", - "iopub.status.busy": "2024-08-05T09:19:31.780724Z", - "iopub.status.idle": "2024-08-05T09:19:31.785005Z", - "shell.execute_reply": "2024-08-05T09:19:31.784385Z" + "iopub.execute_input": "2024-08-05T13:00:15.370051Z", + "iopub.status.busy": "2024-08-05T13:00:15.369621Z", + "iopub.status.idle": "2024-08-05T13:00:15.373853Z", + "shell.execute_reply": "2024-08-05T13:00:15.373208Z" } }, "outputs": [ @@ -416,10 +416,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.787563Z", - "iopub.status.busy": "2024-08-05T09:19:31.787104Z", - "iopub.status.idle": "2024-08-05T09:19:31.790414Z", - "shell.execute_reply": "2024-08-05T09:19:31.789794Z" + "iopub.execute_input": "2024-08-05T13:00:15.376377Z", + "iopub.status.busy": "2024-08-05T13:00:15.375996Z", + "iopub.status.idle": "2024-08-05T13:00:15.379267Z", + "shell.execute_reply": "2024-08-05T13:00:15.378630Z" } }, "outputs": [], @@ -441,10 +441,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.793044Z", - "iopub.status.busy": "2024-08-05T09:19:31.792647Z", - "iopub.status.idle": "2024-08-05T09:19:31.796750Z", - "shell.execute_reply": "2024-08-05T09:19:31.796120Z" + "iopub.execute_input": "2024-08-05T13:00:15.381504Z", + "iopub.status.busy": "2024-08-05T13:00:15.381311Z", + "iopub.status.idle": "2024-08-05T13:00:15.385236Z", + "shell.execute_reply": "2024-08-05T13:00:15.384551Z" } }, "outputs": [ @@ -510,10 +510,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.799301Z", - "iopub.status.busy": "2024-08-05T09:19:31.798859Z", - "iopub.status.idle": "2024-08-05T09:19:31.802217Z", - "shell.execute_reply": "2024-08-05T09:19:31.801590Z" + "iopub.execute_input": "2024-08-05T13:00:15.387895Z", + "iopub.status.busy": "2024-08-05T13:00:15.387348Z", + "iopub.status.idle": "2024-08-05T13:00:15.390860Z", + "shell.execute_reply": "2024-08-05T13:00:15.390195Z" } }, "outputs": [ @@ -548,10 +548,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.804676Z", - "iopub.status.busy": "2024-08-05T09:19:31.804296Z", - "iopub.status.idle": "2024-08-05T09:19:31.807879Z", - "shell.execute_reply": "2024-08-05T09:19:31.807222Z" + "iopub.execute_input": "2024-08-05T13:00:15.393439Z", + "iopub.status.busy": "2024-08-05T13:00:15.392982Z", + "iopub.status.idle": "2024-08-05T13:00:15.396756Z", + "shell.execute_reply": "2024-08-05T13:00:15.396096Z" } }, "outputs": [ @@ -584,10 +584,10 @@ "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.810336Z", - "iopub.status.busy": "2024-08-05T09:19:31.809964Z", - "iopub.status.idle": "2024-08-05T09:19:31.813798Z", - "shell.execute_reply": "2024-08-05T09:19:31.813141Z" + "iopub.execute_input": "2024-08-05T13:00:15.399205Z", + "iopub.status.busy": "2024-08-05T13:00:15.398835Z", + "iopub.status.idle": "2024-08-05T13:00:15.402355Z", + "shell.execute_reply": "2024-08-05T13:00:15.401708Z" } }, "outputs": [ @@ -622,10 +622,10 @@ "execution_count": 15, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.816274Z", - "iopub.status.busy": "2024-08-05T09:19:31.815904Z", - "iopub.status.idle": "2024-08-05T09:19:31.820176Z", - "shell.execute_reply": "2024-08-05T09:19:31.819511Z" + "iopub.execute_input": "2024-08-05T13:00:15.404813Z", + "iopub.status.busy": "2024-08-05T13:00:15.404433Z", + "iopub.status.idle": "2024-08-05T13:00:15.408690Z", + "shell.execute_reply": "2024-08-05T13:00:15.408022Z" } }, "outputs": [ @@ -669,10 +669,10 @@ "execution_count": 16, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.822760Z", - "iopub.status.busy": "2024-08-05T09:19:31.822364Z", - "iopub.status.idle": "2024-08-05T09:19:31.827686Z", - "shell.execute_reply": "2024-08-05T09:19:31.827014Z" + "iopub.execute_input": "2024-08-05T13:00:15.411106Z", + "iopub.status.busy": "2024-08-05T13:00:15.410729Z", + "iopub.status.idle": "2024-08-05T13:00:15.416191Z", + "shell.execute_reply": "2024-08-05T13:00:15.415515Z" } }, "outputs": [ @@ -733,10 +733,10 @@ "execution_count": 17, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.830165Z", - "iopub.status.busy": "2024-08-05T09:19:31.829804Z", - "iopub.status.idle": "2024-08-05T09:19:31.833290Z", - "shell.execute_reply": "2024-08-05T09:19:31.832717Z" + "iopub.execute_input": "2024-08-05T13:00:15.418685Z", + "iopub.status.busy": "2024-08-05T13:00:15.418209Z", + "iopub.status.idle": "2024-08-05T13:00:15.421811Z", + "shell.execute_reply": "2024-08-05T13:00:15.421187Z" } }, "outputs": [], @@ -761,10 +761,10 @@ "execution_count": 18, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.835773Z", - "iopub.status.busy": "2024-08-05T09:19:31.835400Z", - "iopub.status.idle": "2024-08-05T09:19:31.845296Z", - "shell.execute_reply": "2024-08-05T09:19:31.844728Z" + "iopub.execute_input": "2024-08-05T13:00:15.424371Z", + "iopub.status.busy": "2024-08-05T13:00:15.423878Z", + "iopub.status.idle": "2024-08-05T13:00:15.433825Z", + "shell.execute_reply": "2024-08-05T13:00:15.433167Z" } }, "outputs": [], @@ -857,10 +857,10 @@ "execution_count": 19, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.847748Z", - "iopub.status.busy": "2024-08-05T09:19:31.847373Z", - "iopub.status.idle": "2024-08-05T09:19:31.851034Z", - "shell.execute_reply": "2024-08-05T09:19:31.850359Z" + "iopub.execute_input": "2024-08-05T13:00:15.436178Z", + "iopub.status.busy": "2024-08-05T13:00:15.435790Z", + "iopub.status.idle": "2024-08-05T13:00:15.439606Z", + "shell.execute_reply": "2024-08-05T13:00:15.438881Z" } }, "outputs": [ @@ -897,10 +897,10 @@ "execution_count": 20, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:31.853476Z", - "iopub.status.busy": "2024-08-05T09:19:31.853120Z", - "iopub.status.idle": "2024-08-05T09:19:31.858668Z", - "shell.execute_reply": "2024-08-05T09:19:31.858023Z" + "iopub.execute_input": "2024-08-05T13:00:15.443857Z", + "iopub.status.busy": "2024-08-05T13:00:15.443365Z", + "iopub.status.idle": "2024-08-05T13:00:15.450980Z", + "shell.execute_reply": "2024-08-05T13:00:15.450310Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-conductance.ipynb b/notebooks/nmodl-sympy-conductance.ipynb index 8455efb98..e537d8ab6 100644 --- a/notebooks/nmodl-sympy-conductance.ipynb +++ b/notebooks/nmodl-sympy-conductance.ipynb @@ -86,10 +86,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:34.408897Z", - "iopub.status.busy": "2024-08-05T09:19:34.408323Z", - "iopub.status.idle": "2024-08-05T09:19:35.221263Z", - "shell.execute_reply": "2024-08-05T09:19:35.220525Z" + "iopub.execute_input": "2024-08-05T13:00:17.732429Z", + "iopub.status.busy": "2024-08-05T13:00:17.731865Z", + "iopub.status.idle": "2024-08-05T13:00:18.516407Z", + "shell.execute_reply": "2024-08-05T13:00:18.515514Z" } }, "outputs": [], @@ -103,10 +103,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.224606Z", - "iopub.status.busy": "2024-08-05T09:19:35.224076Z", - "iopub.status.idle": "2024-08-05T09:19:35.254587Z", - "shell.execute_reply": "2024-08-05T09:19:35.253917Z" + "iopub.execute_input": "2024-08-05T13:00:18.520023Z", + "iopub.status.busy": "2024-08-05T13:00:18.519534Z", + "iopub.status.idle": "2024-08-05T13:00:18.548622Z", + "shell.execute_reply": "2024-08-05T13:00:18.548004Z" } }, "outputs": [], @@ -149,10 +149,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.257869Z", - "iopub.status.busy": "2024-08-05T09:19:35.257411Z", - "iopub.status.idle": "2024-08-05T09:19:35.536999Z", - "shell.execute_reply": "2024-08-05T09:19:35.536228Z" + "iopub.execute_input": "2024-08-05T13:00:18.551383Z", + "iopub.status.busy": "2024-08-05T13:00:18.551051Z", + "iopub.status.idle": "2024-08-05T13:00:18.818114Z", + "shell.execute_reply": "2024-08-05T13:00:18.817415Z" } }, "outputs": [ @@ -196,10 +196,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.539853Z", - "iopub.status.busy": "2024-08-05T09:19:35.539373Z", - "iopub.status.idle": "2024-08-05T09:19:35.676095Z", - "shell.execute_reply": "2024-08-05T09:19:35.675338Z" + "iopub.execute_input": "2024-08-05T13:00:18.820743Z", + "iopub.status.busy": "2024-08-05T13:00:18.820494Z", + "iopub.status.idle": "2024-08-05T13:00:18.948186Z", + "shell.execute_reply": "2024-08-05T13:00:18.947520Z" } }, "outputs": [ @@ -243,10 +243,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.679025Z", - "iopub.status.busy": "2024-08-05T09:19:35.678577Z", - "iopub.status.idle": "2024-08-05T09:19:35.687471Z", - "shell.execute_reply": "2024-08-05T09:19:35.686804Z" + "iopub.execute_input": "2024-08-05T13:00:18.950670Z", + "iopub.status.busy": "2024-08-05T13:00:18.950464Z", + "iopub.status.idle": "2024-08-05T13:00:18.958371Z", + "shell.execute_reply": "2024-08-05T13:00:18.957726Z" } }, "outputs": [ @@ -290,10 +290,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.690070Z", - "iopub.status.busy": "2024-08-05T09:19:35.689656Z", - "iopub.status.idle": "2024-08-05T09:19:35.707917Z", - "shell.execute_reply": "2024-08-05T09:19:35.707186Z" + "iopub.execute_input": "2024-08-05T13:00:18.960878Z", + "iopub.status.busy": "2024-08-05T13:00:18.960411Z", + "iopub.status.idle": "2024-08-05T13:00:18.977638Z", + "shell.execute_reply": "2024-08-05T13:00:18.976978Z" } }, "outputs": [ @@ -337,10 +337,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.710653Z", - "iopub.status.busy": "2024-08-05T09:19:35.710283Z", - "iopub.status.idle": "2024-08-05T09:19:35.829542Z", - "shell.execute_reply": "2024-08-05T09:19:35.828878Z" + "iopub.execute_input": "2024-08-05T13:00:18.980144Z", + "iopub.status.busy": "2024-08-05T13:00:18.979921Z", + "iopub.status.idle": "2024-08-05T13:00:19.097696Z", + "shell.execute_reply": "2024-08-05T13:00:19.097006Z" } }, "outputs": [ @@ -400,10 +400,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.832468Z", - "iopub.status.busy": "2024-08-05T09:19:35.831927Z", - "iopub.status.idle": "2024-08-05T09:19:35.927721Z", - "shell.execute_reply": "2024-08-05T09:19:35.927002Z" + "iopub.execute_input": "2024-08-05T13:00:19.100317Z", + "iopub.status.busy": "2024-08-05T13:00:19.100085Z", + "iopub.status.idle": "2024-08-05T13:00:19.197073Z", + "shell.execute_reply": "2024-08-05T13:00:19.196420Z" } }, "outputs": [ @@ -456,10 +456,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:35.930541Z", - "iopub.status.busy": "2024-08-05T09:19:35.930115Z", - "iopub.status.idle": "2024-08-05T09:19:36.005078Z", - "shell.execute_reply": "2024-08-05T09:19:36.004472Z" + "iopub.execute_input": "2024-08-05T13:00:19.199593Z", + "iopub.status.busy": "2024-08-05T13:00:19.199386Z", + "iopub.status.idle": "2024-08-05T13:00:19.272768Z", + "shell.execute_reply": "2024-08-05T13:00:19.272196Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-cnexp.ipynb b/notebooks/nmodl-sympy-solver-cnexp.ipynb index 008a858d2..e121d6a4b 100644 --- a/notebooks/nmodl-sympy-solver-cnexp.ipynb +++ b/notebooks/nmodl-sympy-solver-cnexp.ipynb @@ -62,10 +62,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:37.761250Z", - "iopub.status.busy": "2024-08-05T09:19:37.761039Z", - "iopub.status.idle": "2024-08-05T09:19:38.578177Z", - "shell.execute_reply": "2024-08-05T09:19:38.577429Z" + "iopub.execute_input": "2024-08-05T13:00:21.030329Z", + "iopub.status.busy": "2024-08-05T13:00:21.030121Z", + "iopub.status.idle": "2024-08-05T13:00:21.816269Z", + "shell.execute_reply": "2024-08-05T13:00:21.815448Z" } }, "outputs": [], @@ -79,10 +79,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:38.581282Z", - "iopub.status.busy": "2024-08-05T09:19:38.581062Z", - "iopub.status.idle": "2024-08-05T09:19:38.612569Z", - "shell.execute_reply": "2024-08-05T09:19:38.611770Z" + "iopub.execute_input": "2024-08-05T13:00:21.819446Z", + "iopub.status.busy": "2024-08-05T13:00:21.818998Z", + "iopub.status.idle": "2024-08-05T13:00:21.849421Z", + "shell.execute_reply": "2024-08-05T13:00:21.848813Z" } }, "outputs": [], @@ -123,10 +123,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:38.615893Z", - "iopub.status.busy": "2024-08-05T09:19:38.615383Z", - "iopub.status.idle": "2024-08-05T09:19:39.040748Z", - "shell.execute_reply": "2024-08-05T09:19:39.040056Z" + "iopub.execute_input": "2024-08-05T13:00:21.852405Z", + "iopub.status.busy": "2024-08-05T13:00:21.852007Z", + "iopub.status.idle": "2024-08-05T13:00:22.268695Z", + "shell.execute_reply": "2024-08-05T13:00:22.267930Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.043694Z", - "iopub.status.busy": "2024-08-05T09:19:39.043240Z", - "iopub.status.idle": "2024-08-05T09:19:39.156181Z", - "shell.execute_reply": "2024-08-05T09:19:39.155532Z" + "iopub.execute_input": "2024-08-05T13:00:22.271479Z", + "iopub.status.busy": "2024-08-05T13:00:22.271027Z", + "iopub.status.idle": "2024-08-05T13:00:22.381942Z", + "shell.execute_reply": "2024-08-05T13:00:22.381287Z" } }, "outputs": [ @@ -207,10 +207,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.159015Z", - "iopub.status.busy": "2024-08-05T09:19:39.158543Z", - "iopub.status.idle": "2024-08-05T09:19:39.364077Z", - "shell.execute_reply": "2024-08-05T09:19:39.363312Z" + "iopub.execute_input": "2024-08-05T13:00:22.384666Z", + "iopub.status.busy": "2024-08-05T13:00:22.384261Z", + "iopub.status.idle": "2024-08-05T13:00:22.581630Z", + "shell.execute_reply": "2024-08-05T13:00:22.581015Z" } }, "outputs": [ @@ -255,10 +255,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.367226Z", - "iopub.status.busy": "2024-08-05T09:19:39.366787Z", - "iopub.status.idle": "2024-08-05T09:19:39.530219Z", - "shell.execute_reply": "2024-08-05T09:19:39.529605Z" + "iopub.execute_input": "2024-08-05T13:00:22.584204Z", + "iopub.status.busy": "2024-08-05T13:00:22.584008Z", + "iopub.status.idle": "2024-08-05T13:00:22.741564Z", + "shell.execute_reply": "2024-08-05T13:00:22.740923Z" } }, "outputs": [ @@ -303,10 +303,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:39.533016Z", - "iopub.status.busy": "2024-08-05T09:19:39.532579Z", - "iopub.status.idle": "2024-08-05T09:19:41.315831Z", - "shell.execute_reply": "2024-08-05T09:19:41.315194Z" + "iopub.execute_input": "2024-08-05T13:00:22.743985Z", + "iopub.status.busy": "2024-08-05T13:00:22.743751Z", + "iopub.status.idle": "2024-08-05T13:00:24.479162Z", + "shell.execute_reply": "2024-08-05T13:00:24.478426Z" } }, "outputs": [ @@ -351,10 +351,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:41.318625Z", - "iopub.status.busy": "2024-08-05T09:19:41.318189Z", - "iopub.status.idle": "2024-08-05T09:19:43.603212Z", - "shell.execute_reply": "2024-08-05T09:19:43.602443Z" + "iopub.execute_input": "2024-08-05T13:00:24.482135Z", + "iopub.status.busy": "2024-08-05T13:00:24.481706Z", + "iopub.status.idle": "2024-08-05T13:00:26.705583Z", + "shell.execute_reply": "2024-08-05T13:00:26.704962Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb index fb4a0b5a7..5478db967 100644 --- a/notebooks/nmodl-sympy-solver-derivimplicit.ipynb +++ b/notebooks/nmodl-sympy-solver-derivimplicit.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:45.286448Z", - "iopub.status.busy": "2024-08-05T09:19:45.286248Z", - "iopub.status.idle": "2024-08-05T09:19:46.091235Z", - "shell.execute_reply": "2024-08-05T09:19:46.090411Z" + "iopub.execute_input": "2024-08-05T13:00:28.305100Z", + "iopub.status.busy": "2024-08-05T13:00:28.304921Z", + "iopub.status.idle": "2024-08-05T13:00:29.088827Z", + "shell.execute_reply": "2024-08-05T13:00:29.087910Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:46.094598Z", - "iopub.status.busy": "2024-08-05T09:19:46.094132Z", - "iopub.status.idle": "2024-08-05T09:19:46.124082Z", - "shell.execute_reply": "2024-08-05T09:19:46.123429Z" + "iopub.execute_input": "2024-08-05T13:00:29.091946Z", + "iopub.status.busy": "2024-08-05T13:00:29.091718Z", + "iopub.status.idle": "2024-08-05T13:00:29.121288Z", + "shell.execute_reply": "2024-08-05T13:00:29.120676Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:46.127164Z", - "iopub.status.busy": "2024-08-05T09:19:46.126946Z", - "iopub.status.idle": "2024-08-05T09:19:46.602187Z", - "shell.execute_reply": "2024-08-05T09:19:46.601442Z" + "iopub.execute_input": "2024-08-05T13:00:29.124041Z", + "iopub.status.busy": "2024-08-05T13:00:29.123611Z", + "iopub.status.idle": "2024-08-05T13:00:29.578470Z", + "shell.execute_reply": "2024-08-05T13:00:29.577720Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:46.604907Z", - "iopub.status.busy": "2024-08-05T09:19:46.604598Z", - "iopub.status.idle": "2024-08-05T09:19:46.824549Z", - "shell.execute_reply": "2024-08-05T09:19:46.823808Z" + "iopub.execute_input": "2024-08-05T13:00:29.581294Z", + "iopub.status.busy": "2024-08-05T13:00:29.580732Z", + "iopub.status.idle": "2024-08-05T13:00:29.795330Z", + "shell.execute_reply": "2024-08-05T13:00:29.794753Z" } }, "outputs": [ diff --git a/notebooks/nmodl-sympy-solver-sparse.ipynb b/notebooks/nmodl-sympy-solver-sparse.ipynb index d3f4b875c..54d620981 100644 --- a/notebooks/nmodl-sympy-solver-sparse.ipynb +++ b/notebooks/nmodl-sympy-solver-sparse.ipynb @@ -39,10 +39,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:48.184794Z", - "iopub.status.busy": "2024-08-05T09:19:48.184608Z", - "iopub.status.idle": "2024-08-05T09:19:48.989321Z", - "shell.execute_reply": "2024-08-05T09:19:48.988497Z" + "iopub.execute_input": "2024-08-05T13:00:31.089995Z", + "iopub.status.busy": "2024-08-05T13:00:31.089800Z", + "iopub.status.idle": "2024-08-05T13:00:31.879477Z", + "shell.execute_reply": "2024-08-05T13:00:31.878674Z" } }, "outputs": [], @@ -56,10 +56,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:48.992355Z", - "iopub.status.busy": "2024-08-05T09:19:48.992138Z", - "iopub.status.idle": "2024-08-05T09:19:49.022388Z", - "shell.execute_reply": "2024-08-05T09:19:49.021711Z" + "iopub.execute_input": "2024-08-05T13:00:31.882712Z", + "iopub.status.busy": "2024-08-05T13:00:31.882287Z", + "iopub.status.idle": "2024-08-05T13:00:31.912473Z", + "shell.execute_reply": "2024-08-05T13:00:31.911826Z" } }, "outputs": [], @@ -100,10 +100,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:49.025536Z", - "iopub.status.busy": "2024-08-05T09:19:49.025302Z", - "iopub.status.idle": "2024-08-05T09:19:49.497323Z", - "shell.execute_reply": "2024-08-05T09:19:49.496568Z" + "iopub.execute_input": "2024-08-05T13:00:31.915393Z", + "iopub.status.busy": "2024-08-05T13:00:31.914998Z", + "iopub.status.idle": "2024-08-05T13:00:32.368165Z", + "shell.execute_reply": "2024-08-05T13:00:32.367377Z" } }, "outputs": [ @@ -165,10 +165,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-08-05T09:19:49.499967Z", - "iopub.status.busy": "2024-08-05T09:19:49.499697Z", - "iopub.status.idle": "2024-08-05T09:19:49.720159Z", - "shell.execute_reply": "2024-08-05T09:19:49.719409Z" + "iopub.execute_input": "2024-08-05T13:00:32.370926Z", + "iopub.status.busy": "2024-08-05T13:00:32.370467Z", + "iopub.status.idle": "2024-08-05T13:00:32.585200Z", + "shell.execute_reply": "2024-08-05T13:00:32.584577Z" } }, "outputs": [