CppGenerator.xtend 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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 = make_shared<string>(*resourceLocation);
  286. path->append(string("«fmuTypeName».fmu"));
  287. auto «fmuName»Fmu = make_shared<fmi2::Fmu>(*path);
  288. «fmuName»Fmu->initialize();
  289. this->«fmuName» = «fmuName»Fmu->instantiate("«fmuName»",fmi2CoSimulation, "«guid»", true, true, shared_from_this());
  290. if(this->«fmuName»->component == NULL)
  291. this->lastErrorState = fmi2Fatal;
  292. this->instances->push_back(this->«fmuName»);
  293. }
  294. «adapClassName»::~«adapClassName»()
  295. {
  296. }
  297. ''';
  298. }
  299. /*
  300. * Compiles the source file function getRuleThis
  301. */
  302. def String compileGetRuleThis(String adaptationName) {
  303. return '''
  304. «adaptationName»* «adaptationName»::getRuleThis()
  305. {
  306. return this;
  307. }
  308. '''
  309. }
  310. /*
  311. * Compiles the source file functions getFmiValue<double, int, string, bool>
  312. */
  313. def String compileGetFmiValueFunctions(String adaptationName, LinkedHashMap<String, SAScalarVariable> variables) {
  314. var ArrayList<String> cpp = newArrayList();
  315. var List<ScalarVariable> convertedSASVs = variables.values.map[CalcSVar()].toList;
  316. var convertedSASVsOrdered = convertedSASVs.filter[causality === SVCausality.output].groupBy[type];
  317. for (SVType type : SVType.values) {
  318. val functionSignature = '''«Conversions.fmiTypeToCppType(type)» «adaptationName»::getFmiValue«type.toString»(fmi2ValueReference id)''';
  319. val functionReturn = '''return «Conversions.fmiTypeToCppDefaultValue(type)»''';
  320. if (convertedSASVsOrdered.containsKey(type)) {
  321. cpp.add(
  322. '''
  323. «functionSignature»
  324. {
  325. switch (id)
  326. {
  327. «FOR svInner : convertedSASVsOrdered.get(type)»
  328. case «variables.get(svInner.name).defineName»:
  329. {
  330. return this->«svInner.name»;
  331. }
  332. «ENDFOR»
  333. default:
  334. {
  335. «functionReturn»;
  336. }
  337. }
  338. }
  339. '''
  340. );
  341. } else {
  342. cpp.add(
  343. '''
  344. «functionSignature»
  345. {
  346. «functionReturn»;
  347. }
  348. '''
  349. );
  350. }
  351. }
  352. return cpp.join("\n");
  353. }
  354. /*
  355. * Compiles the source file functions setFmiValue<double, int, string, bool>*
  356. */
  357. def String compileSetFmiValueFunctions(String adapClassName, LinkedHashMap<String, SAScalarVariable> variables) {
  358. var ArrayList<String> cpp = newArrayList();
  359. var List<ScalarVariable> convertedSASVs = variables.values.map[CalcSVar()].filter [
  360. causality === SVCausality.input
  361. ].toList;
  362. var convertedSASVsOrdered = convertedSASVs.groupBy[type];
  363. for (SVType type : SVType.values) {
  364. cpp.add(
  365. '''
  366. void «adapClassName»::setFmiValue(fmi2ValueReference id, «Conversions.fmiTypeToCppType(type)» value)
  367. {
  368. «IF convertedSASVsOrdered.containsKey(type)»
  369. switch (id)
  370. {
  371. «FOR svInner : convertedSASVsOrdered.get(type)»
  372. case «variables.get(svInner.name).defineName»:
  373. {
  374. this->«svInner.name» = value;
  375. this->isSet«svInner.name» = true;
  376. break;
  377. }
  378. «ENDFOR»
  379. default:
  380. {
  381. }
  382. }
  383. «ENDIF»
  384. }
  385. '''
  386. );
  387. }
  388. return cpp.join("\n");
  389. }
  390. /*
  391. * Compiles the source file function executeInternalControlFlow.
  392. * Calculates necessary information on function signatures necessary for generation of the header file.
  393. */
  394. def RulesBlockResult compileControlRuleBlock(Iterable<ControlRuleBlock> crtlRuleBlocks, String adaptationClassName,
  395. String adaptationName, LinkedHashMap<String, SAScalarVariable> SASVs) {
  396. var cpp = "";
  397. val visitor = new ControlConditionSwitch(adaptationClassName, adaptationName, SASVs);
  398. for (crtlRule : crtlRuleBlocks) {
  399. cpp += visitor.doSwitch(crtlRule).code;
  400. }
  401. return new RulesBlockResult(cpp, visitor.functionSignatures);
  402. }
  403. def String SplitAtSpaceAndRemoveFirst(String content) {
  404. content.substring(content.indexOf(" ") + 1, content.length);
  405. }
  406. def String removeEmptyArgumentParenthesis(String content) {
  407. return content.substring(0, content.length - 2);
  408. }
  409. /*
  410. * Compiles the source file functions <in/out>_rule_<condition, body, flush>.
  411. * Calculates necessary information on global in/out variables necessary for generation of the header file.
  412. * Calculates necessary information on function signatures necessary for generation of the header file.
  413. */
  414. def InOutRulesBlockResult compileInOutRuleBlocks(InputOutputType ioType, Iterable<InOutRules> rulesBlocks,
  415. String adaptationClassName, String adaptationName,
  416. LinkedHashMap<String, LinkedHashMap<String, MappedScalarVariable>> mSVars,
  417. LinkedHashMap<String, SAScalarVariable> SASVs, LinkedHashMap<String, GlobalInOutVariable> params) {
  418. val visitor = if (ioType == InputOutputType.Input)
  419. new InRulesConditionSwitch(adaptationClassName, adaptationName, mSVars, SASVs, params)
  420. else
  421. new OutRulesConditionSwitch(adaptationClassName, adaptationName, mSVars, SASVs, params);
  422. val functionName = "create" + ioType + "Rules()";
  423. var String cpp = "";
  424. val ruleBlock = rulesBlocks.head;
  425. if (ruleBlock !== null) {
  426. cpp += visitor.doSwitch(ruleBlock).code;
  427. if (!visitor.functionSignatures.empty) {
  428. var ArrayList<String> createRulesFunction = newArrayList();
  429. for (var int i = 0; i < (visitor.functionSignatures.length); i += 3) {
  430. createRulesFunction.add(
  431. '''
  432. list->push_back(
  433. (Rule<«adaptationClassName»>){
  434. &«adaptationClassName»::«visitor.functionSignatures.get(i).SplitAtSpaceAndRemoveFirst.removeEmptyArgumentParenthesis»,
  435. &«adaptationClassName»::«visitor.functionSignatures.get(i+1).SplitAtSpaceAndRemoveFirst.removeEmptyArgumentParenthesis»,
  436. &«adaptationClassName»::«visitor.functionSignatures.get(i+2).SplitAtSpaceAndRemoveFirst.removeEmptyArgumentParenthesis»
  437. });
  438. ''');
  439. }
  440. val functionPrefix = '''shared_ptr<list<Rule<«adaptationClassName»>>>''';
  441. visitor.functionSignatures.add(functionPrefix + " " + functionName)
  442. cpp += '''
  443. «functionPrefix» «adaptationClassName»::«functionName»
  444. {
  445. auto list = make_shared<std::list<Rule<«adaptationClassName»>>>();
  446. «createRulesFunction.join("\n")»
  447. return list;
  448. }
  449. '''
  450. }
  451. }
  452. return new InOutRulesBlockResult(cpp, visitor.functionSignatures, visitor.getGlobalVars,
  453. visitor.constructorInitialization);
  454. }
  455. /*
  456. * Calculates the semantic adaptation scalar variables via input ports and output ports.
  457. * Note: These a not fully populated yet as the in rules and out rules must be compiled first.
  458. */
  459. def LinkedHashMap<String, SAScalarVariable> calcSASVsFromInportsOutports(String definePrefix, EList<Port> inports,
  460. EList<Port> outports) {
  461. var LinkedHashMap<String, SAScalarVariable> saSVs = newLinkedHashMap();
  462. var int valueReference = 0;
  463. for (inport : inports) {
  464. var saSV = new SAScalarVariable();
  465. saSV.SetPartOfMD(true);
  466. saSV.valueReference = valueReference++;
  467. saSV.name = inport.name;
  468. saSV.defineName = (definePrefix + inport.name).toUpperCase
  469. saSV.causality = SVCausality.input;
  470. saSVs.put(saSV.name, saSV);
  471. }
  472. for (outport : outports) {
  473. var saSV = new SAScalarVariable();
  474. saSV.SetPartOfMD(true);
  475. saSV.valueReference = valueReference++;
  476. saSV.defineName = (definePrefix + outport.name).toUpperCase
  477. saSV.name = outport.name;
  478. saSV.causality = SVCausality.output;
  479. saSVs.put(saSV.name, saSV);
  480. }
  481. return saSVs;
  482. }
  483. def List<File> getResourcePaths() {
  484. return resourcePaths;
  485. }
  486. }