Commit 9b6205d
committed
- fixes to make slicing like
a[1,:] := a[:];
and/or
a[2:3,2] := x[2:3];
work:
- fixed code in indexed_assign_real_array(), index_real_array() and index_alloc_real_array()
- fixed daeExpCrefRhsIndexSpec() template to generate "zero" dimension size for scalar subscripts for INDEX case:
(0), make_index_array(1, <%expPart%>), 'S'
- added test ArrayAssignWholeDim.mo; but it should be moved to mosfiles to ensure C-runtime invocation
TODO: the same should be done for integer_array.c; then the character slice coding, i.e. 'S','A','W', can be removed entirely;
or, perhaps, the slicing operation can be generated inline as appropriate nested for loops (I'll do that for C# generator, then it may be ported back to C++)
- fixed daeExpAsub() template for _get_1D() .. _get_4D() constant index cases ... decremented indexes, because the _get_#D() functions works with zero based indexes
- commented out #include "utility.h" in simulation_events.cpp to enable debugging in Visual Studio
- added NO_INTERACTIVE_DEPENDENCY macro switch used in simulation_runtime.cpp for simpler compilation of simulation runtime in Visual Studio
- added SimCode.cref2simvar(ComponentRef,SimCode)->SimVar function and daeLow field into SimCode.SIMCODE record to enable lookup of representation arrays in templates (C#);
note that only cref2simvar() is visible from templates, but not the daeLow field which is not added to SimCodeTV.mo;
the function needs a SimCode value as a whole, so the implementation is effectively hidden from templates' viewpoint;
BUT, this is only a workaround for the lack of the needed information in component references themselves (hope they will have it in the future);
see usage of cref2simvar() in SimCodeCSharp.tpl
- added extern int const specifiers in functionStoreDelayed C++ template to resolve a link problem in VC++
- renamed local identifiers named cref to cr or ecr (ecr when of type DAE.Exp) in the C++ templates to disambiguate them from cref() template name (will be checked in the future; now value binding names and template names has separate name scopes, but that will be changed in the next versions of Susan);
maybe the cref() template should be renamed to compRef() because there exist fields named cref in SimCodeTV.mo
- simplified several constructs like '<%val%>' to just val and/or like (libs |> lib => lib) to just (libs) in C++ templates
- re-factored some case clauses when they shared the same then part (Susan can have "or" cases,e.g.: case PAT1 case PAT2 case PAT3 then tplExpr ... where the same tplExpr is lexically used for every given case)
- renamed subscriptsTpl() and subscriptTpl() templates to more suitable names subscriptsStr() and subscriptStr()
- added many improvements in C# code generator
- changed some make commands for Susan/C# codegen testing
- added testmo make command to Makefile.common
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5881 f25d12d1-65f4-0310-ae8a-bbce733d8d8e1 parent 95e688a commit 9b6205d
File tree
14 files changed
+11423
-3992
lines changed- Compiler
- susan_codegen
- SimCode
- c_runtime
14 files changed
+11423
-3992
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | | - | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
| |||
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
470 | | - | |
| 471 | + | |
471 | 472 | | |
472 | 473 | | |
473 | 474 | | |
| |||
505 | 506 | | |
506 | 507 | | |
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 | + | |
508 | 546 | | |
509 | 547 | | |
510 | 548 | | |
| |||
1247 | 1285 | | |
1248 | 1286 | | |
1249 | 1287 | | |
1250 | | - | |
| 1288 | + | |
| 1289 | + | |
1251 | 1290 | | |
1252 | 1291 | | |
1253 | 1292 | | |
| |||
0 commit comments