Difference between revisions of "Technical topic: Add a new target platform to TASTE"

From TASTE
Jump to: navigation, search
(Test)
Line 121: Line 121:
  
 
   ./install/90_misc.sh
 
   ./install/90_misc.sh
 
== Test ==
 
 
Create a test project:
 
 
:[[File:ClipCapIt-191210-101600.PNG]]
 
 
A single cyclic PI will suffice:
 
 
:[[File:ClipCapIt-191210-101608.PNG]]
 
 
 
The Zynq appears in the Deployment View. Ignore the error message:
 
 
:[[File:ClipCapIt-191210-101707.PNG]]
 
 
And just add the node:
 
 
:[[File:ClipCapIt-191210-101723.PNG]]
 
 
If your cross compiler is properly installed that should be sufficient.
 

Revision as of 11:12, 12 January 2022

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

ClipCapIt-191210-100253.PNG


2. Edit ocarina/src/backends/ocarina-backends-properties.adb, and add the string that the parser needs to read, like this

ClipCapIt-191210-100331.PNG
ClipCapIt-191210-100339.PNG

Also update the API:

ClipCapIt-191210-100409.PNG


3. You must specify the endianness of the platform in ocarina/src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb

ClipCapIt-191210-100532.PNG

4. In ocarina-backends.po_hi_c.adb, add this:

ClipCapIt-191210-100615.PNG

(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

ClipCapIt-191210-100803.PNG

2. Create a new board in tool-src/misc/aadl-library/ocarina_components.aadl

ClipCapIt-191210-100837.PNG

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:

ClipCapIt-191210-101014.PNG

2. Go to c_pohi_zync_rtems_cgpr and edit filepart.tmplt to specify the filename you want to generate:

ClipCapIt-191210-101047.PNG


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

ClipCapIt-191210-101113.PNG


4. Do the same for the "gpr" folder

The generated gpr file is based on the "gprbuild" build system. Extensive documentation is available online.

ClipCapIt-191210-101134.PNG


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
ClipCapIt-191210-101417.PNG


Build and installed the modified libraries

1. Build and install kazoo

ClipCapIt-191210-101501.PNG

2. Build and install Ocarina

ClipCapIt-191210-101527.PNG

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:

ClipCapIt-220112-120406.PNG

The key is formed by the name you set in the Ocarina files before. Add the function to make the check:

ClipCapIt-220112-120533.PNG

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:

ClipCapIt-220112-120701.PNG

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