Technical topic: Add a new target platform to TASTE
Contents
INTRODUCTION
This section is a step by step tutorial for adding a new target support in TASTE. It addresses:
- the update of the AADL meta-models (add a new platform)
- the update of the AADL parser (Ocarina)
- the update of the AADL library of components (add a new CPU board for the given platform)
- the update of the generated project files (configuration of the cross-compiler)
Rating: easy
The paths are relative to ~/tool-src in the TASTE VM.
The tutorial is based on an example: adding support for a generic ZynQ platform with the RTEMS opertating system.
UPDATE OF OCARINA
1. Edit ocarina/src/backends/ocarina-backends-properties.ads, and look for “Supported_Execution_Platform”. Add a platform as shown below
2. Edit ocarina/src/backends/ocarina-backends-properties.adb, and add the string that the parser needs to read, like this
Also update the API:
3. You must specify the endianness of the platform in ocarina/src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
4. In ocarina-backends.po_hi_c.adb, add this:
(NOTE: it is related to the Ocarina-generated Makefile, that is not used in TASTE. However, it is essential to modifiy the code to avoid an error at compile time)
UPDATE OF AADL FILES
1. Add the platform in the AADL metamodel: ocarina/resources/deployment.aadl
2. Create a new board in tool-src/misc/aadl-library/ocarina_components.aadl
UPDATE OF KAZOO
We will now configure the cross-compiler for RTEMS on this target
1. Go to ~/tool-src/kazoo/templates/concurrency_view and copy from existing templates:
2. Go to c_pohi_zync_rtems_cgpr and edit filepart.tmplt to specify the filename you want to generate:
3. Edit partition.tmplt to specify the compiler and compilation flags:
Note: the template format is the one of the "templates-parser" library. Documentation can be found here: http://docs.adacore.com/live/wave/aws/html/template_parser/index.html
4. Do the same for the "gpr" folder
The generated gpr file is based on the "gprbuild" build system. Extensive documentation is available online.
5. Last step, the Makefile.<node_name> must call the newly generated gpr file for this platform. Edit:
~/tool-src/kazoo/templates/concurrency_view/c_pohi_gpr/node.tmplt
BUILD AND INSTALL MODIFIED LIBRARIES
1. Build and install kazoo
2. Build and install Ocarina
TEST
Create a test project:
A single cyclic PI will suffice:
The Zynq appears in the Deployment View. Ignore the error message:
NOTE
Edit misc/helper-scripts/check-deployment-target-gui.py to let the tool check that the cross compiler is properly installed
And just add the node:
If your cross compiler is properly installed that should be sufficient.