Difference between revisions of "Technical topic: Add a new target platform to TASTE"
(→Test) |
|||
Line 121: | Line 121: | ||
./install/90_misc.sh | ./install/90_misc.sh | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 11:12, 12 January 2022
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)
- the update of the script that checks if the platform is installed
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 operating 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 installed the modified libraries
1. Build and install kazoo
2. Build and install Ocarina
Update the platform check script
When building a project in TASTE there is a check that verifies that nodes can actually be compiled, i.e. that the new target runtime (cross compiler, OS) is installed on the build machine. The script is in misc/helper-scripts/, you have to edit it:
$ vi misc/helper-scripts/check_deployment_target_cli.py
There is a map with the key being the name of the platform, and the value being a function that is in charge of checking the installation:
The key is formed by the name you set in the Ocarina files before. Add the function to make the check:
If the target is not installed you must raise a NotImplementedError exception and pass as parameter the name of another function, that is in charge of the installation itself:
It is important to fill in the documentation of the function (the first line) as it is used to tell the user how to install manually.
You can then save this file and update your installation:
./install/90_misc.sh