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 Willi Braun, 10 years ago

Component: UnknownBackend
Owner: changed from somebody to Willi Braun
Status: newaccepted

comment:2 by Willi Braun, 10 years ago

Component: BackendCode Generation
Owner: changed from Willi Braun to somebody
Status: acceptedassigned

Fixed the counting in r25090, but code generation does currently not support arrays of records.

comment:3 by Adrian Pop, 10 years ago

Cc: Mahder Alemseged Gebremedhin added
Owner: changed from somebody to Mahder Alemseged Gebremedhin

comment:4 by Adrian Pop, 10 years ago

Mahder, can you have a look at it?

comment:5 by Mahder Alemseged Gebremedhin, 10 years ago

Status: assignedaccepted

comment:6 by Gustaf Thorslund, 10 years ago

Cc: Gustaf Thorslund added

comment:7 by Gustaf Thorslund, 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?

in reply to:  7 ; comment:8 by Willi Braun, 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.

in reply to:  8 comment:9 by Gustaf Thorslund, 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.

Note: See TracTickets for help on using tickets.