Opened 12 years ago
Closed 12 years ago
#2073 closed defect (fixed)
reading of info XML invalid
Reported by: | Bill Janssen | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Code Generation | Version: | trunk |
Keywords: | Cc: | Jens Frenkel, Willi Braun |
Description (last modified by )
Attached is a model file which when simulated gives the error
assert | assert | simulation/simulation_info_xml.c: Info XML camelbrake.testbench_info.xml got equation with index 9, expected 10
Jens, where are these things split up? It should be done before the SimCode has indexed all equations. Really, somewhere in the backend
Attachments (1)
Change History (6)
by , 12 years ago
Attachment: | camelbrake.mo added |
---|
comment:1 by , 12 years ago
Ok, two equations with index 9. Should be easy enough to fix once I locate it.
comment:2 by , 12 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
ok, SimCodeUtil is driving me crazy
print("iuniqueEqIndex " +& intString(iuniqueEqIndex) +& "\n"); (equations1, uniqueEqIndex) = createSingleAlgorithmCode(eqnlst, varlst, false, iuniqueEqIndex); print("iuniqueEqIndex " +& intString(uniqueEqIndex) +& " len:" +& intString(listLength(equations1)) +& "\n");
gives:
iuniqueEqIndex 9 iuniqueEqIndex 10 len:1
so it creates 1 equation and gives it index=9
it comes from:
initial algorithm count := integer((time - startTime)/period); T_start := startTime + count*period;
but the xml-code has:
<equation index="9"> <statement> brake_pedal.count := integer((time - brake_pedal.startTime) / brake_pedal.period, 0); </statement> </equation> <equation index="9"> <statement> brake_pedal.T_start := brake_pedal.startTime + /*Real*/(brake_pedal.count) * brake_pedal.period; </statement>
comment:3 by , 12 years ago
Cc: | added |
---|
The question is should every statement line get it's own unique index, currently we just distribute them on every BackendDAE equation and therefore one algorithm equation contains up to several statements. But should really every statement has it's own unique index?
I propose just to change the SimCodeDump.dumpEqs to dump several statement into one equations.
comment:4 by , 12 years ago
... OK, I feel stupid. It should be just one equation. I was pretty sure it was already done like that, too...
model which triggers error