Otawa
0.10
|
Usual features and associated processors are defined for computing exactly one feature. More...
Classes | |
class | otawa::ActualFeature |
An actual feature is the result of the instantiation of a parametric feature. More... | |
class | otawa::ParamFeature |
A parametric feature is a feature that may be instantiated according to some parameters passed in a property list. More... | |
class | otawa::AbstractParamIdentifier |
A parametric identifier allows to instantiate identifier depending on a parametric feature. More... | |
class | otawa::ParamIdentifier< T > |
Implementation of AbstractParamIdentifier for an Identifier. More... | |
class | otawa::AbstractParamProcessor |
Abstract form of a parametric processor. More... | |
class | otawa::ParamProcessor |
A parametric processor allows to generate processor for parametric feature. More... | |
Usual features and associated processors are defined for computing exactly one feature.
Yet, several features in the WCET computation may have the same behaviour but with different configurations. For example, in several microprocessors, we may have several levels of cache (L1, L2, ...) exhibiting the same behaviour but with different configurations.
Parametric and processors allows to use the same feature/processors system for different facilities in a WCET computation. Basically, a parametric feature is a feature generator. The feature are identified by specific parameters passed to the parametric feature. For the example of a cache, the parameter may be the description of the cache. Once the parameter is passed, the actual feature may be generated by the parametric feature. The code belows continue with the example of the cache and show the declaration of the parametric feature in a header file.
A processor that has to require the feature with a given cache has to obtain the actual feature from the paramtric feature and to require it:
Getting an actual feature is not enough to use it. Indeed, each actual feature has its own set of identifier to use to hook annotation on the program representation. When a parametric feature is instantiated into an actual feature, it also instantiates a set of parametric identifiers. The instantiated identifiers are then hooked to be used by the requirer processor.
The code below show how to declare parametric identifiers:
The requirer processor then may use the instantiated identifier to retrieve annotation put on the program representation:
A parametric processor is processor implementing a parametric feature. Usually, a default parametric processor is passed as parameter to a default feature and used to generate a processor customized with an actual feature.
From the example below, we get below the source file of the parametric feature and its parametric processor:
In this example, the default processor implementation is given by the CacheProcessor class. This cache must have a constructor taking as parameter the name, the version and the actual feature. This actual feature is used by the processor to get instantiation parameters and instantiated parametric identified associated with the feature. The code below continues the example:
In fact, the actual features contains two sets of annotations: