Difference between pages "Technical topic: SedsConverter" and "TASTE Communication Device"

From TASTE
(Difference between pages)
Jump to: navigation, search
(Basic usage)
 
 
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
 
+
CommunicationDevice (CD) is a new type of TASTE project, that allows to model low level system drivers and integrate CD driver with existing or new TASTE project. It comes with two pre-defined templates: Broker and Broker + Packetizer. Depending on a selected template CD allows to model either Broker or Broker and Packetizer communication components. CommunicationDevice is a part of the SpaceCreator and Kazoo projects.
SedsConverter is a tool that provides EDS import/export capabilities to TASTE:
 
* generation of TASTE compliant ASN.1/ACN, InterfaceView and SDL from EDS;
 
* generation of EDS from TASTE InterfaceView and ASN.1.
 
 
 
InterfaceView XML files can be then converted to AADL with the usage of the SpaceCreator.
 
 
 
SedsConverter is a part of the [https://gitrepos.estec.esa.int/taste/spacecreator SpaceCreator] project. It can be used either from the command line interface or from the SpaceCreator GUI.
 
  
 
== Capabilities ==
 
== Capabilities ==
The following conversion directions are supported:
+
The following functionalities are supported:
* SEDS → ASN.1
+
* creation of new CD project from QTC wizard – SpaceCreator
* SEDS → InterfaceView
+
* modeling and implementation of broker and packetizer
* SEDS → SDL
+
* CD code generation done be Kazoo templates
* ASN.1 → SEDS
+
* integration with full TASTE project
* InterfaceView → SEDS
 
  
== Building and updating ==
+
==How to create CD project==  
 +
Communication device project can be created form QT Creator wizard that can be opened with TASTE command. Then under File->New File or Project (Ctrl + N)
 +
[[File:Cd_wizard_2.png]]
  
=== Building from sources ===
 
SedsConverter is built as a part of the SpaceCreator. For the SpaceCreator building instructions please consult its [https://gitrepos.estec.esa.int/taste/spacecreator/-/blob/master/README.md README] file.
 
  
=== Updating with SpaceCreator ===
+
Non-Qt Project -> Communication Device Project
SedsConverter is updated as a part of the SpaceCreator. To perform an update run the following commands in the terminal:
 
    $ cd ~/tool-src
 
    $ ./install/88_spaceCreator.sh
 
  
== Console interface usage ==
+
[[File:Cd wizard 1.png]]
SedsConverter can be accessed through the SpaceCreator AppImage
 
    $ spacecreator.AppImage --sedsconverter --help
 
  
If SedsConverter was built from sources, then the console interface can be found in the build directory
 
    $ <build_dir>/bin/sedsconverter --help
 
  
=== Basic usage ===
+
CD wizard starts with “Project Location” tab. User shall provide Name for the project and path under which project will be created.
  
Conversion requires input filename and conversion direction to be passed via options
+
[[File:Cd_wizard_3.png]]
    $ spacecreator.AppImage --in <filename> --from <input models> --to <output models>
 
i.e to convert a SEDS file to ASN.1 type the following command:
 
    $ spacecreator.AppImage --sedsconverter --in input.xml --from SEDS --to ASN.1
 
  
 +
Next tab “Project Initialization” provides capabilities of selecting interface view template and CD board. Under IV template either “Broker” or “Broker_Packetizer” can be selected. Under Communication Device board either “x86 Linux CPP” or “SAM V71 FreeRTOS N7S” can be selected.
  
Models could also have dependencies. Those dependencies can be resolved in two ways:
+
[[File:Cd_wizard_4.png]]
# User provides input files for all models that are required for the given conversion
 
# SedsConverter tries to resolve dependencies using available inputs
 
  
Example: SEDS to InterfaceView conversion requires an ASN.1 model. User can either:
+
Next tab is standard “Kit Selection” tab.
provide ASN.1 input file to be used during the conversion
 
    $ spacecreator.AppImage --sedsconverter --in input.xml,input.asn --from SEDS,ASN.1 --to InterfaceView
 
or use SEDS input to create an intermediate ASN.1 model
 
    $ spacecreator.AppImage --sedsconverter --in input.xml --from SEDS --to InterfaceView
 
  
 +
[[File:Cd_wizard_5.png]]
  
Additionally the intermediate models can be also exported using ''--aux'' option:
+
Under last tab that is “Project Management” version control can be added. Also wizard displays all files that will be added to Communication Device project.
    $ spacecreator.AppImage --sedsconverter --in input.xml --from SEDS --to InterfaceView --aux ASN.1
 
  
=== Available commands ===
+
[[File:Cd_wizard_6.png]]
  
==== ASN.1 ====
+
===Generated CD project files details===
 +
Communication Device Project wizard adds the following files to the project:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 65: Line 43:
 
|-
 
|-
 
| --asn1-filepath-prefix <prefix>  
 
| --asn1-filepath-prefix <prefix>  
| <prefix> to add at the beginning of the ASN1 output filepath
+
| <prefix> to add at the beginning of the ASN.1 output filepath
 
|}
 
|}
  
