## Model Validation

### Usage of AMALTHEA Model Validation

The AMALTHEA model validation can be triggered by clicking on the “Validate” button of the Amalthea editor.

All elements of the model are included for validation. In the next window the list of profiles appears allowing the selection of specific validations.

If an error is found, it is shown in the Problems view of Eclipse. A simple double click on the error will lead you to the affected elements in the AMALTHEA model. The validation distinguishes between three error types: errors, warnings and info.

### Included Validations

#### Amalthea Standard Validations

`org.eclipse.app4mc.amalthea.validations.standard.AmaltheaProfile`
Amalthea Standard Validations
Standard validations for AMALTHEA models to ensure data consistency.

- Profiles:
  - `org.eclipse.app4mc.amalthea.validations.standard.BasicProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.ConstraintsProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.EMFProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.EMFScopeProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.HardwareProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.MappingProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.SoftwareProfile`

`org.eclipse.app4mc.amalthea.validations.standard.BasicProfile`
Basic Validations

- Validations:
  - AM-Basic-CustomProperty-Key (WARNING – IAnnotatable)
    - Custom property keys have to be unique
  - AM-Basic-Quantity (ERROR – Quantity)
    - Quantity unit has to be set ( undefined is an error)
  - AM-Basic-Frequency (ERROR – Frequency)
    - Some frequencies have to fulfill the condition >0
  - AM-Basic-Counter (ERROR – Counter)
    - The offset value of a counter must not be negative
  - AM-Basic-Time-Range (ERROR – Time)
    - Some time ranges has to fulfill the condition >0 or >=0
  - AM-Basic-Data-Size (ERROR – DataSize)
    - Some data sizes have to fulfill the condition >0 or >=0

`org.eclipse.app4mc.amalthea.validations.standard.ConstraintsProfile`
Constraints Validations

- Validations:
  - AM-Constraints-EventChain (ERROR – AbstractEventChain)
    - Stimulus and response shall not reference the same event
    - The stimulus of the first segment has to be the same as the stimulus of the event chain
    - The stimulus of other segments have to be equal to the response of the previous segment
    - The response of the last segment has to be the same as the response of the event chain

`org.eclipse.app4mc.amalthea.validations.standard.EMFProfile`
Amalthea EMF Validations
Standard EMF validations for AMALTHEA models (generated).

- Validations:
  - AM-EMF-INTRINSIC (UNDEFINED – EObject)
    - EMF extended metadata constraints (generated)
    - AMALTHEA invariants (generated)

`org.eclipse.app4mc.amalthea.validations.standard.EMFScopeProfile`
Amalthea Scope Validations
Validations to ensure unique names in folder scope.

- Validations:
  - AM-EMF-SCOPE (ERROR – Amalthea)
    - ID has to be unique in folder scope
    - ID has to be set for objects of type IReferable

`org.eclipse.app4mc.amalthea.validations.standard.HardwareProfile`
Hardware Validations

- Validations:
  - AM-HW-Port-BitWidth (WARNING – HwPort)
    - Bitwidth should be greater than zero
  - AM-HW-Connection (ERROR – HwConnection)
    - HwConnections must refer to two HwPorts
    - HwConnections must be linked to HwPorts of the same Interface
  - AM-HW-Structure (ERROR – HwStructure)
    - Connections must only refer to contained HwPorts
    - Inner connections always need one Initiator and one Responder HwPort
    - Delegated connections always connect HwPorts of the same type
  - AM-HW-Module-Definition (WARNING – HwModule)
    - Memory definition must be set
    - ProcessingUnit definition must be set
    - ConnectionHandler definition must be set
    - Cache definition must be set
  - AM-HW-Port-Definition (WARNING – HwPort)
    - PortType must be set
    - PortInterface must be set
  - AM-HW-AccessPath (ERROR – HwAccessPath)
    - HwAccessPath ranges and memory size must be consistent
    - HwAccessPath elements must be consistent
  - AM-HW-Port (ERROR – HwPort)
    - A HwPort can only have one (non internal) HwConnection
  - AM-HW-Definition (ERROR – HwDefinition)
    - Only one feature of a category can be referred

`org.eclipse.app4mc.amalthea.validations.standard.MappingProfile`
Mapping Validations

