Commit e2675b21 authored by Malte Heithoff's avatar Malte Heithoff

semantics

parent e07c9736
Pipeline #388078 failed with stage
in 1 minute and 12 seconds
......@@ -6,7 +6,9 @@ import de.monticore.lang.monticar.generator.cpp.GeneralHelperMethods;
/**
*/
public class ExecuteInstruction implements Instruction {
protected String EXECUTE_COMMAND = "execute";
String componentName;
String targetComponentName;
EMAMBluePrint bluePrint;
String threadName = null;
boolean canBeThreaded = false;
......@@ -21,6 +23,7 @@ public class ExecuteInstruction implements Instruction {
componentName = componentName.replaceFirst("\\_", "]");
}
this.componentName = GeneralHelperMethods.getTargetLanguageVariableInstanceName(componentName);
// this.targetComponentName = GeneralHelperMethods.getTargetLanguageQualifiedComponentName(this.componentName);
if (canBeThreaded)
this.threadName = "thread" + ++threadCounter;
}
......@@ -29,18 +32,10 @@ public class ExecuteInstruction implements Instruction {
return componentName;
}
public void setComponentName(String componentName) {
this.componentName = componentName;
}
public boolean isCanBeThreaded() {
public boolean canBeThreaded() {
return canBeThreaded;
}
public void setCanBeThreaded(boolean canBeThreaded) {
this.canBeThreaded = canBeThreaded;
}
public String getThreadName() {
return threadName;
}
......@@ -53,7 +48,7 @@ public class ExecuteInstruction implements Instruction {
String inst = componentName.substring(0, componentName.indexOf("["));
String id = componentName.substring(componentName.indexOf("[")+1, componentName.lastIndexOf("]"));
return String.format("if(__%s_connected[%s]){ executeDynamicConnects(&(%s)); %s}", inst, id,componentName, exec);
return String.format("if(__%s_connected[%s]){ " + EXECUTE_COMMAND + "DynamicConnects(&(%s)); %s}", inst, id,componentName, exec);
}
return exec;
......@@ -69,13 +64,13 @@ public class ExecuteInstruction implements Instruction {
//++threadCounter;
//OLD: result += "this->" + componentName + ".execute();});\n";
result += addConditionIfDynamic("this->"+componentName+".execute();");
result += addConditionIfDynamic("this->"+componentName+ "." + EXECUTE_COMMAND + "();");
result += "});\n";
return result;
}
return addConditionIfDynamic(componentName + ".execute();")+"\n";
return addConditionIfDynamic(componentName + "." + EXECUTE_COMMAND + "();")+"\n";
}
@Override
......
......@@ -85,6 +85,10 @@ public class Method {
instructions.add(instruction);
}
public void addInstructions(List<Instruction> instructions) {
this.instructions.addAll(instructions);
}
public void setInstructions(List<Instruction> instructions) {
this.instructions = instructions;
}
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator;
public class OutputInstruction extends ExecuteInstruction {
public OutputInstruction(String componentName, EMAMBluePrint bluePrint, boolean canBeThreaded) {
super(componentName, bluePrint, canBeThreaded);
EXECUTE_COMMAND = "output";
}
public OutputInstruction(ExecuteInstruction executeInstruction) {
this(executeInstruction.componentName, executeInstruction.bluePrint, executeInstruction.canBeThreaded);
}
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator;
public class UpdateInstruction extends ExecuteInstruction {
public UpdateInstruction(String componentName, EMAMBluePrint bluePrint, boolean canBeThreaded) {
super(componentName, bluePrint, canBeThreaded);
EXECUTE_COMMAND = "update";
}
public UpdateInstruction(ExecuteInstruction executeInstruction) {
this(executeInstruction.componentName, executeInstruction.bluePrint, executeInstruction.canBeThreaded);
}
}
......@@ -21,6 +21,7 @@ public class Variable {
public static String VARIABLE = "Variable";
public static String ORIGINPORT = "OriginPort";
public static String STATIC = "Static";
public static String CROSSCOMPONENT = "CrossComponent";
String name = "";
VariableType type = new VariableType();
......@@ -194,11 +195,14 @@ public class Variable {
}
public boolean isCrossComponentVariable() {
return name.contains(".");
return additionalInformation.contains(CROSSCOMPONENT);
}
public String getComponentName() {
return name.split("\\.")[0];
String[] split = name.split("\\.");
if (split.length >= 2)
return split[split.length - 2];
return "";
}
public void addDimensionalInformation(String dimension) {
......
......@@ -38,7 +38,7 @@ public class ExecutionOrderFixer {
for (Instruction instruction : newList) {
if (instruction.isExecuteInstruction()) {
ExecuteInstruction executeInstruction = (ExecuteInstruction) instruction;
if (executeInstruction.isCanBeThreaded()) {
if (executeInstruction.canBeThreaded()) {
joinInstructions.add(new TargetCodeInstruction(executeInstruction.getThreadName() + ".join();\n"));
}
}
......@@ -153,7 +153,8 @@ public class ExecutionOrderFixer {
return otherInstructions;
}
public static List<Instruction> getExecutionOrderInstructionsList(List<EMAComponentInstanceSymbol> exOrder, Map<String, List<Instruction>> map, EMAMBluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableSubComponents) {
public static List<Instruction> getExecutionOrderInstructionsList(List<EMAComponentInstanceSymbol> exOrder, Map<String,
List<Instruction>> map, EMAMBluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableSubComponents) {
List<Instruction> newList = new ArrayList<>();
for (EMAComponentInstanceSymbol instanceSymbol : exOrder) {
String namey = instanceSymbol.getName();
......
......@@ -59,4 +59,11 @@ public class GeneralHelperMethods {
return nameChanged;
}
public static String getTargetLanguageQualifiedComponentName(String componentName) {
if (!componentName.contains(".")) return componentName;
String[] parts = componentName.split("\\.");
if (parts.length <= 1) return componentName;
return String.join("->", parts);
}
}
......@@ -24,11 +24,15 @@ import de.monticore.lang.monticar.generator.cpp.mathopt.MathOptSolverConfig;
import de.monticore.lang.monticar.generator.cpp.template.AllTemplates;
import de.monticore.lang.monticar.generator.cpp.viewmodel.AutopilotAdapterDataModel;
import de.monticore.lang.monticar.generator.cpp.viewmodel.ServerWrapperViewModel;
import de.monticore.lang.monticar.generator.order.ImplementExecutionOrder;
import de.monticore.lang.monticar.generator.testing.StreamTestGenerator;
import de.monticore.lang.monticar.semantics.ExecutionSemantics;
import de.monticore.lang.monticar.semantics.helper.Find;
import de.monticore.lang.monticar.semantics.helper.NameHelper;
import de.monticore.lang.monticar.semantics.loops.detection.ConnectionHelper;
import de.monticore.lang.monticar.semantics.loops.symbols.EMAEquationSystem;
import de.monticore.lang.monticar.semantics.loops.symbols.LoopComponentSymbolInstance;
import de.monticore.lang.monticar.semantics.loops.symbols.LoopComponentInstanceSymbol;
import de.monticore.lang.monticar.semantics.loops.symbols.LoopComponentInstanceSymbol;
import de.monticore.lang.monticar.semantics.resolve.SymbolTableHelper;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
......@@ -161,7 +165,8 @@ public class GeneratorCPP implements EMAMGenerator {
this.generationTargetPath = newPath;
}
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol) {
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol,
MathStatementsSymbol mathStatementsSymbol) {
StreamTestGenerator streamTestGenerator = new StreamTestGenerator();//only used when creating streamTestsForAComponent
LanguageUnitCPP languageUnitCPP = new LanguageUnitCPP();
languageUnitCPP.setGeneratorCPP(this);
......@@ -184,41 +189,38 @@ public class GeneratorCPP implements EMAMGenerator {
if (componentSymbol.equals(this.rootModel) && ExecutionStepperHelper.isUsed()) {
Optional<Method> execute = bluePrintCPP.getMethod("execute");
if (!execute.isPresent()) Log.error("TODO should not happen, bc ExecutionStepper is used");
else {
execute.get().getInstructions().add(new Instruction() {
@Override
public String getTargetLanguageInstruction() {
return "advanceTime();\n";
}
execute.get().getInstructions().add(new Instruction() {
@Override
public String getTargetLanguageInstruction() {
return "advanceTime();\n";
}
@Override
public boolean isConnectInstruction() {
return false;
}
});
bluePrintCPP.addAdditionalIncludeString(ExecutionStepperHelper.FILENAME);
}
@Override
public boolean isConnectInstruction() {
return false;
}
});
bluePrintCPP.addAdditionalIncludeString(ExecutionStepperHelper.FILENAME);
}
// connect information to eqs
if (componentSymbol instanceof LoopComponentSymbolInstance) {
if (componentSymbol instanceof LoopComponentInstanceSymbol) {
// connect information to eqs
ExecutionStepperHelper.setUsed();
EMAEquationSystem equationSystem = ((LoopComponentSymbolInstance) componentSymbol).getEquationSystem();
EMAEquationSystem equationSystem = ((LoopComponentInstanceSymbol) componentSymbol).getEquationSystem();
String eqsName = equationSystem.getName();
Variable eqs = new Variable("eqs", "");
eqs.setVariableType(new VariableType("", eqsName, eqsName));
bluePrintCPP.addVariable(eqs);
Optional<Method> execute = bluePrintCPP.getMethod("execute");
if (execute.isPresent()) {
for (EMAPortInstanceSymbol inport : equationSystem.getInports()) {
Optional<EMAPortInstanceSymbol> originalSourcePort = equationSystem.getAtomicSourceOf(inport);
for (EMAPortInstanceSymbol inport : equationSystem.getIncomingPorts()) {
Optional<EMAPortInstanceSymbol> originalSourcePort = equationSystem.getAtomicSourceOf(inport);
Optional<EMAPortInstanceSymbol> currentPort = componentSymbol.getIncomingPortInstances().stream()
.filter(i -> ConnectionHelper.sourceOf(i).equals(originalSourcePort))
.findFirst();
if (currentPort.isPresent()) {
String sourceName = currentPort.get().getName();
String targetName = String.join(".", "eqs",
String targetName = String.join(".", "eqs",
CPPEquationSystemHelper.getNameOfPort(inport));
Variable v1 = PortConverter.convertPortSymbolToVariable(currentPort.get(), sourceName, bluePrintCPP);
Variable v2 = PortConverter.convertPortSymbolToVariable(inport, targetName, bluePrintCPP);
......@@ -230,13 +232,14 @@ public class GeneratorCPP implements EMAMGenerator {
public String getTargetLanguageInstruction() {
return "eqs.execute();\n";
}
@Override
public boolean isConnectInstruction() {
return false;
}
});
for (EMAPortInstanceSymbol outport : componentSymbol.getOutgoingPortInstances()) {
Optional<EMAPortInstanceSymbol> eqsVar = equationSystem.getOutports().stream()
Optional<EMAPortInstanceSymbol> eqsVar = equationSystem.getOutgoingPorts().stream()
.filter(p -> p.getFullName().equals(outport.getFullName()))
.findFirst();
if (eqsVar.isPresent()) {
......@@ -272,14 +275,15 @@ public class GeneratorCPP implements EMAMGenerator {
//setGenerateMainClass(true);
}
if (componentInstanceSymbol instanceof LoopComponentSymbolInstance) {
((LoopComponentSymbolInstance) componentInstanceSymbol).getEquationSystem()
// ImplementExecutionOrder.exOrder(taggingResolver, componentInstanceSymbol);
if (componentInstanceSymbol instanceof LoopComponentInstanceSymbol) {
((LoopComponentInstanceSymbol) componentInstanceSymbol).getEquationSystem()
.setName(String.join("_",
NameHelper.replaceWithUnderScore(NameHelper.calculateFullQualifiedNameOf(rootModel)),
((LoopComponentSymbolInstance) componentInstanceSymbol).getEquationSystem().getName()));
for (CMakeFindModule dependency : OdeintOptions.getDependencies()) {
((LoopComponentInstanceSymbol) componentInstanceSymbol).getEquationSystem().getName()));
for (CMakeFindModule dependency : OdeintOptions.getDependencies())
cMakeConfig.addModuleDependency(dependency);
}
}
currentFileContentList = fileContents;
......@@ -342,10 +346,10 @@ public class GeneratorCPP implements EMAMGenerator {
}
if (componentInstanceSymbol instanceof LoopComponentSymbolInstance) {
if (!equationSystemsAlreadyBuild.contains(((LoopComponentSymbolInstance) componentInstanceSymbol).getEquationSystem())) {
if (componentInstanceSymbol instanceof LoopComponentInstanceSymbol) {
if (!equationSystemsAlreadyBuild.contains(((LoopComponentInstanceSymbol) componentInstanceSymbol).getEquationSystem())) {
fileContents.addAll(OdeintEquationSystemGenerator.generateEquationSystem(
((LoopComponentSymbolInstance) componentInstanceSymbol).getEquationSystem()));
((LoopComponentInstanceSymbol) componentInstanceSymbol).getEquationSystem()));
}
}
......@@ -355,6 +359,7 @@ public class GeneratorCPP implements EMAMGenerator {
//TODO add incremental generation based on described concept
public List<File> generateFiles(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol) throws IOException {
this.rootModel = componentSymbol;
List<FileContent> fileContents = new ArrayList<>();
if (componentSymbol == null) {
ComponentScanner componentScanner = new ComponentScanner(getModelsDirPath(), taggingResolver, "emam");
......@@ -365,10 +370,16 @@ public class GeneratorCPP implements EMAMGenerator {
EMAComponentInstanceSymbol.KIND).isPresent()) {
EMAComponentInstanceSymbol componentInstanceSymbol = (EMAComponentInstanceSymbol) taggingResolver.resolve(componentFullName,
EMAComponentInstanceSymbol.KIND).get();
ExecutionSemantics semantics = new ExecutionSemantics(taggingResolver, componentInstanceSymbol);
semantics.addExecutionSemantics();
fileContents.addAll(generateStrings(taggingResolver, componentInstanceSymbol));
}
}
} else {
ExecutionSemantics semantics = new ExecutionSemantics(taggingResolver, rootModel);
semantics.addExecutionSemantics();
searchForCVEverywhere(componentSymbol, taggingResolver);
fileContents = generateStrings(taggingResolver, componentSymbol);
}
......
......@@ -70,7 +70,7 @@ public class LanguageUnitCPP extends LanguageUnit {
}
public String getGeneratedHeader(TaggingResolver taggingResolver, EMAMBluePrintCPP bluePrint) {
ExecutionOrderFixer.fixExecutionOrder(taggingResolver, bluePrint, (GeneratorCPP) bluePrint.getGenerator());
// ExecutionOrderFixer.fixExecutionOrder(taggingResolver, bluePrint, (GeneratorCPP) bluePrint.getGenerator());
String resultString = "";
//guard defines
resultString += "#ifndef " + bluePrint.getName().toUpperCase() + "\n";
......
......@@ -110,25 +110,25 @@ public class OctaveBackend implements MathBackend {
@Override
public String getWholeNumberRowVectorTypeName() {
Log.warn("Octave does not support whole number matrices. Using real matrix instead!");
Log.info("Octave does not support whole number matrices. Using real matrix instead!", "Octave");
return getRowVectorTypeName();
}
@Override
public String getWholeNumberColumnVectorTypeName() {
Log.warn("Octave does not support whole number matrices. Using real matrix instead!");
Log.info("Octave does not support whole number matrices. Using real matrix instead!", "Octave");
return getColumnVectorTypeName();
}
@Override
public String getWholeNumberMatrixTypeName() {
Log.warn("Octave does not support whole number matrices. Using real matrix instead!");
Log.info("Octave does not support whole number matrices. Using real matrix instead!", "Octave");
return getMatrixTypeName();
}
@Override
public String getWholeNumberCubeTypeName() {
Log.warn("Octave does not support whole number matrices. Using real matrix instead!");
Log.info("Octave does not support whole number matrices. Using real matrix instead!", "Octave");
return getCubeTypeName();
}
......
......@@ -17,6 +17,7 @@ import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cpp.*;
import de.monticore.lang.monticar.generator.cpp.instruction.ConstantConnectInstructionCPP;
import de.monticore.lang.monticar.generator.optimization.MathInformationRegister;
import de.monticore.lang.monticar.semantics.executionOrder.ExecutionOrder;
import de.se_rwth.commons.logging.Log;
import java.util.*;
......@@ -96,8 +97,8 @@ public class ComponentConverter {
generateInitMethod(componentSymbol, bluePrint, generatorCPP, includeStrings);
//generate execute method
Method execute = ComponentConverterMethodGeneration.generateExecuteMethod(componentSymbol, bluePrint, mathStatementsSymbol, generatorCPP, includeStrings);
Method execute = ComponentConverterMethodGeneration.generateExecuteMethod(componentSymbol, bluePrint,
mathStatementsSymbol, generatorCPP, includeStrings);
EventConverter.generateEvents(execute, componentSymbol, bluePrint, mathStatementsSymbol,generatorCPP, includeStrings);
......@@ -121,6 +122,16 @@ public class ComponentConverter {
MathCommand.redefineArmaMat(bluePrint);
MathCommand.redefineInit(bluePrint);
}
// generate output and update
if (ExecutionOrder.needsOutputAndUpdateSplit(componentSymbol)) {
Method output = ComponentConverterMethodGeneration.generateOutputMethod(componentSymbol, bluePrint,
mathStatementsSymbol, generatorCPP, includeStrings);
Method update = ComponentConverterMethodGeneration.generateUpdateMethod(componentSymbol, bluePrint,
mathStatementsSymbol, generatorCPP, includeStrings);
}
return bluePrint;
}
......
<
......@@ -14,21 +14,32 @@ import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.instruction.ConnectInstructionCPP;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.monticar.generator.optimization.MathOptimizer;
import de.monticore.lang.monticar.semantics.executionOrder.SList;
import de.monticore.lang.monticar.semantics.executionOrder.SListEntry;
import de.monticore.lang.monticar.semantics.helper.Find;
import de.monticore.lang.monticar.semantics.helper.NameHelper;
import de.monticore.lang.monticar.semantics.loops.analyze.GenerateComponentFunction;
import de.monticore.lang.monticar.semantics.loops.detection.ConnectionHelper;
import de.monticore.lang.monticar.semantics.loops.graph.EMAAtomicConnectorInstance;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.*;
import static de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter.getNameOfOutput;
/**
*/
public class ComponentConverterMethodGeneration {
public static final String EXECUTE_METHOD_NAME = "execute";
public static final String OUTPUT_METHOD_NAME = "output";
public static final String UPDATE_METHOD_NAME = "update";
public static int currentGenerationIndex = 0;
public static EMAComponentInstanceSymbol currentComponentSymbol = null;
public static Method generateExecuteMethod(EMAComponentInstanceSymbol componentSymbol, EMAMBluePrintCPP bluePrint, MathStatementsSymbol mathStatementsSymbol, GeneratorCPP generatorCPP, List<String> includeStrings) {
public static Method generateExecuteMethod(EMAComponentInstanceSymbol componentSymbol, EMAMBluePrintCPP bluePrint,
MathStatementsSymbol mathStatementsSymbol, GeneratorCPP generatorCPP,
List<String> includeStrings) {
currentComponentSymbol = componentSymbol;
......@@ -57,24 +68,24 @@ public class ComponentConverterMethodGeneration {
}
}
*/
Method exMethod = new Method("execute", "void");
Method exMethod = new Method(EXECUTE_METHOD_NAME, "void");
generateExecuteMethodInner(exMethod,componentSymbol, bluePrint, mathStatementsSymbol, generatorCPP, includeStrings);
// bluePrint.addMethod(exMethod);
return exMethod;
}
protected static void generateExecuteMethodInner(Method method, EMAComponentInstanceSymbol componentSymbol, EMAMBluePrintCPP bluePrint, MathStatementsSymbol mathStatementsSymbol, GeneratorCPP generatorCPP, List<String> includeStrings){
Collection<EMAConnectorInstanceSymbol> connectors = componentSymbol.getConnectorInstances();
generateConnectors(connectors, bluePrint, method);
if (mathStatementsSymbol != null) {
protected static void generateExecuteMethodInner(Method method, EMAComponentInstanceSymbol componentSymbol,
EMAMBluePrintCPP bluePrint,
MathStatementsSymbol mathStatementsSymbol,
GeneratorCPP generatorCPP, List<String> includeStrings){
if (mathStatementsSymbol == null) {
// Collection<EMAConnectorInstanceSymbol> connectors = new HashSet<>();
// connectors.addAll(Find.allAtomicConnectors(componentSymbol));
// generateConnectors(connectors, bluePrint, method);
if (componentSymbol.isNonVirtual() || !componentSymbol.getParent().isPresent())
generateSListConnectors(Find.allAtomicConnectors(componentSymbol), bluePrint, method);
} else
handleMathStatementGeneration(method, bluePrint, mathStatementsSymbol, generatorCPP, includeStrings);
}
}
public static void generateConnectors(Collection<EMAConnectorInstanceSymbol> connectors, EMAMBluePrintCPP bluePrint, Method method){
......@@ -83,6 +94,11 @@ public class ComponentConverterMethodGeneration {
Log.info("source:" + connector.getSource() + " target:" + connector.getTarget(), "Port info:");
Variable v1 = PortConverter.getVariableForPortSymbol(connector, connector.getSource(), bluePrint);
Variable v2 = PortConverter.getVariableForPortSymbol(connector, connector.getTarget(), bluePrint);
if (!connector.getComponentInstance().getIncomingPortInstances().contains(connector.getSourcePort()))
v1.addAdditionalInformation(Variable.CROSSCOMPONENT);
if (!connector.getComponentInstance().getOutgoingPortInstances().contains(connector.getTargetPort()))
v2.addAdditionalInformation(Variable.CROSSCOMPONENT);
Log.info("v1: " + v1.getName() + " v2: " + v2.getName(), "Variable Info:");
Log.info("v1: " + v1.getNameTargetLanguageFormat() + " v2: " + v2.getNameTargetLanguageFormat(), "Variable Info:");
......@@ -114,10 +130,140 @@ public class ComponentConverterMethodGeneration {
}
}
public static void generateSListConnectors(Collection<EMAAtomicConnectorInstance> connectors,
EMAMBluePrintCPP bluePrint,
Method method) {
for (EMAPortInstanceSymbol inport : currentComponentSymbol.getIncomingPortInstances())
if (!inport.isConstant())
method.addInstructions(createTargetConnectors(bluePrint, inport));
generateConstantConnectors(connectors, bluePrint, method);
boolean useThreadingOptimizations = false;
if (bluePrint.getGenerator() instanceof GeneratorCPP
&& ((GeneratorCPP) bluePrint.getGenerator()).useThreadingOptimizations())
useThreadingOptimizations = true;
if (!useThreadingOptimizations)
generateComponentExecutionForNonThreadedSList(bluePrint, method);
else
generateComponentExecutionForThreadedSList(bluePrint, method);
}
private static void generateComponentExecutionForNonThreadedSList(EMAMBluePrintCPP bluePrint, Method method) {
List<SListEntry> slist = SList.sListAtomic(currentComponentSymbol);
generateComponentExecutionForSList(bluePrint, method, slist, false);
}
private static void generateComponentExecutionForThreadedSList(EMAMBluePrintCPP bluePrint, Method method) {
List<List<SListEntry>> slist = SList.sListParallel(currentComponentSymbol);
int lastIndex = 0;
for (List<SListEntry> sListEntries : slist) {
generateComponentExecutionForSList(bluePrint, method, sListEntries, true);
}
}
private static void generateComponentExecutionForSList(EMAMBluePrintCPP bluePrint, Method method,
List<SListEntry> sListEntries, boolean allCanBeThreaded) {
List<Instruction> newInstructions = new LinkedList<>();
for (SListEntry entry : sListEntries) {
entry.getComponent().getFullName();
String componentName = NameHelper.calculatePartialName(entry.getComponent(), currentComponentSymbol);
if (entry.isExecuteCall())
newInstructions.add(new ExecuteInstruction(componentName, bluePrint, allCanBeThreaded));
else if(entry.isOutputCall())
newInstructions.add(new OutputInstruction(componentName, bluePrint, allCanBeThreaded));
else if (entry.isUpdateCall())
newInstructions.add(new UpdateInstruction(componentName, bluePrint, allCanBeThreaded));
// if allCanBeThreaded delay after all are calculated
if (!allCanBeThreaded && (entry.isExecuteCall() || entry.isOutputCall())) {
for (EMAPortInstanceSymbol outport : entry.getComponent().getOutgoingPortInstances())
newInstructions.addAll(createTargetConnectors(bluePrint, outport));
}
}
if (allCanBeThreaded) {
List<Instruction> joinInstructions = new LinkedList<>();