Skip to content

Commit

Permalink
- GOT RID OF the old trunk/c_runtime and old templates SimCodeC.tpl/S…
Browse files Browse the repository at this point in the history
…imCodeFMU.tpl

- HIGHLY RECOMMENDED make clean 
- renamed SimCodeXXX.tpl CodegenXXX.tpl
- merged the needed things from SimCodeC.tpl into CodegenQSS.tpl.
- all tests except the usual mishaps go.
- targeted all trunk/c_runtime references used in 
  Makefiles / C (Qt OMPlot) / Other files to their SimulationRuntime/ counterparts.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11174 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 23, 2012
1 parent c5bda88 commit f904157
Show file tree
Hide file tree
Showing 406 changed files with 2,117 additions and 90,939 deletions.
28 changes: 9 additions & 19 deletions Compiler/BackEnd/SimCode.mo
Expand Up @@ -84,6 +84,10 @@ protected import CevalScript;
protected import ClassInf;
protected import CodegenC;
protected import CodegenFMU;
protected import CodegenQSS;
protected import CodegenAdevs;
protected import CodegenCSharp;
protected import CodegenCpp;
protected import ComponentReference;
protected import Config;
protected import DAEDump;
Expand All @@ -103,13 +107,7 @@ protected import PartFn;
protected import PriorityQueue;
protected import SCodeUtil;
protected import Settings;
protected import SimCodeC;
protected import SimCodeCpp;
protected import SimCodeCSharp;
protected import SimCodeDump;
protected import SimCodeFMU;
protected import SimCodeQSS;
protected import SimCodeAdevs;
protected import System;
protected import Util;
protected import ValuesUtil;
Expand All @@ -131,7 +129,7 @@ type JacobianMatrix = tuple<list<JacobianColumn>, // column
Integer>; // max color used


public constant list<DAE.Exp> listExpLength1 = {DAE.ICONST(0)} "For SimCodeC.tpl";
public constant list<DAE.Exp> listExpLength1 = {DAE.ICONST(0)} "For CodegenC.tpl";

// Root data structure containing information required for templates to
// generate simulation code for a Modelica model.
Expand Down Expand Up @@ -1129,27 +1127,23 @@ algorithm

case (simCode,_,"CSharp")
equation
Tpl.tplNoret(SimCodeCSharp.translateModel, simCode);
Tpl.tplNoret(CodegenCSharp.translateModel, simCode);
then ();
case (simCode,_,"Cpp")
equation
Tpl.tplNoret(SimCodeCpp.translateModel, simCode);
Tpl.tplNoret(CodegenCpp.translateModel, simCode);
then ();
case (simCode,_,"Adevs")
equation
Tpl.tplNoret(SimCodeAdevs.translateModel, simCode);
Tpl.tplNoret(CodegenAdevs.translateModel, simCode);
then ();
case (simCode,outIndexedBackendDAE as BackendDAE.DAE(eqs={
BackendDAE.EQSYSTEM(m=SOME(incidenceMatrix), mT=SOME(incidenceMatrixT), matching=BackendDAE.MATCHING(equationIndices, variableIndices,strongComponents))
}),"QSS")
equation
Debug.trace("Generating QSS solver code\n");
qssInfo = BackendQSS.generateStructureCodeQSS(outIndexedBackendDAE, equationIndices, variableIndices, incidenceMatrix, incidenceMatrixT, strongComponents);
Tpl.tplNoret2(SimCodeQSS.translateModel, simCode, qssInfo);
then ();
case (simCode,_,"c")
equation
Tpl.tplNoret(SimCodeC.translateModel, simCode);
Tpl.tplNoret2(CodegenQSS.translateModel, simCode, qssInfo);
then ();
case (simCode,_,"C")
equation
Expand Down Expand Up @@ -1182,10 +1176,6 @@ algorithm
BackendDAE.StrongComponents strongComponents;
String str;

case (simCode,"c")
equation
Tpl.tplNoret(SimCodeFMU.translateModel, simCode);
then ();
case (simCode,"C")
equation
Tpl.tplNoret(CodegenFMU.translateModel, simCode);
Expand Down
10 changes: 4 additions & 6 deletions Compiler/Makefile.common
Expand Up @@ -131,14 +131,12 @@ Global.mo
TEMPLATE = \
CodegenC.mo \
CodegenFMU.mo \
CodegenAdevs.mo \
CodegenQSS.mo \
CodegenCpp.mo \
CodegenCSharp.mo \
SCodeDumpTpl.mo \
SimCodeC.mo \
SimCodeCSharp.mo \
SimCodeDump.mo \
SimCodeQSS.mo \
SimCodeAdevs.mo \
SimCodeCpp.mo \
SimCodeFMU.mo \
Tpl.mo \
TplAbsyn.mo \
TplCodegen.mo \
Expand Down
10 changes: 6 additions & 4 deletions Compiler/runtime/Makefile.common
Expand Up @@ -11,6 +11,8 @@ builddir_lib=$(top_builddir)/build/lib
builddir_inc=$(top_builddir)/build/include
builddir_doc=$(top_builddir)/build/doc

SimRuntimeCDir = $(top_builddir)/SimulationRuntime/c/util/

