/
SimCode.mo
662 lines (588 loc) · 21.4 KB
/
SimCode.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC),
* c/o Linköpings universitet, Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
* ACCORDING TO RECIPIENTS CHOICE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from OSMC, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
*/
encapsulated package SimCode
" file: SimCode.mo
package: SimCode
description: Code generation using Susan templates
The entry points to this module are the translateModel function and the
translateFunctions fuction.
Except for the entry points, the only other public functions are those that
can be imported and called from templates.
The number of imported functions should be kept as low as possible. Today
some of them are needed to generate target code from templates. More careful
design of data structures passed to templates should reduce the number of
imported functions needed.
Many of the functions in this module were originally copied from the Codegen
and SimCodegen modules.
"
// public imports
import Absyn;
import BackendDAE;
import DAE;
import HashTable;
import HashTableCrILst;
import HashTableCrIListArray;
import HashTableCrefSimVar;
import HpcOmSimCode;
import SimCodeVar;
import SCode;
type ExtConstructor = tuple<DAE.ComponentRef, String, list<DAE.Exp>>;
type ExtDestructor = tuple<String, DAE.ComponentRef>;
type ExtAlias = tuple<DAE.ComponentRef, DAE.ComponentRef>;
type JacobianColumn = tuple<list<SimEqSystem>, list<SimCodeVar.SimVar>, String>; // column equations, column vars, column length
type JacobianMatrix = tuple<list<JacobianColumn>, // column
list<SimCodeVar.SimVar>, // seed vars
String, // matrix name
tuple<list< tuple<Integer, list<Integer>>>,list< tuple<Integer, list<Integer>>>>, // sparse pattern
list<list<Integer>>, // colored cols
Integer, // max color used
Integer>; // jacobian index
constant list<DAE.Exp> listExpLength1 = {DAE.ICONST(0)} "For CodegenC.tpl";
constant list<Variable> boxedRecordOutVars = VARIABLE(DAE.CREF_IDENT("",DAE.T_COMPLEX_DEFAULT_RECORD,{}),DAE.T_COMPLEX_DEFAULT_RECORD,NONE(),{},DAE.NON_PARALLEL(),DAE.VARIABLE())::{} "For CodegenC.tpl";
constant PartitionData emptyPartitionData = PARTITIONDATA(-1,{},{},{});
uniontype SimCode
"Root data structure containing information required for templates to
generate simulation code for a Modelica model."
record SIMCODE
ModelInfo modelInfo;
list<DAE.Exp> literals "shared literals";
list<RecordDeclaration> recordDecls;
list<String> externalFunctionIncludes;
list<SimEqSystem> localKnownVars "state and input dependent variables, that are not inserted into any partion";
list<SimEqSystem> allEquations;
list<list<SimEqSystem>> odeEquations;
list<list<SimEqSystem>> algebraicEquations;
list<ClockedPartition> clockedPartitions;
Boolean useHomotopy "true if homotopy(...) is used during initialization";
list<SimEqSystem> initialEquations;
list<SimEqSystem> initialEquations_lambda0;
list<SimEqSystem> removedInitialEquations;
list<SimEqSystem> startValueEquations;
list<SimEqSystem> nominalValueEquations;
list<SimEqSystem> minValueEquations;
list<SimEqSystem> maxValueEquations;
list<SimEqSystem> parameterEquations;
list<SimEqSystem> removedEquations;
list<SimEqSystem> algorithmAndEquationAsserts;
list<SimEqSystem> equationsForZeroCrossings;
list<SimEqSystem> jacobianEquations;
//list<DAE.Statement> algorithmAndEquationAsserts;
list<StateSet> stateSets;
list<DAE.Constraint> constraints;
list<DAE.ClassAttributes> classAttributes;
list<BackendDAE.ZeroCrossing> zeroCrossings;
list<BackendDAE.ZeroCrossing> relations "only used by c runtime";
list<BackendDAE.TimeEvent> timeEvents "only used by c runtime yet";
list<DAE.ComponentRef> discreteModelVars;
ExtObjInfo extObjInfo;
MakefileParams makefileParams;
DelayedExpression delayedExps;
list<JacobianMatrix> jacobianMatrixes;
Option<SimulationSettings> simulationSettingsOpt;
String fileNamePrefix, fullPathPrefix "Used in FMI where files are generated in a special directory";
HpcOmSimCode.HpcOmData hpcomData;
//maps each variable to an array of storage indices (with this information, arrays must not be unrolled) and a list for the array-dimensions
//if the variable is not part of an array (if it is a scalar value), then the array has size 1
HashTableCrIListArray.HashTable varToArrayIndexMapping;
//*** a protected section *** not exported to SimCodeTV
HashTableCrILst.HashTable varToIndexMapping;
HashTableCrefToSimVar crefToSimVarHT "hidden from typeview - used by cref2simvar() for cref -> SIMVAR lookup available in templates.";
HashTable.HashTable crefToClockIndexHT "map variables to clock indices";
Option<BackendMapping> backendMapping;
//FMI 2.0 data for model structure
Option<FmiModelStructure> modelStructure;
PartitionData partitionData;
Option<DaeModeData> daeModeData;
end SIMCODE;
end SimCode;
public uniontype ClockedPartition
record CLOCKED_PARTITION
DAE.ClockKind baseClock;
list<SubPartition> subPartitions;
end CLOCKED_PARTITION;
end ClockedPartition;
public uniontype SubPartition
record SUBPARTITION
list<tuple<SimCodeVar.SimVar, Boolean /*previous*/>> vars;
list<SimEqSystem> equations;
list<SimEqSystem> removedEquations;
BackendDAE.SubClock subClock;
Boolean holdEvents;
end SUBPARTITION;
end SubPartition;
public
uniontype BackendMapping
record BACKENDMAPPING
BackendDAE.IncidenceMatrix m;
BackendDAE.IncidenceMatrixT mT;
list<tuple<Integer,list<Integer>>> eqMapping; //indx:order <simEq,{backendEq}>
list<tuple<Integer,Integer>> varMapping; //<simVar,backendVar>
array<Integer> eqMatch; //indx:eq entry:var
array<Integer> varMatch; //indx:var entry:eq
array<list<Integer>> eqTree; // arrayIndx:eq list:required eqs
array<list<SimCodeVar.SimVar>> simVarMapping; //indx: backendVar-idx entry: simVar-obj
end BACKENDMAPPING;
record NO_MAPPING
end NO_MAPPING;
end BackendMapping;
public uniontype PartitionData
record PARTITIONDATA
Integer numPartitions;
list<list<Integer>> partitions; // which equations are assigned to the partitions
list<list<Integer>> activatorsForPartitions; // which activators can activate each partition
list<Integer> stateToActivators; // which states belong to which activator, important if various states are gathered in one partition/activator
end PARTITIONDATA;
end PartitionData;
uniontype DelayedExpression
"Delayed expressions type"
record DELAYED_EXPRESSIONS
list<tuple<Integer, tuple<DAE.Exp, DAE.Exp, DAE.Exp>>> delayedExps;
Integer maxDelayedIndex;
end DELAYED_EXPRESSIONS;
end DelayedExpression;
uniontype FunctionCode
"Root data structure containing information required for templates to
generate C functions for Modelica/MetaModelica functions."
record FUNCTIONCODE
String name;
Option<Function> mainFunction "This function is special; the 'in'-function should be generated for it";
list<Function> functions;
list<DAE.Exp> literals "shared literals";
list<String> externalFunctionIncludes;
MakefileParams makefileParams;
list<RecordDeclaration> extraRecordDecls;
end FUNCTIONCODE;
end FunctionCode;
uniontype ModelInfo "Container for metadata about a Modelica model."
record MODELINFO
Absyn.Path name;
String description;
String directory;
VarInfo varInfo;
SimCodeVar.SimVars vars;
list<Function> functions;
list<String> labels;
//Files files "all the files from SourceInfo and DAE.ELementSource";
Integer nClocks;
Integer nSubClocks;
Boolean hasLargeLinearEquationSystems; // True if model has large linear eq. systems that are crucial for performance.
end MODELINFO;
end ModelInfo;
type Files = list<FileInfo>;
uniontype FileInfo
"contains all the .mo files present in all SourceInfo and DAE.ElementSource.info
of all the variables, functions, etc from SimCode that have origin info.
it is used to generate the file information in one place and use an index
whenever we need to refer to one file from a var or function.
this is done so that we don't repeat long filenames everywhere."
record FILEINFO
String fileName "fileName where the class/component is defined in";
Boolean isReadOnly "isReadOnly : (true|false). Should be true for libraries";
end FILEINFO;
end FileInfo;
uniontype VarInfo "Number of variables of various types in a Modelica model."
record VARINFO
Integer numZeroCrossings;
Integer numTimeEvents;
Integer numRelations;
Integer numMathEventFunctions;
Integer numStateVars;
Integer numAlgVars;
Integer numDiscreteReal;
Integer numIntAlgVars;
Integer numBoolAlgVars;
Integer numAlgAliasVars;
Integer numIntAliasVars;
Integer numBoolAliasVars;
Integer numParams;
Integer numIntParams;
Integer numBoolParams;
Integer numOutVars;
Integer numInVars;
Integer numExternalObjects;
Integer numStringAlgVars;
Integer numStringParamVars;
Integer numStringAliasVars;
Integer numEquations;
Integer numLinearSystems;
Integer numNonLinearSystems;
Integer numMixedSystems;
Integer numStateSets;
Integer numJacobians;
Integer numOptimizeConstraints;
Integer numOptimizeFinalConstraints;
Integer numSensitivityParameters;
end VARINFO;
end VarInfo;
uniontype DaeModeConfig
record ALL_EQUATIONS end ALL_EQUATIONS;
record DYNAMIC_EQUATIONS end DYNAMIC_EQUATIONS;
end DaeModeConfig;
uniontype DaeModeData
"contains data that belongs to the dae mode"
record DAEMODEDATA
list<list<SimEqSystem>> daeEquations "daeModel residuals equations";
Option<JacobianMatrix> sparsityPattern "contains the sparsity pattern for the daeMode";
list<SimCodeVar.SimVar> residualVars; // variable used to calculate residuals of a DAE form, they are real
list<SimCodeVar.SimVar> algebraicDAEVars; // variable used to calculate residuals of a DAE form, they are real
DaeModeConfig modeCreated; // indicates the mode in which
end DAEMODEDATA;
end DaeModeData;
// TODO: I believe some of these fields can be removed. Check to see what is
// used in templates.
uniontype Function
"Represents a Modelica or MetaModelica function."
record FUNCTION
Absyn.Path name;
list<Variable> outVars;
list<Variable> functionArguments;
list<Variable> variableDeclarations;
list<DAE.Statement> body;
SCode.Visibility visibility;
SourceInfo info;
end FUNCTION;
record PARALLEL_FUNCTION
Absyn.Path name;
list<Variable> outVars;
list<Variable> functionArguments;
list<Variable> variableDeclarations;
list<DAE.Statement> body;
SourceInfo info;
end PARALLEL_FUNCTION;
record KERNEL_FUNCTION
Absyn.Path name;
list<Variable> outVars;
list<Variable> functionArguments;
list<Variable> variableDeclarations;
list<DAE.Statement> body;
SourceInfo info;
end KERNEL_FUNCTION;
record EXTERNAL_FUNCTION
Absyn.Path name;
String extName;
list<Variable> funArgs;
list<SimExtArg> extArgs;
SimExtArg extReturn;
list<Variable> inVars;
list<Variable> outVars;
list<Variable> biVars;
list<String> includes "this one is needed so that we know if we should generate the external function prototype or not";
list<String> libs "need this one for C#";
String language "C or Fortran";
SCode.Visibility visibility;
SourceInfo info;
Boolean dynamicLoad;
end EXTERNAL_FUNCTION;
record RECORD_CONSTRUCTOR
Absyn.Path name;
list<Variable> funArgs;
list<Variable> locals;
SCode.Visibility visibility;
SourceInfo info;
end RECORD_CONSTRUCTOR;
end Function;
uniontype RecordDeclaration
record RECORD_DECL_FULL
String name "struct (record) name ? encoded";
Option<String> aliasName "alias of struct (record) name ? encoded. Code generators can generate an aliasing typedef using this, and avoid problems when casting a record from one type to another (*(othertype*)(&var)), which only works if you have a lhs value.";
Absyn.Path defPath "definition path";
list<Variable> variables "only name and type";
end RECORD_DECL_FULL;
record RECORD_DECL_DEF
Absyn.Path path "definition path .. encoded?";
list<String> fieldNames;
end RECORD_DECL_DEF;
end RecordDeclaration;
uniontype SimExtArg
"Information about an argument to an external function."
record SIMEXTARG
DAE.ComponentRef cref;
Boolean isInput;
Integer outputIndex "> 0 if output";
Boolean isArray;
Boolean hasBinding "avoid double allocation";
DAE.Type type_;
end SIMEXTARG;
record SIMEXTARGEXP
DAE.Exp exp;
DAE.Type type_;
end SIMEXTARGEXP;
record SIMEXTARGSIZE
DAE.ComponentRef cref;
Boolean isInput;
Integer outputIndex "> 0 if output";
DAE.Type type_;
DAE.Exp exp;
end SIMEXTARGSIZE;
record SIMNOEXTARG end SIMNOEXTARG;
end SimExtArg;
uniontype Variable
"a variable represents a name, a type and a possible default value"
record VARIABLE
DAE.ComponentRef name;
DAE.Type ty;
Option<DAE.Exp> value "default value";
list<DAE.Exp> instDims;
DAE.VarParallelism parallelism;
DAE.VarKind kind;
end VARIABLE;
record FUNCTION_PTR
String name;
list<DAE.Type> tys;
list<Variable> args;
Option<DAE.Exp> defaultValue "default value";
end FUNCTION_PTR;
end Variable;
uniontype SimEqSystem
"Represents a single equation or a system of equations that must be solved together."
record SES_RESIDUAL
Integer index;
DAE.Exp exp;
DAE.ElementSource source;
end SES_RESIDUAL;
record SES_SIMPLE_ASSIGN
Integer index;
DAE.ComponentRef cref;
DAE.Exp exp;
DAE.ElementSource source;
end SES_SIMPLE_ASSIGN;
record SES_ARRAY_CALL_ASSIGN
Integer index;
DAE.Exp lhs;
DAE.Exp exp;
DAE.ElementSource source;
end SES_ARRAY_CALL_ASSIGN;
record SES_IFEQUATION
Integer index;
list<tuple<DAE.Exp,list<SimEqSystem>>> ifbranches;
list<SimEqSystem> elsebranch;
DAE.ElementSource source;
end SES_IFEQUATION;
record SES_ALGORITHM
Integer index;
list<DAE.Statement> statements;
end SES_ALGORITHM;
record SES_INVERSE_ALGORITHM
"this should only occur inside SES_NONLINEAR"
Integer index;
list<DAE.Statement> statements;
list<DAE.ComponentRef> knownOutputCrefs "this is a subset of output crefs of the original algorithm, which are already known";
end SES_INVERSE_ALGORITHM;
record SES_LINEAR
LinearSystem lSystem;
Option<LinearSystem> alternativeTearing;
end SES_LINEAR;
record SES_NONLINEAR
NonlinearSystem nlSystem;
Option<NonlinearSystem> alternativeTearing;
end SES_NONLINEAR;
record SES_MIXED
Integer index;
SimEqSystem cont;
list<SimCodeVar.SimVar> discVars;
list<SimEqSystem> discEqs;
Integer indexMixedSystem;
end SES_MIXED;
record SES_WHEN
Integer index;
list<DAE.ComponentRef> conditions "list of boolean variables as conditions";
Boolean initialCall "true, if top-level branch with initial()";
list<BackendDAE.WhenOperator> whenStmtLst;
Option<SimEqSystem> elseWhen;
DAE.ElementSource source;
end SES_WHEN;
record SES_FOR_LOOP
Integer index;
DAE.Exp iter;
DAE.Exp startIt;
DAE.Exp endIt;
DAE.ComponentRef cref;//lhs
DAE.Exp exp;//rhs
DAE.ElementSource source;
end SES_FOR_LOOP;
end SimEqSystem;
public
uniontype LinearSystem
record LINEARSYSTEM
Integer index;
Boolean partOfMixed;
list<SimCodeVar.SimVar> vars;
list<DAE.Exp> beqs;
list<tuple<Integer, Integer, SimEqSystem>> simJac;
/* solver linear tearing system */
list<SimEqSystem> residual;
Option<JacobianMatrix> jacobianMatrix;
list<DAE.ElementSource> sources;
Integer indexLinearSystem;
end LINEARSYSTEM;
end LinearSystem;
public
uniontype NonlinearSystem
record NONLINEARSYSTEM
Integer index;
list<SimEqSystem> eqs;
list<DAE.ComponentRef> crefs;
Integer indexNonLinearSystem;
Option<JacobianMatrix> jacobianMatrix;
Boolean homotopySupport;
Boolean mixedSystem;
end NONLINEARSYSTEM;
end NonlinearSystem;
uniontype StateSet
record SES_STATESET
Integer index;
Integer nCandidates;
Integer nStates;
list<DAE.ComponentRef> states;
list<DAE.ComponentRef> statescandidates;
DAE.ComponentRef crA;
JacobianMatrix jacobianMatrix;
end SES_STATESET;
end StateSet;
uniontype ExtObjInfo
record EXTOBJINFO
list<SimCodeVar.SimVar> vars;
list<ExtAlias> aliases;
end EXTOBJINFO;
end ExtObjInfo;
uniontype MakefileParams
"Platform specific parameters used when generating makefiles."
record MAKEFILE_PARAMS
String ccompiler;
String cxxcompiler;
String linker;
String exeext;
String dllext;
String omhome;
String cflags;
String ldflags;
String runtimelibs "Libraries that are required by the runtime library";
list<String> includes;
list<String> libs;
list<String> libPaths;
String platform;
String compileDir;
end MAKEFILE_PARAMS;
end MakefileParams;
uniontype SimulationSettings
"Settings for simulation init file header."
record SIMULATION_SETTINGS
Real startTime;
Real stopTime;
Integer numberOfIntervals;
Real stepSize;
Real tolerance;
String method;
String options;
String outputFormat;
String variableFilter;
String cflags;
end SIMULATION_SETTINGS;
end SimulationSettings;
uniontype Context
"Constants of this type defined below are used by templates to be able to
generate different code depending on the context it is generated in."
record SIMULATION_CONTEXT
Boolean genDiscrete;
end SIMULATION_CONTEXT;
record FUNCTION_CONTEXT
end FUNCTION_CONTEXT;
record ALGLOOP_CONTEXT
Boolean genInitialisation;
Boolean genJacobian;
end ALGLOOP_CONTEXT;
record JACOBIAN_CONTEXT
end JACOBIAN_CONTEXT;
record OTHER_CONTEXT
end OTHER_CONTEXT;
record PARALLEL_FUNCTION_CONTEXT
end PARALLEL_FUNCTION_CONTEXT;
record ZEROCROSSINGS_CONTEXT
end ZEROCROSSINGS_CONTEXT;
record OPTIMIZATION_CONTEXT
end OPTIMIZATION_CONTEXT;
record FMI_CONTEXT
end FMI_CONTEXT;
end Context;
public constant Context contextSimulationNonDiscrete = SIMULATION_CONTEXT(false);
public constant Context contextSimulationDiscrete = SIMULATION_CONTEXT(true);
public constant Context contextFunction = FUNCTION_CONTEXT();
public constant Context contextJacobian = JACOBIAN_CONTEXT();
public constant Context contextAlgloopJacobian = ALGLOOP_CONTEXT(false,true);
public constant Context contextAlgloopInitialisation = ALGLOOP_CONTEXT(true,false);
public constant Context contextAlgloop = ALGLOOP_CONTEXT(false,false);
public constant Context contextOther = OTHER_CONTEXT();
public constant Context contextParallelFunction = PARALLEL_FUNCTION_CONTEXT();
public constant Context contextZeroCross = ZEROCROSSINGS_CONTEXT();
public constant Context contextOptimization = OPTIMIZATION_CONTEXT();
public constant Context contextFMI = FMI_CONTEXT();
/****** HashTable ComponentRef -> SimCodeVar.SimVar ******/
type Key = HashTableCrefSimVar.Key;
type Value = HashTableCrefSimVar.Value;
type HashTableCrefToSimVar = HashTableCrefSimVar.HashTable;
/* FMI 2.0 Export */
public uniontype FmiUnknown
record FMIUNKNOWN
Integer index;
list<Integer> dependencies;
list<String> dependenciesKind;
end FMIUNKNOWN;
end FmiUnknown;
public uniontype FmiOutputs
record FMIOUTPUTS
list<FmiUnknown> fmiUnknownsList;
end FMIOUTPUTS;
end FmiOutputs;
public uniontype FmiDerivatives
record FMIDERIVATIVES
list<FmiUnknown> fmiUnknownsList;
end FMIDERIVATIVES;
end FmiDerivatives;
public uniontype FmiDiscreteStates
record FMIDISCRETESTATES
list<FmiUnknown> fmiUnknownsList;
end FMIDISCRETESTATES;
end FmiDiscreteStates;
public uniontype FmiInitialUnknowns
record FMIINITIALUNKNOWNS
list<FmiUnknown> fmiUnknownsList;
end FMIINITIALUNKNOWNS;
end FmiInitialUnknowns;
public uniontype FmiModelStructure
record FMIMODELSTRUCTURE
FmiOutputs fmiOutputs;
FmiDerivatives fmiDerivatives;
FmiDiscreteStates fmiDiscreteStates;
FmiInitialUnknowns fmiInitialUnknowns;
end FMIMODELSTRUCTURE;
end FmiModelStructure;
annotation(__OpenModelica_Interface="backend");
end SimCode;