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

Commit

Permalink
Make predictable tmp-indexes for residual functions
Browse files Browse the repository at this point in the history
This makes it easier to compare the generated code of different OMC
versions since each residual starts from tmp-index=0.
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Jul 20, 2017
1 parent 88c73ca commit b00d68d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2525,6 +2525,7 @@ end createGlobalConstraints;
template functionExtraResidualsPreBody(SimEqSystem eq, Text &eqs, String modelNamePrefixStr)
"Generates an equation."
::=
let () = tmpTickReset(0)
match eq
case e as SES_RESIDUAL(__)
then ""
Expand Down Expand Up @@ -2567,7 +2568,9 @@ end createLocalConstraints;
template functionNonLinearResiduals(list<SimEqSystem> allEquations, String modelNamePrefix)
"Generates functions in simulation file."
::=
(allEquations |> eqn => (match eqn
(allEquations |> eqn => (
let () = tmpTickReset(0)
match eqn
case eq as SES_MIXED(__) then functionNonLinearResiduals(fill(eq.cont,1),modelNamePrefix)
// no dynamic tearing
case eq as SES_NONLINEAR(nlSystem=nls as NONLINEARSYSTEM(
Expand Down Expand Up @@ -2666,6 +2669,7 @@ template generateNonLinearResidualFunction(NonlinearSystem system, String modelN
whichSet = 0: Strict Set
whichSet = 1: Casual Set"
::=
let () = tmpTickReset(0)
match system
case nls as NONLINEARSYSTEM(__) then
let &varDecls = buffer ""
Expand Down

0 comments on commit b00d68d

Please sign in to comment.