- Validations:
  - AM-Mapping-Task-Scheduler (WARNING – Task)
    - A task should have an allocation to a task scheduler
  - AM-Mapping-Scheduler-ProcessingUnit (WARNING – Scheduler)
    - A scheduler should be responsible for at least one processing unit
  - AM-Mapping-ISR-Scheduler (WARNING – ISR)
    - An ISR should have an allocation to an interrupt controller

`org.eclipse.app4mc.amalthea.validations.standard.SoftwareProfile`
Software Validations

- Validations:
  - AM-SW-DataDependency (ERROR – DataDependency)
    - A data dependency can only be defined for specific types of label accesses, parameters and call arguments
    - A data dependency can only refer to specific types of parameters and call arguments
  - AM-SW-CallArgument (ERROR – CallArgument)
    - The referred runnable must contain the referred parameter

#### Timing Architects Validations

`org.eclipse.app4mc.amalthea.validations.ta.TimingArchitectsProfile`
Timing Architects Validations
Validations for AMALTHEA models used in a Timing Architects Simulation.

- Validations:
  - TA-Misc-Semaphore (ERROR – Semaphore)
    - Initial value must not be negative
    - Max value must be positive
    - Max value must not be smaller than the initial value
- Profiles:
  - `org.eclipse.app4mc.amalthea.validations.standard.AmaltheaProfile`
  - `org.eclipse.app4mc.amalthea.validations.ta.TABasicProfile`
  - `org.eclipse.app4mc.amalthea.validations.ta.TAConstraintsProfile`
  - `org.eclipse.app4mc.amalthea.validations.ta.TAHardwareProfile`
  - `org.eclipse.app4mc.amalthea.validations.ta.TASoftwareProfile`
  - `org.eclipse.app4mc.amalthea.validations.ta.TAStimuliProfile`

`org.eclipse.app4mc.amalthea.validations.ta.TABasicProfile`
Basic Validations (Timing Architects)

- Validations:
  - TA-Basic-DiscreteValueGaussDistribution-mean (ERROR – DiscreteValueGaussDistribution)
    - Mean must not be less than the lower bound
    - Mean must not be greater than the upper bound
  - TA-Basic-ContinuousValueGaussDistribution-mean (ERROR – ContinuousValueGaussDistribution)
    - Mean must not be less than the lower bound
    - Mean must not be greater than the upper bound
  - TA-Basic-TimeGaussDistribution-mean (ERROR – TimeGaussDistribution)
    - Mean must not be less than the lower bound
    - Mean must not be greater than the upper bound

`org.eclipse.app4mc.amalthea.validations.ta.TAConstraintsProfile`
Constraints Validations (Timing Architects)

- Validations:
  - TA-Constraints-DataAgeTime (ERROR – DataAgeTime)
    - Maximum time must not be smaller than minimum time
  - TA-Constraints-EDFTaskMustHaveDeadline (ERROR – Task)
    - EDF tasks must have a deadline requirement
  - TA-Constraints-RepetitionConstraint (ERROR – RepetitionConstraint)
    - Upper bound must not be smaller than lower bound
  - TA-Constraints-DelayConstraint (ERROR – DelayConstraint)
    - Upper bound must not be smaller than lower bound
  - TA-Constraints-RTLimitMustBePositive (ERROR – TimeRequirementLimit)
    - Response time must be positive
  - TA-Constraints-ECLConstraint (ERROR – EventChainLatencyConstraint)
    - Maximum must not be smaller than minimum

`org.eclipse.app4mc.amalthea.validations.ta.TAHardwareProfile`
Hardware Validations (Timing Architects)

- Validations:
  - TA-Hardware-HWFIPCMustBePositive (ERROR – HwFeature)
    - IPC (instructions per cycle) must be positive
  - TA-Hardware-PUDIPCMissing (INFO – ProcessingUnitDefinition)
    - IPC (instructions per cycle) should be set, otherwise default (1.0) will be assumed
    - Only one IPC HwFeature should be specified for a processing unit definition

`org.eclipse.app4mc.amalthea.validations.ta.TASoftwareProfile`
Software Validations (Timing Architects)

- Validations:
  - TA-Software-ModeConditionDisjunctionAlwaysTrue (WARNING – ModeConditionDisjunction)
  - TA-Stimuli-ArrivalCurveStimulus (ERROR – OsEvent)
  - TA-Software-RunnableCall (ERROR – RunnableCall)
  - TA-Software-ModeConditionConjunctionAlwaysFalse (WARNING – ModeConditionConjunction)
  - TA-Software-ServerCall (ERROR – ServerCall)

