BlueBrain / nmodl

Code Generation Framework For NEURON MODeling Language
https://bluebrain.github.io/nmodl/
Apache License 2.0
48 stars 15 forks source link

Add TABLE statement #1247

Closed JCGoran closed 1 month ago

JCGoran commented 2 months ago

Needs #1260.

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 41.89189% with 43 lines in your changes are missing coverage. Please review.

Project coverage is 85.50%. Comparing base (341b89e) to head (d224278). Report is 3 commits behind head on master.

Files Patch % Lines
src/codegen/codegen_neuron_cpp_visitor.cpp 20.37% 43 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1247 +/- ## ========================================== - Coverage 86.24% 85.50% -0.75% ========================================== Files 178 178 Lines 13299 13446 +147 ========================================== + Hits 11470 11497 +27 - Misses 1829 1949 +120 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bbpbuildbot commented 2 months ago

Logfiles from GitLab pipeline #208975 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 2 months ago

Logfiles from GitLab pipeline #209020 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 2 months ago

Logfiles from GitLab pipeline #209643 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #210705 (:no_entry:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #211195 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #211286 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #211428 (:white_check_mark:) have been uploaded here!

Status and direct links:

1uc commented 1 month ago

Further comments on: https://github.com/BlueBrain/nmodl-references/pull/20

1uc commented 1 month ago

One should probably check if multiple tables are permitted and work. The reason is that we do use both sig and sigmoid to mangle names. Therefore, the question is can one have two different proceedures that both compute (a) sig (with different values) and both tabulate their sig.

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #212706 (:no_entry:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #212725 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #213066 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #213318 (:white_check_mark:) have been uploaded here!

Status and direct links:

JCGoran commented 1 month ago

One should probably check if multiple tables are permitted and work. The reason is that we do use both sig and sigmoid to mangle names. Therefore, the question is can one have two different proceedures that both compute (a) sig (with different values) and both tabulate their sig.

It seems this will not error out at the parsing stage, but will at the compilation stage:

NEURON {
    SUFFIX minimal
    RANGE v1, v2
    GLOBAL c1, c2
}

PARAMETER {
    c1 = 1
    c2 = 2
}

ASSIGNED {
    v1
    v2
}

PROCEDURE p1(arg) {
    TABLE v1, v2 DEPEND c1, c2 FROM -1 TO 1 WITH 100
    v1 = c1 * arg + c2
    v2 = c2 * arg + c1
}

PROCEDURE p2(arg) {
    TABLE v1, v2 DEPEND c1, c2 FROM -5 TO 5 WITH 2000
    v1 = c1 * arg
    v2 = c2 * arg
}

due to redefinitions of v1 and v2 tables:

 -> Compiling arm64/ex.cpp
arm64/ex.cpp:220:17: error: redefinition of '_t_v1'
 static double *_t_v1;
                ^
arm64/ex.cpp:218:17: note: previous definition is here
 static double *_t_v1;
                ^
arm64/ex.cpp:221:17: error: redefinition of '_t_v2'
 static double *_t_v2;
                ^
arm64/ex.cpp:219:17: note: previous definition is here
 static double *_t_v2;
                ^
2 errors generated.

so I think it's safe to assume NOCMODL does not support duplicate TABLE variables. I'll see if I can add this check in NMODL as part of one of the visitors. EDIT Fixed in #1280

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #213586 (:white_check_mark:) have been uploaded here!

Status and direct links:

bbpbuildbot commented 1 month ago

Logfiles from GitLab pipeline #214372 (:white_check_mark:) have been uploaded here!

Status and direct links: