Skip to content

Commit db90b5d

Browse files
committed
Squashed commit of the following:
Additional change: - Skipped changes to SimulationRuntime commit d40c51142e56d487703ae6a61e2c54b1fe8981cb Merge: a996a90 9300fd4 Author: Martin Sjölund <martin.sjolund@liu.se> Date: Sat Jun 13 08:37:30 2015 +0200 Merge branch 'master' into gossenpull-5-cleanup Conflicts: Compiler/BackEnd/DynamicOptimization.mo commit a996a90eb2a53b6153df0266484b5505e5586557 Author: gossen <maksimov.io@yandex.ru> Date: Wed Jun 3 19:25:15 2015 +0300 Refine documentation for DAEUtil.verifyEquationsDAE function commit 9c3b89f746c6d3852a497ff16cb06257e118cf63 Author: gossen <maksimov.io@yandex.ru> Date: Mon Jun 1 21:44:41 2015 +0300 Rename function verifyDAE to verifyEquationsDAE in DAEUtil.mo and add documentation for it commit 56e9a7f2ddd06837a089307b5012c879f7ae7a3e Merge: dc8140e 4715552 Author: gossen <maksimov.io@yandex.ru> Date: Mon Jun 1 21:27:26 2015 +0300 Merge branch 'upstream' Conflicts: Compiler/Template/CodegenCpp.tpl SimulationRuntime/cpp/Include/Core/Solver/FactoryExport.h commit dc8140e54e2536fb3bf0b411a112411fbbc13def Author: gossen <maximov@techno-com.ru> Date: Thu May 28 10:47:11 2015 +0300 Fix typo commit 459659a929c20b26bec4191971820ff1a8506fd8 Author: gossen <maximov@techno-com.ru> Date: Thu May 28 10:38:01 2015 +0300 Fix typo in comments commit 4e67dd0b17309d2775404c73ba42f71685442101 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 27 21:38:03 2015 +0300 Remove debug messages commit 1cabda5a8afc20a2723b86dd6065e90ac05b08ae Author: gossen <maksimov.io@yandex.ru> Date: Wed May 27 21:16:41 2015 +0300 Change default partition kind to UNKNOWN_PARTITION commit cc20af9162a517e133571ff175df6240cbe33077 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 27 21:09:03 2015 +0300 Restore old synchronous dump format commit 430811fcd63937257a1f8084079a398720a064ac Merge: 2ab8393 1eb6ca8 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 27 21:07:10 2015 +0300 Merge branch 'upstream' Conflicts: Compiler/BackEnd/HpcOmScheduler.mo Compiler/FrontEnd/Expression.mo Compiler/SimCode/HpcOmSimCodeMain.mo Compiler/SimCode/SimCodeUtil.mo commit 2ab8393baf3a1e89fbc2c4cb2c936d141367b440 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 27 19:48:53 2015 +0300 Add partitions count in synchronous debug info commit a70638e5d70ba107dadde5126c0f97888628cb17 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 27 19:27:09 2015 +0300 Make new partitioning algorithm backward-compatible with old one Some tests produce different results ( Modelica.Mechanics.MultiBody.Examples.Systems.RobotR3.fullRobot, ThermoSysPro.Examples.SimpleExamples.TestIdealCheckValve ) and others have mismatched output due to equation reordering. So restore compiler old behavior for continuous systems. commit 6099375345919e495641ee7f209b6a6cc871f398 Merge: d2b8a39 cc6a016 Author: gossen <maksimov.io@yandex.ru> Date: Sun May 24 23:14:27 2015 +0300 Merge branch 'upstream' into sync Conflicts: Compiler/BackEnd/BackendDAEUtil.mo commit d2b8a3936a5ea8e3f2cfba73055006aca56ae441 Author: gossen <maksimov.io@yandex.ru> Date: Sun May 24 19:03:34 2015 +0300 Fix removed parameter binding equations commit 3c5963cf692eeb3a23fbf750050700577cad3d6d Author: gossen <maksimov.io@yandex.ru> Date: Sat May 23 16:38:46 2015 +0300 Fix discrete partitions zero-crossings commit 0345ffdd69e41e15bf84d5690f721d161e456327 Author: Maximov Timur <maximov@techno-com.ru> Date: Fri May 22 15:28:31 2015 +0300 Asserts in parameter bindings should be in removed equations section in BackendDAE commit 72c8a5e2f23018af7ea6a0ecfea1534364123fd2 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 20 23:00:18 2015 +0300 Fix merge errors commit 14ec9a2511d1adf006807f4c4ce0f4804eca93ae Merge: fbd89b4 3ede179 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 20 22:48:30 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit fbd89b4c387203ca23561e7a233c7831ab03c6f9 Merge: e1e1efc bf6ce68 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 20 01:28:12 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit e1e1efcfa4b79dadce9c3d982ef46efbceaf3169 Author: gossen <maksimov.io@yandex.ru> Date: Wed May 20 01:28:01 2015 +0300 Fix typo commit ad19eaa2c984181d55b0ddb1583b4a6700880437 Merge: 04973aa 60c93f5 Author: gossen <maksimov.io@yandex.ru> Date: Tue May 19 19:56:07 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit 04973aabffe56c3fc1f415650a9c445a8fdc710c Merge: 78d2dd3 0d42956 Author: gossen <maksimov.io@yandex.ru> Date: Mon May 18 19:16:10 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit 78d2dd33244cf30d0e0f05c7f763be1436c8b008 Author: gossen <maksimov.io@yandex.ru> Date: Mon May 18 19:15:09 2015 +0300 Add comments to SynchronousFeatures.mo commit 9f62ef9164830c8baa478947e05184f12e698a66 Author: gossen <maksimov.io@yandex.ru> Date: Mon May 18 00:35:11 2015 +0300 More fixes commit 69028127770fb0fa216f6babaa62d9f85c2307b6 Author: gossen <maksimov.io@yandex.ru> Date: Mon May 18 00:00:59 2015 +0300 Fix factor and shift inferencing errors commit a4466403c9156bc910f08223512fd0593f4e942f Author: gossen <maksimov.io@yandex.ru> Date: Sun May 17 19:53:41 2015 +0300 Revert base clocks dumping in print function for BackendDAE.Shared because of some tests failure commit b4333b880dccc96381afe7aa31bdfffe07a61257 Author: gossen <maksimov.io@yandex.ru> Date: Sun May 17 14:14:54 2015 +0300 No zero crossings for clocked discrete partitions commit 990dfb0285fe209dc5f3a193149c00c16210fca8 Merge: 230f349 348b22c Author: gossen <maksimov.io@yandex.ru> Date: Sun May 17 13:26:54 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler Conflicts: Compiler/BackEnd/BackendQSS.mo Compiler/BackEnd/HpcOmScheduler.mo Compiler/SimCode/HpcOmSimCodeMain.mo Compiler/SimCode/SimCodeUtil.mo SimulationRuntime/c/util/CMakeLists.txt commit 230f349559bceae2d3df8edeb1a39c8c710faa19 Author: gossen <maksimov.io@yandex.ru> Date: Sun May 17 13:20:07 2015 +0300 Revert Synchronous support in C simulation runtime. commit a9954e8263456efc77cede1c57fe2a9eeea41667 Author: gossen <maksimov.io@yandex.ru> Date: Sun May 17 13:16:47 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit da9219766e4444dadce5579f6e2bd3b25727bcc4 Author: gossen <maksimov.io@yandex.ru> Date: Sat May 16 13:02:02 2015 +0300 Add rational module to CMakeLists commit 92dfa97f962dbc77f04bcc83ad3ce19ae53d481e Author: gossen <maksimov.io@yandex.ru> Date: Wed May 13 02:12:04 2015 +0300 Add rational number support in SimulationRuntime-C. commit 70ec35aa8bc3e911fa0e0f1a3055a612b33418a3 Merge: acf5306 ff139a3 Author: gossen <maksimov.io@yandex.ru> Date: Mon May 11 23:04:52 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit acf5306708d425c0f6fd9f04bb1de24c5eee6b56 Merge: b6feb53 66346e3 Author: Timur Maksimov <maksimov.io@yandex.ru> Date: Fri May 8 00:35:47 2015 +0300 Merge branch 'master' of github.com:OpenModelica/OMCompiler commit b6feb5375b2e96bf2519e32a0f1298ee46b11432 Author: Timur Maksimov <maksimov.io@yandex.ru> Date: Fri May 8 00:33:38 2015 +0300 Import from svn and merging with upstream. Improved support for Modelica synchronous features.
1 parent 9300fd4 commit db90b5d

38 files changed

+2756
-1071
lines changed

Compiler/BackEnd/BackendDAE.mo

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public import SCode;
4444
public import Values;
4545
public import HashTable3;
4646
public import HashTableCG;
47+
public import MMath;
4748

4849
public
4950
type Type = .DAE.Type
@@ -79,25 +80,27 @@ uniontype EqSystem "An independent system of equations (and their corresponding
7980
end EQSYSTEM;
8081
end EqSystem;
8182

83+
public uniontype SubClock
84+
record SUBCLOCK
85+
MMath.Rational factor;
86+
MMath.Rational shift;
87+
Option<String> solver;
88+
end SUBCLOCK;
89+
end SubClock;
90+
8291
public
8392
uniontype BaseClockPartitionKind
8493
record UNKNOWN_PARTITION end UNKNOWN_PARTITION;
8594
record CLOCKED_PARTITION
86-
.DAE.ClockKind clockKind;
87-
// array<SubClockPartitions> subClockPartitions;
95+
Integer baseClock;
96+
SubClock subClock;
97+
Boolean holdEvents;
8898
end CLOCKED_PARTITION;
8999
record CONTINUOUS_TIME_PARTITION end CONTINUOUS_TIME_PARTITION;
90100
record UNSPECIFIED_PARTITION "treated as CONTINUOUS_TIME_PARTITION" end UNSPECIFIED_PARTITION;
91101
end BaseClockPartitionKind;
92102

