Page 1 of 1

How to modify the eecfg.c/h templates

Posted: Fri Jul 08, 2016 12:33 pm
by MatzeB.
Hello,

I would like to change the templates, used during code generation for the eecfg.c/h files. I found some .xsl templates in:

/plugins/com.eu.evidence.rtdruid.oil.ee.core_2.7.0.20160615_1643/xsltTransformations/kernel

But changes on this templates do not change the generated eecfg.c/h files from RT-Druid.
Am I missing something here?

Best regards
Matthias

Re: How to modify the eecfg.c/h templates

Posted: Fri Jul 08, 2016 1:06 pm
by MatzeB.
PS: If I run the xslt transformation manually as described in http://erika.tuxfamily.org/wiki/index.p ... formations the changes are visible and according to my changes in the templates

Re: How to modify the eecfg.c/h templates

Posted: Mon Jul 11, 2016 8:38 am
by nicola.serreli
Hi Matthias,

All xslt transformation located in /plugins/com.eu.evidence.rtdruid.oil.ee.core_2.7.0.xxxx/xsltTransformations are just examples and they are explicitly disabled in the plugin.xml file.

The main question is: you want to add something new or change the code currently generated for a configuration already supported by RT-Druid?

If you want to generate code for a new configuration, you can follow the http://erika.tuxfamily.org/wiki/index.p ... formations page.
Otherwise you have to locate first where the "erika configuration code" is generated and then change it. Note that most of the generator code is written in java, without a specific template language.

If it is something that you do in the University and that you will release opensource, we'll be happy to help you (but please submit first the code so that we can help you in supporting it).

Best regards,
Nicola

Re: How to modify the eecfg.c/h templates

Posted: Mon Jul 11, 2016 8:53 am
by MatzeB.
Hi Nicola,

I'm working on a mechanism, to utilize unused slack in systems with fixed priorities. I already implemented this in an other operating system (µC/OS-II) and the mechanism will be published this year at the ETFA conference. Now I would like to evaluate this mechanism also on an AURIX multicore in combination with ERIKA. In order to do this, I have to change some variables in eecfg.c/h, as they are otherwise linked as 'const'. As I found the templates during grep'ing through the ERIKA plugins, I thought it would be the smartest way to directly modify the templates ;)

On the other hand, it would also be sufficient for me, if I could disable the automatic build process for those files and use some hardcoded instead.

Best regards
Matthias

Re: How to modify the eecfg.c/h templates

Posted: Mon Jul 11, 2016 12:28 pm
by nicola.serreli
Hi Matthias,

the generation is driven by the architecture, not by file.
This means: you can disable the generation of the code related to a specific kernel (that may generated code in more than one file), but you cannot disable the generation of a single file.

For "test" purpose, http://erika.tuxfamily.org/wiki/index.p ... formations describes also how enable/disable a specific code generator (writer).
A more "brute-force" approach is to remove all RT-Druid plugins that you do not need (es. the one related to the FP kernel).

Note that if you "remove/disable" a generator, everything that it does is disabled. Then you may need to generate more than the single line you want to change.

Moreover, if what you want to do is to write a new kind of kernel, you may add a new kernel type to the oil file and write your xslt file that support it.
This will automatically disable all kernel generators (each one check the kernel type item in the oil file to choose if generate something or not).

Best regards,
Nicola

Re: How to modify the eecfg.c/h templates

Posted: Mon Jul 11, 2016 12:44 pm
by MatzeB.
Hi Nicola,

thank you for the input. At the moment I use a quick and dirty method, which simply replaces the strings inside the files.

Code: Select all

#!/bin/bash
find -name "eecfg.c" -exec sed -i 's/const EE_TYPEPRIO EE_th_ready_prio/EE_TYPEPRIO EE_th_ready_prio/' {} \; -exec sed -i 's/const EE_TYPEPRIO EE_th_dispatch_prio/EE_TYPEPRIO EE_th_dispatch_prio/' {} \;
cd ./Debug
./make_launcher.bat $1
This file is called as make command by eclipse's CDT plugin, replaces the strings and calls the real make script. Not pretty, but at the moment sufficient for my modifications

Kind regards
Matthias