Commit 01aeaf3c authored by Hernan Ponce de Leon's avatar Hernan Ponce de Leon
Browse files

Merge branch '3598' into 'master'

3598

See merge request af3/af3!143
parents 35631b2d 269e3d6f
AF3z3Activator.java e9ff1932a62e74d66260edab2132501a327f08b6 GREEN
Z3Type.java 73e319ae206d2fd456ec9430c01b5ff7fc7282d0 GREEN
Z3javaAPIWrapper.java d836f387a7b911f736643d3358679741b7fb2f10 GREEN
Z3javaAPIWrapper.java d21fa89f50dd9afe49eaad0901384bdf99df548f GREEN
......@@ -163,6 +163,11 @@ public class Z3javaAPIWrapper {
return context.mkEq(expr, context.mkInt(arg));
}
/** Returns a {@link BoolExpr}: <i>expr == arg</i>. */
public static BoolExpr createEqual(Context context, Expr expr, long arg) throws Z3Exception {
return context.mkEq(expr, context.mkInt(arg));
}
/** Returns a {@link BoolExpr}: <i>expr == arg</i>. */
public static BoolExpr createEqual(Context context, Expr expr, boolean arg) throws Z3Exception {
return context.mkEq(expr, context.mkBool(arg));
......
AllocationModelElementFactory.java 1790fc35d560cdf74ac1900c0d289e58900a0c32 GREEN
AllocationUtils.java 53a4c74cc34c989adec115c0e855698a933756bb GREEN
AllocationUtils.java c5d804fc26e9b2664af32e3eb3b9379dd10f9802 GREEN
......@@ -21,16 +21,20 @@ import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.cre
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationTableCollection;
import static org.fortiss.af3.project.utils.ProjectUtils.getFileProject;
import static org.fortiss.tooling.common.util.LambdaUtils.asStream;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copyToRefMap;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getEClassForClass;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.computeFullyQualifiedName;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getRootElements;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.fixMissingIDs;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.eclipse.emf.common.util.BasicEList;
......@@ -53,6 +57,7 @@ import org.fortiss.tooling.base.annotation.AnnotationEntry;
import org.fortiss.tooling.base.annotation.IAnnotationValueService;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.kernel.model.IIdLabeled;
import org.fortiss.tooling.kernel.model.INamedElement;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
......@@ -678,4 +683,78 @@ public class AllocationUtils {
return rvalOpt.isPresent() ? rvalOpt.get() : null;
}
/**
* Helper for {@link #cloneView(AllocationTable, boolean, boolean)} that creates the copy of the
* original view.
*/
private static Map<EObject, EObject> cloneView(IProjectRootElement view) {
Map<EObject, EObject> refMap = copyToRefMap(view);
IProjectRootElement viewCopy = (IProjectRootElement)refMap.get(view);
FileProject fileProject = getParentElement(view, FileProject.class, false);
fileProject.getRootElements().add(viewCopy);
viewCopy.setId(0);
asStream(viewCopy.eAllContents()).forEach(e -> {
if(e instanceof IIdLabeled) {
((IIdLabeled)e).setId(0);
}
});
fixMissingIDs(viewCopy, fileProject);
return refMap;
}
/**
* Clones the source and/or target view of the given {@link AllocationTable} and retargets it to
* the cloned elements. I.e., after the operation, the {@link AllocationTable} points to the
* cloned view(s), and its entries reference the cloned elements.
*/
public static void cloneView(AllocationTable at, boolean cloneSource, boolean cloneTarget) {
Map<EObject, EObject> sourceRefMap;
if(cloneSource) {
IProjectRootElement sourceView = at.getSourceView();
sourceRefMap = cloneView(sourceView);
at.setSourceView((IProjectRootElement)sourceRefMap.get(sourceView));
} else {
sourceRefMap = null;
}
Map<EObject, EObject> targetRefMap;
if(cloneTarget) {
IProjectRootElement targetView = at.getTargetView();
targetRefMap = cloneView(targetView);
at.setTargetView((IProjectRootElement)targetRefMap.get(targetView));
} else {
targetRefMap = null;
}
for(AllocationEntry entry : at.getAllocationEntries()) {
if(entry instanceof OneToOneAllocationEntry) {
OneToOneAllocationEntry o2o = (OneToOneAllocationEntry)entry;
if(sourceRefMap != null) {
o2o.setSourceElement((IModelElement)sourceRefMap.get(o2o.getSourceElement()));
}
if(targetRefMap != null) {
o2o.setTargetElement((IModelElement)targetRefMap.get(o2o.getTargetElement()));
}
} else if(entry instanceof OneToManyAllocationEntry) {
OneToManyAllocationEntry o2m = (OneToManyAllocationEntry)entry;
if(sourceRefMap != null) {
o2m.setSourceElement((IModelElement)sourceRefMap.get(o2m.getSourceElement()));
}
if(targetRefMap != null) {
o2m.getTargetElements().replaceAll(e -> (IModelElement)targetRefMap.get(e));
}
} else if(entry instanceof ManyToOneAllocationEntry) {
ManyToOneAllocationEntry o2m = (ManyToOneAllocationEntry)entry;
if(sourceRefMap != null) {
o2m.getSourceElements().replaceAll(e -> (IModelElement)sourceRefMap.get(e));
}
if(targetRefMap != null) {
o2m.setTargetElement((IModelElement)targetRefMap.get(o2m.getTargetElement()));
}
}
}
}
}
......@@ -16,7 +16,6 @@ Require-Bundle: org.fortiss.af3.allocation;visibility:=reexport,
org.fortiss.pragmatictransformation,
org.fortiss.af3.tools
Export-Package: org.fortiss.af3.component;uses:="org.osgi.framework,org.eclipse.core.runtime",
org.fortiss.af3.component.annotation.valueprovider,
org.fortiss.af3.component.compose,
org.fortiss.af3.component.constraint;
uses:="org.eclipse.emf.ecore,
......
component.ecore 17894992fca8d79a7fb4b2b8379a965cff73ccea RED
component.ecore 53e9021aab7ee4a7331e1ef3d2eb4bc2e30afe7e GREEN
......@@ -372,7 +372,7 @@
nsPrefix="org-fortiss-af3-component-annotation">
<eClassifiers xsi:type="ecore:EClass" name="MemoryRequirement" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IAnnotatedSpecification platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IHiddenSpecification">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Annotation that returns the (estimated) memory requirement of a component, i.e. the sum of its local memory requirement + the memory requirements of its children."/>
<details key="documentation" value="@deprecated Annotation that returns the (estimated) memory requirement of a component, i.e. the sum of its local memory requirement + the memory requirements of its children."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="localMemoryRequirement"
lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
......
......@@ -305,12 +305,6 @@
</modelElementCompositor>
</extension>
<extension point="org.fortiss.tooling.base.annotation">
<annotation binding="org.fortiss.af3.component.annotation.valueprovider.MemoryRequirementValueProvider">
<modelElementClass modelElementClass="org.fortiss.af3.component.model.Component"/>
</annotation>
</extension>
<extension
point="org.fortiss.tooling.kernel.modelElementCompositor">
<modelElementCompositor
......
MemoryRequirementValueProvider.java 0f56a62c8913b9b0dd5ab20f5c0da24c36748cf4 GREEN
......@@ -5,7 +5,7 @@ ConstraintDefinitionUtils.java f110a4a216905d2236324ae459d789d50114e25c GREEN
ConstraintToNonQuantifiedSMT.java de0e8a7000e26d745b62a27f8c2482e7a7737add GREEN
ConstraintToQuantifiedSMT.java c84e799c69195fe80a2e66a39d0192325b06c7fd GREEN
DSMLTransformationService.java b2e90e11e36346d01c79c18f16ffc62f66f35888 GREEN
DSMLtoSMTTransformator.java a201b15a23aa2eb0dc73f6324981f50f0d523534 GREEN
DSMLtoSMTTransformator.java 7a03c75f6d7baba392fee2c0f900fb7726854d72 GREEN
DeploScheduleRun.java d074d157250deba431d8f34d13d6464fd27f8acb GREEN
DeploymentRun.java 67d240b1f02f906748811acad9ced9dd71e7cb56 GREEN
IDSMLTransformationService.java f56241d2dff68a69cd1fe09c119d615f74088650 GREEN
......
......@@ -43,10 +43,7 @@ import javax.activation.UnsupportedDataTypeException;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.Enumerator;
import org.fortiss.af3.component.model.annotation.MemoryRequirement;
import org.fortiss.af3.deployment.model.VirtualLink;
import org.fortiss.af3.efficientdeployment.model.Flash;
import org.fortiss.af3.efficientdeployment.model.RAM;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.IArithmeticExpression;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.ModelElementPropertyLiteral;
import org.fortiss.af3.exploration.dsl_v2.model.booleanp.ForAll;
......@@ -68,15 +65,18 @@ import org.fortiss.af3.exploration.smt.model.SMTObjective;
import org.fortiss.af3.platform.hierarchic.model.annotation.FailureRate;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.TransmissionUnit;
import org.fortiss.af3.platform.model.annotation.FlashSize;
import org.fortiss.af3.platform.model.annotation.HardwareCost;
import org.fortiss.af3.platform.model.annotation.MemoryPerNode;
import org.fortiss.af3.platform.model.annotation.PowerConsumption;
import org.fortiss.af3.platform.model.annotation.RamSize;
import org.fortiss.af3.safety.model.annotation.SafetyIntegrityLevel;
import org.fortiss.af3.schedule.model.PeriodicTimeTrigger;
import org.fortiss.af3.schedule.model.ResourceAllocation;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.allocation.TaskToExecutionUnitAllocationEntry;
import org.fortiss.af3.task.model.annotation.FlashRequirement;
import org.fortiss.af3.task.model.annotation.RamRequirement;
import org.fortiss.af3.timing.model.annotation.TransmissionUnitBandwidth;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IModelElement;
......@@ -461,13 +461,7 @@ public class DSMLtoSMTTransformator {
annotation = getAnnotation(parameterProvider, specType);
}
Expr valueExpr = null;
if(annotation instanceof MemoryRequirement) {
Long value = ((MemoryRequirement)annotation).getLocalMemoryRequirement();
valueExpr = createInteger(context, value);
} else if(annotation instanceof MemoryPerNode) {
int memory = ((MemoryPerNode)annotation).getMemory();
valueExpr = createInteger(context, memory);
} else if(annotation instanceof SafetyIntegrityLevel) {
if(annotation instanceof SafetyIntegrityLevel) {
Enumerator value = ((SafetyIntegrityLevel)annotation).getValue();
valueExpr = createInteger(context, value.getValue());
} else if(annotation instanceof HardwareCost) {
......@@ -479,14 +473,20 @@ public class DSMLtoSMTTransformator {
} else if(annotation instanceof TransmissionUnitBandwidth) {
double value = ((TransmissionUnitBandwidth)annotation).getBandwidth_MBitS();
valueExpr = createReal(context, Double.toString(value));
} else if(annotation instanceof Flash) {
int value = ((Flash)annotation).getMemory();
} else if(annotation instanceof FlashSize) {
long value = ((FlashSize)annotation).getBytes();
valueExpr = createInteger(context, value);
} else if(annotation instanceof RamSize) {
long value = ((RamSize)annotation).getBytes();
valueExpr = createInteger(context, value);
} else if(annotation instanceof FlashRequirement) {
long value = ((FlashRequirement)annotation).getBytes();
valueExpr = createInteger(context, value);
} else if(annotation instanceof RAM) {
int value = ((RAM)annotation).getMemory();
} else if(annotation instanceof RamRequirement) {
long value = ((RamRequirement)annotation).getBytes();
valueExpr = createInteger(context, value);
} else if(annotation instanceof FailureRate) {
Double value = ((FailureRate)annotation).getFailureRate_FIT();
double value = ((FailureRate)annotation).getFailureRate_FIT();
valueExpr = createReal(context, Double.toString(value));
}
......
......@@ -26,7 +26,6 @@ import javax.activation.UnsupportedDataTypeException;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.component.model.annotation.MemoryRequirement;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.ArithmeticFactory;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.ArithmeticLiteral;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.Minus;
......@@ -51,9 +50,10 @@ import org.fortiss.af3.exploration.smt.modeltransformation.DSMLTransformationSer
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.annotation.HardwareCost;
import org.fortiss.af3.platform.model.annotation.MemoryPerNode;
import org.fortiss.af3.platform.model.annotation.RamSize;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.af3.task.model.annotation.RamRequirement;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.utils.AnnotationUtils;
import org.fortiss.tooling.kernel.model.INamedElement;
......@@ -186,8 +186,7 @@ public class DSLtoSMT2Test {
set1.getEntries().add(c);
objectivePredicateSet.getEntries().add(c);
// component memory constraints
MemoryRequirement annotation =
AnnotationUtils.getAnnotation(c, MemoryRequirement.class);
RamRequirement annotation = AnnotationUtils.getAnnotation(c, RamRequirement.class);
//
// Expr createFunction =
// Z3javaAPIWrapper.createFunction(context, "Component_" + c.getId() +
......@@ -207,8 +206,7 @@ public class DSLtoSMT2Test {
}
}
BoolExpr boolExpr = Z3javaAPIWrapper.createEqual(context, apply,
(int)annotation.getLocalMemoryRequirement());
BoolExpr boolExpr = Z3javaAPIWrapper.createEqual(context, apply, annotation.getBytes());
solver.Add(boolExpr);
//
// ArrayList<Expr> allocs = new ArrayList<>();
......@@ -285,7 +283,7 @@ public class DSLtoSMT2Test {
set2.getEntries().add(e);
objectiveSumSet.getEntries().add(e);
// ecu memory constraints
MemoryPerNode annotation = AnnotationUtils.getAnnotation(e, MemoryPerNode.class);
RamSize annotation = AnnotationUtils.getAnnotation(e, RamSize.class);
FuncDecl createFunction = Z3javaAPIWrapper.createFunction(context,
"f_" + "MemoryRequirement" + "_value", sort2, context.mkIntSort());
Expr apply = null;
......@@ -341,7 +339,7 @@ public class DSLtoSMT2Test {
ModelElementPropertyLiteral propertyLiteral =
ArithmeticFactory.eINSTANCE.createModelElementPropertyLiteral();
propertyLiteral.setSetReference(set1);
propertyLiteral.setSpecificationType(MemoryRequirement.class);
propertyLiteral.setSpecificationType(RamRequirement.class);
ArithmeticLiteral arithmeticLiteral = ArithmeticFactory.eINSTANCE.createArithmeticLiteral();
arithmeticLiteral.setValue(new BigDecimal(10));
minus.setLeft(propertyLiteral);
......@@ -352,7 +350,7 @@ public class DSLtoSMT2Test {
ModelElementPropertyLiteral elementPropertyLiteral2 =
ArithmeticFactory.eINSTANCE.createModelElementPropertyLiteral();
elementPropertyLiteral2.setSetReference(set2);
elementPropertyLiteral2.setSpecificationType(MemoryRequirement.class);
elementPropertyLiteral2.setSpecificationType(RamRequirement.class);
LessEqual lq = ComparisonFactory.eINSTANCE.createLessEqual();
lq.setLeft(sum);
lq.setRight(elementPropertyLiteral2);
......@@ -416,15 +414,14 @@ public class DSLtoSMT2Test {
set1.getEntries().add(c);
objectivePredicateSet.getEntries().add(c);
// component memory constraints
MemoryRequirement annotation =
AnnotationUtils.getAnnotation(c, MemoryRequirement.class);
RamRequirement annotation = AnnotationUtils.getAnnotation(c, RamRequirement.class);
Expr createFunction = Z3javaAPIWrapper.createFunction(context,
"Component_" + c.getId() + "_MemoryRequirement", Z3Type.INT);
// TODO Check: Test used to be based on the accumulated memory requirement which has
// been removed in the frame of #2964.
BoolExpr boolExpr = Z3javaAPIWrapper.createEqual(context, createFunction,
(int)annotation.getLocalMemoryRequirement());
BoolExpr boolExpr =
Z3javaAPIWrapper.createEqual(context, createFunction, annotation.getBytes());
// solver.Add(boolExpr);
ArrayList<Expr> allocs = new ArrayList<>();
......@@ -481,7 +478,7 @@ public class DSLtoSMT2Test {
set2.getEntries().add(e);
objectiveSumSet.getEntries().add(e);
// ecu memory constraints
MemoryPerNode annotation = AnnotationUtils.getAnnotation(e, MemoryPerNode.class);
RamSize annotation = AnnotationUtils.getAnnotation(e, RamSize.class);
FuncDecl createFunction = Z3javaAPIWrapper.createFunction(context,
"f_" + "MemoryRequirement" + "_value", sort, context.mkIntSort());
Expr apply = null;
......@@ -491,8 +488,7 @@ public class DSLtoSMT2Test {
}
}
BoolExpr boolExpr =
Z3javaAPIWrapper.createEqual(context, apply, annotation.getMemory());
BoolExpr boolExpr = Z3javaAPIWrapper.createEqual(context, apply, annotation.getBytes());
solver.Add(boolExpr);
// objectives
......@@ -525,7 +521,7 @@ public class DSLtoSMT2Test {
ModelElementPropertyLiteral propertyLiteral =
ArithmeticFactory.eINSTANCE.createModelElementPropertyLiteral();
propertyLiteral.setSetReference(set1);
propertyLiteral.setSpecificationType(MemoryRequirement.class);
propertyLiteral.setSpecificationType(RamRequirement.class);
ArithmeticLiteral arithmeticLiteral = ArithmeticFactory.eINSTANCE.createArithmeticLiteral();
arithmeticLiteral.setValue(new BigDecimal(10));
minus.setLeft(propertyLiteral);
......@@ -536,7 +532,7 @@ public class DSLtoSMT2Test {
ModelElementPropertyLiteral elementPropertyLiteral2 =
ArithmeticFactory.eINSTANCE.createModelElementPropertyLiteral();
elementPropertyLiteral2.setSetReference(set2);
elementPropertyLiteral2.setSpecificationType(MemoryRequirement.class);
elementPropertyLiteral2.setSpecificationType(RamRequirement.class);
LessEqual lq = ComparisonFactory.eINSTANCE.createLessEqual();
lq.setLeft(arithmeticLiteral);
lq.setRight(elementPropertyLiteral2);
......
......@@ -39,7 +39,6 @@ import org.fortiss.af3.allocation.model.AllocationTableCollection;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.deployment.model.VirtualLink;
import org.fortiss.af3.efficientdeployment.model.Flash;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.ArithmeticFactory;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.IArithmeticExpression;
import org.fortiss.af3.exploration.dsl_v2.model.arithmetic.ModelElementPropertyLiteral;
......@@ -69,6 +68,7 @@ import org.fortiss.af3.exploration.util.DSEProjectModelElementFactory;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.TransmissionUnit;
import org.fortiss.af3.platform.model.annotation.FlashSize;
import org.fortiss.af3.task.model.Signal;
import org.fortiss.af3.task.model.Task;
import org.fortiss.af3.task.model.TaskArchitecture;
......@@ -284,7 +284,7 @@ public class GenerateTestBundles {
List<TestBundle> results = new ArrayList<>();
RuleSet ruleSet = DSEProjectModelElementFactory.createRuleSet();
incrementIDcounter1000andFixIDs(bundle, ruleSet);
SMTConstraint t = createDeploymentMemoryConstraint(Flash.class, bundle);
SMTConstraint t = createDeploymentMemoryConstraint(FlashSize.class, bundle);
incrementIDcounter1000andFixIDs(bundle, t);
ruleSet.setImplicit(false);
ruleSet.setName(GenerationProperties.FLASH_RULE_SET_NAME);
......
......@@ -25,7 +25,6 @@ import java.util.Optional;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.efficientdeployment.model.Flash;
import org.fortiss.af3.exploration.dsl_v2.model.booleanp.allocation.Allocation;
import org.fortiss.af3.exploration.dsl_v2.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.ExplorationSpecification;
......@@ -37,6 +36,7 @@ import org.fortiss.af3.exploration.projectmodel.DSE;
import org.fortiss.af3.exploration.projectmodel.RuleSet;
import org.fortiss.af3.exploration.smt.modeltransformation.DeploymentRun;
import org.fortiss.af3.exploration.util.ExplorationUtils;
import org.fortiss.af3.platform.model.annotation.FlashSize;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.af3.task.model.Task;
......@@ -112,13 +112,14 @@ public class GenericTest {
int flashSum = 0;
for(IModelElement task : a.getSourceElements()) {
for(Component comp : ca2ta.getComponents((Task)task)) {
Flash annotation = AnnotationUtils.getAnnotation(comp, Flash.class);
flashSum += annotation.getMemory();
FlashSize annotation =
AnnotationUtils.getAnnotation(comp, FlashSize.class);
flashSum += annotation.getBytes();
}
}
Flash ecuAnnotation =
AnnotationUtils.getAnnotation(a.getTargetElement(), Flash.class);
boolean actual = flashSum <= ecuAnnotation.getMemory();
FlashSize ecuAnnotation =
AnnotationUtils.getAnnotation(a.getTargetElement(), FlashSize.class);
boolean actual = flashSum <= ecuAnnotation.getBytes();
Assert.assertEquals("Flash of ECU " +
((INamedElement)a.getTargetElement()).getName() + " is exceeded.", true,
......
......@@ -22,13 +22,13 @@ import java.util.List;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.efficientdeployment.model.DSEModelFactory;
import org.fortiss.af3.efficientdeployment.model.Flash;
import org.fortiss.af3.efficientdeployment.model.RAM;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.ASIL_DISTRIBUTION_SW_HW;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.FLASH_DISTRIBUTION_SW;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.RAM_DISTRIBUTION_SW;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.UsedGenerationProperties;
import org.fortiss.af3.platform.model.annotation.AF3PlatformAnnotationFactory;
import org.fortiss.af3.platform.model.annotation.FlashSize;
import org.fortiss.af3.platform.model.annotation.RamSize;
import org.fortiss.af3.safety.model.ASIL;
import org.fortiss.af3.safety.model.SafetyStandard;
import org.fortiss.af3.safety.model.annotation.SafetyAnnotationFactory;
......@@ -205,8 +205,8 @@ public class LogArchAnnotationGeneration {
* @param i
*/
private void setFlash(Component comp, int i) {
Flash rom = DSEModelFactory.eINSTANCE.createFlash();
rom.setMemory(i);
FlashSize rom = AF3PlatformAnnotationFactory.eINSTANCE.createFlashSize();
rom.setBytes(i);
comp.addSpecification(rom);
}
......@@ -215,8 +215,8 @@ public class LogArchAnnotationGeneration {
* @param i
*/
private void setRAM(Component comp, int i) {
RAM ram = DSEModelFactory.eINSTANCE.createRAM();
ram.setMemory(i);
RamSize ram = AF3PlatformAnnotationFactory.eINSTANCE.createRamSize();
ram.setBytes(i);
comp.addSpecification(ram);
}
......
......@@ -21,15 +21,15 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.efficientdeployment.model.DSEModelFactory;
import org.fortiss.af3.efficientdeployment.model.Flash;
import org.fortiss.af3.efficientdeployment.model.RAM;
import org.fortiss.af3.exploration.smt.AF3ExplorationSMTActivator;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.FLASH_DISTRIBUTION_HW;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.RAM_DISTRIBUTION_HW;
import org.fortiss.af3.exploration.ui.featuretest.GenerationProperties.UsedGenerationProperties;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.annotation.AF3PlatformAnnotationFactory;
import org.fortiss.af3.platform.model.annotation.FlashSize;
import org.fortiss.af3.platform.model.annotation.RamSize;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
......@@ -148,12 +148,12 @@ public class TechArchTopologyGeneration {
*/
private void setRAM(IHierarchicElement comp, int i) {
List<IModelElementSpecification> list =
LambdaUtils.filterList(comp.getSpecifications(), s -> s instanceof RAM);
LambdaUtils.filterList(comp.getSpecifications(), s -> s instanceof RamSize);
if(list.size() == 1) {
((RAM)list.get(0)).setMemory(i);
((RamSize)list.get(0)).setBytes(i);
} else {
RAM ram = DSEModelFactory.eINSTANCE.createRAM();
ram.setMemory(i);
RamSize ram = AF3PlatformAnnotationFactory.eINSTANCE.createRamSize();
ram.setBytes(i);
comp.addSpecification(ram);
}
}
......@@ -164,12 +164,12 @@ public class TechArchTopologyGeneration {
*/
private void setFlash(IHierarchicElement comp, int i) {
List<IModelElementSpecification> list =
LambdaUtils.filterList(comp.getSpecifications(), s -> s instanceof Flash);
LambdaUtils.filterList(comp.getSpecifications(), s -> s instanceof FlashSize);
if(list.size() == 1) {
((Flash)list.get(0)).setMemory(i);
((FlashSize)list.get(0)).setBytes(i);
} else {
Flash ram = DSEModelFactory.eINSTANCE.createFlash();
ram.setMemory(i);
FlashSize ram = AF3PlatformAnnotationFactory.eINSTANCE.createFlashSize();
ram.setBytes(i);
comp.addSpecification(ram);
}
}
......
AllocationPatternCompositeBackend.java afd6f4373b2f6fda3a99d1c3d2ba7c296a877567 GREEN
ConstraintPatternHeader.java 8a4d00fa9831bc762ab6eeebf764a0b01a14bee8 RED
ConstraintViewBackend.java a0119b1199b3b34a4a736935608ff638a23e9c1a RED
ConstraintViewBackend.java 7600f81a5a08a2fbb586189fc3bb269b09b5e914 GREEN
FunctionCouplingCompositeBackend.java 0bdfcf5b127ab06893638b4f3c09d87f97e1decb YELLOW
MemoryPatternBackend.java bad317a40a06784eb23e77c884ffb6516af8d2d2 RED
MemoryPatternBackend.java 886d69513d2c6237696184b9bf5fb1cfaadfa943 GREEN
SafetyPatternBackend.java 262de8fe2277f6e55e0936c9631cccf53c794b1c RED
......@@ -18,12 +18,12 @@ package org.fortiss.af3.exploration.ui.perspective.constraint;
import java.util.List;
import org.eclipse.swt.widgets.Composite;
import org.fortiss.af3.component.model.annotation.MemoryRequirement;
import org.fortiss.af3.exploration.ui.perspective.generic.ConstraintObjectiveViewBase;
import org.fortiss.af3.exploration.ui.perspective.process.IProcessManager.EProcessStep;
import org.fortiss.af3.exploration.ui.perspective.service.IExternalDSEExtensionService;
import org.fortiss.af3.exploration.ui.perspective.service.IExternalDSEExtensionService.PatternStruct;
import org.fortiss.af3.platform.model.annotation.MemoryPerNode;
import org.fortiss.af3.platform.model.annotation.RamSize;
import org.fortiss.af3.task.model.annotation.RamRequirement;
/**
* Backend implementation the addition of constraints. All constraint patterns are added here to the
......@@ -46,7 +46,7 @@ public class ConstraintViewBackend extends ConstraintObjectiveViewBase {
addNewPatternSection("Function Coupling Pattern", FunctionCouplingCompositeBackend.class);
addNewPatternSection("Safety Pattern", SafetyPatternBackend.class);
addNewUtilizationPatternSection("Memory Pattern", MemoryPatternBackend.class,
MemoryRequirement.class, MemoryPerNode.class);
RamRequirement.class, RamSize.class