93-
public
94-
uniontype SubClockPartition
95-
record SubClockPartition
96-
Integer factor "subSample/superSample";
97-
//Integer counter "shiftSample/backSample";
98-
//Integer resolution "shiftSample/backSample";
99-
end SubClockPartition;
100-
end SubClockPartition;
103+
101104

102105
public
103106
uniontype Shared "Data shared for all equation-systems"
@@ -244,26 +247,33 @@ public uniontype TearingSelect
244247
record ALWAYS end ALWAYS;
245248
end TearingSelect;
246249

250+
public constant String WHENCLK_PRREFIX = "$whenclk";
247251
public uniontype EquationKind "equation kind"
248-
record BINDING_EQUATION end BINDING_EQUATION;
249-
record DYNAMIC_EQUATION end DYNAMIC_EQUATION;
250-
record INITIAL_EQUATION end INITIAL_EQUATION;
251-
record UNKNOWN_EQUATION_KIND end UNKNOWN_EQUATION_KIND;
252+
record BINDING_EQUATION
253+
end BINDING_EQUATION;
254+
record DYNAMIC_EQUATION
255+
end DYNAMIC_EQUATION;
256+
record INITIAL_EQUATION
257+
end INITIAL_EQUATION;
258+
record CLOCKED_EQUATION
259+
Integer clk;
260+
end CLOCKED_EQUATION;
261+
record UNKNOWN_EQUATION_KIND
262+
end UNKNOWN_EQUATION_KIND;
252263
end EquationKind;
253264

254265
public uniontype EquationAttributes
255266
record EQUATION_ATTRIBUTES
256267
Boolean differentiated "true if the equation was differentiated, and should not differentiated again to avoid equal equations";
257268
EquationKind kind;
258-
Integer subPartitionIndex;
259269
LoopInfo loopInfo;
260270
end EQUATION_ATTRIBUTES;
261271
end EquationAttributes;
262272

263-
public constant EquationAttributes EQ_ATTR_DEFAULT_DYNAMIC = EQUATION_ATTRIBUTES(false, DYNAMIC_EQUATION(), 0, NO_LOOP());
264-
public constant EquationAttributes EQ_ATTR_DEFAULT_BINDING = EQUATION_ATTRIBUTES(false, BINDING_EQUATION(), 0, NO_LOOP());
265-
public constant EquationAttributes EQ_ATTR_DEFAULT_INITIAL = EQUATION_ATTRIBUTES(false, INITIAL_EQUATION(), 0, NO_LOOP());
266-
public constant EquationAttributes EQ_ATTR_DEFAULT_UNKNOWN = EQUATION_ATTRIBUTES(false, UNKNOWN_EQUATION_KIND(), 0, NO_LOOP());
273+
public constant EquationAttributes EQ_ATTR_DEFAULT_DYNAMIC = EQUATION_ATTRIBUTES(false, DYNAMIC_EQUATION(), NO_LOOP());
274+
public constant EquationAttributes EQ_ATTR_DEFAULT_BINDING = EQUATION_ATTRIBUTES(false, BINDING_EQUATION(), NO_LOOP());
275+
public constant EquationAttributes EQ_ATTR_DEFAULT_INITIAL = EQUATION_ATTRIBUTES(false, INITIAL_EQUATION(), NO_LOOP());
276+
public constant EquationAttributes EQ_ATTR_DEFAULT_UNKNOWN = EQUATION_ATTRIBUTES(false, UNKNOWN_EQUATION_KIND(), NO_LOOP());
267277

268278
public uniontype LoopInfo "is this equation part of a for-loop"
269279
record NO_LOOP
@@ -526,6 +536,7 @@ uniontype EventInfo
526536
list<ZeroCrossing> sampleLst "[deprecated] list of sample as before, only used by cpp runtime (TODO: REMOVE ME)";
527537
list<ZeroCrossing> relationsLst "list of zero crossing function as before";
528538
Integer numberMathEvents "stores the number of math function that trigger events e.g. floor, ceil, integer, ...";
539+
array<.DAE.ClockKind> clocks;
529540
end EVENT_INFO;
530541
end EventInfo;
531542

@@ -645,8 +656,8 @@ uniontype IndexType
645656
record ABSOLUTE "incidence matrix with absolute indexes" end ABSOLUTE;
646657
record NORMAL "incidence matrix with positive/negative indexes" end NORMAL;
647658
record SOLVABLE "incidence matrix with only solvable entries, for example {a,b,c}[d] then d is skipped" end SOLVABLE;
648-
record BASECLOCK "incidence matrix for base-clock partitioning" end BASECLOCK;
649-
record SUBCLOCK "incidence matrix for sub-clock partitioning" end SUBCLOCK;
659+
record BASECLOCK_IDX "incidence matrix for base-clock partitioning" end BASECLOCK_IDX;
660+
record SUBCLOCK_IDX "incidence matrix for sub-clock partitioning" end SUBCLOCK_IDX;
650661
record SPARSE "incidence matrix as normal, but add for inputs also a value" end SPARSE;
651662
end IndexType;
652663

0 commit comments

Comments
 (0)