Opened 10 years ago

Last modified 9 years ago

#3217 accepted defect

Wrong equation counting

Reported by: lochel Owned by: mahge930
Priority: high Milestone: Future
Component: Code Generation Version: trunk
Keywords: Cc: mahge930, gustaf

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 Changed 10 years ago by wbraun

  • Component changed from Unknown to Backend
  • Owner changed from somebody to wbraun
  • Status changed from new to accepted

comment:2 Changed 10 years ago by wbraun

  • Component changed from Backend to Code Generation
  • Owner changed from wbraun to somebody
  • Status changed from accepted to assigned

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

comment:3 Changed 10 years ago by adrpo

  • Cc mahge930 added
  • Owner changed from somebody to mahge930

comment:4 Changed 10 years ago by adrpo

Mahder, can you have a look at it?

comment:5 Changed 10 years ago by mahge930

  • Status changed from assigned to accepted

comment:6 Changed 10 years ago by gustaf

  • Cc gustaf added

comment:7 follow-up: Changed 9 years ago by 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?

comment:8 in reply to: ↑ 7 ; follow-up: Changed 9 years ago by wbraun

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 in reply to: ↑ 8 Changed 9 years ago by gustaf

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.