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

Commit 3a94441

Browse files
vwaurichOpenModelica-Hudson
authored andcommitted
sort clocked sub-partitions and deactivate negative shift
1 parent 54881ac commit 3a94441

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

Compiler/BackEnd/SynchronousFeatures.mo

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,12 @@ protected
616616
DAE.FunctionTree funcs;
617617
BackendDAE.EquationArray eqs, clockEqs;
618618
BackendDAE.Variables vars, clockVars;
619-
BackendDAE.EqSystem clockSyst;
619+
BackendDAE.EqSystem clockSyst,outSys;
620620
BackendDAE.IncidenceMatrix m, mT, rm, rmT;
621621
Integer partitionsCnt;
622622
array<Integer> partitions, reqsPartitions;
623623
list<BackendDAE.Equation> newClockEqs;
624+
array<BackendDAE.EqSystem> outSysts_noOrder;
624625
list<BackendDAE.Var> newClockVars;
625626
array<Option<Boolean>> contPartitions;
626627
array<tuple<BackendDAE.SubClock, Integer>> subclocksTree;
@@ -672,7 +673,16 @@ algorithm
672673
fail();
673674
end if;
674675

675-
(outSysts, _) := List.map2Fold(outSysts, makeClockedSyst, order, off, 1);
676+
//order the partitions according to their causality order and corresponding subclock order
677+
outSysts_noOrder := arrayCreate(listLength(outSysts), listHead(outSysts));
678+
for i in List.intRange(arrayLength(order)) loop
679+
outSys := listGet(outSysts,i);
680+
outSys.partitionKind := BackendDAE.CLOCKED_PARTITION(order[i] + off);
681+
arrayUpdate(outSysts_noOrder, order[i], outSys);
682+
end for;
683+
//(outSysts, _) := List.map2Fold(outSysts, makeClockedSyst, order, off, 1);
684+
outSysts := arrayList(outSysts_noOrder);
685+
676686
outSubClocks := {};
677687
subclocksOutArr := arrayCopy(subclocks);
678688
for i in List.intRange(arrayLength(subclocksOutArr)) loop
@@ -771,7 +781,7 @@ algorithm
771781
// apply inverse clock conversion to a parent without base
772782
// as the clock propagates backwards
773783
subClock.factor := MMath.divRational(MMath.RAT1, subClock.factor);
774-
subClock.shift := MMath.subRational(MMath.RAT0, subClock.shift);
784+
//subClock.shift := MMath.subRational(MMath.RAT0, subClock.shift); //vwaurich: Disabled because of negative shifts
775785
updateIdx := parentIdx;
776786
(_, parentIdx) := arrayGet(outSubClocks, updateIdx);
777787
then

0 commit comments

Comments
 (0)