Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Fix order of clocked equations
Browse files Browse the repository at this point in the history
Before, the IDs given to clocked equations was in the middle of the
regular equations, but it needs to come after (or before).
  • Loading branch information
sjoelund committed Oct 21, 2016
1 parent f9018bb commit 1a1a32a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Compiler/SimCode/SimCodeUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,19 @@ algorithm
createEquationsForSystems(contSysts, shared, uniqueEqIndex, zeroCrossings, tempvars, 1, backendMapping);
if debug then execStat("simCode: createEquationsForSystems"); end if;

(clockedPartitions, uniqueEqIndex, backendMapping, equationSccMapping, eqBackendSimCodeMapping, tempvars) :=
translateClockedEquations(clockedSysts, dlow.shared, sccOffset, uniqueEqIndex,
backendMapping, equationSccMapping, eqBackendSimCodeMapping, tempvars);
if debug then execStat("simCode: translateClockedEquations"); end if;

outMapping := (uniqueEqIndex /* highestSimEqIndex */, equationSccMapping);
execStat("simCode: created simulation system equations");

//(remEqLst, paramAsserts) := List.fold1(BackendEquation.equationList(removedEqs), getParamAsserts, globalKnownVars,({},{}));
//((uniqueEqIndex, removedEquations)) := BackendEquation.traverseEquationArray(BackendEquation.listEquation(remEqLst), traversedlowEqToSimEqSystem, (uniqueEqIndex, {}));
((uniqueEqIndex, removedEquations)) := BackendEquation.traverseEquationArray(removedEqs, traversedlowEqToSimEqSystem, (uniqueEqIndex, {}));
if debug then execStat("simCode: traversedlowEqToSimEqSystem"); end if;

(clockedPartitions, uniqueEqIndex, backendMapping, equationSccMapping, eqBackendSimCodeMapping, tempvars) :=
translateClockedEquations(clockedSysts, dlow.shared, sccOffset, uniqueEqIndex,
backendMapping, equationSccMapping, eqBackendSimCodeMapping, tempvars);
if debug then execStat("simCode: translateClockedEquations"); end if;

// Assertions and crap
// create parameter equations
((uniqueEqIndex, startValueEquations)) := BackendDAEUtil.foldEqSystem(dlow, createStartValueEquations, (uniqueEqIndex, {}));
Expand Down

0 comments on commit 1a1a32a

Please sign in to comment.