Skip to content

Commit

Permalink
Remove outdated QSS implementation
Browse files Browse the repository at this point in the history
This refers to +simCodeTarget=QSS
  • Loading branch information
lochel committed Oct 15, 2015
1 parent e1a4c64 commit 8cbbb37
Show file tree
Hide file tree
Showing 21 changed files with 15 additions and 2,963 deletions.
1,024 changes: 0 additions & 1,024 deletions Compiler/BackEnd/BackendQSS.mo

This file was deleted.

40 changes: 13 additions & 27 deletions Compiler/SimCode/SimCodeMain.mo
Expand Up @@ -56,14 +56,12 @@ import SimCode;
// protected imports
protected
import BackendDAECreate;
import BackendQSS;
import ClockIndexes;
import CevalScriptBackend;
import CodegenC;
import CodegenFMU;
import CodegenFMUCpp;
import CodegenFMUCppHpcom;
import CodegenQSS;
import CodegenAdevs;
import CodegenSparseFMI;
import CodegenCSharp;
Expand Down Expand Up @@ -414,7 +412,7 @@ algorithm
SimCodeFunctionUtil.execStat("SimCode");

System.realtimeTick(ClockIndexes.RT_CLOCK_TEMPLATES);
callTargetTemplates(simCode, inBackendDAE, Config.simCodeTarget());
callTargetTemplates(simCode, Config.simCodeTarget());
timeTemplates := System.realtimeTock(ClockIndexes.RT_CLOCK_TEMPLATES);
SimCodeFunctionUtil.execStat("Templates");
end generateModelCode;
Expand Down Expand Up @@ -479,44 +477,32 @@ algorithm
end createSimCode;

// TODO: use another switch ... later make it first class option like -target or so
// Update: inQSSrequiredData passed in order to call BackendQSS and generate the extra structures needed for QSS simulation.
protected function callTargetTemplates "
Generate target code by passing the SimCode data structure to templates."
input SimCode.SimCode simCode;
input BackendDAE.BackendDAE inQSSrequiredData;
input String target;
algorithm
_ := match(simCode, inQSSrequiredData, target)
_ := match(simCode, target)
local
BackendDAE.BackendDAE outIndexedBackendDAE;
BackendQSS.QSSinfo qssInfo;
String str,guid;
SimCode.SimCode sc;
String str, guid;

case (_, _, "CSharp") equation
case (_, "CSharp") equation
Tpl.tplNoret(CodegenCSharp.translateModel, simCode);
then ();

case (_, _, "Cpp") equation
case (_, "Cpp") equation
callTargetTemplatesCPP(simCode);
then ();

case (_, _, "Adevs") equation
case (_, "Adevs") equation
Tpl.tplNoret(CodegenAdevs.translateModel, simCode);
then ();

case (_, _, "sfmi") equation
case (_, "sfmi") equation
Tpl.tplNoret3(CodegenSparseFMI.translateModel, simCode, "2.0", "me");
then ();

case (_, outIndexedBackendDAE, "QSS") equation
/* as BackendDAE.DAE(eqs={ BackendDAE.EQSYSTEM( m=SOME(incidenceMatrix) , mT=SOME(incidenceMatrixT), matching=BackendDAE.MATCHING(equationIndices, variableIndices, strongComponents)*/
Debug.trace("Generating code for QSS solver\n");
(qssInfo, sc) = BackendQSS.generateStructureCodeQSS(outIndexedBackendDAE, simCode); //, equationIndices, variableIndices, incidenceMatrix, incidenceMatrixT, strongComponents, simCode);
Tpl.tplNoret2(CodegenQSS.translateModel, sc, qssInfo);
then ();

case (_, _, "C")
case (_, "C")
equation
guid = System.getUUIDStr();

Expand All @@ -537,7 +523,7 @@ algorithm
// print("SimCode -> C-files: " + realString(System.realtimeTock(ClockIndexes.RT_PROFILER0)*1000) + "ms\n");
then ();

case (_, _, "JavaScript")
case (_, "JavaScript")
equation
guid = System.getUUIDStr();
Tpl.tplNoret2(CodegenC.translateModel, simCode, guid);
Expand All @@ -546,18 +532,18 @@ algorithm
Tpl.tplNoret(CodegenJS.markdownFile, simCode);
then ();

case (_, _, "XML") equation
case (_, "XML") equation
Tpl.tplNoret(CodegenXML.translateModel, simCode);
then ();

case (_, _, "Java") equation
case (_, "Java") equation
Tpl.tplNoret(CodegenJava.translateModel, simCode);
then ();

case (_, _, "None")
case (_, "None")
then ();

case (_, _, _) equation
else equation
str = "Unknown template target: " + target;
Error.addMessage(Error.INTERNAL_ERROR, {str});
then fail();
Expand Down

0 comments on commit 8cbbb37

Please sign in to comment.