OpenAADL / fmu2aadl

FMI to AADL conversion toolchain
Eclipse Public License 1.0
1 stars 2 forks source link

Variable names in generated AADL files #1

Closed svenTeum closed 4 years ago

svenTeum commented 6 years ago

I'm using some FMUs generated by Amesim tool. When running fmu2aadl, I get the corresponding AADL files. The problem is that the FMUs have input/output names that contain some special characters, like for example: _pin@expseu__ In that way, I must manually edit the variable names in fmu_name.aadl and fmu_name_wrapper.c to something like pinexpseu (otherwise Ocarina won't compile the model using those FMUs)

Because of that manually editing, I'm not sure if some other errors I get are related to that.

Could it be possible for fmu2aadl to parse that kind of variable names?

yoogx commented 6 years ago

I think the right path would be to escape those names the proper way. Do you have a list special characters ? beyond @ and _ ?

Note I did not test Amesim FMUs. Would it make sense for you to contribute a basic FMU that I can integrate in my test suite ?

svenTeum commented 6 years ago

Thanks, I will see if I can send you an FMU from Amesim (BTW how can I send you a file?) In my case I had to replace only those two characters.

Another issue with Amesim FMUs is that they generate a specific label in ModelDescription.xml that is not parsed well when running Ocarina so I also have to edit the xml file as a previous step to building with Ocarina. But maybe I should open a different issue for that.

yoogx commented 6 years ago

I think you can do a pull request to send files, in particular if there are issues in ModelDescription.xml

You may have reviewed the code, it is basic and goes straight to the point. Having more FMUs to test would be helpful

svenTeum commented 6 years ago

I'm attaching an example file here: ABouncingBall.zip

Ocarina can compile an AADL file that uses that kind of FMU after removing the characters from the variables. Also, about the ModelDescription.xml, unless you remove this kind of lines: <Annotations><Tool name="Amesim"><VarAnnot index="1"/></Tool></Annotations> running the Ocarina build executable will show the following:

Parser error. Depth wrong after parsing sub-tree for Tool.
Segmentation fault

Also please note that I tested an FMU from Amesim with fmusdk and it worked with no parsing errors.

yoogx commented 6 years ago

Thanks for this FMU. I see the bug. Unfortunately, you won't go further with this kind of FMU since it as local or parameter variables, whereas the FMU2AADL script expects input/output. Can you provide one ?

svenTeum commented 6 years ago

The following FMU has 1 input and 1 output: ABouncingBall_v2.zip