Commit cfee592
[OMSI] Preparing Code generation for C
Preparing OpenModelica/OMCompiler master for generating OMSUs with `simCodeTarget=omsic`.
- Compiler/Template/CodegenCFunctions.tpl
- Use new C data structure for generated code for OMSUs.
- Added function `crefOMSI` and C basic data types depending on `simCodeTarget`.
- Compiler/Template/CodegenUtil.tpl
- Added `varKinds` `LOOP_ITERATION()` and `LOOP_SOLVED()`. Those are used for solving algebraic loops.
- Compiler/Template/CodegenUtilSimulation.tpl
- Added function `template fullPathPrefix(SimCode simCode)` to get `fullPathPrefix` from `SimCode`. Used for generating OMSUs in specified folder.
- Return `equationIndex` for `SES_ALGEBRAIC_SYSTEM`.
- Added dump functions for `derivativeMatrix` and `OMSIFunction`.
- Compiler/Template/SimCodeTV.mo
- Added optional `OMSIData` to `SimCode`
- Added typeview for new records `OMSIData`, `SES_ALGEBRAIC_SYSTEM`, `DerivativeMatrix`, `OMSI_CONTEXT`, `LOOP_ITERATION`, `LOOP_SOLVED`
- Added typeview for new functions `getLocalValueReference`, `localCref2SimVar`, crefPrefixPre
- Compiler/Stubs/SimCodeUtil.mo
- Added `function localCref2SimVar<A,B>`, `function getValueReference`, `function getLocalValueReference<A>`
- Compiler/Template/CodegenOMSIC.tpl
- Functions for code generation only used for `simCodeTarget=omsic`
- Compiler/Template/CodegenOMSIC_Equations.tpl
- Mainly functions for code generation for equation code. Used for C and C++
- Compiler/Template/CodegenOMSI_common.tpl
- Shared template functions, used for `simCodeTarget=omsic` and `simCodeTarget=omsicpp`
Co-authored-by: niklwors <niiklas.worschech@boschrexroth.de>
Co-authored-by: wibraun <wbraun@fh-bielefeld.de>
Belonging to [master]:
- OpenModelica/OMCompiler#29481 parent ea6c155 commit cfee592
File tree
8 files changed
+2128
-26
lines changed- Compiler
- Stubs
- Template
8 files changed
+2128
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
46 | 62 | | |
47 | 63 | | |
48 | 64 | | |
49 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
50 | 85 | | |
51 | 86 | | |
52 | 87 | | |
0 commit comments