CppGenerator.xtend 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. package be.uantwerpen.ansymo.semanticadaptation.cg.cpp.generation
  2. import be.uantwerpen.ansymo.semanticadaptation.generator.SemanticAdaptationGenerator
  3. import org.eclipse.xtext.generator.IFileSystemAccess2
  4. import org.eclipse.xtext.generator.IGeneratorContext
  5. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.SemanticAdaptation
  6. import org.eclipse.emf.ecore.resource.Resource
  7. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Adaptation
  8. import java.util.ArrayList
  9. import java.util.LinkedHashMap
  10. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.MappedScalarVariable
  11. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.InnerFMU
  12. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.exceptions.IncorrectAmountOfElementsException
  13. import java.io.File
  14. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.SAScalarVariable
  15. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.InputOutputType
  16. import org.eclipse.emf.common.util.EList
  17. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.Port
  18. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.SVCausality
  19. import java.util.Collection
  20. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.InOutRules
  21. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.InRulesBlock
  22. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.InOutRulesBlockResult
  23. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.OutRulesBlock
  24. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.GlobalInOutVariable
  25. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.ControlRuleBlock
  26. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.RulesBlockResult
  27. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.ScalarVariable
  28. import java.util.List
  29. import be.uantwerpen.ansymo.semanticadaptation.cg.cpp.data.SVType
  30. import be.uantwerpen.ansymo.semanticadaptation.semanticAdaptation.ParamDeclarations
  31. class CppGenerator extends SemanticAdaptationGenerator {
  32. private var IFileSystemAccess2 fsa;
  33. private List<File> resourcePaths = newArrayList();
  34. override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
  35. this.fsa = fsa;
  36. for (SemanticAdaptation type : resource.allContents.toIterable.filter(SemanticAdaptation)) {
  37. type.compile;
  38. }
  39. }
  40. // TODO: Verify adaptation.name is not a C++ keyword
  41. def void compile(SemanticAdaptation adaptation) {
  42. for (Adaptation adap : adaptation.elements.filter(Adaptation)) {
  43. // Value used for scoping variables in the .sa file
  44. val adapInteralRefName = adap.name;
  45. // The CPP class name
  46. val adapClassName = adap.name.toFirstUpper;
  47. // This is the external name used in the model description file for the semantic adaptation FMU.
  48. val adapExternalName = adap.type.name;
  49. // List of FMUs with a pairing between its name and its type.name.
  50. var ArrayList<Pair<String, String>> fmus = newArrayList();
  51. // TODO: Currently only 1 inner fmu is supported
  52. val innerFmus = adap.inner.eAllContents.toList.filter(InnerFMU);
  53. if (innerFmus.size > 1) {
  54. throw new IncorrectAmountOfElementsException("Only one InnerFmu is supported.")
  55. }
  56. if (innerFmus.isEmpty) {
  57. throw new IncorrectAmountOfElementsException("The adaptation does not contain any InnerFMUs.")
  58. }
  59. /*
  60. * This map will contain scalar variables from the FMUs defined in InnerFMU.
  61. * The structure is fmuName -> (SVName -> mappedSV) where SVName = mappedSV.name for easy lookup.
  62. * The mappedSV contains the original scalar variable and extra data such as define name.
  63. */
  64. var LinkedHashMap<String, LinkedHashMap<String, MappedScalarVariable>> mappedScalarVariables = newLinkedHashMap();
  65. /*
  66. * Loading the FMU defined in InnerFMU, the related model description file and its scalar variables.
  67. */
  68. // TODO: Add support for multiple inner fmus
  69. var ModelDescription md;
  70. for (fmu : adap.inner.eAllContents.toList.filter(InnerFMU)) {
  71. val fmuFile = new File(fmu.path.replace('\"', ''));
  72. this.resourcePaths.add(fmuFile);
  73. md = new ModelDescription(fmu.name, fmu.type.name, fmuFile);
  74. fmus.add(fmu.name -> fmu.type.name);
  75. val LinkedHashMap<String, MappedScalarVariable> mSV = newLinkedHashMap();
  76. for (sv : md.sv.values) {
  77. var mappedSv = new MappedScalarVariable(sv);
  78. mappedSv.define = (mappedSv.mappedSv.owner + mappedSv.mappedSv.name).toUpperCase;
  79. mSV.put(mappedSv.mappedSv.name, mappedSv);
  80. }
  81. mappedScalarVariables.put(fmu.name, mSV);
  82. }
  83. // C++ Defines for accessing FMU scalar variables.
  84. val String fmusDefines = calcDefines(mappedScalarVariables);
  85. // Compile Params
  86. var LinkedHashMap<String, GlobalInOutVariable> params = newLinkedHashMap;
  87. val String paramsConstructorSource = compileParams(params, adap.params);
  88. /*
  89. * This map contains all the ScalarVariables for the semantic adaptation.
  90. * The are not populated yet, but they will be during the compilation of the in and out rule blocks.
  91. */
  92. var LinkedHashMap<String, SAScalarVariable> SASVs = calcSASVsFromInportsOutports(adapInteralRefName,
  93. adap.inports, adap.outports)
  94. // C++ defines for accessing semantic adaptation scalar variables
  95. val String SADefines = calcSADefines(SASVs.values);
  96. // Compile the transparent in mappings
  97. // Compile the in rules
  98. val inRuleResult = compileInOutRuleBlocks(InputOutputType.Input, adaptation.eAllContents.toIterable.filter(
  99. InRulesBlock).map[x|x as InOutRules], adapClassName, adapInteralRefName, mappedScalarVariables, SASVs,
  100. params);
  101. // Compile the out rules
  102. val outRuleResult = compileInOutRuleBlocks(InputOutputType.Output, adaptation.eAllContents.toIterable.
  103. filter(OutRulesBlock).map[x|x as InOutRules], adapClassName, adapInteralRefName, mappedScalarVariables,
  104. SASVs, params);
  105. // Compile the Control Rules
  106. val crtlRuleResult = compileControlRuleBlock(adaptation.eAllContents.toIterable.filter(ControlRuleBlock),
  107. adapClassName, adapInteralRefName, SASVs);
  108. /*
  109. * Compile the constructor, destructor and initialize functions
  110. */
  111. val String deAndConstructorAndInitializeSource = compileDeAndConstructorAndInitialize(
  112. adapClassName,
  113. fmus.head.key,
  114. fmus.head.value,
  115. md.guid,
  116. paramsConstructorSource,
  117. inRuleResult.constructorInitialization,
  118. outRuleResult.constructorInitialization
  119. );
  120. /*
  121. * Compile getRuleThis function
  122. */
  123. val String getRuleThisSource = compileGetRuleThis(adapClassName);
  124. /*
  125. * The in and out rules have populated the semantic adaptation scalar variables we can generate the getFmiValue* and setFmiValue functions.
  126. */
  127. val String getFuncsSource = compileGetFmiValueFunctions(adapClassName, SASVs);
  128. val String setFuncsSource = compileSetFmiValueFunctions(adapClassName, SASVs);
  129. // Compile the source file
  130. val String sourceInclude = '''#include "«adapClassName».h"''';
  131. val sourceFile = compileSource(
  132. sourceInclude,
  133. deAndConstructorAndInitializeSource,
  134. getRuleThisSource,
  135. getFuncsSource,
  136. setFuncsSource,
  137. inRuleResult.generatedCpp,
  138. outRuleResult.generatedCpp,
  139. crtlRuleResult.generatedCpp
  140. );
  141. fsa.generateFile(adapClassName + ".cpp", sourceFile);
  142. // Merge the global variables for use in compiling the header file.
  143. // TODO: Check for duplicates
  144. var LinkedHashMap<String, GlobalInOutVariable> allGVars = newLinkedHashMap();
  145. allGVars.putAll(params);
  146. allGVars.putAll(outRuleResult.gVars);
  147. allGVars.putAll(inRuleResult.gVars);
  148. // Compile the header file
  149. val headerFile = compileHeader(
  150. adapClassName,
  151. fmusDefines,
  152. SADefines,
  153. inRuleResult.functionSignatures,
  154. outRuleResult.functionSignatures,
  155. crtlRuleResult.functionSignatures,
  156. allGVars,
  157. fmus,
  158. SASVs.values.map[CalcSVar()].toList
  159. );
  160. fsa.generateFile(adapClassName + ".h", headerFile);
  161. // Compile the model description file
  162. val modelDescCreator = new ModelDescriptionCreator(adapExternalName);
  163. val modelDescription = modelDescCreator.generateModelDescription(SASVs.values);
  164. fsa.generateFile("modelDescription.xml", modelDescription);
  165. // Compile the fmu.cpp file
  166. val fmuCppFile = StaticGenerators.GenFmuCppFile(adapClassName);
  167. fsa.generateFile("Fmu.cpp", fmuCppFile);
  168. }
  169. }
  170. def String compileParams(LinkedHashMap<String, GlobalInOutVariable> gVars, EList<ParamDeclarations> params) {
  171. val paramsConditionSwitch = new ParamConditionSwitch(gVars);
  172. var String paramsConstructorSource = "";
  173. for (paramDecl : params) {
  174. val doSwitchRes = paramsConditionSwitch.doSwitch(paramDecl);
  175. paramsConstructorSource += doSwitchRes.code;
  176. }
  177. return paramsConstructorSource;
  178. }
  179. def calcSADefines(Collection<SAScalarVariable> variables) {
  180. var ArrayList<String> defines = newArrayList();
  181. for (SASV : variables) {
  182. defines.add("#define " + SASV.defineName + " " + SASV.valueReference);
  183. }
  184. return defines.join("\n");
  185. }
  186. def calcDefines(LinkedHashMap<String, LinkedHashMap<String, MappedScalarVariable>> map) {
  187. var ArrayList<String> defines = newArrayList();
  188. for (fmuEntries : map.entrySet) {
  189. for (MappedScalarVariable mSV : fmuEntries.value.values) {
  190. defines.add("#define " + mSV.define + " " + mSV.valueReference);
  191. }
  192. }
  193. return defines.join("\n");
  194. }
  195. // Compiles the final source file
  196. def String compileSource(String include, String constructor, String getRuleThis, String getFunctions,
  197. String setFunctions, String inFunctions, String outFunctions, String controlFunction) {
  198. return '''
  199. «include»
  200. namespace adaptation
  201. {
  202. «constructor»
  203. «getRuleThis»
  204. «getFunctions»
  205. «setFunctions»
  206. «inFunctions»
  207. «controlFunction»
  208. «outFunctions»
  209. }
  210. '''
  211. }
  212. /*
  213. * Compiles the header file split into two: The first part contains the includes and using namespace definitions and start the ,
  214. * the second part contains the class
  215. */
  216. def String compileHeader(String adapClassName, String fmusDefines, String SADefines, List<String> inRulesFuncSig,
  217. List<String> outRulesFuncSig, List<String> crtlRulesFuncSig,
  218. LinkedHashMap<String, GlobalInOutVariable> globalVariables, ArrayList<Pair<String, String>> fmus,
  219. Collection<ScalarVariable> sVars) {
  220. return '''
  221. #ifndef SRC_«adapClassName.toUpperCase»_H
  222. #define SRC_«adapClassName.toUpperCase»_H
  223. #include "SemanticAdaptation.h"
  224. #include <memory>
  225. #include "Fmu.h"
  226. using namespace std;
  227. using namespace fmi2;
  228. namespace adaptation
  229. {
  230. «fmusDefines»
  231. «SADefines»
  232. class «adapClassName» : public SemanticAdaptation<«adapClassName»>, public enable_shared_from_this<«adapClassName»>
  233. {
  234. public:
  235. «adapClassName»(shared_ptr<string> resourceLocation, const fmi2CallbackFunctions* functions);
  236. void initialize();
  237. virtual ~«adapClassName»();
  238. void setFmiValue(fmi2ValueReference id, int value);
  239. void setFmiValue(fmi2ValueReference id, bool value);
  240. void setFmiValue(fmi2ValueReference id, double value);
  241. void setFmiValue(fmi2ValueReference id, string value);
  242. int getFmiValueInteger(fmi2ValueReference id);
  243. bool getFmiValueBoolean(fmi2ValueReference id);
  244. double getFmiValueReal(fmi2ValueReference id);
  245. string getFmiValueString(fmi2ValueReference id);
  246. private:
  247. «adapClassName»* getRuleThis();
  248. /*in rules*/
  249. «inRulesFuncSig.map[x | x+";"].join("\n")»
  250. /*out rules*/
  251. «outRulesFuncSig.map[x | x+";"].join("\n")»
  252. «crtlRulesFuncSig.map[x | x+";"].join("\n")»
  253. «FOR fmu : fmus»
  254. shared_ptr<FmuComponent> «fmu.key»;
  255. «ENDFOR»
  256. «FOR sv : sVars»
  257. «Conversions.fmiTypeToCppType(sv.type)» «sv.name»;
  258. «IF sv.causality == SVCausality.input»
  259. bool isSet«sv.name»;
  260. «ENDIF»
  261. «ENDFOR»
  262. «FOR v : globalVariables.entrySet»
  263. «Conversions.fmiTypeToCppType(v.value.type)» «v.key»;
  264. «ENDFOR»
  265. };
  266. }
  267. #endif
  268. ''';
  269. }
  270. /*
  271. * Compiles the source file constructor, destructor and the initialize function
  272. */
  273. def String compileDeAndConstructorAndInitialize(String adapClassName, String fmuName, String fmuTypeName,
  274. String guid, String paramsCons, String inCons, String outCons) {
  275. return '''
  276. «adapClassName»::«adapClassName»(shared_ptr<string> resourceLocation, const fmi2CallbackFunctions* functions) :
  277. SemanticAdaptation(resourceLocation, createInputRules(),createOutputRules(), functions)
  278. {
  279. «paramsCons»
  280. «inCons»
  281. «outCons»
  282. }
  283. void «adapClassName»::initialize()
  284. {
  285. auto path = Fmu::combinePath(resourceLocation, make_shared<string>("«fmuTypeName».fmu"));
  286. auto «fmuName»Fmu = make_shared<fmi2::Fmu>(*path);
  287. «fmuName»Fmu->initialize();
  288. this->«fmuName» = «fmuName»Fmu->instantiate("«fmuName»",fmi2CoSimulation, "«guid»", true, true, shared_from_this());
  289. if(this->«fmuName»->component == NULL)
  290. this->lastErrorState = fmi2Fatal;
  291. this->instances->push_back(this->«fmuName»);
  292. }
  293. «adapClassName»::~«adapClassName»()
  294. {
  295. }
  296. ''';
  297. }
  298. /*
  299. * Compiles the source file function getRuleThis
  300. */
  301. def String compileGetRuleThis(String adaptationName) {
  302. return '''
  303. «adaptationName»* «adaptationName»::getRuleThis()
  304. {
  305. return this;
  306. }
  307. '''
  308. }
  309. /*
  310. * Compiles the source file functions getFmiValue<double, int, string, bool>
  311. */
  312. def String compileGetFmiValueFunctions(String adaptationName, LinkedHashMap<String, SAScalarVariable> variables) {
  313. var ArrayList<String> cpp = newArrayList();
  314. var List<ScalarVariable> convertedSASVs = variables.values.map[CalcSVar()].toList;
  315. var convertedSASVsOrdered = convertedSASVs.filter[causality === SVCausality.output].groupBy[type];
  316. for (SVType type : SVType.values) {
  317. val functionSignature = '''«Conversions.fmiTypeToCppType(type)» «adaptationName»::getFmiValue«type.toString»(fmi2ValueReference id)''';
  318. val functionReturn = '''return «Conversions.fmiTypeToCppDefaultValue(type)»''';
  319. if (convertedSASVsOrdered.containsKey(type)) {
  320. cpp.add(
  321. '''
  322. «functionSignature»
  323. {
  324. switch (id)
  325. {
  326. «FOR svInner : convertedSASVsOrdered.get(type)»
  327. case «variables.get(svInner.name).defineName»:
  328. {
  329. return this->«svInner.name»;
  330. }
  331. «ENDFOR»
  332. default:
  333. {
  334. «functionReturn»;
  335. }
  336. }
  337. }
  338. '''
  339. );
  340. } else {
  341. cpp.add(
  342. '''
  343. «functionSignature»
  344. {
  345. «functionReturn»;
  346. }
  347. '''
  348. );
  349. }
  350. }
  351. return cpp.join("\n");
  352. }
  353. /*
  354. * Compiles the source file functions setFmiValue<double, int, string, bool>*
  355. */
  356. def String compileSetFmiValueFunctions(String adapClassName, LinkedHashMap<String, SAScalarVariable> variables) {
  357. var ArrayList<String> cpp = newArrayList();
  358. var List<ScalarVariable> convertedSASVs = variables.values.map[CalcSVar()].filter [
  359. causality === SVCausality.input
  360. ].toList;
  361. var convertedSASVsOrdered = convertedSASVs.groupBy[type];
  362. for (SVType type : SVType.values) {
  363. cpp.add(
  364. '''
  365. void «adapClassName»::setFmiValue(fmi2ValueReference id, «Conversions.fmiTypeToCppType(type)» value)
  366. {
  367. «IF convertedSASVsOrdered.containsKey(type)»
  368. switch (id)
  369. {
  370. «FOR svInner : convertedSASVsOrdered.get(type)»
  371. case «variables.get(svInner.name).defineName»:
  372. {
  373. this->«svInner.name» = value;
  374. this->isSet«svInner.name» = true;
  375. break;
  376. }
  377. «ENDFOR»
  378. default:
  379. {
  380. }
  381. }
  382. «ENDIF»
  383. }
  384. '''
  385. );
  386. }
  387. return cpp.join("\n");
  388. }
  389. /*
  390. * Compiles the source file function executeInternalControlFlow.
  391. * Calculates necessary information on function signatures necessary for generation of the header file.
  392. */
  393. def RulesBlockResult compileControlRuleBlock(Iterable<ControlRuleBlock> crtlRuleBlocks, String adaptationClassName,
  394. String adaptationName, LinkedHashMap<String, SAScalarVariable> SASVs) {
  395. var cpp = "";
  396. val visitor = new ControlConditionSwitch(adaptationClassName, adaptationName, SASVs);
  397. for (crtlRule : crtlRuleBlocks) {
  398. cpp += visitor.doSwitch(crtlRule).code;
  399. }
  400. return new RulesBlockResult(cpp, visitor.functionSignatures);
  401. }
  402. def String SplitAtSpaceAndRemoveFirst(String content) {
  403. content.substring(content.indexOf(" ") + 1, content.length);
  404. }
  405. def String removeEmptyArgumentParenthesis(String content) {
  406. return content.substring(0, content.length - 2);
  407. }
  408. /*
  409. * Compiles the source file functions <in/out>_rule_<condition, body, flush>.
  410. * Calculates necessary information on global in/out variables necessary for generation of the header file.
  411. * Calculates necessary information on function signatures necessary for generation of the header file.
  412. */
  413. def InOutRulesBlockResult compileInOutRuleBlocks(InputOutputType ioType, Iterable<InOutRules> rulesBlocks,
  414. String adaptationClassName, String adaptationName,
  415. LinkedHashMap<String, LinkedHashMap<String, MappedScalarVariable>> mSVars,
  416. LinkedHashMap<String, SAScalarVariable> SASVs, LinkedHashMap<String, GlobalInOutVariable> params) {
  417. val visitor = if (ioType == InputOutputType.Input)
  418. new InRulesConditionSwitch(adaptationClassName, adaptationName, mSVars, SASVs, params)
  419. else
  420. new OutRulesConditionSwitch(adaptationClassName, adaptationName, mSVars, SASVs, params);
  421. val functionName = "create" + ioType + "Rules()";
  422. var String cpp = "";
  423. val ruleBlock = rulesBlocks.head;
  424. if (ruleBlock !== null) {
  425. cpp += visitor.doSwitch(ruleBlock).code;
  426. if (!visitor.functionSignatures.empty) {
  427. var ArrayList<String> createRulesFunction = newArrayList();
  428. for (var int i = 0; i < (visitor.functionSignatures.length); i += 3) {
  429. createRulesFunction.add(
  430. '''
  431. list->push_back(
  432. (Rule<«adaptationClassName»>){
  433. &«adaptationClassName»::«visitor.functionSignatures.get(i).SplitAtSpaceAndRemoveFirst.removeEmptyArgumentParenthesis»,
  434. &«adaptationClassName»::«visitor.functionSignatures.get(i+1).SplitAtSpaceAndRemoveFirst.removeEmptyArgumentParenthesis»,
  435. &«adaptationClassName»::«visitor.functionSignatures.get(i+2).SplitAtSpaceAndRemoveFirst.removeEmptyArgumentParenthesis»
  436. });
  437. ''');
  438. }
  439. val functionPrefix = '''shared_ptr<list<Rule<«adaptationClassName»>>>''';
  440. visitor.functionSignatures.add(functionPrefix + " " + functionName)
  441. cpp += '''
  442. «functionPrefix» «adaptationClassName»::«functionName»
  443. {
  444. auto list = make_shared<std::list<Rule<«adaptationClassName»>>>();
  445. «createRulesFunction.join("\n")»
  446. return list;
  447. }
  448. '''
  449. }
  450. }
  451. return new InOutRulesBlockResult(cpp, visitor.functionSignatures, visitor.getGlobalVars,
  452. visitor.constructorInitialization);
  453. }
  454. /*
  455. * Calculates the semantic adaptation scalar variables via input ports and output ports.
  456. * Note: These a not fully populated yet as the in rules and out rules must be compiled first.
  457. */
  458. def LinkedHashMap<String, SAScalarVariable> calcSASVsFromInportsOutports(String definePrefix, EList<Port> inports,
  459. EList<Port> outports) {
  460. var LinkedHashMap<String, SAScalarVariable> saSVs = newLinkedHashMap();
  461. var int valueReference = 0;
  462. for (inport : inports) {
  463. var saSV = new SAScalarVariable();
  464. saSV.SetPartOfMD(true);
  465. saSV.valueReference = valueReference++;
  466. saSV.name = inport.name;
  467. saSV.defineName = (definePrefix + inport.name).toUpperCase
  468. saSV.causality = SVCausality.input;
  469. saSVs.put(saSV.name, saSV);
  470. }
  471. for (outport : outports) {
  472. var saSV = new SAScalarVariable();
  473. saSV.SetPartOfMD(true);
  474. saSV.valueReference = valueReference++;
  475. saSV.defineName = (definePrefix + outport.name).toUpperCase
  476. saSV.name = outport.name;
  477. saSV.causality = SVCausality.output;
  478. saSVs.put(saSV.name, saSV);
  479. }
  480. return saSVs;
  481. }
  482. def List<File> getResourcePaths() {
  483. return resourcePaths;
  484. }
  485. }