`org.eclipse.app4mc.amalthea.validations.ta.TAStimuliProfile`
Stimuli Validations (Timing Architects)

- Validations:
  - TA-Stimuli-VariableRateStimulusScenario (ERROR – VariableRateStimulus)
    - Scenario must be set

#### Inchron Validations

`org.eclipse.app4mc.amalthea.validations.inchron.InchronProfile`
Inchron Validations
Validation for Amalthea models used in Inchron Toolsuite

- Profiles:
  - `org.eclipse.app4mc.amalthea.validations.inchron.InchronConstraintsProfile`
  - `org.eclipse.app4mc.amalthea.validations.inchron.InchronHWProfile`
  - `org.eclipse.app4mc.amalthea.validations.inchron.InchronOsProfile`
  - `org.eclipse.app4mc.amalthea.validations.inchron.InchronSoftwareProfile`
  - `org.eclipse.app4mc.amalthea.validations.inchron.InchronStimuliProfile`
  - `org.eclipse.app4mc.amalthea.validations.standard.AmaltheaProfile`

`org.eclipse.app4mc.amalthea.validations.inchron.InchronConstraintsProfile`
Constraints Validations (INCHRON)

- Validations:
  - Inchron-Constraints-LoadRequirementMissingResource (ERROR – CPUPercentageRequirementLimit)
    - CPU load requirement must have hardware context

`org.eclipse.app4mc.amalthea.validations.inchron.InchronHWProfile`
Hardware Validations (INCHRON)

- Validations:
  - AM-HW-Port-BitWidth (ERROR – HwPort)
    - Bitwidth should be greater than zero
  - Inchron-HWModule-InconsistentPortWidths (ERROR – HwModule)
    - HW Module cannot have ports with unequal bitwidth
  - Inchron-HW-Memory-PortTypeResponder (ERROR – Memory)
    - HW ports of memory should be of type responder
  - Inchron-HW-PU-PortTypeInitiator (ERROR – ProcessingUnit)
    - HW ports of processing Unit should be of type initiator
  - Inchron-HWModule-MissingClockReference (ERROR – HwModule)
    - HW Module must have ‘Frequency Domain’ reference
- Profiles:
  - `org.eclipse.app4mc.amalthea.validations.standard.HardwareProfile`

`org.eclipse.app4mc.amalthea.validations.inchron.InchronOsProfile`
Operating Systems Validations (INCHRON)

- Validations:
  - Inchron-OS-Scheduler-Allocation-DifferentCPU (ERROR – Scheduler)
    - OS Task scheduler should not be allocated to more than one HwStructure
  - Inchron-Os-PU-Allocation-MustBeDisjunct (ERROR – OperatingSystem)
    - OS Scheduler to core mapping must be distinct
  - Inchron-Os-UserSpecificSchedulerCheck (ERROR – UserSpecificSchedulingAlgorithm)
    - User specific task scheduler needs at least one task allocation

`org.eclipse.app4mc.amalthea.validations.inchron.InchronSoftwareProfile`
Software Validations (INCHRON)

- Validations:
  - Inchron-SW-Task-EnforcedMigrationCheck (ERROR – Task)
    - Invalid Enforced Migration of a task to a task Scheduler
  - Inchron-SW-Task-NotAllocated-DifferentSchedulers (ERROR – Task)
    - Task cannot be scheduled by more than one OS
  - Inchron-SW-Runnable-MustHaveActivityGraph (ERROR – Runnable)
    - Runnable must have at least one ActivityGraph
  - Inchron-SW-RunnableAllocation-Present (ERROR – RunnableAllocation)
    - Runnable allocation is not supported
  - Inchron-SW-Runnable-NotAllocated-DifferentOS (ERROR – Runnable)
    - Runnable cannot be scheduled by more than one OS
  - Inchron-SW-Task-MustHaveActivityGraph (ERROR – Task)
    - Task must have atleast one ActivityGraph
- Profiles:
  - `org.eclipse.app4mc.amalthea.validations.standard.SoftwareProfile`

`org.eclipse.app4mc.amalthea.validations.inchron.InchronStimuliProfile`
Stimuli Validations (INCHRON)

- Validations:
  - Inchron-Stimuli-TypeCheck (ERROR – Stimulus)
    - Unsupported stimuli types