Opened 10 years ago
Last modified 10 years ago
#3217 accepted defect
Wrong equation counting
Reported by: | Lennart Ochel | Owned by: | Mahder Alemseged Gebremedhin |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Code Generation | Version: | trunk |
Keywords: | Cc: | Mahder Alemseged Gebremedhin, Gustaf Thorslund |
Description
OM counts just 2 equations for following model, but it should be 4.
model TestSimpleEqu record foo Real a; Real b; end foo; function foofoo2 input foo x[2]; output foo y[2]; algorithm y[1].a := x[2].b; y[1].b := x[2].a; y[2].a := x[1].b; y[2].b := x[1].a; end foofoo2; foo g1[2]; equation //{foo(g1[1].a, g1[1].b), foo(g1[2].a, g1[2].b)} = foofoo2({foo(1.0, 2.0),foo(1.0, 2.0)}); g1 = foofoo2({foo(1.0, 2.0),foo(1.0, 2.0)}); end TestSimpleEqu;
Change History (9)
comment:1 by , 10 years ago
Component: | Unknown → Backend |
---|---|
Owner: | changed from | to
Status: | new → accepted |
comment:2 by , 10 years ago
Component: | Backend → Code Generation |
---|---|
Owner: | changed from | to
Status: | accepted → assigned |
comment:3 by , 10 years ago
Cc: | added |
---|---|
Owner: | changed from | to
comment:5 by , 10 years ago
Status: | assigned → accepted |
---|
comment:6 by , 10 years ago
Cc: | added |
---|
follow-up: 8 comment:7 by , 10 years ago
What was the original error for this example? When trying it now I get the following error:
Error processing file: TestSimpleEqu.mo [CodegenC.tpl:3812:14-3812:14:writable] Error: Template error: No runtime support for this sort of array call: TestSimpleEqu.foofoo2({TestSimpleEqu.foo(1.0, 2.0), TestSimpleEqu.foo(1.0, 2.0)})
This is when using a 12 days old r25516, so at least newer than when the bug was reported.
Is this a new error introduced by some regression? Is it already reported in some other bug?
follow-up: 9 comment:8 by , 10 years ago
Replying to gustaf:
What was the original error for this example? When trying it now I get the following error:
Error processing file: TestSimpleEqu.mo [CodegenC.tpl:3812:14-3812:14:writable] Error: Template error: No runtime support for this sort of array call: TestSimpleEqu.foofoo2({TestSimpleEqu.foo(1.0, 2.0), TestSimpleEqu.foo(1.0, 2.0)})This is when using a 12 days old r25516, so at least newer than when the bug was reported.
Is this a new error introduced by some regression? Is it already reported in some other bug?
I guess this is also the error message, since r25090.
comment:9 by , 10 years ago
Replying to wbraun:
I guess this is also the error message, since r25090.
Ok, I somehow get confused by the commit message of r25090
"fix the counting of #3217, but record of arrays are currently not supported by the runtime."
Considering #3217 does not deal with record of arrays I somehow get the impression the fix should fix #3217, but then I suppose the test should not fail. Is there some other bug saying record of arrays are currently not supported?
I'm wondering since I ran into other interesting issues now reported in #3293. At least in my algorithm section it appears to be ok to have an array inside a record, but not to put the record into an array.
Fixed the counting in r25090, but code generation does currently not support arrays of records.