==== InterfaceView ====
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
| --iv-config <file>
+
|--taste.pro – empty taste.pro file that will be automatically generated during build
| Specify config xml <file> for InterfaceView
 
 
|-
 
|-
| --iv-generate-parent-functions
+
|-- Makefile – entry build and clean procedure that includes Kazoo and SC dependencies definitions
| Generate parent functions for each SEDS package
+
|-
|}
+
|-- deploymentvew.dv.xml – predefined deploymentview.dv.xml that includes CD build partition
 
+
|-
==== SDL ====
+
|*--interfaceview.xml – interfaceview with Broker, Packetizer and interfaces. In this file user shall model Broker or Broker and Packetizer (depending on a template) along with required and provided components interfaces.
{| class="wikitable"
 
 
|-
 
|-
| --sdl-filepath-prefix <prefix>
+
|-- <project name>.acn – ACN project model for custom binary encoding rules.
| SDL filepath <prefix>
 
|}
 
 
 
==== SEDS ====
 
{| class="wikitable"
 
 
|-
 
|-
| --seds-preprocessed-filepath
+
|-- <project name>.asn – ASN non user-editable model that contains all the basic data types.
| Path to the intermediate file that will be created during preprocessing
 
 
|-
 
|-
| --seds-schema
+
|-- <project name>.pro/shared – QTC project files with custom user build settings.
| Specify schema <file> for SEDS
 
 
|-
 
|-
| --seds-ext-ref <references>
+
|-- <project name>configuration.acn - ACN project configuration model for custom binary encoding rules.
| Specify external <references> for SEDS, e.g. foo:bar,foo2:bar2,foo3:bar3,...
 
 
|-
 
|-
| --seds-ext-ref-file <file>
+
|-- <project name>configuration.asn - ASN user-editable model that contains definition of Driver Configuration. This file will be used by ocarina-components.aadl and Board1.xml and shall be implemented by the user.
| Specify <file> with an external references for SEDS
 
 
|-
 
|-
| --skip-validation
+
|--<project name>privatedata.acn - ACN project privatedata model for custom binary encoding rules.
| Skip validation for SEDS
 
 
|-
 
|-
| --keep-intermediate-files
+
|-- <project name>privatedata.asn - ASN user-editable model that contains definition of Private Data structure. This type shall be used in main.c[pp] to indicate the type of the variable that is passed as a private pointer to the driver. Shall be implemented by the user.
| Keep SEDS intermediate files
 
 
|}
 
|}
  
== GUI usage ==
+
==Exemplary CD broker and packetizer modeling and implementation==
SEDS import and export operations are accessible through graphical user interface. The following options are available:
+
Based on selected CD “Interface view template” either broker or broker and packetizer can be modeled and implemented. In this example second template will be used.
* '''Import InterfaceView''' - a user selects a SEDS file containing InterfaceView description; SedsConverter adds described functions to the current interaceview.xml file
+
 
* '''Import SDL''' - a user selects a SEDS file containing SDL data; SedsConverter extracts SDL data and outputs it to dedicated .pr files
+
===CD IV file specifics – fixed system elements===
* '''Import ASN.1''' - a user selects a SEDS file containing ASN.1 type definitions; SedsConverter extracts definitions and creates .asn and .acn files in the current project directory
+
After opening IV file in the editor user can find (depending on selected template) Broker and Packetizer components. These are virtual components that are not taken for final code generation. Purpose of those elements is to provide “must have” set of interfaces. Those are required to match newly created and modeled communication components to existing in TASTE runtime calls.
* '''Export InterfaceView''' - a user selects IV functions from the current project which will be exported to SEDS .xml file; a user selects a destination directory, where the output shall be placed by SedsConverter
+
 
* '''Export ASN.1''' - a user selects ASN.1 and ACN files to be exported to SEDS .xml file; a user selects a destination directory, where the output shall be placed
+
[[File:Cd_broker_pack_iv_1.png|1100px]]
 +
 
 +
User can’t remove those element neither the interfaces and will be informed about that while trying to do so.
 +
 
 +
[[File:Cd_broker_pack_iv_2.png]]
 +
 
 +
===Modeling Packetizer component===
 +
While modeling Packetizer user shall provide a TASTE function that implements needed interfaces and connect that function to pre-defined virtual Packetizer component. Also each interface shall contain set of input and output parameters. The easiest way to do so is by dragging each interface from virtual Packetizer with left Ctrl key pressed and drop it on custom function. This way each interface will be copied along with set of parameters.
 +
 
 +
