Opened 12 years ago

Closed 12 years ago

#1961 closed defect (fixed)

Modelica.Electrical.Digital.Sources.Table

Reported by: Christian Schubert Owned by: Adrian Pop
Priority: blocker Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: enumeration to integer conversion Cc: Willi Braun, Martin Sjölund

Description

Hi,

while comparing results I found that Modelica.Electrical.Digital.Sources.Table produces wrong results which causes many MSL Models to fail comparison.
The table is written as a simple algorithm and the data is stored as an array. Thus it is all pure Modelica and therefore critical.

See the attached picture and model for details.

Attachments (3)

TableTest.mo (455 bytes ) - added by Christian Schubert 12 years ago.
TableTest.mos (95 bytes ) - added by Christian Schubert 12 years ago.
Result_Comparison.png (81.3 KB ) - added by Christian Schubert 12 years ago.

Download all attachments as: .zip

Change History (10)

by Christian Schubert, 12 years ago

Attachment: TableTest.mo added

by Christian Schubert, 12 years ago

Attachment: TableTest.mos added

by Christian Schubert, 12 years ago

Attachment: Result_Comparison.png added

comment:1 by Martin Sjölund, 12 years ago

Owner: changed from Martin Sjölund to Adrian Pop
Status: newassigned

comment:2 by Willi Braun, 12 years ago

Component: Run-timeFrontend
Keywords: enumaration integer added; wrong results removed

As far as I see it's not a runtime issue. Just the enumeration to integer are translated different:
x={Logic.'U',Logic.'X',Logic.'0',Logic.'1',Logic.'Z',Logic.'W',Logic.'L',Logic.'H',Logic.'-'})
OM: x = {1,1,2,3,4,5,6,7,8};
Dymola: x = {1,2,3,4,5,6,7,8,9};

comment:3 by Martin Sjölund, 12 years ago

Did you use the exact same version of MSL? It might be that the trunk uses a different table.

comment:4 by Christian Schubert, 12 years ago

I've reran it again with Dymola and MSL 3.2.1 and I got the same result.

But surely, Logic.'U' and Logic.'X' should be mapped to different integer values, right?

comment:5 by Martin Sjölund, 12 years ago

Ok, this is a bit weird... I got the following array in the code using just that assignment...
static const modelica_integer _OMC_LIT0_data[] = {1, 1, 2, 3, 4, 5, 6, 7, 8};

Maybe I can fix this before I go to Canada...

comment:6 by Martin Sjölund, 12 years ago

Should work in r14168 but did not run tests.

comment:7 by Adrian Pop, 12 years ago

Cc: Martin Sjölund added
Keywords: enumeration to conversion added; enumaration removed
Resolution: fixed
Status: assignedclosed

This seems to be fixed now. Christian, can you enable the test for it in msl32?

Note: See TracTickets for help on using tickets.