Skip to content

Commit

Permalink
Dump flat model after running the new backend (#10887)
Browse files Browse the repository at this point in the history
- Dumping the flat model should be done after running the new backend,
  since converting the FlatModel to DAE is a destructive process.
  • Loading branch information
perost committed Jun 23, 2023
1 parent a6a176a commit b0c0a25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions OMCompiler/Compiler/SimCode/SimCodeMain.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1081,17 +1081,19 @@ algorithm
timeFrontend := System.realtimeTock(ClockIndexes.RT_CLOCK_FRONTEND);
ExecStat.execStat("FrontEnd");

if runBackend then
(outLibs, outFileDir, resultValues) := translateModelCallBackendNB(flatModel, funcTree, className, inFileNamePrefix, inSimSettingsOpt);
end if;

// This must be done after calling the backend since it uses the FlatModel,
// and converting it to DAE is destructive.
if dumpValidFlatModelicaNF then
flatString := NFFlatString;
elseif not runSilent then
(dae, funcs) := NFConvertDAE.convert(flatModel, funcTree);
flatString := DAEDump.dumpStr(dae, funcs);
end if;

if runBackend then
(outLibs, outFileDir, resultValues) := translateModelCallBackendNB(flatModel, funcTree, className, inFileNamePrefix, inSimSettingsOpt);
end if;

// old backend
else
// calculate stuff that we need to create SimCode data structure
Expand Down

0 comments on commit b0c0a25

Please sign in to comment.