[[File:Cd_broker_pack_iv_3.png|1100px]]
 +
 
 +
 
 +
[[File:Cd_pack_params_1.png|t300px]]
 +
[[File:Cd_pack_params_2.png|500px]]
 +
 
 +
To avoid build errors another function can be connected to Broker and it’s implementation is not required.
 +
 
 +
===Implementation of Packetizer component===
 +
At this point CD project is able to generate source code for MyPacketizer function that can be extended with user implementation. Screens below presents empty mypacketizer.c/h files.
 +
 
 +
 
 +
[[File:Cd_mypack_code_2.png|t300px]]
 +
[[File:Cd_mypack_code_1.png|400px]]
 +
 
 +
For this example simple implementations of “Packetize” and “Depacketize” functions will be implemented and Init function will not be used. Screens bellow presents exemplary implementation of those functions.
 +
 
 +
 
 +
[[File:Cd_mypack_code_6.png|t300px]]
 +
[[File:Cd_mypack_code_5.png|400px]]
 +
 
 +
Communication Device project with packetizer component implementation is ready to be integrated wit full TASTE project. See another chapters to follow TASTE project integration.

Revision as of 17:47, 29 November 2022

Introduction

CommunicationDevice (CD) is a new type of TASTE project, that allows to model low level system drivers and integrate CD driver with existing or new TASTE project. It comes with two pre-defined templates: Broker and Broker + Packetizer. Depending on a selected template CD allows to model either Broker or Broker and Packetizer communication components. CommunicationDevice is a part of the SpaceCreator and Kazoo projects.

Capabilities

The following functionalities are supported:

  • creation of new CD project from QTC wizard – SpaceCreator
  • modeling and implementation of broker and packetizer
  • CD code generation done be Kazoo templates
  • integration with full TASTE project

How to create CD project

Communication device project can be created form QT Creator wizard that can be opened with TASTE command. Then under File->New File or Project (Ctrl + N) Cd wizard 2.png


Non-Qt Project -> Communication Device Project

Cd wizard 1.png


CD wizard starts with “Project Location” tab. User shall provide Name for the project and path under which project will be created.

Cd wizard 3.png

Next tab “Project Initialization” provides capabilities of selecting interface view template and CD board. Under IV template either “Broker” or “Broker_Packetizer” can be selected. Under Communication Device board either “x86 Linux CPP” or “SAM V71 FreeRTOS N7S” can be selected.

Cd wizard 4.png

Next tab is standard “Kit Selection” tab.

Cd wizard 5.png

Under last tab that is “Project Management” version control can be added. Also wizard displays all files that will be added to Communication Device project.

Cd wizard 6.png

Generated CD project files details

Communication Device Project wizard adds the following files to the project:

--acn-filepath-prefix <prefix> <prefix> to add at the beginning of the ACN output filepath
--asn1-filepath-prefix <prefix> <prefix> to add at the beginning of the ASN.1 output filepath
*--interfaceview.xml – interfaceview with Broker, Packetizer and interfaces. In this file user shall model Broker or Broker and Packetizer (depending on a template) along with required and provided components interfaces.

Exemplary CD broker and packetizer modeling and implementation

Based on selected CD “Interface view template” either broker or broker and packetizer can be modeled and implemented. In this example second template will be used.

CD IV file specifics – fixed system elements

After opening IV file in the editor user can find (depending on selected template) Broker and Packetizer components. These are virtual components that are not taken for final code generation. Purpose of those elements is to provide “must have” set of interfaces. Those are required to match newly created and modeled communication components to existing in TASTE runtime calls.

Cd broker pack iv 1.png

User can’t remove those element neither the interfaces and will be informed about that while trying to do so.

Cd broker pack iv 2.png

Modeling Packetizer component

While modeling Packetizer user shall provide a TASTE function that implements needed interfaces and connect that function to pre-defined virtual Packetizer component. Also each interface shall contain set of input and output parameters. The easiest way to do so is by dragging each interface from virtual Packetizer with left Ctrl key pressed and drop it on custom function. This way each interface will be copied along with set of parameters.

Cd broker pack iv 3.png


t300px Cd pack params 2.png

To avoid build errors another function can be connected to Broker and it’s implementation is not required.

Implementation of Packetizer component

At this point CD project is able to generate source code for MyPacketizer function that can be extended with user implementation. Screens below presents empty mypacketizer.c/h files.


t300px Cd mypack code 1.png

For this example simple implementations of “Packetize” and “Depacketize” functions will be implemented and Init function will not be used. Screens bellow presents exemplary implementation of those functions.


t300px Cd mypack code 5.png

Communication Device project with packetizer component implementation is ready to be integrated wit full TASTE project. See another chapters to follow TASTE project integration.