| /** |
| ******************************************************************************** |
| * Copyright (c) 2015-2020 Robert Bosch GmbH and others. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * ******************************************************************************* |
| */ |
| |
| @GenModel( |
| modelName="Amalthea", prefix="Amalthea", |
| editDirectory="/org.eclipse.app4mc.amalthea.model.edit/src-gen", |
| editorDirectory="/org.eclipse.app4mc.amalthea.model.editor/src-gen", |
| rootExtendsClass="org.eclipse.app4mc.amalthea.sphinx.AmaltheaExtendedEObjectImpl", |
| providerRootExtendsClass="org.eclipse.app4mc.amalthea.sphinx.AmaltheaExtendedItemProviderAdapter", |
| creationIcons="false", |
| forceOverwrite="true", |
| creationSubmenus="true", |
| // *** create XML instance of the Amalthea meta model |
| publicationLocation="org.eclipse.app4mc.amalthea.model/model-gen/xml/amalthea.xml", |
| loadInitialization="false", // can be removed with Neon.3 ?? |
| // dynamicTemplates="true", |
| // templateDirectory="org.eclipse.app4mc.amalthea.model/templates", |
| copyrightText="*******************************************************************************\r\n Copyright (c) 2015-2020 Robert Bosch GmbH and others.\r\n\r\n This program and the accompanying materials are made\r\n available under the terms of the Eclipse Public License 2.0\r\n which is available at https://www.eclipse.org/legal/epl-2.0/\r\n\r\n SPDX-License-Identifier: EPL-2.0\r\n\r\n Generated using Eclipse EMF\r\n\r\n*******************************************************************************", |
| decoration="Live", |
| collapseAllAction="true", |
| expandAllAction="true", |
| autoExpandProperties="1", |
| eclipsePlatformVersion="Photon" |
| ) |
| |
| @Ecore( |
| nsPrefix="am", |
| nsURI="http://app4mc.eclipse.org/amalthea/0.9.7" |
| ) |
| |
| package org.eclipse.app4mc.amalthea.model |
| |
| import org.eclipse.emf.ecore.EDiagnosticChain |
| import org.eclipse.emf.ecore.EMap |
| import org.eclipse.emf.ecore.InternalEObject |
| import org.eclipse.emf.ecore.util.EcoreEList$UnmodifiableEList |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Central Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class Amalthea extends BaseObject |
| { |
| derived readonly String version get { |
| return "0.9.7" |
| } |
| |
| contains CommonElements commonElements |
| contains SWModel swModel |
| contains HWModel hwModel |
| contains OSModel osModel |
| contains StimuliModel stimuliModel |
| contains EventModel eventModel |
| contains ConstraintsModel constraintsModel |
| contains PropertyConstraintsModel propertyConstraintsModel |
| contains MappingModel mappingModel |
| contains ComponentsModel componentsModel |
| contains ConfigModel configModel |
| contains MeasurementModel measurementModel |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Common Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class CommonElements extends BaseObject |
| { |
| contains Tag[] tags |
| contains Namespace[] namespaces |
| contains CoreClassifier[] coreClassifiers |
| contains MemoryClassifier[] memoryClassifiers |
| } |
| |
| /* |
| * Base classes to be used to provide common functionality for all objects. |
| * Needs to be extended by other classes. |
| */ |
| abstract class BaseObject extends IAnnotatable {} |
| |
| abstract class ReferableObject extends IReferable {} |
| |
| abstract class ReferableBaseObject extends IAnnotatable, IReferable {} |
| |
| /* |
| * IAnnotatable: Possibility to store custom properties on elements |
| */ |
| interface IAnnotatable |
| { |
| contains CustomProperty[] customProperties |
| } |
| |
| /* |
| * ITaggable: Possibility to add tags to an elements |
| */ |
| interface ITaggable |
| { |
| refers Tag[] tags |
| } |
| |
| /* |
| * INamed: Name attribute |
| */ |
| interface INamed |
| { |
| @GenModel(propertyCategory="Main") |
| String name = "" |
| |
| op INamed getNamedContainer() { |
| if (eContainer instanceof INamed) eContainer as INamed else null |
| } |
| |
| op INamespace getNamespace() { null } |
| |
| @GenModel(propertyCategory="Read only") |
| derived readonly String qualifiedName get { AmaltheaExtensions.toPlainString(qualifiedNameSegments) } |
| |
| op String getEncodedQualifiedName () { AmaltheaExtensions.toEncodedString(qualifiedNameSegments) } |
| |
| op String getNamePrefix() { |
| if (namespace === null) return "" else AmaltheaExtensions.toPlainString(namePrefixSegments) |
| } |
| |
| op String[] getQualifiedNameSegments() { |
| val segments = getNamePrefixSegments() |
| if (name !== null) segments.add(name) |
| return segments |
| } |
| |
| @GenModel(documentation="Overwrite this method to define a specific prefix (used by name-based references).") |
| op String[] getNamePrefixSegments() { |
| if (namespace === null) newBasicEList else namespace.qualifiedNameSegments |
| } |
| } |
| |
| interface INamespaceMember { |
| @GenModel(notify="true") |
| refers INamespace namespace |
| } |
| |
| interface INamespace extends IReferable |
| { |
| op boolean isNamespaceSegment() { true } |
| |
| op String[] getQualifiedNameSegments() { |
| val segments = getNamePrefixSegments() |
| if (namespaceSegment) segments.add(name) |
| return segments |
| } |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of objects (INamespaceMember) referring to the this namespace.</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived INamespaceMember[] memberObjects get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.INamespace_MemberObjects, |
| #{AmaltheaPackage.eINSTANCE.INamespaceMember_Namespace} |
| ) |
| } |
| } |
| |
| interface IConditionalNamespace extends INamespace |
| { |
| boolean namespaceSegment = "false" |
| } |
| |
| /* |
| * IReferable: Computed ID for name based references |
| */ |
| interface IReferable extends INamed |
| { |
| // use IPropertySheetEntry.FILTER_ID_EXPERT ("org.eclipse.ui.views.properties.expert") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| id derived readonly String uniqueName get { encodedQualifiedName + "?type=" + eClass.name } |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| interface IDisplayName |
| { |
| String displayName |
| } |
| |
| interface IDescription |
| { |
| @GenModel(propertyMultiLine="true") |
| String description |
| } |
| |
| /* |
| * A tag for processes, runnables, events and labels |
| */ |
| class Tag extends ReferableBaseObject, IDescription |
| { |
| String tagType |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of objects (ITaggable) referring to the this tag.</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived ITaggable[] taggedObjects get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.tag_TaggedObjects, |
| #{AmaltheaPackage.eINSTANCE.ITaggable_Tags} |
| ) |
| } |
| } |
| |
| class Namespace extends INamespace |
| { |
| contains Namespace[] nextSegments opposite previousSegment |
| |
| @GenModel(propertyCategory="Read only") |
| container readonly Namespace previousSegment opposite nextSegments |
| |
| op String[] getNamePrefixSegments() { (previousSegment?.qualifiedNameSegments) ?: newBasicEList } |
| } |
| |
| enum RelationalOperator |
| { |
| _undefined_ // Display: "<relation>" |
| EQUAL |
| NOT_EQUAL |
| LESS_THAN |
| GREATER_THAN |
| } |
| |
| /* |
| * Classifiers for hardware properties |
| */ |
| abstract class Classifier extends ReferableBaseObject, IDescription |
| { |
| } |
| |
| class CoreClassifier extends Classifier |
| { |
| } |
| |
| class MemoryClassifier extends Classifier |
| { |
| } |
| |
| /* |
| * Data transmission details for communication (e.g. LabelAccesses) |
| */ |
| class TransmissionPolicy |
| { |
| contains DataSize chunkSize |
| int chunkProcessingTicks = "0" |
| double transmitRatio = "1.0" |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Quantities |
| // |
| // ------------------------------------------------------------------------------- |
| |
| /* |
| * Abstract class for Quantities (value + unit) |
| */ |
| abstract class Quantity {} |
| |
| /* |
| * Time units (enumeration of available units) |
| */ |
| enum TimeUnit |
| { |
| _undefined_ // Display: "<unit>" |
| s |
| ms |
| us |
| ns |
| ps |
| } |
| |
| interface TimeComparable wraps java.lang.Comparable<Time> {} |
| |
| /* |
| * General time class to define time value and unit. |
| */ |
| class Time extends Quantity, Value, TimeComparable |
| { |
| BigInteger value = "0" |
| TimeUnit unit |
| |
| op String toString() { |
| return value + " " + if (unit == TimeUnit::_UNDEFINED_) "<unit>" else unit.literal |
| } |
| |
| op int compareTo(Time t) { return AmaltheaServices.compareTimes(this, t) } |
| |
| op Time adjustUnit() { return AmaltheaServices.adjustTimeUnit(this) } |
| op Time add(Time t) { return AmaltheaServices.addTime(this, t) } |
| op Time subtract(Time t) { return AmaltheaServices.subtractTime(this, t) } |
| op Time multiply(long v) { return AmaltheaServices.multiply(this, v) } |
| op Time multiply(double v) { return AmaltheaServices.multiply(this, v) } |
| op double divide(Time t) { return AmaltheaServices.divideTime(this, t) } |
| } |
| |
| |
| /* |
| * Frequency units (enumeration of available units) |
| */ |
| enum FrequencyUnit |
| { |
| _undefined_ // Display: "<unit>" |
| Hz |
| kHz |
| MHz |
| GHz |
| // rpm ??? |
| } |
| |
| /* |
| * General frequency class to define frequency value and unit |
| */ |
| class Frequency extends Quantity |
| { |
| NonNegativeDouble value = "0.0" |
| FrequencyUnit unit |
| |
| op String toString() { |
| return value + " " + if (unit == FrequencyUnit::_UNDEFINED_) "<unit>" else unit.literal |
| } |
| } |
| |
| /* |
| * Voltage units (enumeration of available units) |
| */ |
| enum VoltageUnit |
| { |
| _undefined_ // Display: "<unit>" |
| uV |
| mV |
| V |
| } |
| |
| /* |
| * General voltage class to define voltage value and unit |
| */ |
| class Voltage extends Quantity |
| { |
| double value = "0.0" |
| VoltageUnit unit |
| |
| op String toString() { |
| return value + " " + if (unit == VoltageUnit::_UNDEFINED_) "<unit>" else unit.literal |
| } |
| } |
| |
| /* |
| * Data size units (enumeration of available units) |
| */ |
| enum DataSizeUnit |
| { |
| _undefined_ // Display: "<unit>" |
| bit |
| kbit |
| Mbit |
| Gbit |
| Tbit |
| |
| Kibit |
| Mibit |
| Gibit |
| Tibit |
| |
| B |
| kB |
| MB |
| GB |
| TB |
| |
| KiB |
| MiB |
| GiB |
| TiB |
| } |
| |
| /* |
| * General data size class to define size (value and unit) |
| */ |
| class DataSize extends Quantity |
| { |
| BigInteger value = "0" |
| DataSizeUnit unit |
| |
| op String toString() { |
| return value + " " + if (unit == DataSizeUnit::_UNDEFINED_) "<unit>" else unit.literal |
| } |
| |
| /* |
| * Convenience methods to retrieve the size in Bits and Bytes |
| */ |
| op long getNumberBits() { |
| if (unit === DataSizeUnit::BIT) return value.longValue |
| |
| val bits = AmaltheaServices.convertToBit(this) |
| if (bits === null) -1L else bits.longValue |
| } |
| op long getNumberBytes() { |
| if (unit === DataSizeUnit::B) return value.longValue |
| |
| val bits = AmaltheaServices.convertToBit(this) |
| if (bits === null) -1L else Math::ceil(bits.longValue / 8).longValue |
| } |
| } |
| |
| /* |
| * Data rate units (enumeration of available units) |
| */ |
| enum DataRateUnit |
| { |
| _undefined_ // Display: "<unit>" |
| bitPerSecond // Display: "bit/s" |
| kbitPerSecond |
| MbitPerSecond |
| GbitPerSecond |
| TbitPerSecond |
| |
| KibitPerSecond |
| MibitPerSecond |
| GibitPerSecond |
| TibitPerSecond |
| |
| BPerSecond |
| kBPerSecond |
| MBPerSecond |
| GBPerSecond |
| TBPerSecond |
| |
| KiBPerSecond |
| MiBPerSecond |
| GiBPerSecond |
| TiBPerSecond |
| } |
| |
| interface DataRateComparable wraps java.lang.Comparable<DataRate> {} |
| |
| /* |
| * General data rate class to define rate (value and unit) |
| */ |
| class DataRate extends Quantity, DataRateComparable |
| { |
| BigInteger value = "0" |
| DataRateUnit unit |
| |
| op String toString() { |
| return value + " " + if (unit == DataRateUnit::_UNDEFINED_) "<unit>" else unit.literal.replace("PerSecond", "/s") |
| } |
| op int compareTo(DataRate rate) { |
| return AmaltheaServices.compareDataRates(this, rate) |
| } |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Custom Properties and Values |
| // |
| // ------------------------------------------------------------------------------- |
| |
| /* |
| * custom property container for map |
| */ |
| class CustomProperty wraps java.util.Map$Entry |
| { |
| String[1] key |
| contains Value value |
| } |
| |
| /* |
| * Abstract generalization of a value entry. |
| */ |
| abstract class Value {} |
| |
| class ListObject extends Value |
| { |
| contains Value[] values |
| } |
| |
| /* |
| * Object for using the elementary datatype String as generic parameter |
| */ |
| class StringObject extends Value |
| { |
| @GenModel(propertyMultiLine="true") |
| String[1] value |
| } |
| |
| /* |
| * Object for using the elementary datatype String as generic parameter |
| */ |
| class BigIntegerObject extends Value |
| { |
| BigInteger[1] value = "0" |
| } |
| |
| /* |
| * Object for using object reference as generic parameter |
| */ |
| class ReferenceObject extends Value |
| { |
| refers IReferable value |
| } |
| |
| /* |
| * Object for using the elementary datatype integer as generic parameter |
| */ |
| class IntegerObject extends Value |
| { |
| int[1] value = "0" |
| } |
| |
| /* |
| * Object for using the elementary datatype long as generic parameter |
| */ |
| class LongObject extends Value |
| { |
| long[1] value = "0" |
| } |
| |
| /* |
| * Object for using the elementary datatype float as generic parameter |
| */ |
| class FloatObject extends Value |
| { |
| float[1] value = "0.0" |
| } |
| |
| /* |
| * Object for using the elementary datatype double as generic parameter |
| */ |
| class DoubleObject extends Value |
| { |
| double[1] value = "0.0" |
| } |
| |
| /* |
| * Object for using the elementary datatype boolean as generic parameter |
| */ |
| class BooleanObject extends Value |
| { |
| boolean[1] value = "false" |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Statistics / Deviations (general) |
| // |
| // ------------------------------------------------------------------------------- |
| |
| interface NumericStatistic {} |
| |
| /* |
| * Statistic to provide capabilities for min, max and avg |
| */ |
| class MinAvgMaxStatistic extends NumericStatistic |
| { |
| int min = "0" |
| float avg = "0f" |
| int max = "0" |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| class SingleValueStatistic extends NumericStatistic |
| { |
| float value = "0f" |
| } |
| |
| /* |
| * The types of sampling |
| */ |
| enum SamplingType |
| { |
| ^default // Display: "<sampling>" |
| BestCase |
| WorstCase |
| AverageCase |
| CornerCase |
| Uniform |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Deviation of Time |
| // |
| // ------------------------------------------------------------------------------- |
| |
| interface ITimeDeviation { |
| op Time getLowerBound() |
| op Time getUpperBound() |
| op Time getAverage() |
| } |
| |
| abstract class TimeInterval { |
| contains Time[1] lowerBound |
| contains Time[1] upperBound |
| |
| op Time getAverage() { |
| AmaltheaServices2.getAverage(lowerBound, upperBound) |
| } |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| class TimeConstant extends ITimeDeviation { |
| contains Time[1] value |
| |
| op Time getLowerBound() { value } |
| op Time getUpperBound() { value } |
| op Time getAverage() { value } |
| } |
| |
| class TimeHistogram extends ITimeDeviation { |
| contains TimeHistogramEntry[+] entries |
| |
| op Time getLowerBound() { AmaltheaServices2.getLowerBound_Time(entries) } |
| op Time getUpperBound() { AmaltheaServices2.getUpperBound_Time(entries) } |
| op Time getAverage() { AmaltheaServices2.getAverage_Time(entries) } |
| } |
| |
| class TimeHistogramEntry extends TimeInterval { |
| PositiveLong[1] occurrences = "1" |
| } |
| |
| abstract class BoundedTimeDistribution extends TimeInterval, ITimeDeviation {} |
| |
| abstract class TruncatedTimeDistribution extends ITimeDeviation { |
| contains Time lowerBound |
| contains Time upperBound |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| /* |
| * Defines the upper and lower bounds of a value interval without defining the distribution |
| */ |
| class TimeBoundaries extends BoundedTimeDistribution { |
| SamplingType samplingType |
| } |
| |
| /* |
| * Defines the upper bound, lower bound and mean of a value interval without defining the distribution |
| */ |
| class TimeStatistics extends BoundedTimeDistribution { |
| contains Time[1] average |
| } |
| |
| /* |
| * Uniform distribution |
| */ |
| class TimeUniformDistribution extends BoundedTimeDistribution {} |
| |
| /* |
| * Gauss distribution |
| */ |
| class TimeGaussDistribution extends TruncatedTimeDistribution { |
| contains Time[1] mean |
| contains Time[1] sd |
| |
| op Time getAverage() { |
| return AmaltheaServices2.getAverageOfTruncatedNormalDistribution(lowerBound, upperBound, mean, sd) |
| } |
| } |
| |
| /* |
| * Weibull Distribution |
| * The parameter of a Weibull distribution (kappa, lambda...) are calculated from the estimators minimum, maximum and average. |
| */ |
| class TimeWeibullEstimatorsDistribution extends BoundedTimeDistribution { |
| contains Time[1] average |
| PositiveDouble[1] pRemainPromille = "1.0" |
| } |
| |
| /* |
| * Beta distribution |
| */ |
| class TimeBetaDistribution extends BoundedTimeDistribution { |
| PositiveDouble[1] alpha = "1.0" |
| PositiveDouble[1] beta = "1.0" |
| |
| op Time getAverage() { |
| return AmaltheaServices2.getAverageOfBetaDistribution(lowerBound, upperBound, alpha, beta) |
| } |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Deviation of Long |
| // |
| // ------------------------------------------------------------------------------- |
| |
| interface IDiscreteValueDeviation { |
| op Long getLowerBound() |
| op Long getUpperBound() |
| op Double getAverage() |
| } |
| |
| abstract class DiscreteValueInterval { |
| Long[1] lowerBound = "0" |
| Long[1] upperBound = "0" |
| |
| op Double getAverage() { |
| AmaltheaServices2.getAverage(lowerBound, upperBound) |
| } |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| class DiscreteValueConstant extends IDiscreteValueDeviation { |
| long[1] value = "0" |
| |
| op Long getLowerBound() { value } |
| op Long getUpperBound() { value } |
| op Double getAverage() { value.doubleValue } |
| } |
| |
| class DiscreteValueHistogram extends IDiscreteValueDeviation { |
| contains DiscreteValueHistogramEntry[+] entries |
| |
| op Long getLowerBound() { AmaltheaServices2.getLowerBound_DV(entries) } |
| op Long getUpperBound() { AmaltheaServices2.getUpperBound_DV(entries) } |
| op Double getAverage() { AmaltheaServices2.getAverage_DV(entries) } |
| } |
| |
| class DiscreteValueHistogramEntry extends DiscreteValueInterval { |
| PositiveLong[1] occurrences = "1" |
| } |
| |
| abstract class BoundedDiscreteValueDistribution extends DiscreteValueInterval, IDiscreteValueDeviation {} |
| |
| abstract class TruncatedDiscreteValueDistribution extends IDiscreteValueDeviation { |
| Long lowerBound // initial value is null |
| Long upperBound // initial value is null |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| /* |
| * Defines the upper and lower bounds of a value interval without defining the distribution |
| */ |
| class DiscreteValueBoundaries extends BoundedDiscreteValueDistribution { |
| SamplingType samplingType |
| } |
| |
| /* |
| * Defines the upper bound, lower bound and mean of a value interval without defining the distribution |
| */ |
| class DiscreteValueStatistics extends BoundedDiscreteValueDistribution { |
| Double[1] average = "0.0" |
| } |
| |
| /* |
| * Uniform distribution |
| */ |
| class DiscreteValueUniformDistribution extends BoundedDiscreteValueDistribution {} |
| |
| /* |
| * Gauss distribution |
| */ |
| class DiscreteValueGaussDistribution extends TruncatedDiscreteValueDistribution { |
| double[1] mean = "0.0" |
| PositiveDouble[1] sd = "1.0" |
| |
| op Double getAverage() { |
| return AmaltheaServices2.getAverageOfTruncatedNormalDistribution(lowerBound, upperBound, mean, sd) |
| } |
| } |
| |
| /* |
| * Weibull Distribution |
| * The parameter of a Weibull distribution (kappa, lambda...) are calculated from the estimators minimum, maximum and average. |
| */ |
| class DiscreteValueWeibullEstimatorsDistribution extends BoundedDiscreteValueDistribution { |
| Double[1] average = "0.0" |
| PositiveDouble[1] pRemainPromille = "1.0" |
| } |
| |
| /* |
| * Beta distribution |
| */ |
| class DiscreteValueBetaDistribution extends BoundedDiscreteValueDistribution { |
| PositiveDouble[1] alpha = "1.0" |
| PositiveDouble[1] beta = "1.0" |
| |
| op Double getAverage() { |
| return AmaltheaServices2.getAverageOfBetaDistribution(lowerBound, upperBound, alpha, beta) |
| } |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Deviation of Double |
| // |
| // ------------------------------------------------------------------------------- |
| |
| interface IContinuousValueDeviation { |
| op Double getLowerBound() |
| op Double getUpperBound() |
| op Double getAverage() |
| } |
| |
| abstract class ContinuousValueInterval { |
| Double[1] lowerBound = "0.0" |
| Double[1] upperBound = "0.0" |
| |
| op Double getAverage() { |
| AmaltheaServices2.getAverage(lowerBound, upperBound) |
| } |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| class ContinuousValueConstant extends IContinuousValueDeviation { |
| double[1] value = "0.0" |
| |
| op Double getLowerBound() { value } |
| op Double getUpperBound() { value } |
| op Double getAverage() { value } |
| } |
| |
| class ContinuousValueHistogram extends IContinuousValueDeviation { |
| contains ContinuousValueHistogramEntry[+] entries |
| |
| op Double getLowerBound() { AmaltheaServices2.getLowerBound_CV(entries) } |
| op Double getUpperBound() { AmaltheaServices2.getUpperBound_CV(entries) } |
| op Double getAverage() { AmaltheaServices2.getAverage_CV(entries) } |
| } |
| |
| class ContinuousValueHistogramEntry extends ContinuousValueInterval { |
| PositiveLong[1] occurrences = "1" |
| } |
| |
| abstract class BoundedContinuousValueDistribution extends ContinuousValueInterval, IContinuousValueDeviation {} |
| |
| abstract class TruncatedContinuousValueDistribution extends IContinuousValueDeviation { |
| Double lowerBound // initial value is null |
| Double upperBound // initial value is null |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| } |
| |
| /* |
| * Defines the upper and lower bounds of a value interval without defining the distribution |
| */ |
| class ContinuousValueBoundaries extends BoundedContinuousValueDistribution { |
| SamplingType samplingType |
| } |
| |
| /* |
| * Defines the upper bound, lower bound and mean of a value interval without defining the distribution |
| */ |
| class ContinuousValueStatistics extends BoundedContinuousValueDistribution { |
| Double[1] average = "0.0" |
| } |
| |
| /* |
| * Uniform distribution |
| */ |
| class ContinuousValueUniformDistribution extends BoundedContinuousValueDistribution {} |
| |
| /* |
| * Gauss distribution |
| */ |
| class ContinuousValueGaussDistribution extends TruncatedContinuousValueDistribution { |
| double[1] mean = "0.0" |
| PositiveDouble[1] sd = "1.0" |
| |
| op Double getAverage() { |
| return AmaltheaServices2.getAverageOfTruncatedNormalDistribution(lowerBound, upperBound, mean, sd) |
| } |
| } |
| |
| /* |
| * Weibull Distribution |
| * The parameter of a Weibull distribution (kappa, lambda...) are calculated from the estimators minimum, maximum and average. |
| */ |
| class ContinuousValueWeibullEstimatorsDistribution extends BoundedContinuousValueDistribution { |
| Double[1] average = "0.0" |
| PositiveDouble[1] pRemainPromille = "1.0" |
| } |
| |
| /* |
| * Beta distribution |
| */ |
| class ContinuousValueBetaDistribution extends BoundedContinuousValueDistribution { |
| PositiveDouble[1] alpha = "1.0" |
| PositiveDouble[1] beta = "1.0" |
| |
| op Double getAverage() { |
| return AmaltheaServices2.getAverageOfBetaDistribution(lowerBound, upperBound, alpha, beta) |
| } |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Modes |
| // |
| // ------------------------------------------------------------------------------- |
| |
| abstract class Mode extends ReferableBaseObject {} |
| |
| class NumericMode extends Mode |
| { |
| // future extensions (restrictions) possible, e.g. range |
| } |
| |
| class EnumMode extends Mode |
| { |
| contains ModeLiteral[] literals opposite containingMode |
| |
| op ModeLiteral getLiteral(String literal) { |
| literals.findFirst[it.name == literal] |
| } |
| } |
| |
| class ModeLiteral extends ReferableBaseObject |
| { |
| @GenModel(propertyCategory="Read only") |
| container readonly EnumMode containingMode opposite literals |
| |
| op String[] getNamePrefixSegments() { (containingMode?.qualifiedNameSegments) ?: newBasicEList } |
| |
| op String toString() { |
| if (name.nullOrEmpty) "<literal>" else name |
| } |
| } |
| |
| // ------------------------------------------------------------------------------- |
| // |
| // Datatypes |
| // |
| // ------------------------------------------------------------------------------- |
| |
| /* |
| * Hardware Address (long; specified as hexadecimal value) |
| */ |
| @ExtendedMetaData(minInclusive="0") |
| type Address wraps long |
| create { |
| if (it !== null) { |
| if (it.startsWith("-") || it.startsWith("+")) |
| throw new NumberFormatException("Sign character") |
| else |
| Long.decode(it) |
| } |
| } |
| convert { |
| "0x" + Long.toHexString(it) |
| } |
| |
| // |
| // Positive Numbers (value > 0): Integer (int), Long (long), Double (double) |
| // |
| |
| @ExtendedMetaData(minExclusive="0") |
| type PositiveInt wraps int |
| |
| @ExtendedMetaData(minExclusive="0") |
| type PositiveLong wraps long |
| |
| @ExtendedMetaData(minExclusive="0") |
| type PositiveDouble wraps double |
| |
| // |
| // Non Negative Numbers(value >= 0): Integer (int), Long (long), Double (double) |
| // |
| |
| @ExtendedMetaData(minInclusive="0") |
| type NonNegativeInt wraps int |
| |
| @ExtendedMetaData(minInclusive="0") |
| type NonNegativeLong wraps long |
| |
| @ExtendedMetaData(minInclusive="0") |
| type NonNegativeDouble wraps double |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Components Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class ComponentsModel extends BaseObject, IComponentContainer, IInterfaceContainer |
| { |
| contains ComponentStructure[] structures |
| contains System[] systems |
| |
| op Component[] getAllComponents() { |
| |
| } |
| |
| } |
| |
| interface IComponentContainer { |
| contains Component[] components |
| } |
| |
| interface IInterfaceContainer { |
| contains MainInterface[] interfaces |
| } |
| |
| interface ISystem |
| { |
| contains ComponentInstance[] componentInstances opposite containingSystem |
| contains Connector[] connectors opposite containingSystem |
| contains QualifiedPort[] groundedPorts |
| |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers derived readonly QualifiedPort[] innerPorts get { |
| AmaltheaServices.getInnerPorts(this); |
| } |
| } |
| |
| abstract class ComponentInterface extends ReferableBaseObject, ITaggable |
| { |
| refers TypeDefinition datatype |
| contains SubInterface[] subInterfaces opposite containingInterface |
| } |
| |
| @GenModel(labelFeature="qualifiedName") |
| class MainInterface extends ComponentInterface, INamespaceMember |
| { |
| String version = "1.0" |
| } |
| |
| @GenModel(labelFeature="qualifiedName") |
| class SubInterface extends ComponentInterface |
| { |
| @GenModel(propertyCategory="Read only") |
| container readonly ComponentInterface containingInterface opposite subInterfaces |
| |
| op String[] getNamePrefixSegments() { (containingInterface?.qualifiedNameSegments) ?: newBasicEList } |
| } |
| |
| class ComponentPort extends ReferableBaseObject, ITaggable |
| { |
| @GenModel(propertyCategory="Read only") |
| container readonly Component containingComponent opposite ports |
| |
| op String[] getNamePrefixSegments() { (containingComponent?.qualifiedNameSegments) ?: newBasicEList } |
| |
| InterfaceKind kind |
| refers ComponentInterface ^interface |
| } |
| |
| class ComponentStructure extends INamed, IComponentContainer, IInterfaceContainer |
| { |
| String structureType = "" |
| contains ComponentStructure[] subStructures |
| } |
| |
| @GenModel(labelFeature="qualifiedName") |
| class Component extends ReferableBaseObject, ITaggable, INamespaceMember |
| { |
| contains ComponentPort[] ports opposite containingComponent |
| |
| refers AbstractProcess[] tasks |
| refers Runnable[] runnables |
| refers Label[] labels |
| refers Semaphore[] semaphores |
| refers OsEvent[] osEvents |
| } |
| |
| class Composite extends Component, ISystem {} |
| |
| class System extends ReferableBaseObject, ITaggable, ISystem {} |
| |
| class ComponentInstance extends ReferableBaseObject, ITaggable |
| { |
| container ISystem containingSystem opposite componentInstances |
| |
| refers Component ^type |
| |
| op String[] getNamePrefixSegments() { (namedContainer?.qualifiedNameSegments) ?: newBasicEList } |
| } |
| |
| class Connector extends BaseObject, INamed, ITaggable |
| { |
| container ISystem containingSystem opposite connectors |
| |
| contains QualifiedPort sourcePort |
| contains QualifiedPort targetPort |
| |
| contains InterfaceChannel[] implementedInterfaces |
| } |
| |
| class InterfaceChannel wraps java.util.Map$Entry |
| { |
| refers ComponentInterface[1] key |
| refers Channel value |
| } |
| |
| class QualifiedPort extends BaseObject |
| { |
| refers ComponentInstance instance |
| refers ComponentPort[1] port |
| } |
| |
| enum InterfaceKind |
| { |
| _undefined_ // Display: "<kind>" |
| provides // Display: "PROVIDES" |
| requires // Display: "REQUIRES" |
| provides_requires // Display: "PROVIDES+REQUIRES" |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Config Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class ConfigModel extends BaseObject |
| { |
| contains EventConfig[] eventsToTrace |
| } |
| |
| class EventConfig extends BaseObject, INamed |
| { |
| refers EntityEvent[1] event |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Constraints Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class ConstraintsModel extends BaseObject |
| { |
| contains EventChain[] eventChains |
| contains TimingConstraint[] timingConstraints |
| contains AffinityConstraint[] affinityConstraints |
| contains RunnableSequencingConstraint[] runnableSequencingConstraints |
| contains DataAgeConstraint[] dataAgeConstraints |
| contains Requirement[] requirements |
| contains DataCoherencyGroup[] dataCoherencyGroups |
| contains DataStabilityGroup[] dataStabilityGroups |
| contains PhysicalSectionConstraint[] physicalSectionConstraints |
| } |
| |
| enum RunnableOrderType{ |
| _undefined_ // Display: "<order>" |
| successor |
| immediateSuccessorStartSequence |
| immediateSuccessorAnySequence |
| immediateSuccessorEndSequence |
| } |
| |
| class RunnableSequencingConstraint extends ReferableBaseObject |
| { |
| RunnableOrderType orderType |
| contains RunnableEntityGroup[2..*] runnableGroups |
| refers AbstractProcess[] processScope |
| } |
| |
| abstract class AffinityConstraint extends ReferableBaseObject {} |
| |
| /* |
| * An abstract superclass for all separation constraints |
| */ |
| abstract class SeparationConstraint extends AffinityConstraint {} |
| |
| /* |
| * An abstract superclass for all pairing constraints |
| */ |
| abstract class PairingConstraint extends AffinityConstraint {} |
| |
| /* |
| * An abstract superclass for all process related constraint |
| * The target describes the entity on which the processes can be mapped |
| */ |
| abstract class ProcessConstraint |
| { |
| contains ProcessConstraintTarget target |
| } |
| |
| /* |
| * An abstract superclass for all runnable related constraint |
| * The target describes the entity on which the runnables can be mapped |
| */ |
| abstract class RunnableConstraint |
| { |
| contains RunnableConstraintTarget target |
| } |
| |
| /* |
| * An abstract superclass for all data related constraint |
| * The target describes the entity on which the data can be mapped |
| */ |
| abstract class DataConstraint |
| { |
| contains DataConstraintTarget target |
| } |
| |
| /* |
| * A runnable-separation-constraint |
| * groups describes the runnable-groups that should be separated from each other on the target |
| * if there is only one group then this means that the runnables of this group are not allowed to be executed on the target |
| */ |
| class RunnableSeparationConstraint extends SeparationConstraint, RunnableConstraint, BaseObject |
| { |
| contains RunnableGroup[1..2] groups |
| } |
| |
| /* |
| * A process-separation-constraint |
| * groups describes the process-groups that should be separated from each other on the target |
| * if there is only one group then this means that the processes of this group are not allowed to be executed on the target |
| */ |
| class ProcessSeparationConstraint extends SeparationConstraint, ProcessConstraint, BaseObject |
| { |
| contains ProcessGroup[1..2] groups |
| } |
| |
| /* |
| * A data-separation-constraint |
| * groups describes the label-groups that should be separated from each other on the target |
| * if there is only one group then this means that the label of this group is not allowed to be executed on the target |
| */ |
| class DataSeparationConstraint extends SeparationConstraint, DataConstraint, BaseObject |
| { |
| contains LabelEntityGroup[1..2] groups |
| } |
| |
| /* |
| * A runnable-pairing-constraint |
| * runnables describes the group of runnables that should be paired on the target |
| */ |
| class RunnablePairingConstraint extends PairingConstraint, RunnableConstraint, BaseObject |
| { |
| contains RunnableGroup[1] group |
| } |
| |
| /* |
| * A process-pairing-constraint |
| * processes describes the group of processes that should be paired on the target |
| */ |
| class ProcessPairingConstraint extends PairingConstraint, ProcessConstraint, BaseObject |
| { |
| contains ProcessGroup[1] group |
| } |
| |
| /* |
| * A data-pairing-constraint |
| * labels describes the group of labels that should be paired on the target |
| */ |
| class DataPairingConstraint extends PairingConstraint, DataConstraint, BaseObject |
| { |
| contains LabelGroup[1] group |
| } |
| |
| /* |
| * An abstract superclass for all possible targets for runnable-constraints |
| */ |
| abstract class RunnableConstraintTarget {} |
| |
| /* |
| * An abstract superclass for all possible targets for process-constraints |
| */ |
| abstract class ProcessConstraintTarget {} |
| |
| /* |
| * An abstract superclass for all possible targets for data-constraints |
| */ |
| abstract class DataConstraintTarget {} |
| |
| /* |
| * A memory target description |
| * A memory can be a target for data-constraints |
| * memories: the reference to zero or more Memories. If this list is empty, the target stands for all memories! |
| */ |
| class TargetMemory extends DataConstraintTarget, BaseObject |
| { |
| refers Memory[] memories |
| } |
| |
| /* |
| * A core target description |
| * A core can be a target for runnable-constraints, process-constraints and scheduler-constraints |
| * cores: the reference to zero or more Cores. If this list is empty, the target stands for all cores! |
| */ |
| class TargetCore extends RunnableConstraintTarget, ProcessConstraintTarget, BaseObject |
| { |
| refers ProcessingUnit[] cores |
| } |
| |
| /* |
| * A scheduler target description |
| * A scheduler can be a target for runnable-constraints and process-constraints |
| * schedulers: the reference to zero or more Schedulers. If this list is empty, the target stands for all schedulers! |
| */ |
| class TargetScheduler extends RunnableConstraintTarget, ProcessConstraintTarget, BaseObject |
| { |
| refers Scheduler[] schedulers |
| } |
| |
| /* |
| * An abstract description for a group of labels that can be paired or separated by a runnable-constraint |
| */ |
| abstract class LabelGroup {} |
| |
| /* |
| * An abstract description for a group of runnables that can be paired or separated by a runnable-constraint |
| */ |
| abstract class RunnableGroup {} |
| |
| /* |
| * An abstract description for a group of processes that can be paired or separated by a process-constraint |
| */ |
| abstract class ProcessGroup {} |
| |
| /* |
| * A group of labels that can be paired or separated by a data-constraint |
| */ |
| class LabelEntityGroup extends LabelGroup, BaseObject |
| { |
| refers Label[1..*] labels |
| } |
| |
| /* |
| * A group of runnables that can be paired or separated by a runnable-constraint |
| */ |
| class RunnableEntityGroup extends RunnableGroup, BaseObject |
| { |
| refers Runnable[1..*] runnables |
| } |
| |
| /* |
| * A group of processes that can be paired or separated by a process-constraint |
| */ |
| class ProcessEntityGroup extends ProcessGroup, BaseObject |
| { |
| refers Process[1..*] processes |
| } |
| |
| /* |
| * A group that contains only a tag and groups all objects that are marked with this tag |
| * This can be runnables or processes |
| */ |
| class TagGroup extends RunnableGroup, ProcessGroup, BaseObject |
| { |
| refers Tag[1] tag |
| } |
| |
| //////////////////////////Event chains & Timing constraints: |
| /* |
| * Describes an event chain which must have a minimum of two events (stimulus and response) |
| * If there are more events the event chain have to be divided into segments. Each segment is another event chain. |
| * Alternative event paths are contained in strands. |
| * stimulus: Beginning of chain |
| * response: End of chain |
| * segments: Sub event chains |
| * strands: alternative event paths |
| */ |
| abstract class AbstractEventChain extends BaseObject, INamed |
| { |
| refers Event[1] stimulus |
| refers Event[1] response |
| contains EventChainItem[] items |
| EventChainItemType itemType |
| PositiveInt minItemsCompleted = "1" |
| } |
| |
| enum EventChainItemType |
| { |
| _undefined_ // Display: "<item type>" |
| sequence |
| parallel |
| } |
| |
| class EventChain extends AbstractEventChain, IReferable {} |
| |
| class SubEventChain extends AbstractEventChain {} |
| |
| interface EventChainItem |
| { |
| op AbstractEventChain getEventChain() |
| } |
| |
| class EventChainReference extends BaseObject, EventChainItem |
| { |
| refers EventChain[1] eventChain |
| } |
| |
| class EventChainContainer extends BaseObject, EventChainItem |
| { |
| contains SubEventChain[1] eventChain |
| } |
| |
| abstract class TimingConstraint extends ReferableBaseObject {} |
| |
| /* |
| * This contraints is used to limit a section in Memories |
| */ |
| class PhysicalSectionConstraint extends ReferableBaseObject |
| { |
| refers Section[1] section |
| refers Memory[+] memories |
| } |
| |
| /* |
| * Base class for synchronization constraints, which limit the distance between events |
| * multipleOccurrencesAllowed: Defines whether multiple event occurrences are allowed for analysis |
| * tolerance: Maximum allowed tolerance |
| */ |
| abstract class SynchronizationConstraint extends TimingConstraint |
| { |
| boolean multipleOccurrencesAllowed = "false" |
| contains Time[1] tolerance |
| } |
| |
| /* |
| * The synchronization constraint considers a group of events and limits the distance of the events within this group. |
| */ |
| class EventSynchronizationConstraint extends SynchronizationConstraint |
| { |
| refers EntityEvent[+] events |
| } |
| |
| enum SynchronizationType |
| { |
| _undefined_ // Display: "<synchronization>" |
| Stimulus |
| Response |
| } |
| |
| /* |
| * A synchronization constraint describes the allowed tolerance in synchronization between two event chains |
| * scope: Considered event chains that have to by in sync |
| * type: Defines which parts of the event chains have to be in sync |
| */ |
| class EventChainSynchronizationConstraint extends SynchronizationConstraint |
| { |
| refers EventChain[2] scope |
| SynchronizationType ^type |
| } |
| |
| enum MappingType |
| { |
| _undefined_ // Display: "<mapping>" |
| OneToOne |
| Reaction |
| UniqueReaction |
| } |
| |
| /* |
| * This constraint describes how a source and a target event are placed relative to each other |
| */ |
| class DelayConstraint extends TimingConstraint |
| { |
| MappingType mappingType |
| refers EntityEvent[1] source |
| refers EntityEvent[1] target |
| contains Time upper |
| contains Time lower |
| } |
| |
| enum LatencyType |
| { |
| _undefined_ // Display: "<latency>" |
| Age |
| Reaction |
| } |
| |
| /* |
| * A latency constraint describes the allowed range in latency between a stimulus and its response. |
| * scope: Considered event chain that defines the stimulus and response relation |
| * type: Defines the point of view (forward or backward) |
| * minimum: Minimum allowed latency |
| * maximum: Maximum allowed latency |
| */ |
| class EventChainLatencyConstraint extends TimingConstraint |
| { |
| refers EventChain[1] scope |
| LatencyType ^type |
| contains Time minimum |
| contains Time maximum |
| } |
| |
| /* |
| * A repetition constraint prescribes the distribution of a single event during runtime. |
| */ |
| class RepetitionConstraint extends TimingConstraint |
| { |
| refers EntityEvent[1] event |
| int span = "0" |
| contains Time lower |
| contains Time upper |
| contains Time jitter |
| contains Time period |
| } |
| |
| //////////////////////////Data Age Constraint |
| class DataAgeConstraint extends ReferableBaseObject |
| { |
| refers Runnable[1] runnable |
| refers Label[1] label |
| contains DataAge[1] dataAge |
| } |
| |
| abstract class DataAge {} |
| |
| class DataAgeCycle extends DataAge |
| { |
| int minimumCycle = "0" |
| int maximumCycle = "0" |
| } |
| |
| class DataAgeTime extends DataAge |
| { |
| contains Time minimumTime |
| contains Time maximumTime |
| } |
| |
| ////////////////////////// Requirements |
| abstract class Requirement extends BaseObject, INamed |
| { |
| Severity severity |
| contains RequirementLimit[1] limit |
| } |
| |
| class ProcessRequirement extends Requirement |
| { |
| refers AbstractProcess[1] process |
| } |
| |
| class RunnableRequirement extends Requirement |
| { |
| refers Runnable[1] runnable |
| } |
| |
| class ArchitectureRequirement extends Requirement |
| { |
| refers Component[1] component |
| } |
| |
| class ProcessChainRequirement extends Requirement |
| { |
| refers ProcessChain[1] processChain |
| } |
| |
| abstract class RequirementLimit |
| { |
| LimitType limitType |
| } |
| |
| class CPUPercentageRequirementLimit extends RequirementLimit |
| { |
| CPUPercentageMetric metric |
| double limitValue = "0.0" |
| // can be ECU, Processor or Core |
| refers ProcessingUnit hardwareContext |
| } |
| |
| class FrequencyRequirementLimit extends RequirementLimit |
| { |
| FrequencyMetric metric |
| contains Frequency[1] limitValue |
| } |
| |
| class PercentageRequirementLimit extends RequirementLimit |
| { |
| PercentageMetric metric |
| double limitValue = "0.0" |
| } |
| |
| class CountRequirementLimit extends RequirementLimit |
| { |
| CountMetric metric |
| int limitValue = "0" |
| } |
| |
| class TimeRequirementLimit extends RequirementLimit |
| { |
| TimeMetric metric |
| // signed time is allowed because the requirement to lateness can be negative |
| contains Time[1] limitValue |
| } |
| |
| enum Severity |
| { |
| _undefined_ // Display: "<severity>" |
| Cosmetic |
| Minor |
| Major |
| Critical |
| } |
| |
| enum LimitType |
| { |
| _undefined_ // Display: "<limit>" |
| UpperLimit |
| LowerLimit |
| } |
| |
| enum TimeMetric |
| { |
| _undefined_ // Display: "<time metric>" |
| ActivateToActivate |
| CoreExecutionTime |
| EndToEnd |
| EndToStart |
| GrossExecutionTime |
| Lateness |
| MemoryAccessTime |
| NetExecutionTime |
| OsOverhead |
| ParkingTime |
| PollingTime |
| ReadyTime |
| ResponseTime |
| RunningTime |
| StartDelay |
| StartToStart |
| WaitingTime |
| } |
| |
| enum CountMetric |
| { |
| _undefined_ // Display: "<count metric>" |
| Activations |
| BoundedMigrations |
| CacheHit |
| CacheMiss |
| FullMigrations |
| MtaLimitExceeding |
| Preemptions |
| } |
| |
| enum PercentageMetric |
| { |
| _undefined_ // Display: "<% metric>" |
| CacheHitRatio |
| CacheMissRatio |
| CoreExecutionTimeRelative |
| MemoryAccessTimeRelative |
| NormalizedLateness |
| NormalizedResponseTime |
| OsOverheadRelative |
| } |
| |
| enum CPUPercentageMetric |
| { |
| _undefined_ // Display: "<CPU % metric>" |
| CPUBuffering |
| CPULoad |
| CPUParking |
| CPUPolling |
| CPUReady |
| CPURunning |
| CPUWaiting |
| } |
| |
| enum FrequencyMetric |
| { |
| _undefined_ // Display: "<frequency metric>" |
| CacheHitFrequency |
| CacheMissFrequency |
| } |
| |
| //////////////////////////// Data Groups (Coherency and Stability) |
| class DataCoherencyGroup extends ReferableBaseObject |
| { |
| refers Label[+] labels |
| contains DataGroupScope scope |
| CoherencyDirection direction |
| } |
| |
| enum CoherencyDirection |
| { |
| _undefined_ // Display: "<direction>" |
| input |
| output |
| } |
| |
| class DataStabilityGroup extends ReferableBaseObject |
| { |
| refers Label[+] labels |
| contains DataGroupScope scope |
| } |
| |
| abstract class DataGroupScope {} |
| |
| class ProcessScope extends DataGroupScope |
| { |
| refers AbstractProcess process |
| } |
| |
| class RunnableScope extends DataGroupScope |
| { |
| refers Runnable runnable |
| } |
| |
| class ComponentScope extends DataGroupScope |
| { |
| refers Component component |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Events Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class EventModel extends BaseObject |
| { |
| contains Event[] events |
| } |
| |
| /* |
| * An abstract event |
| */ |
| abstract class Event extends ReferableBaseObject, ITaggable, IDescription |
| { |
| } |
| |
| /* |
| * A set of entity-events |
| */ |
| class EventSet extends Event |
| { |
| refers EntityEvent[+] events |
| } |
| |
| /* |
| * An abstract event that describes the notification of a changed state of an entity |
| */ |
| abstract class EntityEvent extends Event {} |
| |
| /* |
| * Defines Events to be used in Stimuli as trigger. |
| */ |
| abstract class TriggerEvent extends EntityEvent |
| { |
| } |
| |
| class CustomEvent extends TriggerEvent |
| { |
| String eventType |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of triggers (CustomEventTrigger).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived CustomEventTrigger[] explicitTriggers get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.customEvent_ExplicitTriggers, |
| #{AmaltheaPackage.eINSTANCE.customEventTrigger_Event} ) |
| } |
| } |
| |
| /* |
| * Describes the event of a stimulus. |
| * It contains only the stimulus but no event type because a stimulus has only one event type. |
| */ |
| class StimulusEvent extends EntityEvent |
| { |
| refers Stimulus entity |
| } |
| |
| /* |
| * Describes the event of a process |
| * eventType: The type of the Event |
| * entity: The process that fires the event (optional) |
| * processingUnit: The processing unit that executes the process when the event is fired (optional) |
| */ |
| class ProcessEvent extends EntityEvent |
| { |
| ProcessEventType eventType |
| refers Process entity |
| refers ProcessingUnit processingUnit |
| } |
| |
| /* |
| * Describes the event of some process within a process chain |
| * eventType: The type of the Event |
| * entity: The process that fires the event (optional) |
| * processingUnit: The processing unit that executes the process when the event is fired (optional) |
| */ |
| class ProcessChainEvent extends EntityEvent |
| { |
| ProcessEventType eventType |
| refers ProcessChain entity |
| refers ProcessingUnit processingUnit |
| } |
| |
| /* |
| * Describes the event of a runnable |
| * eventType: The type of event |
| * entity: The runnable that fires the event (optional) |
| * process: The process that executes the runnable (optional) |
| * processingUnit: The processing unit that executes the runnable (executes the process that calls the runnable) (optional) |
| */ |
| class RunnableEvent extends TriggerEvent |
| { |
| RunnableEventType eventType |
| refers Runnable entity |
| refers Process process |
| refers ProcessingUnit processingUnit |
| } |
| |
| /* |
| * Describes the event of a label access |
| * eventType: The type of event |
| * entity: The accessed label that fires the event (optional) |
| * runnable: The runnable that accesses the label (optional) |
| * process: The process that accesses the label (optional) |
| */ |
| class LabelEvent extends TriggerEvent |
| { |
| LabelEventType eventType |
| refers Label entity |
| refers Runnable runnable |
| refers Process process |
| } |
| |
| /* |
| * Describes the event of a channel access |
| * eventType: The type of event |
| * entity: The accessed channel that fires the event (optional) |
| * runnable: The runnable that accesses the label (optional) |
| * process: The process that accesses the label (optional) |
| */ |
| class ChannelEvent extends TriggerEvent |
| { |
| ChannelEventType eventType |
| refers Channel entity |
| refers Runnable runnable |
| refers Process process |
| } |
| |
| /* |
| * Describes the event of a semaphore access |
| * eventType: The type of event |
| * entity: The accessed semaphore that fires the event (optional) |
| * runnable: The runnable that accesses the semaphore (optional) |
| * process: The process that accesses the semaphore (optional) |
| * processingUnit: The processing unit that executes the process/runnable that accesses the semaphore (optional) |
| */ |
| class SemaphoreEvent extends EntityEvent |
| { |
| SemaphoreEventType eventType |
| refers Semaphore entity |
| refers Runnable runnable |
| refers Process process |
| refers ProcessingUnit processingUnit |
| } |
| |
| /* |
| * Describes the event of a component |
| * eventType: The type of event |
| * entity: The component that fires the event (optional) |
| */ |
| class ComponentEvent extends EntityEvent |
| { |
| ComponentEventType eventType |
| refers Component entity |
| } |
| |
| /* |
| * The types of a process event |
| */ |
| enum ProcessEventType |
| { |
| _all_ |
| activate |
| deadline |
| start |
| resume |
| preempt |
| poll |
| run |
| wait |
| poll_parking |
| park |
| release_parking |
| release |
| terminate |
| } |
| |
| /* |
| * The types of a runnable event |
| */ |
| enum RunnableEventType |
| { |
| _all_ |
| start |
| suspend |
| resume |
| terminate |
| } |
| |
| /* |
| * The types of a label event |
| */ |
| enum LabelEventType |
| { |
| _all_ |
| read |
| write |
| } |
| |
| /* |
| * The types of a label event |
| */ |
| enum ChannelEventType |
| { |
| _all_ |
| send |
| receive |
| } |
| |
| /* |
| * The types of a semaphore event |
| */ |
| enum SemaphoreEventType |
| { |
| _all_ |
| lock |
| unlock |
| } |
| |
| /* |
| * The types of a component event |
| */ |
| enum ComponentEventType |
| { |
| _all_ |
| start |
| end |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // HW Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class HWModel extends BaseObject |
| { |
| contains HwDefinition[] definitions |
| contains HwFeatureCategory[] featureCategories |
| contains HwStructure[] structures |
| contains HwDomain[] domains |
| } |
| |
| class HwStructure extends ReferableBaseObject, ITaggable |
| { |
| StructureType structureType |
| contains HwPort[] ports |
| contains HwStructure[] structures |
| contains HwModule[] modules |
| contains HwConnection[] connections |
| |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers derived readonly HwPort[] innerPorts get { |
| AmaltheaServices.getInnerPorts(this); |
| } |
| } |
| |
| abstract class HwModule extends ReferableBaseObject, ITaggable |
| { |
| contains HwPort[] ports |
| refers PowerDomain powerDomain |
| refers FrequencyDomain frequencyDomain |
| } |
| |
| abstract class HwDomain extends ReferableBaseObject, ITaggable {} |
| |
| class FrequencyDomain extends HwDomain |
| { |
| // contains Frequency[] possibleValues |
| contains Frequency defaultValue |
| boolean clockGating = "false" |
| } |
| |
| class PowerDomain extends HwDomain |
| { |
| // contains Voltage[] possibleValues |
| contains Voltage defaultValue |
| boolean powerGating = "false" |
| } |
| |
| class ProcessingUnit extends HwModule, HwDestination, HwPathElement |
| { |
| refers ProcessingUnitDefinition definition |
| contains HwAccessElement[] accessElements opposite source |
| contains Cache[] caches |
| } |
| |
| class Memory extends HwModule, HwDestination |
| { |
| refers MemoryDefinition definition |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of mappings (MemoryMapping).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived MemoryMapping[] mappings get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.memory_Mappings, |
| #{AmaltheaPackage.eINSTANCE.memoryMapping_Memory} ) |
| } |
| } |
| |
| enum MemoryType |
| { |
| _undefined_ |
| DRAM |
| SRAM |
| FLASH |
| PCM |
| } |
| |
| class Cache extends HwModule, HwPathElement |
| { |
| refers CacheDefinition definition |
| } |
| |
| class HwFeatureCategory extends ReferableBaseObject, IDescription |
| { |
| HwFeatureType featureType |
| contains HwFeature[] features opposite containingCategory |
| } |
| |
| class HwFeature extends ReferableBaseObject |
| { |
| @GenModel(propertyCategory="Read only") |
| container readonly HwFeatureCategory containingCategory opposite features |
| |
| op String[] getNamePrefixSegments() { (containingCategory?.qualifiedNameSegments) ?: newBasicEList } |
| |
| op String toString() { |
| val featureName = containingCategory?.name |
| return (if (featureName.nullOrEmpty) "<category>" else featureName) + "::" + (if (name.nullOrEmpty) "<feature>" else name) |
| } |
| |
| double value = "0.0" |
| } |
| |
| class HwPort extends ReferableBaseObject, ITaggable |
| { |
| op String[] getNamePrefixSegments() { (namedContainer?.qualifiedNameSegments) ?: newBasicEList } |
| |
| int bitWidth = "0" |
| int priority = "0" |
| PortType portType |
| PortInterface portInterface |
| |
| @GenModel(propertyCategory="Read only") |
| derived readonly boolean delegated get { |
| eContainer instanceof HwStructure |
| } |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of connections (HwConnection).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived HwConnection[] connections get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.hwPort_Connections, |
| #{AmaltheaPackage.eINSTANCE.hwConnection_Port1, AmaltheaPackage.eINSTANCE.hwConnection_Port2} |
| ) |
| } |
| |
| } |
| |
| class ConnectionHandler extends HwModule, HwPathElement |
| { |
| refers ConnectionHandlerDefinition definition |
| contains HwConnection[] internalConnections |
| } |
| |
| class HwConnection extends ReferableBaseObject, HwPathElement, ITaggable |
| { |
| op String[] getNamePrefixSegments() { (namedContainer?.qualifiedNameSegments) ?: newBasicEList } |
| |
| @GenModel(documentation="<p><b>Read latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation readLatency |
| @GenModel(documentation="<p><b>Write latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation writeLatency |
| contains DataRate dataRate |
| refers HwPort port1 |
| refers HwPort port2 |
| |
| @GenModel(propertyCategory="Read only") |
| derived readonly boolean internal get { |
| eContainer instanceof ConnectionHandler |
| } |
| |
| op HwPort[] getPorts() { |
| return newArrayList(port1, port2).filterNull.toEList.unmodifiableEList |
| } |
| } |
| |
| class HwAccessElement extends ITaggable, INamed |
| { |
| // container (read only) |
| @GenModel(propertyCategory="Read only") |
| container readonly ProcessingUnit source opposite accessElements |
| |
| refers HwDestination[1] destination |
| contains HwAccessPath accessPath opposite containingAccessElement |
| @GenModel(documentation="<p><b>Read latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation readLatency |
| @GenModel(documentation="<p><b>Write latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation writeLatency |
| contains DataRate dataRate |
| } |
| |
| enum StructureType |
| { |
| _undefined_ |
| System |
| ECU |
| Microcontroller |
| SoC |
| Cluster |
| Group |
| Array |
| Area |
| Region |
| } |
| |
| enum CacheType |
| { |
| _undefined_ |
| instruction |
| data |
| unified |
| } |
| |
| enum PortType |
| { |
| _undefined_ |
| initiator // master |
| responder // slave |
| } |
| |
| enum SchedPolicy |
| { |
| _undefined_ |
| RoundRobin |
| FCFS |
| PriorityBased |
| } |
| |
| enum WriteStrategy |
| { |
| _undefined_ |
| none |
| writeback |
| writethrough |
| } |
| |
| abstract class HwDefinition extends ReferableBaseObject, ITaggable {} |
| |
| class ProcessingUnitDefinition extends HwDefinition |
| { |
| PuType puType |
| refers HwFeature[] features |
| refers CoreClassifier[] classifiers // backward compatibility |
| } |
| |
| class ConnectionHandlerDefinition extends HwDefinition |
| { |
| SchedPolicy policy |
| @GenModel(documentation="<p><b>Read latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation readLatency |
| @GenModel(documentation="<p><b>Write latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation writeLatency |
| contains DataRate dataRate |
| PositiveInt maxBurstSize = "1" |
| PositiveInt maxConcurrentTransfers = "1" |
| } |
| |
| class MemoryDefinition extends HwDefinition |
| { |
| contains DataSize size |
| @GenModel(documentation="<p><b>Access latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation accessLatency |
| contains DataRate dataRate |
| MemoryType memoryType |
| refers MemoryClassifier[] classifiers // backward compatibility |
| } |
| |
| class CacheDefinition extends HwDefinition |
| { |
| contains DataSize size |
| contains DataSize lineSize |
| @GenModel(documentation="<p><b>Access latency [cycles]</b></p>") |
| contains IDiscreteValueDeviation accessLatency |
| CacheType cacheType |
| WriteStrategy writeStrategy |
| int nWays = "0" |
| boolean coherency = "false" |
| boolean exclusive = "false" |
| double hitRate = "0.0" |
| } |
| |
| abstract class HwPath |
| { |
| op HwAccessElement getContainingAccessElement() {} |
| |
| @GenModel(propertyCategory="Read only") |
| refers derived readonly ProcessingUnit source get { |
| return containingAccessElement.source |
| } |
| @GenModel(propertyCategory="Read only") |
| refers derived readonly HwDestination destination get { |
| return containingAccessElement.destination |
| } |
| } |
| |
| class HwAccessPath extends HwPath, INamed |
| { |
| @GenModel(propertyCategory="Read only") |
| container readonly HwAccessElement containingAccessElement opposite accessPath |
| |
| refers HwPathElement[+] pathElements |
| Address startAddress = "0" |
| Address endAddress = "0" |
| Address memOffset = "0" |
| } |
| |
| interface HwPathElement extends IReferable |
| { |
| op HwPort[] getPorts() |
| } |
| |
| interface HwDestination extends IReferable |
| { |
| op HwPort[] getPorts() |
| } |
| |
| enum PuType |
| { |
| _undefined_ |
| GPU |
| CPU |
| Accelerator |
| } |
| |
| enum PortInterface |
| { |
| _undefined_ |
| custom |
| CAN |
| Flexray |
| LIN |
| MOST |
| Ethernet |
| SPI // Serial Peripheral Interface |
| I2C // Inter-Integrated Circuit |
| AXI // Advanced eXtensible Interface |
| AHB // Advanced High-performance Bus |
| APB // Advanced Peripheral Bus |
| SWR // Serial WireRing |
| } |
| |
| enum HwFeatureType |
| { |
| _undefined_ |
| performance |
| power |
| performance_and_power |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Mapping Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class MappingModel extends BaseObject |
| { |
| contains SchedulerAllocation[] schedulerAllocation |
| contains RunnableAllocation[] runnableAllocation |
| contains TaskAllocation[] taskAllocation |
| contains ISRAllocation[] isrAllocation |
| contains MemoryMapping[] memoryMapping |
| contains PhysicalSectionMapping[] physicalSectionMapping |
| MemoryAddressMappingType addressMappingType |
| } |
| |
| /* |
| * Defines how to interpret the memory addresses in this mapping model |
| */ |
| enum MemoryAddressMappingType |
| { |
| _undefined_ // Display: "<address type>" |
| // no addresses required |
| none |
| // absolute memory address |
| address |
| // offset from first address of memory |
| offset |
| } |
| |
| //////////////// Generalizations for the Allocations (assignment to cores) |
| /* |
| * Allocation of Schedulers |
| */ |
| class SchedulerAllocation extends BaseObject |
| { |
| refers Scheduler[1] scheduler |
| refers ProcessingUnit[+] responsibility |
| refers ProcessingUnit executingPU |
| } |
| |
| //////////////// Specializations of Allocations |
| class TaskAllocation extends BaseObject |
| { |
| refers Task[1] task |
| refers TaskScheduler[1] scheduler |
| refers ProcessingUnit[] affinity |
| contains SchedulingParameters schedulingParameters |
| contains ParameterExtension[] parameterExtensions |
| } |
| |
| class ISRAllocation extends BaseObject |
| { |
| refers ISR[1] isr |
| refers InterruptController[1] controller |
| Integer priority |
| } |
| |
| class RunnableAllocation extends BaseObject |
| { |
| refers Scheduler[1] scheduler |
| refers Runnable[1] entity |
| } |
| |
| //////////////// Specializations of Mappings |
| /* |
| * Mapping of AbstractMemoryElement (Label, Runnable, ISR, Task, ...) |
| * to a specific memory. |
| */ |
| class MemoryMapping extends BaseObject |
| { |
| refers AbstractMemoryElement[1] abstractElement |
| refers Memory memory |
| /* |
| * The position of the element in the mapped memory |
| */ |
| Address memoryPositionAddress = "0" |
| } |
| |
| class PhysicalSectionMapping extends ReferableBaseObject |
| { |
| @GenModel(propertyCategory="Main") |
| refers Section[+] origin |
| @GenModel(propertyCategory="Memory") |
| refers Memory[1] memory |
| @GenModel(propertyCategory="Memory") |
| Address startAddress = "0" |
| @GenModel(propertyCategory="Memory") |
| Address endAddress = "0" |
| refers Label[] labels |
| refers Runnable[] runEntities |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // OS Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class OSModel extends BaseObject |
| { |
| contains Semaphore[] semaphores |
| contains OperatingSystem[] operatingSystems |
| contains OsOverhead[] osOverheads |
| } |
| |
| class OsDataConsistency extends BaseObject |
| { |
| OsDataConsistencyMode mode |
| contains DataStability dataStability |
| contains NonAtomicDataCoherency nonAtomicDataCoherency |
| } |
| |
| class DataStability |
| { |
| boolean enabled = "false" |
| String algorithm |
| AccessMultiplicity accessMultiplicity |
| DataStabilityLevel level |
| } |
| |
| class NonAtomicDataCoherency |
| { |
| boolean enabled = "false" |
| String algorithm |
| AccessMultiplicity accessMultiplicity |
| } |
| |
| enum OsDataConsistencyMode |
| { |
| _undefined_ // Display: "<data consistency mode>" |
| noProtection |
| automaticProtection |
| customProtection |
| handledByModelElements |
| } |
| |
| enum AccessMultiplicity |
| { |
| _undefined_ // Display: "<access multiplicity>" |
| singleAccess |
| multipleAccesses |
| } |
| |
| enum DataStabilityLevel |
| { |
| _undefined_ // Display: "<data stability level>" |
| period // between consecutive occurrences |
| process // within a Task or ISR |
| scheduleSection // between Schedule points (explicit schedule points, begin and end of process) |
| runnable // within a Runnable |
| } |
| |
| /* |
| * name: Name of semaphore |
| * maxValue: maximum number of users which can access the semaphore simultaneously |
| * initialValue: number of users which access semaphore at system startup |
| * priorityCeilingProtocol: enables priority ceiling for this resource |
| |
| */ |
| class Semaphore extends ReferableBaseObject |
| { |
| SemaphoreType semaphoreType |
| int initialValue = "0" |
| int maxValue = "0" |
| boolean priorityCeilingProtocol = "false" |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of accesses (SemaphoreAccess).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived SemaphoreAccess[] semaphoreAccesses get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.semaphore_SemaphoreAccesses, |
| #{AmaltheaPackage.eINSTANCE.semaphoreAccess_Semaphore} ) |
| } |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of components the semaphore belongs to.</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived Component[] referringComponents get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.semaphore_ReferringComponents, |
| #{AmaltheaPackage.eINSTANCE.component_Semaphores} ) |
| } |
| } |
| |
| enum SemaphoreType |
| { |
| _undefined_ // Display: "<semaphore type>" |
| CountingSemaphore |
| Resource |
| Spinlock |
| } |
| |
| /* |
| * scheduling algorithm: The used algorithm for scheduling |
| * computation items: steps to perform the scheduling algorithm |
| */ |
| abstract class Scheduler extends ReferableBaseObject |
| { |
| contains ComputationItem[] computationItems |
| op Algorithm getSchedulingAlgorithm() {} |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of scheduler allocations (SchedulerAllocation).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived SchedulerAllocation[] schedulerAllocations get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.scheduler_SchedulerAllocations, |
| #{AmaltheaPackage.eINSTANCE.schedulerAllocation_Scheduler} ) |
| } |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of runnable allocations (RunnableAllocation).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived RunnableAllocation[] runnableAllocations get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.scheduler_RunnableAllocations, |
| #{AmaltheaPackage.eINSTANCE.runnableAllocation_Scheduler} ) |
| } |
| } |
| |
| class TaskScheduler extends Scheduler |
| { |
| contains TaskSchedulingAlgorithm schedulingAlgorithm |
| contains SchedulerAssociation parentAssociation opposite child |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of child associations (SchedulerAssociation).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived SchedulerAssociation[] childAssociations get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.taskScheduler_ChildAssociations, |
| #{AmaltheaPackage.eINSTANCE.schedulerAssociation_Parent} ) |
| } |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of task allocations (TaskAllocation).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived TaskAllocation[] taskAllocations get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.taskScheduler_TaskAllocations, |
| #{AmaltheaPackage.eINSTANCE.taskAllocation_Scheduler} ) |
| } |
| |
| @GenModel(propertyCategory="Read only") |
| refers derived readonly TaskScheduler parentScheduler get { |
| return parentAssociation?.parent |
| } |
| |
| @GenModel(propertyCategory="Read only") |
| refers derived readonly TaskScheduler[] childSchedulers get { |
| val result = childAssociations.map[child].filterNull |
| return new UnmodifiableEList(this as InternalEObject, AmaltheaPackage.eINSTANCE.taskScheduler_ChildSchedulers, |
| result.size, result.toList.toArray) |
| } |
| } |
| |
| class SchedulerAssociation |
| { |
| // container (read only) |
| @GenModel(propertyCategory="Read only") |
| container readonly TaskScheduler child opposite parentAssociation |
| |
| refers TaskScheduler parent |
| contains SchedulingParameters schedulingParameters |
| contains ParameterExtension[] parameterExtensions |
| } |
| |
| class InterruptController extends Scheduler |
| { |
| contains InterruptSchedulingAlgorithm schedulingAlgorithm |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of ISR allocations (ISRAllocation).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived ISRAllocation[] isrAllocations get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.interruptController_IsrAllocations, |
| #{AmaltheaPackage.eINSTANCE.ISRAllocation_Controller} ) |
| } |
| } |
| |
| /* |
| * Common scheduling parameters |
| */ |
| class SchedulingParameters |
| { |
| Integer priority |
| contains Time minBudget |
| contains Time maxBudget |
| contains Time replenishment |
| } |
| |
| /* |
| * Parameter extensions (used for scheduling algorithms) |
| */ |
| class ParameterExtension wraps java.util.Map$Entry |
| { |
| String[1] key |
| String[1] value |
| } |
| |
| abstract class Algorithm extends BaseObject {} |
| |
| /* |
| * Interrupt Scheduling Algorithm |
| */ |
| abstract class InterruptSchedulingAlgorithm extends Algorithm {} |
| |
| /* |
| * Task Scheduling Algorithm |
| */ |
| abstract class TaskSchedulingAlgorithm extends Algorithm {} |
| |
| /* |
| * Fixed Priority Scheduling |
| */ |
| abstract class FixedPriority extends TaskSchedulingAlgorithm {} |
| |
| /* |
| * Fixed Priority Preemptive scheduling algorithm |
| */ |
| class FixedPriorityPreemptive extends FixedPriority {} |
| |
| /* |
| * Fixed Priority Preemptive scheduling algorithm (with budget enforcement) |
| */ |
| class FixedPriorityPreemptiveWithBudgetEnforcement extends FixedPriority {} |
| |
| /* |
| * OSEK scheduling algorithm |
| */ |
| class OSEK extends FixedPriority {} |
| |
| /* |
| * task with shortest deadline has highest priority |
| */ |
| class DeadlineMonotonic extends FixedPriority {} |
| |
| /* |
| * task with shortest recurrence (i.e. period) has highest priority |
| */ |
| class RateMonotonic extends FixedPriority {} |
| |
| /* |
| * Proportionate Fair (Pfair) Scheduling |
| * (global scheduling algorithm) |
| */ |
| abstract class Pfair extends TaskSchedulingAlgorithm |
| { |
| int quantSizeNs = "0" |
| } |
| |
| /* |
| * Proportionate Fair PD2 Scheduling |
| * (global scheduling algorithm) |
| */ |
| class PfairPD2 extends Pfair {} |
| |
| /* |
| * Partly Proportionate Fair PD2 Scheduling |
| * (global scheduling algorithm) |
| */ |
| class PartlyPFairPD2 extends Pfair {} |
| |
| /* |
| * Early Release Fair PD2 Scheduling |
| * (global scheduling algorithm) |
| */ |
| class EarlyReleaseFairPD2 extends Pfair {} |
| |
| /* |
| * Partly Early Release Fair PD2 Scheduling |
| * (global scheduling algorithm) |
| */ |
| class PartlyEarlyReleaseFairPD2 extends Pfair {} |
| |
| /* |
| * Dynamic Priority Scheduling |
| */ |
| abstract class DynamicPriority extends TaskSchedulingAlgorithm {} |
| |
| /* |
| * global scheduling algorithm |
| */ |
| class LeastLocalRemainingExecutionTimeFirst extends DynamicPriority {} |
| |
| /* |
| * earliest absolute deadline first |
| */ |
| class EarliestDeadlineFirst extends DynamicPriority {} |
| |
| /* |
| * all tasks with equal priority executed for certain time slice |
| */ |
| class PriorityBasedRoundRobin extends DynamicPriority {} |
| |
| /* |
| * Reservation Based Server |
| */ |
| abstract class ReservationBasedServer extends TaskSchedulingAlgorithm {} |
| |
| /* |
| * Deferrable Server |
| */ |
| class DeferrableServer extends ReservationBasedServer {} |
| |
| /* |
| * Polling Periodic Server |
| */ |
| class PollingPeriodicServer extends ReservationBasedServer {} |
| |
| /* |
| * Sporadic Server |
| */ |
| class SporadicServer extends ReservationBasedServer {} |
| |
| /* |
| * Constant Bandwidth Server |
| */ |
| class ConstantBandwidthServer extends ReservationBasedServer {} |
| |
| /* |
| * Constant Bandwidth Server With CASH |
| */ |
| class ConstantBandwidthServerWithCASH extends ReservationBasedServer {} |
| |
| /* |
| * logical grouping of tasks/child-schedulers |
| */ |
| class Grouping extends TaskSchedulingAlgorithm {} |
| |
| /* |
| * allows the user to define own scheduling algorithm (TA-Toolsuite feature) |
| */ |
| class UserSpecificSchedulingAlgorithm extends TaskSchedulingAlgorithm, InterruptSchedulingAlgorithm |
| { |
| contains ParameterExtension[] parameterExtensions |
| } |
| |
| /* |
| * Priority based Scheduling Algorithm for Interrupts |
| */ |
| class PriorityBased extends InterruptSchedulingAlgorithm {} |
| |
| class OperatingSystem extends BaseObject, INamed |
| { |
| refers OsOverhead overhead |
| contains TaskScheduler[] taskSchedulers |
| contains InterruptController[] interruptControllers |
| contains OsDataConsistency osDataConsistency |
| } |
| |
| class VendorOperatingSystem extends OperatingSystem |
| { |
| String osName |
| String vendor |
| String version |
| } |
| |
| class OsOverhead extends ReferableBaseObject |
| { |
| contains OsAPIOverhead apiOverhead |
| contains OsISROverhead isrCategory1Overhead |
| contains OsISROverhead isrCategory2Overhead |
| } |
| |
| class OsAPIOverhead extends BaseObject |
| { |
| contains Ticks apiSendMessage |
| contains Ticks apiTerminateTask |
| contains Ticks apiSchedule |
| contains Ticks apiRequestResource |
| contains Ticks apiReleaseResource |
| contains Ticks apiSetEvent |
| contains Ticks apiWaitEvent |
| contains Ticks apiClearEvent |
| contains Ticks apiActivateTask |
| contains Ticks apiEnforcedMigration |
| contains Ticks apiSuspendOsInterrupts |
| contains Ticks apiResumeOsInterrupts |
| contains Ticks apiRequestSpinlock |
| contains Ticks apiReleaseSpinlock |
| contains Ticks apiSenderReceiverRead |
| contains Ticks apiSenderReceiverWrite |
| contains Ticks apiSynchronousServerCallPoint |
| contains Ticks apiIocRead |
| contains Ticks apiIocWrite |
| } |
| |
| class OsISROverhead extends BaseObject |
| { |
| contains Ticks preExecutionOverhead |
| contains Ticks postExecutionOverhead |
| } |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Property Constraints Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class PropertyConstraintsModel extends BaseObject |
| { |
| contains CoreAllocationConstraint[] allocationConstraints |
| contains MemoryMappingConstraint[] mappingConstraints |
| } |
| |
| /* |
| * Abstract Class, used to describe Constraints for Allocations |
| * (these usually target Cores and their features/attributes) |
| */ |
| abstract class CoreAllocationConstraint extends BaseObject |
| { |
| contains CoreClassification coreClassification |
| } |
| |
| /* |
| * Abstract Class, used to describe Constraints for Mapping |
| * (these usually target Memories and their features/attributes) |
| */ |
| abstract class MemoryMappingConstraint extends BaseObject |
| { |
| contains MemoryClassification memoryClassification |
| } |
| |
| /* |
| * ProcessAllocationConstraints describe the constraints for |
| * Process-to-Core allocations |
| */ |
| class ProcessAllocationConstraint extends CoreAllocationConstraint |
| { |
| refers Process process |
| } |
| |
| /* |
| * ProcessPrototypeAllocationConstraints describe the constraints for |
| * ProcessPrototype-to-Core allocations |
| */ |
| class ProcessPrototypeAllocationConstraint extends CoreAllocationConstraint |
| { |
| refers ProcessPrototype processPrototype |
| } |
| |
| /* |
| * RunnableAllocationConstraints describe the constraints for |
| * Runnable-to-Core allocations |
| */ |
| class RunnableAllocationConstraint extends CoreAllocationConstraint |
| { |
| refers Runnable runnable |
| } |
| |
| /* |
| * AbstractElementMappingConstraints describe the constraints for |
| * AbstractMemoryElement-to-Memory Mapping |
| */ |
| class AbstractElementMappingConstraint extends MemoryMappingConstraint |
| { |
| refers AbstractMemoryElement abstractElement |
| } |
| |
| /* |
| * Generalization for all Hardware related constraints |
| */ |
| abstract class Classification extends BaseObject |
| { |
| Condition condition |
| GroupingType grouping |
| } |
| |
| enum Condition |
| { |
| _undefined_ // Display: "<condition>" |
| requires |
| excludes |
| } |
| |
| enum GroupingType{ |
| _undefined_ // Display: "<grouping>" |
| allOfThem |
| atLeastOneOfThem |
| } |
| |
| class CoreClassification extends Classification |
| { |
| refers CoreClassifier[] classifiers |
| } |
| |
| class MemoryClassification extends Classification |
| { |
| refers MemoryClassifier[] classifiers |
| } |
| |
| |
| |
| // =============================================================================== |
| // =============================================================================== |
| // |
| // Stimuli Model |
| // |
| // =============================================================================== |
| // =============================================================================== |
| |
| |
| class StimuliModel extends BaseObject |
| { |
| contains Stimulus[] stimuli |
| contains Clock[] clocks |
| } |
| |
| /* |
| * Every process/task can have one or more stimuli. |
| * A stimulus activates the process |
| */ |
| abstract class Stimulus extends ReferableBaseObject, ITaggable |
| { |
| contains ModeValueList setModeValueList |
| contains ModeConditionDisjunction executionCondition |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of affected processes (Process).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived Process[] affectedProcesses get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.stimulus_AffectedProcesses, |
| #{AmaltheaPackage.eINSTANCE.process_Stimuli} ) |
| } |
| } |
| |
| class ModeValueList extends BaseObject |
| { |
| contains ModeAssignment[] entries |
| } |
| |
| class ModeValueMapEntry wraps java.util.Map$Entry |
| { |
| refers ModeLabel[1] key |
| String[1] value |
| } |
| |
| abstract class ModeValue extends BaseObject { |
| refers ModeLabel[1] label |
| String[1] value |
| |
| op boolean validateInvariants(EDiagnosticChain diagnostics, EMap<Object,Object> context) { |
| AmaltheaValidations.validateInvariants(this, diagnostics, context) |
| } |
| |
| op ModeLiteral getLiteral() { |
| if (value === null) return null |
| val mode = label?.mode |
| if (mode instanceof EnumMode) {mode.literals.findFirst[name == value]} else {null} |
| } |
| |
| op Integer getInteger() { |
| if (value === null) return null |
| val mode = label?.mode |
| if (mode instanceof NumericMode && value.matches("-?\\d+")) {Integer.parseInt(value)} else {null} |
| } |
| } |
| |
| class ModeAssignment extends ModeValue { |
| } |
| |
| class ModeConditionDisjunction extends BaseObject |
| { |
| contains ModeConditionDisjunctionEntry[+] entries |
| |
| op boolean isSatisfiedBy(ModeValueMapEntry[] context) { |
| for (ModeConditionDisjunctionEntry entry : entries) { |
| if (entry.isSatisfiedBy(context)) return true; |
| } |
| return false; |
| } |
| } |
| |
| interface ModeConditionDisjunctionEntry extends BaseObject |
| { |
| op boolean isSatisfiedBy(ModeValueMapEntry[] assignment) |
| } |
| |
| interface ModeCondition extends ModeConditionDisjunctionEntry { |
| RelationalOperator relation |
| |
| op boolean isSatisfiedBy(ModeValueMapEntry[] context) |
| } |
| |
| class ModeValueCondition extends ModeValue, ModeCondition |
| { |
| op boolean isSatisfiedBy(ModeValueMapEntry[] context) { |
| // no value defined => satisfied (don't care) |
| val labelValue = context?.get(label) |
| return (labelValue === null) || (labelValue == value) |
| } |
| } |
| |
| class ModeLabelCondition extends ModeCondition |
| { |
| refers ModeLabel[1] label1 |
| refers ModeLabel[1] label2 |
| |
| op boolean isSatisfiedBy(ModeValueMapEntry[] context) { |
| // no value defined => satisfied (don't care) |
| val labelValue1 = context?.get(label1) |
| val labelValue2 = context?.get(label2) |
| return (labelValue1 === null) || (labelValue2 === null) || (labelValue1 == labelValue2) |
| } |
| } |
| |
| class ModeConditionConjunction extends ModeConditionDisjunctionEntry |
| { |
| contains ModeCondition[+] entries |
| |
| op boolean isSatisfiedBy(ModeValueMapEntry[] context) { |
| for (ModeCondition entry : entries) { |
| if (! entry.isSatisfiedBy(context)) return false; |
| } |
| return true; |
| } |
| } |
| |
| /* |
| * Stimulus that is triggered periodically. |
| * offset: Time of first occurrence |
| * recurrence: Time between following occurrences |
| */ |
| interface FixedPeriodic |
| { |
| contains Time[1] recurrence |
| contains Time offset |
| } |
| |
| /* |
| * Stimulus that is triggered periodically. |
| * jitter: Deviation from true periodicity to real occurrence |
| * minDistance: Minimal time between occurrences |
| */ |
| class PeriodicStimulus extends Stimulus, FixedPeriodic |
| { |
| contains ITimeDeviation jitter |
| contains Time minDistance |
| } |
| |
| /* |
| * Stimulus that is triggered relative to the previous occurrence. |
| * offset: Time of first occurrence |
| * step: Time (Deviation) between successive occurrences |
| */ |
| class RelativePeriodicStimulus extends Stimulus |
| { |
| contains Time offset |
| contains ITimeDeviation[1] nextOccurrence |
| } |
| |
| /* |
| * Periodic stimulus based on other events, like rotation speed |
| * clock: Time base which defines deviation of time, multiple stimuli can have the same time base |
| */ |
| class VariableRateStimulus extends Stimulus |
| { |
| contains Time[1] step |
| contains IContinuousValueDeviation[1] occurrencesPerStep |
| Double maxIncreasePerStep // initial value is null |
| Double maxDecreasePerStep // initial value is null |
| contains Scenario scenario |
| } |
| |
| class Scenario extends BaseObject |
| { |
| refers Clock[1] clock |
| |
| NonNegativeDouble samplingOffset = "0.0" |
| NonNegativeDouble samplingRecurrence = "1.0" |
| } |
| |
| /* |
| * Stimulus (repeated periodically) with a defined list of occurrences. |
| * occurrenceTimes: List of all occurrences |
| */ |
| class PeriodicSyntheticStimulus extends Stimulus, FixedPeriodic |
| { |
| contains Time[+] occurrenceTimes |
| } |
| |
| /* |
| * Stimulus to describe own custom types, including properties. |
| */ |
| class CustomStimulus extends Stimulus, IDescription |
| { |
| } |
| |
| /* |
| * Single occurrence at a defined time. |
| */ |
| class SingleStimulus extends Stimulus |
| { |
| contains Time[1] occurrence |
| } |
| |
| /* |
| * Stimulus based on a explicit inter process trigger. |
| */ |
| class InterProcessStimulus extends Stimulus |
| { |
| contains Counter counter |
| |
| // back pointer (readonly) |
| @GenModel(documentation="<p><b>Returns an <em>immutable</em> list of triggers (InterProcessTrigger).</b></p>") |
| @GenModel(propertyCategory="Read only", propertyFilterFlags="org.eclipse.ui.views.properties.expert") |
| refers transient readonly volatile derived InterProcessTrigger[] explicitTriggers get { |
| AmaltheaIndex.getInverseReferences(this, AmaltheaPackage.eINSTANCE.interProcessStimulus_ExplicitTriggers, |
| #{AmaltheaPackage.eINSTANCE.interProcessTrigger_Stimulus} ) |
| } |
| } |
| |
| /* |
| * Stimulus (repeated periodically) for burst occurrences |
| * burstLength: Time frame for the burst (occurrences after the length are clipped) |
| */ |
| class PeriodicBurstStimulus extends Stimulus, FixedPeriodic |
| { |
| contains Time[1] burstLength |
| contains Time occurrenceMinDistance |
| int occurrenceCount = "0" |
| } |
| |
| /* |
| * Stimulus which is activated by an event. |
| */ |
| class EventStimulus extends Stimulus |
| { |
| refers TriggerEvent[+] triggeringEvents |
| contains Counter counter |
| } |
| |
| /* |
| * Arrival Curve Stimulus |
| */ |
| class ArrivalCurveStimulus extends Stimulus |
| { |
| contains ArrivalCurveEntry[+] entries |
| } |
| |
| class ArrivalCurveEntry extends BaseObject |
| { |
| int numberOfOccurrences = "0" |
| contains Time lowerTimeBorder |
| contains Time upperTimeBorder |
| } |
| |
| /* |
|