- Index
- » Users
- » jwharington
- » Profile
Posts
Posts
Flattening of the model results in losing aliases of inner/outer variables.
Here's a test case:
Code:
model teststate3
block Common
Integer b;
end Common;
model Hookup
outer Common global;
Boolean active;
parameter Integer m;
algorithm
when (active) then
global.b := m;
end when;
end Hookup;
inner Common global;
Hookup fred (m = 0, active = true);
Hookup ginger (m = 1, active = false);
end teststate3;
This produces (output of instantiateModel()):
Code:
class teststate3
Integer global.b;
Boolean fred.active = true;
parameter Integer fred.m = 0;
Boolean ginger.active = false;
parameter Integer ginger.m = 1;
algorithm
when fred.active then
fred.global.b := fred.m;
end when;
when ginger.active then
ginger.global.b := ginger.m;
end when;
end teststate3;
In this example, "ginger.global.b" should be "global.b" etc.
Are there plans for support for language specification 3.3 in openmodelica?
In particular I am interested in using the new state machine system.
So far, I have not been able to find any reference implementation of this functionality.
I have discovered certain conditions whereby compilation of models that contain class instances, will fail, but where if I use instantiateModel() to produce flattened code, the flattened code (once copied into a new file and "." replaced with "_"), compiles ok.
This is certainly strange. Where should I report the bug in greater detail?
- Index
- » Users
- » jwharington
- » Profile