ifndef OMDEV
configUnix = config.unix.h
else
Expand Down Expand Up @@ -51,8 +53,8 @@ omc_communication.h: omc_communication_impl.cpp corbaimpl.cpp
omc_communication_impl.o: omc_communication.h
Corba_rml.o: omc_communication.h corbaimpl.cpp
Corba_omc.o: omc_communication.h corbaimpl.cpp
Dynload_rml.o: systemimpl.h errorext.h ../Absyn.h ../Values.h ../../c_runtime/read_write.h ../../c_runtime/memory_pool.h Dynload.cpp
Dynload_omc.o: systemimpl.h errorext.h ../OpenModelicaBootstrappingHeader.h ../../c_runtime/read_write.h ../../c_runtime/memory_pool.h Dynload.cpp $(RML_COMPAT)
Dynload_rml.o: systemimpl.h errorext.h ../Absyn.h ../Values.h $(SimRuntimeCDir)/read_write.h $(SimRuntimeCDir)/memory_pool.h Dynload.cpp
Dynload_omc.o: systemimpl.h errorext.h ../OpenModelicaBootstrappingHeader.h $(SimRuntimeCDir)/read_write.h $(SimRuntimeCDir)/memory_pool.h Dynload.cpp $(RML_COMPAT)
Database_rml.o: Database.c Database_rml.c
Database_omc.o: Database.c Database_omc.c
Print_rml.o : printimpl.c
Expand All @@ -73,8 +75,8 @@ BackendDAEEXT_rml.o : BackendDAEEXT.cpp
BackendDAEEXT_omc.o : BackendDAEEXT.cpp $(RML_COMPAT)
Socket_rml.o : socketimpl.c
Socket_omc.o : socketimpl.c
SimulationResults_rml.o : SimulationResults.c SimulationResultsCmp.c errorext.h ../../c_runtime/read_matlab4.h
SimulationResults_omc.o : SimulationResults.c SimulationResultsCmp.c errorext.h ../../c_runtime/read_matlab4.h
SimulationResults_rml.o : SimulationResults.c SimulationResultsCmp.c errorext.h $(SimRuntimeCDir)/read_matlab4.h
SimulationResults_omc.o : SimulationResults.c SimulationResultsCmp.c errorext.h $(SimRuntimeCDir)/read_matlab4.h
ptolemyio_rml.o : ptolemyio.cpp errorext.h
ptolemyio_omc.o : ptolemyio.cpp errorext.h $(RML_COMPAT)
ErrorMessage.o : ErrorMessage.cpp ErrorMessage.hpp
Expand Down
2 changes: 1 addition & 1 deletion Compiler/runtime/Makefile.vc
Expand Up @@ -5,7 +5,7 @@ USE_CORBA = /DUSE_CORBA
CORBAHOME = $(OMDEV)
RMLINCLUDE = $(OMDEV)tools\\rml\\include\\plain

INCLUDES = $(INCP) /I. /I $(OMDEV)\tools\rml\include\plain /I..\..\c_runtime /I..\..\c_runtime\superlu\include /I..\ /I$(OMDEV)\include\mico-win32-msvc /Ilpsolve
INCLUDES = $(INCP) /I. /I $(OMDEV)\tools\rml\include\plain /I..\..\SimulationRuntime\c\ /I..\ /I$(OMDEV)\include\mico-win32-msvc /Ilpsolve

CFLAGS = /O2 /Ot $(INCLUDES) /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" /FD /EHsc /MT /GS- /W2 /c /TC
CXXFLAGS = /O2 /Ot $(INCLUDES) /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" /FD /EHsc /MT /GS- /W2 /c /TP
Expand Down
Expand Up @@ -43,7 +43,7 @@
// - Code after a case should be indented with 2 spaces if not written on the
// same line

package SimCodeAdevs
package CodegenAdevs
import interface SimCodeTV;

template translateModel(SimCode simCode)
Expand Down Expand Up @@ -5289,5 +5289,5 @@ let() = Tpl.addSourceTemplateError(errMessage, srcInfo)
>>
end error;

end SimCodeAdevs;
end CodegenAdevs;

@@ -1,6 +1,6 @@
// This file defines templates for transforming Modelica code to C# code.

package SimCodeCSharp
package CodegenCSharp

import interface SimCodeTV;

Expand Down Expand Up @@ -2281,7 +2281,7 @@ end error;
//for completeness; although the error() template above is preferable
template errorMsg(String errMessage)
"Example template error reporting template
that is reporting only the error message without the usage of source infotmation."
that is reporting only the error message without the usage of source information."
::=
let() = Tpl.addTemplateError(errMessage)
<<
Expand All @@ -2291,5 +2291,5 @@ let() = Tpl.addTemplateError(errMessage)
end errorMsg;


end SimCodeCSharp;
end CodegenCSharp;
// vim: filetype=susan sw=2 sts=2
@@ -1,4 +1,4 @@
package SimCodeCpp
package CodegenCpp

import interface SimCodeTV;

Expand Down Expand Up @@ -6199,4 +6199,4 @@ then
>>
end setVariables;

end SimCodeCpp;
end CodegenCpp;

0 comments on commit f904157

Please sign in to comment.