Technical topic: Add a new target platform to TASTE

From TASTE
Jump to: navigation, search

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

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 INSTALL MODIFIED LIBRARIES

1. Build and install kazoo

ClipCapIt-191210-101501.PNG

2. Build and install Ocarina

ClipCapIt-191210-101527.PNG


TEST

Create a test project:

ClipCapIt-191210-101600.PNG

A single cyclic PI will suffice:

ClipCapIt-191210-101608.PNG


The Zynq appears in the Deployment View. Ignore the error message:

ClipCapIt-191210-101707.PNG

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:

ClipCapIt-191210-101723.PNG

If your cross compiler is properly installed that should be sufficient.