Difference between revisions of "Import/Export of Components in TASTE"

From TASTE
Jump to: navigation, search
(Shared library of component types)
Line 10: Line 10:
  
 
=== Overview ===
 
=== Overview ===
 +
 
'''Component types''' are TASTE functions that contain a generic implementation in '''Ada''', '''C++''' or '''SDL''' and that can be instantiated several times in a system.
 
'''Component types''' are TASTE functions that contain a generic implementation in '''Ada''', '''C++''' or '''SDL''' and that can be instantiated several times in a system.
  
Line 19: Line 20:
  
 
:[[File:ClipCapIt-200907-105501.PNG]]
 
:[[File:ClipCapIt-200907-105501.PNG]]
 +
 +
Details for its content are explained on this page: [[Technical topic: C++ Components and AIR IO Partitions]]
  
 
=== Creating and exporting a component type ===
 
=== Creating and exporting a component type ===
 +
 +
A component type can be created in C++, Ada and SDL as these languages have a built-in Object-Oriented features that allow instantiation. It is not possible to create a component type in the plain C language.
 +
 +
The process the create the component type is the following:
 +
 +
* Add a Function Type and select among the possible 3 languages in the Interface View editor
 +
* Add provided and required interfaces at will (but you cannot connect them to other functions)
 +
* Edit the function type properties, and in the Context Parameters tab, create the default state of the component
 +
* Generate the code skeletons and implement the generic behaviour of the component
 +
 +
 +
Then the process to export the component type is the following:
 +
 +
* Right-Click on the function and choose Export Type
 +
 +
 +
When you export the function the tool proceeds with the following actions:
 +
 +
* Create a new folder ''FunctionName'' in the shared component folder
 +
* Copy ''DataView.aadl'' in that new folder
 +
* Copy all the .asn files referenced in DataView.aadl in that new folder
 +
* Copy recursively the folder ''work/FunctionName'' (containing the component implementation) into that new folder
 +
* Create and copy a file named (in lowecase) functionname-iv-functionname.aadl
 +
 +
The file functionname-iv-functionname.aadl contains the component description itself. It is like an Interface View but containing a single package:
 +
 +
  PACKAGE FunctionName::IV::FunctionName

Revision as of 09:17, 7 September 2020

Introduction

A new system is rarely created from scratch and having a library of reusable building blocks is a fundamental basics when working with models. This page explains the two forms of component reuse that are available in TASTE and how they operate:

  1. The shared library of component type that can be instantiated in a system
  2. The import/export of complete parts of an interface view

Shared library of component types

Overview

Component types are TASTE functions that contain a generic implementation in Ada, C++ or SDL and that can be instantiated several times in a system.

While the types can be defined locally in a project, they are usually exported to an external folder, from which they are shared and visible to all TASTE users.

In the TASTE VM, the default base folder for such shared component types is /home/taste/tool-inst/share/SharedTypes. It can be overridden by setting the TASTE_SHARED_TYPES environment variable and make it point to a different folder.

For example this component is present:

ClipCapIt-200907-105501.PNG

Details for its content are explained on this page: Technical topic: C++ Components and AIR IO Partitions

Creating and exporting a component type

A component type can be created in C++, Ada and SDL as these languages have a built-in Object-Oriented features that allow instantiation. It is not possible to create a component type in the plain C language.

The process the create the component type is the following:

  • Add a Function Type and select among the possible 3 languages in the Interface View editor
  • Add provided and required interfaces at will (but you cannot connect them to other functions)
  • Edit the function type properties, and in the Context Parameters tab, create the default state of the component
  • Generate the code skeletons and implement the generic behaviour of the component


Then the process to export the component type is the following:

  • Right-Click on the function and choose Export Type


When you export the function the tool proceeds with the following actions:

  • Create a new folder FunctionName in the shared component folder
  • Copy DataView.aadl in that new folder
  • Copy all the .asn files referenced in DataView.aadl in that new folder
  • Copy recursively the folder work/FunctionName (containing the component implementation) into that new folder
  • Create and copy a file named (in lowecase) functionname-iv-functionname.aadl

The file functionname-iv-functionname.aadl contains the component description itself. It is like an Interface View but containing a single package:

 PACKAGE FunctionName::IV::FunctionName