public class RuntimeUtil
extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RuntimeUtil.AccessDirection |
static class |
RuntimeUtil.PositionType |
static class |
RuntimeUtil.TimeType |
Constructor and Description |
---|
RuntimeUtil() |
Modifier and Type | Method and Description |
---|---|
static Runnable |
addRuntimeToProcessAsNewRunnable(Process process,
ExecutionNeed need,
String runnableName,
RuntimeUtil.PositionType positon)
Creates a new Runnable with the given runtime at beginning / end of the given process
|
static Runnable |
addRuntimeToProcessAsNewRunnable(Process process,
Ticks ticks,
String runnableName,
RuntimeUtil.PositionType positon)
Creates a new Runnable with the given runtime at beginning / end of the given process
|
static void |
addRuntimeToRunnable(Runnable runnable,
ExecutionNeed need)
Adds Runtime (given as ExecutionNeed) to an existing Runnable currently
without consideration of modes
|
static void |
addRuntimeToRunnable(Runnable runnable,
Ticks ticks)
Adds Runtime (given as Ticks) to an existing Runnable currently
without consideration of modes
|
static void |
clearRuntimeOfModel(Amalthea model,
EMap<ModeLabel,String> modes)
Clears all runtime information (execution needs and ticks)
|
static void |
clearRuntimeOfProcess(Process process,
EMap<ModeLabel,String> modes)
Clears all runtime information (execution needs and ticks)
|
static void |
clearRuntimeOfRunnable(Runnable runnable,
EMap<ModeLabel,String> modes)
Clears all runtime information (execution needs and ticks)
|
static Map<Process,Double> |
getCumulativeProcessUtilizations(Amalthea model,
RuntimeUtil.TimeType tt,
List<HwFeature> hwFeatures,
EMap<ModeLabel,String> modes)
Returns the cumulative process utilization, i.e. runtime on every procUnit summed up
|
static Time |
getExecutionTimeForCycles(double ticks,
Frequency frequency)
Computes time for a number of ticks with a given frequency
|
static Time |
getExecutionTimeForExecutionNeedEntry(IDiscreteValueDeviation deviation,
HwFeatureCategory hwFeatureCategory,
ProcessingUnit processingUnit,
RuntimeUtil.TimeType executionCase)
Computes time for specific execution need entry on a given processing unit
|
static Time |
getExecutionTimeForExecutionNeeds(ExecutionNeed need,
ProcessingUnit processingUnit,
RuntimeUtil.TimeType executionCase)
Computes time for execution needs on a given processing unit
|
static Time |
getExecutionTimeForProcess(Process process,
EMap<ModeLabel,String> modes,
RuntimeUtil.TimeType executionCase)
Computes the execution time of a Process (Task or ISR) - unique mapping is required
|
static Time |
getExecutionTimeForProcess(Process process,
ProcessingUnit processingUnit,
EMap<ModeLabel,String> modes,
RuntimeUtil.TimeType executionCase)
Computes the execution time of a Process (Task or ISR) on a given processing unit
|
static Time |
getExecutionTimeForRunnable(Runnable runnable,
ProcessingUnit processingUnit,
EMap<ModeLabel,String> modes,
RuntimeUtil.TimeType executionCase)
Computes the execution time of a Runnable on a given processing unit
|
static Time |
getExecutionTimeForTicks(Ticks ticks,
ProcessingUnit processingUnit,
RuntimeUtil.TimeType executionCase)
Computes time for ticks on a given processing unit
|
static Time |
getExecutionTimeForTicksDeviation(IDiscreteValueDeviation deviation,
ProcessingUnit processingUnit,
RuntimeUtil.TimeType executionCase)
Computes time for ticks on a given processing unit
|
static Map<Process,List<Time>> |
getPeriodsOfAllProcesses(Amalthea model,
RuntimeUtil.TimeType tt,
EMap<ModeLabel,String> modes)
Gets all Period ranges from the model
|
static List<Time> |
getPeriodsOfProcess(Process process,
RuntimeUtil.TimeType tt,
EMap<ModeLabel,String> modes)
Returns a list of all triggering periods.
|
static <T> Map<Stimulus,Long> |
getPlainTriggerForProcess(Process process,
long depthCounter,
Function<Stimulus,Boolean> filter)
Returns all stimuli (matching filter) that trigger the given process
|
static <T> Map<Process,Map<Stimulus,Long>> |
getPlainTriggersForModel(Amalthea model,
Function<Stimulus,Boolean> filter)
Returns a map from process to all stimuli (matching filter) that
lead to that process with the correct prescaler
|
static Map<Process,List<ITimeDeviation>> |
getProcessesWithRelativePeriodicStimulus(Amalthea model)
Returns a Map of all sporadically triggered processes with their prescaler
|
static Map<Process,List<Time>> |
getProcessesWithRelativePeriodicStimulus(Amalthea model,
RuntimeUtil.TimeType tt)
Returns a Map of all sporadically triggered processes with their prescaler
|
static Map<ProcessingUnit,Double> |
getProcessUtilization(Process process,
Amalthea model,
RuntimeUtil.TimeType tt,
List<HwFeature> hwFeatures,
EMap<ModeLabel,String> modes)
Calculates the utilization for a given process
|
static double |
getProcessUtilization(Process process,
ProcessingUnit procUnit,
Amalthea model,
RuntimeUtil.TimeType tt,
List<HwFeature> hwFeatures,
EMap<ModeLabel,String> modes)
Calculates the utilization for a given process on a given procUnit
Assumption (wrong): All triggers activate the process on all procUnits together!
|
static double |
getProcessUtilization(Process process,
Time period,
RuntimeUtil.TimeType tt,
EMap<ModeLabel,String> modes)
Calculates the process utilization
|
static double |
getProcUnitUtilization(ProcessingUnit procUnit,
Amalthea model,
RuntimeUtil.TimeType tt,
List<HwFeature> hwFeatures,
EMap<ModeLabel,String> modes)
Calculates the utilization for a given procUnit
|
static HashMap<Stimulus,Long> |
getTriggeredStimuli(Process process,
EMap<ModeLabel,String> modes)
Returns a map of all stimuli, triggered by this process, associated with its prescaler.
|
static Map<Process,Long> |
getTriggeringProcesses(InterProcessStimulus ip,
EMap<ModeLabel,String> modes)
Returns all Processes that trigger the given InterProcessStimulus
|
static void |
setRuntimeOfRunnable(Runnable runnable,
ExecutionNeed need,
EMap<ModeLabel,String> modes)
Sets the runtime of the given runnable to the given ExecutionNeed
|
static void |
setRuntimeOfRunnable(Runnable runnable,
Ticks ticks,
EMap<ModeLabel,String> modes)
Sets the runtime of the given runnable to the given Ticks
|
public static Time getExecutionTimeForProcess(Process process, EMap<ModeLabel,String> modes, RuntimeUtil.TimeType executionCase)
process
- task or isrmodes
- (optional) - null worksexecutionCase
- BCET, ACET, WCETpublic static Time getExecutionTimeForProcess(Process process, ProcessingUnit processingUnit, EMap<ModeLabel,String> modes, RuntimeUtil.TimeType executionCase)
process
- task or isrprocessingUnit
- executing processing unitmodes
- (optional) - null worksexecutionCase
- BCET, ACET, WCETpublic static Time getExecutionTimeForRunnable(Runnable runnable, ProcessingUnit processingUnit, EMap<ModeLabel,String> modes, RuntimeUtil.TimeType executionCase)
runnable
- runnableprocessingUnit
- executing processing unitmodes
- (optional) - null worksexecutionCase
- BCET, ACET, WCETpublic static Time getExecutionTimeForTicks(Ticks ticks, ProcessingUnit processingUnit, RuntimeUtil.TimeType executionCase)
public static Time getExecutionTimeForTicksDeviation(IDiscreteValueDeviation deviation, ProcessingUnit processingUnit, RuntimeUtil.TimeType executionCase)
deviation
- ticks deviationprocessingUnit
- executing processing unitexecutionCase
- BCET, ACET, WCETpublic static Time getExecutionTimeForExecutionNeeds(ExecutionNeed need, ProcessingUnit processingUnit, RuntimeUtil.TimeType executionCase)
need
- execution needprocessingUnit
- executing processing unitexecutionCase
- BCET, ACET, WCETpublic static Time getExecutionTimeForExecutionNeedEntry(IDiscreteValueDeviation deviation, HwFeatureCategory hwFeatureCategory, ProcessingUnit processingUnit, RuntimeUtil.TimeType executionCase)
deviation
- needs deviationhwFeatureCategory
- corresponding feature categoryprocessingUnit
- executing processing unitexecutionCase
- BCET, ACET, WCETpublic static Time getExecutionTimeForCycles(double ticks, Frequency frequency)
ticks
- ticks / cyclesfrequency
- frequency (of an executing processing unit)public static void setRuntimeOfRunnable(Runnable runnable, ExecutionNeed need, EMap<ModeLabel,String> modes)
public static void setRuntimeOfRunnable(Runnable runnable, Ticks ticks, EMap<ModeLabel,String> modes)
public static void addRuntimeToRunnable(Runnable runnable, ExecutionNeed need)
public static void addRuntimeToRunnable(Runnable runnable, Ticks ticks)
public static void clearRuntimeOfModel(Amalthea model, EMap<ModeLabel,String> modes)
model
- Amalthea modelmodes
- (optional) - null workspublic static void clearRuntimeOfProcess(Process process, EMap<ModeLabel,String> modes)
process
- task or isrmodes
- (optional) - null workspublic static void clearRuntimeOfRunnable(Runnable runnable, EMap<ModeLabel,String> modes)
runnable
- runnablemodes
- (optional) - null workspublic static Runnable addRuntimeToProcessAsNewRunnable(Process process, ExecutionNeed need, String runnableName, RuntimeUtil.PositionType positon)
process
- containing process (task or isr)need
- execution needrunnableName
- name of new runnablepositon
- FIRST, LASTpublic static Runnable addRuntimeToProcessAsNewRunnable(Process process, Ticks ticks, String runnableName, RuntimeUtil.PositionType positon)
process
- containing process (task or isr)ticks
- ticksrunnableName
- name of new runnablepositon
- FIRST, LASTpublic static double getProcUnitUtilization(ProcessingUnit procUnit, Amalthea model, RuntimeUtil.TimeType tt, List<HwFeature> hwFeatures, EMap<ModeLabel,String> modes)
public static Map<ProcessingUnit,Double> getProcessUtilization(Process process, Amalthea model, RuntimeUtil.TimeType tt, List<HwFeature> hwFeatures, EMap<ModeLabel,String> modes)
public static double getProcessUtilization(Process process, ProcessingUnit procUnit, Amalthea model, RuntimeUtil.TimeType tt, List<HwFeature> hwFeatures, EMap<ModeLabel,String> modes)
Assumption (wrong): All triggers activate the process on all procUnits together! (at the same time)
public static double getProcessUtilization(Process process, Time period, RuntimeUtil.TimeType tt, EMap<ModeLabel,String> modes)
public static Map<Process,Double> getCumulativeProcessUtilizations(Amalthea model, RuntimeUtil.TimeType tt, List<HwFeature> hwFeatures, EMap<ModeLabel,String> modes)
public static Map<Process,List<Time>> getPeriodsOfAllProcesses(Amalthea model, RuntimeUtil.TimeType tt, EMap<ModeLabel,String> modes)
public static List<Time> getPeriodsOfProcess(Process process, RuntimeUtil.TimeType tt, EMap<ModeLabel,String> modes)
public static Map<Process,Long> getTriggeringProcesses(InterProcessStimulus ip, EMap<ModeLabel,String> modes)
public static HashMap<Stimulus,Long> getTriggeredStimuli(Process process, EMap<ModeLabel,String> modes)
public static Map<Process,List<Time>> getProcessesWithRelativePeriodicStimulus(Amalthea model, RuntimeUtil.TimeType tt)
public static Map<Process,List<ITimeDeviation>> getProcessesWithRelativePeriodicStimulus(Amalthea model)
public static <T> Map<Process,Map<Stimulus,Long>> getPlainTriggersForModel(Amalthea model, Function<Stimulus,Boolean> filter)
public static <T> Map<Stimulus,Long> getPlainTriggerForProcess(Process process, long depthCounter, Function<Stimulus,Boolean> filter)