Page History
...
The priority-based low-level compilation approach uses the established compiling chain for SCCharts until the dependency analysis of the SCG is finished. From this point, either the netlist low-level compilation approach or the priority-based low-level compilation approach can be used. Because of the different approaches, it is possible, that one of the compiler finds a valid schedule for an SCChart, while the other fails.
Table of Contents |
---|
General
Table of Contents |
---|
General
The priority-based low-level compilation approach compiles an SCG enriched by the results of the dependency analysis to SCL_P, whose basis is the programming language C and which is enriched by the SCL_P macros. Therefore the regions of the SCG are fragmented into threads, whose priority determines the order in which the threads are executed. A thread might change its priority, which results in a context switch. The adiministration of the threads is done by the SCL_P macros. As the calculation of the thread priorities is not trivial, it done stepwise, which should help the user to understand how it is done. This is provided by a KiCo compilation chain, which can be called from the SCCharts editor or from the SCG editor.The image below shows the compilation chain as shown in the SCChart editor
Transformation Steps
The KIELER Compiler (KiCo) project allows to register step-by-step model transformations on EObjects that could be written in Xtend or Java. These transformations are registered using an extension point provided (see below). After registering transformations these can be used by simply call the KielerCompiler compilation method as also explained further below.
Extension Point
In order to add a transformation to KiCo you must follow these steps:
Add dependency to
de.cau.cs.kieler.kico
Add the extension
de.cau.cs.kieler.kico.transformation
Add one of the following extension element
Extension Element | Description |
---|---|
transformationClass | The defined class must extend "de.cau.cs.kieler.kico.Transformation" and must implement the methods defined in "de.cau.cs.kieler.kico.ITransformation". These are
|
transformationMethod | The defined class can be freely chosen and does not need to extend or implement any other class or interface. Although you have to give more information in the extension element now:
|
transformationGroup | Sometimes you may want to group other transformations and give this group a specific transformation ID as a kind of shortcut. You can do this by using the transformationGroup element giving the following information:
|
Example
Code Block | ||
---|---|---|
| ||
<extension point="de.cau.cs.kieler.kico.transformation"> <transformationGroup id="NORMALIZE" dependencies="TRIGGEREFFECT, SURFACEDEPTH" name="Transform All Normalize"> </transformationGroup> <transformationMethod class="de.cau.cs.kieler.sccharts.extensions.SCChartsCoreTransformation" id="TRIGGEREFFECT" method="transformTriggerEffect" name="Transform Trigger and Effect"> </transformationMethod> <transformationMethod class="de.cau.cs.kieler.sccharts.extensions.SCChartsCoreTransformation" id="SURFACEDEPTH" method="transformSurfaceDepth" name="Transform Surface Depth"> </transformationMethod> <transformationGroup id="ALL" dependencies="CORE NORMALIZE" name="Transform All"> </transformationGroup> </extension> |
...
Compilation
Once a bunch of model transformations are registered, these can simply be called using the KiCo central "KielerCompiler" class with its method compile(). This will be given a List<String> of transformation IDs or a comma separated String of transformation IDs as the first parameter. The second parameter is the EObject that is being transformed. It should meet the signature of the first model transformation called. Note that the actual model transformations that are done may vary because KiCo will automatically inspect the dependencies of each transformation requested (deep-recursively). If you do not like this to happen as an advanced user you can use a third parameter that will skip this autocompletion. Note that if you switch this off also NO transformation groups can be processed. Here is an overview and examples how to use the compile() method:
Method | Description |
---|---|
EObjectKielerCompiler.compile(List<String>transformationIDs,EObjecteObject) |
|
EObjectKielerCompiler.compile(StringtransformationIDs,EObjecteObject) | This is a convenient method only which can be used to give transformation IDs or transformation group IDs as a comma separated String. For eObject and the return value see above. |
EObjectKielerCompiler.compile(List<String>transformationIDs,EObjecteObject,booleanautoexpand) | This is an advanced compile method which can turn of auto-expansion with the last parameter. Use this with care! Note that if switching autoexpand off you cannot use transformation group IDs any more. Also no dependencies will be considered. The transformations will be applied straight forward in the order defined by the transformationIDs list. |
Examples
Code Block | ||
---|---|---|
| ||
import de.cau.cs.kieler.kico.KielerCompiler; ... private MyEObjectClass myMethod(EObject eObject) { ... transformed = (MyEObjectClass) KielerCompiler.compile("ABORT, SIGNAL", eObject); ... return transformed } |
Code Block | ||
---|---|---|
| ||
import de.cau.cs.kieler.kico.KielerCompiler ... def dispatch MyEObjectClass myMethod(EObject eObject) { transformed = KielerCompiler.compile("ABORT, SIGNAL", eObject) as MyEObjectClass ... transformed } |
Requirement Completion
...
Original
| Example 1
|
---|
Example 2
| Example 3
|
---|
...
Help / Problems / FAQs
Maybe you get into problems when using KiCo. The following list should give you hints to solve these. If you have a problem not considered here please write us an e-mail (see above for contact information of the persons in charge of KiCo).
Symptom | Reason | Solution |
---|---|---|
You get the following run time error:ENTRYde.cau.cs.kieler.klighd402014-03-17 11:08:46.009 | There is a transformation with ID "ABORT2" referenced | Check why "ABORT2" may not be found |
You get the following error:!ENTRYde.cau.cs.kieler.kico222014-03-1711:26:13.818!MESSAGEExtension'TERMINATION'fromcomponent:de.cau.cs.kieler.scchartscannot be | The trasformation with ID "TERMINATION" is alreadyregistered and this ID cannot be used a second time.The component "de.cau...sccharts" tries to registera transformation with this ID while this ID is alreadytaken. | Rename one of the IDs or form a group oftransformations. |