Difference between revisions of "Kazoo"

From TASTE
Jump to: navigation, search
(New templates for kazoo)
 
(42 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Kazoo is a part of TASTE tool-chain.
+
Kazoo is a part of the TASTE toolchain responsible for generating code and build scripts from AADL models.
  
 +
== Overview ==
 +
 +
Kazoo is a command line tool which processes input AADL models and produces derived models, code and scripts used to build complete system.
 +
It uses [[Ocarina]] for AADL parsing and [https://github.com/AdaCore/templates-parser templates-parser] for templates processing and files generation.
 +
Standard library of components used by templates is defined by TASTE common models from ''ocarina_components.aadl'' file, which includes supported processors, devices, drivers etc.
 +
Generated build scripts apart from calling code compilers also run other tools like '''ocarina''' and '''aadl2glueC''' to create rest of the source code.
 +
 +
== Installation and updating ==
 +
 +
=== Updating sources ===
 +
To update kazoo run the following commands in the terminal:
 +
    $ cd ~/tool-src/kazoo
 +
    $ git checkout master
 +
    $ git pull
 +
When command succeeds, kazoo needs to be rebuild to complete installation.
 +
 +
=== Rebuilding from source ===
 +
 +
To build and install kazoo from sources so run the following commands in the terminal:
 +
    $ cd ~/tool-src
 +
    $ ./install/87_kazoo.sh
 +
 +
== Using kazoo ==
 +
 +
Kazoo is a command line tool, executed from terminal and configured by a list of parameters.
 +
 +
=== Basic usage ===
 +
 +
Kazoo is integrated in TASTE as one of the main tools for generating and building the code of the system under development. The calls to kazoo are normally hidden to the user and should rarely be done manually. To start a project using Kazoo, user normally run a single command:
 +
 +
    $ taste
 +
 +
If user would like to use kazoo directly, or tweak it's behaviour, the following example Makefile presents the calls to kazoo that generate the code skeletons and glue.
 +
 +
<syntaxhighlight lang="Makefile">
 +
KAZOO?=kazoo
 +
 +
all:    c
 +
 +
c:      work/glue_built
 +
        $(MAKE) -C work
 +
 +
skeletons:      InterfaceView.aadl DataView.aadl
 +
        $(KAZOO) --gw -o work
 +
        $(MAKE) -C work dataview
 +
   
 +
work/glue_built:        InterfaceView.aadl DeploymentView.aadl DataView.aadl
 +
        $(KAZOO) -p --glue --gw -o work
 +
        touch work/glue_built
 +
 +
clean:
 +
        $(MAKE) -C work clean
 +
   
 +
.PHONY: clean skeletons c
 +
</syntaxhighlight>
 +
 +
Kazoo will read the default [[#Input files|input AADL models]] and generate code to the selected output directory.
 +
Parameter <code>--output</code> chooses the output directory for generated files (''work''), <code>--gw</code> enables models and code skeletons generation, <code>--glue</code> enables glue code generation and <code>-p</code> or <code>--polyorb-hi-c</code> turns on use of [[PolyORB-HI-C]] runtime.
 +
 +
In the result directory '''work''' will be created and filled with generated models and source files.
 +
 +
To build the generated system run following commands in the terminal:
 +
    $ make
 +
 +
The output binary files will be located in the directory '''work/binaries'''.
 +
 +
=== Kazoo example ===
 +
Kazoo comes with a lot of helpful examples.The examples are located in the directory '''tool-src/kazoo/test/'''.
 +
Every example project contains Makefile, which simplifies the process of the build.
 +
For an example, to build project ''Demo_C'' run following commands in the terminal:
 +
    $ cd ~/tool-src/kazoo/test/Demo_C
 +
    $ make -j
 +
 +
=== Kazoo help ===
 +
To obtain complete list of kazoo parameters and options type <code>kazoo --help</code>.
 +
 +
=== Input files ===
 +
Kazoo uses default TASTE AADL models as input:
  
== Input files ==
 
 
* InterfaceView.aadl
 
* InterfaceView.aadl
 
* DeploymentView.aadl
 
* DeploymentView.aadl
* DataView.aadl
+
* DataView.aadl (+ .asn/.acn models)
* DataView.asn
 
* DataView.acn
 
  
== Internal representation of system ==
+
== New templates for kazoo ==
Taste uses Ocarina library to parse input aadl files.
+
To create new set of templates to be used by kazoo copy existing template subdirectory.
The internal representation of system consists of thre major structures:
+
For example to create new Concurrency View template, execute the following commands:
 +
    $ cd ~/tool-src/kazoo/templates/concurrency_view
 +
    $ cp -r aadl_2_threads <new subdirectory>
 +
 
 +
Edit newly created templates and [[#Rebuilding from source|rebuild]] kazoo.
 +
For more details see [[Technical_topic:_Add_a_new_target_platform_to_TASTE|note about adding new target to TASTE]].
 +
 
 +
Templates locations:
 +
* Code skeletons: <code>tool-src/kazoo/templates/skeletons</code>
 +
* Glue code: <code>tool-src/kazoo/templates/glue/language_wrappers</code>
 +
* Concurrency View: <code>tool-src/kazoo/templates/concurrency_view</code>
 +
 
 +
 
 +
 
 +
=== Templates documentation ===
 +
 
 +
The up to date list list of tags available for each template file is documented here: [[Kazoo Templates Documentation]]
 +
 
 +
== Code generation ==
 +
 
 +
Kazoo uses provided AADL models to generate four major parts of the final system implementation:
 +
* Makefiles/Project Files/ - to build the system incrementally,
 +
* Code skeletons - actual implementation of functions and their provided interfaces,
 +
* Glue code - the source code responsible for exchanging parameters and results between interfaces, via a middleware and operating system,
 +
* Concurrency View - the system.aadl and main.aadl files, which will be later used by [[Ocarina]] to generate code during build script execution.
 +
 
 +
Code is generated using input AADL models, parsed by [[Ocarina]].
 +
 
 +
The system representation consists of three major structures:
 
* InterfaceView
 
* InterfaceView
 
* DeploymentView
 
* DeploymentView
 
* ConcurrencyView
 
* ConcurrencyView
  
The InterfaceView representation contains of list of functions. Every function contains provided interfaces and required interfaces. Optionally a function may contain context parameters.
+
The InterfaceView contains of list of functions. Every function contains provided and required interfaces. Optionally a function may contain context parameters.
The InterfaceView representation contains also connections between provided interfaces and required interfaces.
+
The InterfaceView contains also connections between provided interfaces and required interfaces.
The InterfaceView representation is used to create skeletons and glue code.
+
The InterfaceView is used to create skeletons and glue code. See [[#Code skeletons|code skeletons]] and [[#Glue code|glue code]] generation algorithms.
  
The DeploymentView constists of Nodes, Buses and connections between them.
+
The DeploymentView consists of Nodes, Buses and connections between them.
 
The Node contains Partitions, Processors and Drivers.
 
The Node contains Partitions, Processors and Drivers.
 
The Partition contains a list of bounded functions.
 
The Partition contains a list of bounded functions.
The DeploymentView is not directly used for code generation.
 
  
 
The ConcurrencyView is generated from DeploymentView.
 
The ConcurrencyView is generated from DeploymentView.
Line 31: Line 133:
 
Every Thread has a list of assigned functions from InterfaceView.
 
Every Thread has a list of assigned functions from InterfaceView.
  
The ConcurrencyView is used for generation of rest of glue code and also middleware integration.
+
The ConcurrencyView is used for generation of the rest of glue code and also middleware integration. See [[#Concurrency View|Concurrency View processing]].
 +
 
 +
=== Build script ===
 +
A build script named <code>build-script.sh</code> is generated from <code>build-script.tmplt</code> template file.
 +
It is however kept only for legacy reasons and backward compatibility with the former build system named ''buildsupport''. Kazoo primarily generates a Makefile for automatic the build of TASTE systems and the default content of the build-script.sh file is to call the <code>make</code> command.
  
== build-script.sh generation ==
+
=== Code skeletons ===
The file build-script.sh is generated from build-script.tmplt.
+
For each function defined in Interface View Kazoo will process each [[Kazoo skeletons and glue templates|skeleton template]] (each containing multiple template files).
The template files: build-script-gen.tmplt, build-script-func.tmplt and build-script-zip.tmplt are evaluated earlier, and the output is passed to main template as parameters.
+
From each processing a one 'Makefile' and one 'implementation' file can be generated (both are optional outputs).
 +
This processing algorithm is presented in more detail in the pseudocode below:
 +
<syntaxhighlight lang="Python">
 +
for function in InterfaceView:
 +
    for skeleton_template_subdirectory in skeleton_directory:
 +
        makefile_filename = evaluate_optional_template_file("makefile-filename.tmplt")
 +
        function_filename = evaluate_optional_template_file("function-filename.tmplt")
 +
        if evaluate_template_file("trigger.tmplt") is "TRUE":
 +
            for interface in function.required_interfaces:
 +
                evaluate_template_file("interface.tmplt")
 +
            for interface in function.provided_interfaces:
 +
                evaluate_template_file("interface.tmplt")
 +
            if makefile_filename is not empty:
 +
                evaluate_template_file("makefile.tmplt") and save as makefile_filename
 +
            evaluate_template_file("function.tmplt") and (save as function_filename if function_filename is not empty)
 +
    if context_parameters in function:
 +
        evaluate_template_file("context_parameters.tmplt") and save as "<function name>/<implementation lang>/Context-<function name>.asn"
 +
</syntaxhighlight>
  
== Code skeletons generation ==
+
The skeletons templates are responsible for creating code skeletons,
Algorithm in pseudocode:
+
which are a placeholders for actual implementation of the functions, provided by the user.
<nowiki>
 
for every function from InterfaceView:
 
    for every subdirectory
 
        evaluate template trigger.tmplt
 
        if result is equal to “TRUE” then
 
            evaluate template function-filename.tmplt if exists
 
            evaluate template makefile-filename.tmplt if exists
 
            evaluate template interface.tmplt for required interfaces of function
 
            evaluate template interface.tmplt for provided interfaces of function
 
            evaluate template makefile.tmplt and optionally save output to file
 
            evaluate template function.tmplt and optionally save output to file
 
    if function has context parameters then
 
        evaluate template context_parameters.tmplt and save the output to file
 
</nowiki>
 
  
 +
Kazoo uses code skeletons to generate files in folder created according to <code><function name>/<language>/<src>/</code> scheme.
  
== Glue code generation ==
+
==== Available code skeletons templates ====
Algorithm in pseudocode:
 
<nowiki>
 
for every function from InterfaceView:
 
    for every subdirectory
 
        evaluate template trigger.tmplt
 
        if result is equal to “TRUE” then
 
            evaluate template function-filename.tmplt if exists
 
            evaluate template makefile-filename.tmplt if exists
 
            evaluate template interface.tmplt for required interfaces of function
 
            evaluate template interface.tmplt for provided interfaces of function
 
            evaluate template makefile.tmplt and optionally save output to file
 
            evaluate template function.tmplt and optionally save output to file
 
</nowiki>
 
  
 +
Currently kazoo provides the following code skeletons templates (each stored in separate subdirectory of <code>tool-src/kazoo/templates/skeletons</code>):
 +
* ada-body
 +
* ada-source
 +
* blackbox-c-body
 +
* blackbox-c-header
 +
* c-body
 +
* c-header
 +
* cpp-body
 +
* cpp-body-instance
 +
* cpp-body-type
 +
* cpp-context
 +
* cpp-header
 +
* cpp-header-instance
 +
* cpp-header-type
 +
* gui-body
 +
* gui-enum-defs
 +
* gui-header
 +
* gui-runtime-body
 +
* gui-runtime-debug-body
 +
* gui-runtime-debug-header
 +
* gui-runtime-header
 +
* opengeode-process-body
 +
* opengeode-structure
 +
* pragmadev_process_rdd
 +
* pragmadev_process_rdp
 +
* pragmadev_scheduled
 +
* pragmadev_sys_process_rdd
 +
* simulink
 +
* timer-manager-body
 +
* timer-manager-header
 +
* vdm-body
 +
* vdm-header
  
== Concurrency View generation ==
+
=== Glue code ===
Algorithm in pseudocode:
+
For each function defined in Interface View Kazoo will process each [[Kazoo skeletons and glue templates|glue template]] (each containing multiple template files).
<nowiki>
+
From each processing a one 'Makefile' and one 'implementation' file can be generated (both are optional outputs).
for every subdirectory
+
This processing algorithm is presented in more detail in the pseudocode below:
     for every node from ConcurrencyView
+
 
         evaluate template filenode.tmplt
+
<syntaxhighlight lang="Python">
         evaluate template trigger.tmplt
+
for function in InterfaceView:
         if result is equal to “TRUE” then
+
     for glue_template_subdirectory in glue_directory:
             for every partition from node:
+
         makefile_filename = evaluate_optional_template_file("makefile-filename.tmplt")
                 evaluate template filepart.tmplt
+
         function_filename = evaluate_optional_template_file("function-filename.tmplt")
                evaluate template thread.tmplt
+
         if evaluate_template_file("trigger.tmplt") is "TRUE":
                 evaluate template filethread.tmplt
+
             for interface in function.required_interfaces:
                evaluate template fileblock.tmplt
+
                 evaluate_template_file("interface.tmplt")
                 evaluate template pi.tmplt
+
            for interface in function.provided_interfaces:
                evaluate template pi.tmplt (with other parameters)
+
                 evaluate_template_file("interface.tmplt")
                evaluate template ri.tmplt
+
            if makefile_filename is not empty:
                evaluate template block.tmplt
+
                 evaluate_template_file("makefile.tmplt") and save as makefile_filename
                evaluate template partition.tmplt
+
            evaluate_template_file("function.tmplt") and (save as function_filename if function_filename is not empty)
        evaluate template node.tmplt
+
</syntaxhighlight>
    evaluate template system.tmplt
+
 
</nowiki>
+
==== Available glue templates ====
 +
 
 +
Currently kazoo provides the glue code templates (each stored in separate subdirectory of <code>tool-src/kazoo/templates/glue</code>) listed in table:
  
== Templates ==
 
=== templates/build-script.tmplt ===
 
This template is evaluated only once. The output is saved to the file build-script.sh within output directory.
 
 
{| class="wikitable"
 
{| class="wikitable"
!Parameter name
+
!Template name
!Description
+
!Generates
 
|-
 
|-
|Interface_View_Path
+
|invoke_ri-body
|Path to the interface view file
+
|<code><function name>/<language>/<function name>_invoke_ri.c</code>
 
|-
 
|-
|Output_Path
+
|mini-cv
|Output directory
+
|<code><function name>/<language>/<function name>_mini_cv.aadl</code>
 
|-
 
|-
|Generate_Code
+
|system_config
|Concatenated result from evaluation of build-script-gencode.tmplt
+
|<code><function name>/<language>/<function name>_system_config.h</code>
 
|-
 
|-
|Zip_Code
+
|vm_if-body
|Concatenated result from evaluation of build-script-zip.tmplt
+
|<code><function name>/<language>/<function name>_vm_if.c</code>
 
|-
 
|-
|Functions
+
|vm_if-header
|Concatenated result from evaluation of build-script-func.tmplt
+
|<code><function name>/<language>/<function name>_vm_if.h</code>
 
|}
 
|}
=== templates/skeletons/makefile.tmplt ===
 
This template is evaluated only once. The output is saved to the Makefile within output directory.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Function_Names
 
|Combined table: list of fuction names...
 
|-
 
|Language
 
|... and corresponding implementation language
 
|-
 
|Is_Type
 
|... and flag if it is a function type
 
|-
 
|Has_Context_Param
 
|... and flag to indicate if function has context parameters
 
|-
 
|Has_Context_Param_Tag
 
|
 
|-
 
|CP_Files
 
|List of all context parameters ASN.1 files
 
|-
 
|Unique_Languages
 
|List of all languages used in the system
 
|-
 
|ASN1_Files
 
|List of all ASN.1 files
 
|-
 
|ACN_Files
 
|List of all ACN files
 
|-
 
|ASN1_Modules
 
|List of all ASN.1 modules
 
|}
 
=== templates/skeletons/context-parameters.tmplt ===
 
This template is evaluated for every function which has context parameters. The output is saved to the file Context-<function name>.asn
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|Function name
 
|-
 
|Sort_Set
 
|Set of types used for this Context Parameter file
 
|-
 
|Module_Set
 
|... corresponding module (needed for ASN.1 "IMPORTS")
 
|-
 
|CP_Name
 
|Table of context parameter names
 
|-
 
|CP_Sort
 
|... corresponding ASN.1 type
 
|-
 
|CP_ASN1_Module
 
|... in ASN.1 module
 
|-
 
|CP_Value
 
|... with default value
 
|}
 
=== templates/skeletons/sub/trigger.tmplt ===
 
This template is evaluated to trigger processing of other files from given directory.
 
If the result of evaluation is equal to "TRUE", then other files will be processed.
 
This template is identical for Skeleton and Glue subfolders.
 
  
{| class="wikitable"
+
=== Concurrency View ===
!Parameter name
+
For each [[Kazoo concurrency view templates|Concurrency View template]] kazoo processes each node of the view and creates set of files
!Description
+
according to the presented algorithm in pseudocode:
|-
+
 
|Name
+
<syntaxhighlight lang="Python">
|The name of the function
+
for template_subdirectory in concurrency_view_directory:
|-
+
    all_nodes = ""
|Is_Type
+
    filesys = evaluate_template_file("filesys.tmplt")
|True if function type
+
    for node in ConcurrencyView:
|-
+
        filenode = evaluate_optional_template_file("filenode.tmplt")
|Instance_Of
+
        if evaluate_template_file("trigger.tmplt") is "TRUE":
|Name of instance or empty string
+
            for partition in node.partitions:
|-
+
                filepart = evaluate_optional_template_file("filepart.tmplt")
|Language
+
                for thread in partition.threads:
|Implementation language for the function
+
                    filethread = evaluate_optional_template_file("filethread.tmplt")
|-
+
                    evaluate_template_file("thread.tmplt") and (save as filethread if filethread is not empty)
|Filename_Is_Present
+
                for block in partition.blocks:
|True if target function output already exists
+
                    fileblock = evaluate_optional_template_file("fileblock.tmplt")
|-
+
                    for block.protected_interfaces:
|Makefile_Is_Present
+
                        evaluate_template_file("pi.tmplt")
|True if target build script already exists
+
                    for block.unprotected_interfaces:
|-
+
                        evaluate_template_file("pi.tmplt")
|Zip_File
+
                    for block.required_interfaces:
|Optional path to zip file
+
                        evaluate_template_file("ri.tmplt")
|-
+
                    evaluate_template_file("block.tmplt") and (save as fileblock if fileblock is not empty)
|Use_POHIC
+
                partition_content = evaluate_template_file("partition.tmplt")
|Command line configuration
+
                if filepart is not empty:
|}
+
                    save partition_content as filepart
=== templates/skeletons/sub/makefile-filename.tmplt ===
+
        node_content = evaluate_template_file("node.tmplt")
This file is optional, if exists the result of parsing of this file is a name of output file for makefile.tmplt, otherwise this template will not be processed.
+
        if filenode is not empty:
{| class="wikitable"
+
            save node_content as filenode
!Parameter name
+
        all_nodes += node_content
!Description
+
    if filesys is not empty and all_nodes is not empty:
|-
+
        evaluate_optional_template_file("system.tmplt") and save as filesys
|Name
+
</syntaxhighlight>
|The name of the function
+
 
|}
+
==== Available Concurrency View templates ====
=== templates/skeletons/sub/function-filename.tmplt ===
 
This file is optional, if exists the result of parsing of this file is a name of output file for function.tmplt, otherwise this template will not be processed.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|The name of the function
 
|}
 
=== templates/skeletons/sub/interface.tmplt ===
 
This file is processed twice, first time for required interfaces of the function from Interface View, second time for the provided interfaces. The results are parameters for processing function.tmplt
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|The name of the interface
 
|-
 
|Direction
 
|"PI" or "RI"
 
|-
 
|Kind
 
|The RCM Kind
 
|-
 
|Parent_Function
 
|The name of the function
 
|-
 
|Language
 
|The implementation language of the function
 
|-
 
|Property_Names
 
|All AADL properties (names) associated to the function
 
|-
 
|Property_Values
 
|... and corresponding values
 
|-
 
|Param_Names
 
|List of parameter names
 
|-
 
|Param_Types
 
| |_ Corresponding parameter types
 
|-
 
|Param_Directions
 
| |_ Corresponding direction
 
|-
 
|Param_Encodings
 
| |_ Corresponding ASN.1 encoding
 
|-
 
|Is_Timer
 
|Flag set to true if this is a timer interface
 
|-
 
|Period
 
|Property of the interface
 
|-
 
|WCET
 
|Property of the interface
 
|-
 
|Queue_Size
 
|Property of the interface
 
|-
 
|IF_Property_Names
 
| and Values User-defined properties (vector tag)
 
|}
 
=== templates/skeletons/sub/makefile.tmplt ===
 
This template is processed when makefile-filename.tmplt exists.
 
The output of this template is saved to the file with name returned by processing makefile-filename.tmplt In directory [functionname]/[ languagename]
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|The function name
 
|-
 
|ASN1_Files
 
|List of all ASN.1 files
 
|-
 
|ASN1_Modules
 
|List of all ASN.1 modules
 
|-
 
|Is_Type
 
|Flag set to True for function type
 
|-
 
|Instance_Of
 
|Name of function type if instance
 
|}
 
=== templates/skeletons/sub/function.tmplt ===
 
This template is processed when function-filename.tmplt exists.
 
The output of this template is save to the file with name returned by processing function-filename.tmplt in directory [functionname]/[languagename]/src.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|The name of the function
 
|-
 
|Language
 
|The implementation language
 
|-
 
|List_Of_PIs
 
|List of all Provided Interfaces (just names)
 
|-
 
|List_Of_RIs
 
|List of all Required Interfaces (just names)
 
|-
 
|List_Of_Sync_PIs
 
|List of synchronous Provided Interfaces
 
|-
 
|List_Of_Sync_RIs
 
|List of synchronous Required Interfaces
 
|-
 
|List_Of_ASync_PIs
 
|List of asynchronous Provided Interfaces
 
|-
 
|List_Of_ASync_RIs
 
|List of asynchronous Required Interfaces
 
|-
 
|ASN1_Modules
 
|List of ASN.1 Modules names
 
|-
 
|ASN1_Files
 
|List of ASN.1 Files with path
 
|-
 
|Timers
 
|List of timers (just names)
 
|-
 
|Has_Context
 
|Flag, True if there are context parameters
 
|-
 
|CP_Names
 
|List of Context Parameter names
 
|-
 
|CP_Types
 
|List of Context Parameter types
 
|-
 
|Provided_Interfaces
 
|From template: Provided interfaces with params
 
|-
 
|Required_Interfaces
 
|From template: Required interfaces with params
 
|-
 
|Property_Names
 
|List of User-defined properties (names)
 
|-
 
|Property_Values
 
|List of User-defined properties (values)
 
|-
 
|Is_Type Flag
 
|True if function is a component type
 
|-
 
|Instance_Of
 
|Optional name of component type
 
|}
 
=== templates/concurrency_view/sub/filenode.tmplt ===
 
This file is optional. This file is processed for every node. The result of this file is a filename for result of processing node.tmplt.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Node_Name
 
|Name of the node as defined in the Deployment View
 
|-
 
=== templates/concurrency_view/sub/trigger.tmplt ===
 
This file is processed for every node. The result of this file indicates if the rest of templates for given node will be processed.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Filename_Is_Present
 
|true if file with name returned by filenode.tmplt exists
 
|-
 
|Skeletons
 
|from kazoo configuration
 
|-
 
|Glue
 
|from kazoo configuration
 
|-
 
|POHIC
 
|from kazoo configuration
 
|-
 
|Debug
 
|from kazoo configuration
 
|-
 
|No_Stdlib
 
|from kazoo configuration
 
|}
 
=== templates/concurrency_view/sub/filepart.tmplt ===
 
This file is processed for every partition in every node. This file is optional.
 
If the result is not empty then is used as a file name for parsing partition.tmplt
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Partition_Name
 
|Partition name
 
|}
 
=== templates/concurrency_view/sub/thread.tmplt ===
 
This file is processed for every thread in every partition in every node.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Thread_Name
 
|Thread name
 
|-
 
|Partition_Name
 
|Partition containing this thread
 
|-
 
|Entry_Port_Name
 
|Name of the PI
 
|-
 
|RCM
 
|One of "CYCLIC_OPERATION", "SPORADIC_OPERATION"
 
|-
 
|Need_Mutex
 
|True if the PI is shared with others in the protected block
 
|-
 
|Pro_Block_Name
 
|Name of the protected function
 
|-
 
|Node_Name
 
|Name of the deployment node
 
|-
 
|Remote_Threads
 
|Vector tag: output remote thread list
 
|-
 
|RI_Port_Name
 
| |_ Corresponding local RI name
 
|-
 
|Remote_PIs
 
| |_ Associated PI Name
 
|-
 
|Remote_PI_Sorts
 
| |_ Optional param type of the remote thread
 
|-
 
|Remote_PI_Modules
 
| |_ Asn1 module of the optional param type
 
|-
 
|Name
 
|
 
|-
 
|Kind
 
|
 
|-
 
|Parent_Function
 
|Tags related to the PI that is at the origin of the thread creation: shoud be useless here
 
|-
 
|Param_Names
 
|
 
|-
 
|Types
 
|
 
|-
 
|ASN1_Modules
 
|
 
|-
 
|Encodings
 
|
 
|-
 
|Directions
 
|param vector tag
 
|-
 
|Period
 
|
 
|-
 
|WCET
 
|
 
|-
 
|Queue_Size
 
|relevant here
 
|-
 
|IF_Property_Names
 
|
 
|-
 
|Values
 
|user properties (vector tag)
 
|-
 
|Skeletons
 
|from kazoo configuration
 
|-
 
|Glue
 
|from kazoo configuration
 
|-
 
|POHIC
 
|from kazoo configuration
 
|-
 
|Debug
 
|from kazoo configuration
 
|-
 
|No_Stdlib
 
|from kazoo configuration
 
|}
 
=== templates/concurrency_view/sub/filethread.tmplt ===
 
This file is processed for every thread in every partition in every node.
 
The result of this template is used as a file name to save thread.tmplt. If the result is empty the file will be not created.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Thread_Name
 
|Thread name
 
|}
 
=== templates/concurrency_view/sub/fileblock.tmplt ===
 
This template is evaluated for every block in partition.
 
The result of this template is used as a file name to save block.tmplt. If the result is empty then the file will not be created.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Block_Name
 
|Block Name
 
|}
 
=== templates/concurrency_view/sub/pi.tmplt ===
 
The template pi.tmplt is evaluated many times for every protected and unprotected provided interface.
 
The result of every evaluation is joined to one string and passed as a parameter to block.tmplt
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|The name of the interface
 
|-
 
|Direction
 
|"PI" or "RI"
 
|-
 
|Kind
 
|The RCM Kind
 
|-
 
|Parent_Function
 
|The name of the function
 
|-
 
|Param_Names
 
|List of parameter names
 
|-
 
|Param_Types
 
| |_ Corresponding parameter types
 
|-
 
|Param_Directions
 
| |_ Corresponding direction
 
|}
 
=== templates/concurrency_view/sub/ri.tmplt ===
 
The template ri.tmplt is evaluated many times for every required interface.
 
The result of every evaluation is koined to one string and passed as a parameter to block.tmplt
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|The name of the interface
 
|-
 
|Direction
 
|"PI" or "RI"
 
|-
 
|Kind
 
|The RCM Kind
 
|-
 
|Parent_Function
 
|The name of the function
 
|-
 
|Param_Names
 
|List of parameter names
 
|-
 
|Param_Types
 
|Corresponding parameter types
 
|-
 
|Param_Directions
 
|Corresponding direction
 
|}
 
=== templates/concurrency_view/sub/block.tmplt ===
 
This template is evaluated for every block.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Name
 
|Protected block name
 
|-
 
|Language
 
|Implementation language
 
|-
 
|Calling_Threads
 
|List of calling threads
 
|-
 
|Node name
 
|Node name
 
|-
 
|Protected_PIs
 
|Protected Provided interfaces (from pi.tmplt)
 
|-
 
|Unprotected_PIs
 
|Unprotected Provided interfaces (from pi.tmplt)
 
|-
 
|Required
 
|Required interfaces (from ri.tmplt)
 
|}
 
  
And all the system configuration obtained from the command line:
+
Currently kazoo provides the Concurrency View templates (each stored in separate subdirectory of <code>tool-src/kazoo/templates/concurrency_view</code>) listed in table:
Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
 
Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
 
No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
 
  
=== templates/concurrency_view/sub/partition.tmplt ===
 
This file is evaluated for every partition.
 
 
{| class="wikitable"
 
{| class="wikitable"
!Parameter name
+
!Template name
!Description
+
!Generates
 +
!Processed
 
|-
 
|-
|Name
+
|aadl_2_threads
|Partition name (usually the name of the binary)
+
|<code>build/system.aadl</code> (the actual Concurrency View)
 +
|Always (Used later by [[Ocarina]] to create middleware source code from the Concurrency View)
 
|-
 
|-
|Threads
+
|aadl_3_main
|Code generated for the threads
+
|<code>build/main.aadl</code> (AADL project entry point)
 +
|Always (Used later by [[Ocarina]] to process the Concurrency View)
 
|-
 
|-
|Thread_Names
+
|aadl_4_makefile
|Tag: list of thread names
+
|<code>build/Makefile.taste</code>
 +
|Always
 
|-
 
|-
|Node_Name
+
|ada_pohi_gpr
|Name of the node containing this partition
+
|
|-
+
* for every node: <code>Makefike.<node name></code>
|Blocks
+
* for every partition: <code><partition name>.gpr</code>
|Code generated for protected functions
+
|Only when [[PolyORB-HI-Ada]] middleware should be used (default)
|-
 
|Block_Names
 
|Tag: list of block (user functions) names
 
|-
 
|Coverage
 
|True if user requested code coverage enable
 
|-
 
|Package_Name
 
|AADL Package name for the target (e.g. ocarina_porocessors_x86)
 
|-
 
|CPU_Name
 
|CPU AADL Identifier (e.g. x86_inst)
 
|-
 
|CPU_Family
 
|CPU Kind (e.g. leon3)
 
|-
 
|CPU_Instance
 
|AADL component instance (e.g. rtems_posix)
 
|-
 
|CPU_Platform
 
|AADL CPU_Platform (e.g. PLATFORM_NATIVE)
 
|-
 
|CPU_Classifier
 
|AADL CPU Classifier (e.g. ocarina_processors_x86::x86.linux)
 
|-
 
|VP_Name
 
|Virtual processor name on which the partition is bounded
 
|-
 
|VP_Platform
 
|Virtual processor platform (e.g. PLATFORM_AIR)
 
|-
 
|VP_Classifier
 
|Virtual processor classifier
 
|-
 
|Bound_Functions
 
|List of user functions from Interface view
 
|-
 
|Thread_Src_Name
 
|Vector tag : connection thread name (source)
 
|-
 
|Thread_Dst_Name
 
|Vector tag : connection thread name (dest)
 
|-
 
|Thread_Src_Port
 
|Vector tag : connection port name (source)
 
|-
 
|Thread_Dst_Port
 
|Vector tag : connection port name (dest)
 
|-
 
|In_Port_Names
 
|Vector tag: input ports of the partition
 
|-
 
|In_Port_Thread_Name
 
| |_ corresponding thread inside the partition
 
|-
 
|In_Port_Type_Name
 
| |_ corresponding parameter type name (optional)
 
|-
 
|Out_Port_Names
 
|Vector tag: output ports of the partition
 
|-
 
|Out_Port_Type_Name
 
| |_ corresponding parameter type name (optional)
 
|-
 
|Part_Out_Port_Name
 
|Vector tag: output ports of the partition (can be several times the same)
 
|-
 
|Connected_Threads
 
| |_ Corresponding thread connected to it
 
|}
 
=== templates/concurrency_view/sub/node.tmplt ===
 
This file is evaluated for every node. The result of this file is saved to the file with name returned by filenode.tmplt. The result is also used as a parameter for system.tmplt.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Node_Name
 
|Name of the node from deployment view
 
|-
 
|Partition_Names
 
|Tag listing the partitions in this node
 
|-
 
|Has_Memory
 
|Boolean flag indicating that a memory is defined for this node
 
|-
 
|Partitions
 
|List of rendered code for partitions
 
|-
 
|VP_Names
 
|Vector tag: list of virtual processors on this node
 
|-
 
|VP_Package_Names
 
| |_ Corresponding package name
 
|-
 
|VP_Platforms
 
| |_ Corresponding platform name
 
|-
 
|VP_Classifiers
 
| |_ Corresponding aadl classifier
 
|-
 
|CPU_Name, Family, Instance, Platform, Classifier, Ada_Runtime
 
|Info about CPU
 
|}
 
=== templates/concurrency_view/sub/system.tmplt ===
 
This file is evaluated for every node. The result of this file is save to the file with name returned by
 
filesys.tmplt.
 
{| class="wikitable"
 
!Parameter name
 
!Description
 
|-
 
|Nodes
 
|Code generated for the nodes
 
|-
 
|Node_Names
 
|Vector Tag of node names
 
|-
 
|Node_CPU
 
|Corresponding CPU name (eg x86_linux)
 
|-
 
|Node_CPU_Classifier
 
|CPU Classifier (ocarina...::x86_linux)
 
|-
 
|Node_Major_Frame
 
|Time in milliseconds allocated to the CPU (TSP only)
 
|-
 
|Partition_Names
 
|Vector Tag of partition names
 
|-
 
|Partition_Node
 
|Corresponding node name
 
|-
 
|Partition_CPU
 
|Corresponding CPU name
 
|-
 
|Partition_Duration
 
|Corresponding time allocation (TSP only)
 
|-
 
|Partition_VP
 
|Virtual processor binding (TSP only)
 
 
|-
 
|-
|Threads
+
|ada_wrappers_body
|Code generated for the threads
+
|for every partition: <code>build/<partition name>/<partition name>_taste_interface.adb</code>
 +
|Only when [[PolyORB-HI-Ada]] middleware should be used (default)
 
|-
 
|-
|Thread_Names
+
|ada_wrappers_source
|List of all threads in the complete system
+
|for every partition: <code>build/<partition name>/<partition name>_taste_interface.ads</code>
 +
|Only when [[PolyORB-HI-Ada]] middleware should be used (default)
 
|-
 
|-
|Target_Packages
+
|air_cgpr
|List of all target package names in the complete system
+
|for every partition: <code>build/<node name>/air.cgpr</code> (Cross-compiler configuration for the TSP/AIR hypervisor)
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Part_Source_Name
+
|air_gpr
|Inter-partition connections : partition source name (vector tag)
+
|for every partition: <code>build/<node name>/_air.gpr</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Part_Source_Port
+
|air_makefile
| |_ Corresponding port name
+
|<code>build/Makefile.air</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Part_Dest_Name
+
|air_port_polling
| |_ Corresponding name of the remote partition
+
|for every partition: <code>build/<node name>/<partition name>/air_polling.c</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Part_Dest_Port
+
|c_pohi_gpr
| |_ Corresponding name of the port on the remote partition
 
|-
 
|Bus_Names
 
|Vector tag: busses present in the system
 
|-
 
|Bus_AADL_Package
 
| |_ corresponding AADL Package
 
|-
 
|Bus_Classifier
 
| |_ corresponding AADL classifier
 
|-
 
|Device_Names
 
|
 
|-
 
|Device_Node_Name
 
|
 
|-
 
|Device_Partition
 
|-- Partition name associated to the driver (currently only one supported per node)
 
|-
 
|Device_AADL_Pkg
 
|
 
|-
 
|Device_Classifier
 
|
 
|-
 
|Device_CPU
 
|
 
|-
 
|Device_Config
 
|
 
|-
 
|Device_Bus_Name
 
|
 
|-
 
|Device_Port_Name
 
|
 
|-
 
|Device_ASN1_File
 
|
 
|-
 
|Device_ASN1_Sort
 
 
|
 
|
 +
* for every node: <code>build/<node name>/Makefile.<node name></code>
 +
* for every partition <code>build/<node name>/<partition name>.gpr</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Device_ASN1_Module
+
|c_pohi_rtems_with_ada_cgpr
|Device drivers (vector tag)
+
|for every partition: <code>build/<node name>/rtems_ada.cgpr</code>
|-
+
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
|Unique_Dev_ASN1_Files
 
|List of ASN.1 files/module/type for device configuration with no duplicates (vector tag)
 
 
|-
 
|-
|Unique_Dev_ASN1_Mod
+
|c_pohi_rtems_with_ada_gpr
| |_  corresponding asn1 module
+
|for every partition: <code>build/<node name>/<partition name>_rtems_ada.gpr</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Unique_Dev_ASN1_Sorts
+
|drivers_config
| |_  type name
+
|<code>build/drivers_config.asn</code>
 +
|Always
 
|-
 
|-
|Connect_From_Part
+
|pohic_makefile_workaround
|Vector tag - bus connection: partition source
+
|for every partition: <code>build/<node name>/gather_<partition name>_filelist.sh</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Connect_Via_Bus
+
|pohic_wrappers_body
| |_ bus name
+
|for every partition: <code>build/<node name>/<partition name>_polyorb_interface.c</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|-
 
|-
|Connect_Port_Name
+
|pohic_wrappers_header
| |_ port name
+
|for every partition: <code>build/<node name>/<partition name>_polyorb_interface.h</code>
 +
|Only when [[PolyORB-HI-C]] middleware should be used (<code>--polyorb-hi-c</code> option).
 
|}
 
|}
 
And all the system configuration obtained from the command line:
 
Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
 
Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
 
No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
 

Latest revision as of 09:55, 17 April 2020

Kazoo is a part of the TASTE toolchain responsible for generating code and build scripts from AADL models.

Overview

Kazoo is a command line tool which processes input AADL models and produces derived models, code and scripts used to build complete system. It uses Ocarina for AADL parsing and templates-parser for templates processing and files generation. Standard library of components used by templates is defined by TASTE common models from ocarina_components.aadl file, which includes supported processors, devices, drivers etc. Generated build scripts apart from calling code compilers also run other tools like ocarina and aadl2glueC to create rest of the source code.

Installation and updating

Updating sources

To update kazoo run the following commands in the terminal:

   $ cd ~/tool-src/kazoo
   $ git checkout master
   $ git pull

When command succeeds, kazoo needs to be rebuild to complete installation.

Rebuilding from source

To build and install kazoo from sources so run the following commands in the terminal:

   $ cd ~/tool-src
   $ ./install/87_kazoo.sh

Using kazoo

Kazoo is a command line tool, executed from terminal and configured by a list of parameters.

Basic usage

Kazoo is integrated in TASTE as one of the main tools for generating and building the code of the system under development. The calls to kazoo are normally hidden to the user and should rarely be done manually. To start a project using Kazoo, user normally run a single command:

   $ taste

If user would like to use kazoo directly, or tweak it's behaviour, the following example Makefile presents the calls to kazoo that generate the code skeletons and glue.

KAZOO?=kazoo

all:    c

c:      work/glue_built
        $(MAKE) -C work

skeletons:      InterfaceView.aadl DataView.aadl
        $(KAZOO) --gw -o work
        $(MAKE) -C work dataview
    
work/glue_built:        InterfaceView.aadl DeploymentView.aadl DataView.aadl
        $(KAZOO) -p --glue --gw -o work
        touch work/glue_built

clean:
        $(MAKE) -C work clean
    
.PHONY: clean skeletons c

Kazoo will read the default input AADL models and generate code to the selected output directory. Parameter --output chooses the output directory for generated files (work), --gw enables models and code skeletons generation, --glue enables glue code generation and -p or --polyorb-hi-c turns on use of PolyORB-HI-C runtime.

In the result directory work will be created and filled with generated models and source files.

To build the generated system run following commands in the terminal:

   $ make

The output binary files will be located in the directory work/binaries.

Kazoo example

Kazoo comes with a lot of helpful examples.The examples are located in the directory tool-src/kazoo/test/. Every example project contains Makefile, which simplifies the process of the build. For an example, to build project Demo_C run following commands in the terminal:

   $ cd ~/tool-src/kazoo/test/Demo_C
   $ make -j

Kazoo help

To obtain complete list of kazoo parameters and options type kazoo --help.

Input files

Kazoo uses default TASTE AADL models as input:

  • InterfaceView.aadl
  • DeploymentView.aadl
  • DataView.aadl (+ .asn/.acn models)

New templates for kazoo

To create new set of templates to be used by kazoo copy existing template subdirectory. For example to create new Concurrency View template, execute the following commands:

   $ cd ~/tool-src/kazoo/templates/concurrency_view
   $ cp -r aadl_2_threads <new subdirectory>

Edit newly created templates and rebuild kazoo. For more details see note about adding new target to TASTE.

Templates locations:

  • Code skeletons: tool-src/kazoo/templates/skeletons
  • Glue code: tool-src/kazoo/templates/glue/language_wrappers
  • Concurrency View: tool-src/kazoo/templates/concurrency_view


Templates documentation

The up to date list list of tags available for each template file is documented here: Kazoo Templates Documentation

Code generation

Kazoo uses provided AADL models to generate four major parts of the final system implementation:

  • Makefiles/Project Files/ - to build the system incrementally,
  • Code skeletons - actual implementation of functions and their provided interfaces,
  • Glue code - the source code responsible for exchanging parameters and results between interfaces, via a middleware and operating system,
  • Concurrency View - the system.aadl and main.aadl files, which will be later used by Ocarina to generate code during build script execution.

Code is generated using input AADL models, parsed by Ocarina.

The system representation consists of three major structures:

  • InterfaceView
  • DeploymentView
  • ConcurrencyView

The InterfaceView contains of list of functions. Every function contains provided and required interfaces. Optionally a function may contain context parameters. The InterfaceView contains also connections between provided interfaces and required interfaces. The InterfaceView is used to create skeletons and glue code. See code skeletons and glue code generation algorithms.

The DeploymentView consists of Nodes, Buses and connections between them. The Node contains Partitions, Processors and Drivers. The Partition contains a list of bounded functions.

The ConcurrencyView is generated from DeploymentView. The ConcurrencyView consists of list of Nodes. Every Node consists of list of Partitions and list of Drivers. Every Partition consists of list of Threads. Every Thread has a list of assigned functions from InterfaceView.

The ConcurrencyView is used for generation of the rest of glue code and also middleware integration. See Concurrency View processing.

Build script

A build script named build-script.sh is generated from build-script.tmplt template file. It is however kept only for legacy reasons and backward compatibility with the former build system named buildsupport. Kazoo primarily generates a Makefile for automatic the build of TASTE systems and the default content of the build-script.sh file is to call the make command.

Code skeletons

For each function defined in Interface View Kazoo will process each skeleton template (each containing multiple template files). From each processing a one 'Makefile' and one 'implementation' file can be generated (both are optional outputs). This processing algorithm is presented in more detail in the pseudocode below:

for function in InterfaceView:
    for skeleton_template_subdirectory in skeleton_directory:
        makefile_filename = evaluate_optional_template_file("makefile-filename.tmplt")
        function_filename = evaluate_optional_template_file("function-filename.tmplt")
        if evaluate_template_file("trigger.tmplt") is "TRUE":
            for interface in function.required_interfaces:
                evaluate_template_file("interface.tmplt")
            for interface in function.provided_interfaces:
                evaluate_template_file("interface.tmplt")
            if makefile_filename is not empty:
                evaluate_template_file("makefile.tmplt") and save as makefile_filename
            evaluate_template_file("function.tmplt") and (save as function_filename if function_filename is not empty)
    if context_parameters in function:
        evaluate_template_file("context_parameters.tmplt") and save as "<function name>/<implementation lang>/Context-<function name>.asn"

The skeletons templates are responsible for creating code skeletons, which are a placeholders for actual implementation of the functions, provided by the user.

Kazoo uses code skeletons to generate files in folder created according to <function name>/<language>/<src>/ scheme.

Available code skeletons templates

Currently kazoo provides the following code skeletons templates (each stored in separate subdirectory of tool-src/kazoo/templates/skeletons):

  • ada-body
  • ada-source
  • blackbox-c-body
  • blackbox-c-header
  • c-body
  • c-header
  • cpp-body
  • cpp-body-instance
  • cpp-body-type
  • cpp-context
  • cpp-header
  • cpp-header-instance
  • cpp-header-type
  • gui-body
  • gui-enum-defs
  • gui-header
  • gui-runtime-body
  • gui-runtime-debug-body
  • gui-runtime-debug-header
  • gui-runtime-header
  • opengeode-process-body
  • opengeode-structure
  • pragmadev_process_rdd
  • pragmadev_process_rdp
  • pragmadev_scheduled
  • pragmadev_sys_process_rdd
  • simulink
  • timer-manager-body
  • timer-manager-header
  • vdm-body
  • vdm-header

Glue code

For each function defined in Interface View Kazoo will process each glue template (each containing multiple template files). From each processing a one 'Makefile' and one 'implementation' file can be generated (both are optional outputs). This processing algorithm is presented in more detail in the pseudocode below:

for function in InterfaceView:
    for glue_template_subdirectory in glue_directory:
        makefile_filename = evaluate_optional_template_file("makefile-filename.tmplt")
        function_filename = evaluate_optional_template_file("function-filename.tmplt")
        if evaluate_template_file("trigger.tmplt") is "TRUE":
            for interface in function.required_interfaces:
                evaluate_template_file("interface.tmplt")
            for interface in function.provided_interfaces:
                evaluate_template_file("interface.tmplt")
            if makefile_filename is not empty:
                evaluate_template_file("makefile.tmplt") and save as makefile_filename
            evaluate_template_file("function.tmplt") and (save as function_filename if function_filename is not empty)

Available glue templates

Currently kazoo provides the glue code templates (each stored in separate subdirectory of tool-src/kazoo/templates/glue) listed in table:

Template name Generates
invoke_ri-body <function name>/<language>/<function name>_invoke_ri.c
mini-cv <function name>/<language>/<function name>_mini_cv.aadl
system_config <function name>/<language>/<function name>_system_config.h
vm_if-body <function name>/<language>/<function name>_vm_if.c
vm_if-header <function name>/<language>/<function name>_vm_if.h

Concurrency View

For each Concurrency View template kazoo processes each node of the view and creates set of files according to the presented algorithm in pseudocode:

for template_subdirectory in concurrency_view_directory:
    all_nodes = ""
    filesys = evaluate_template_file("filesys.tmplt")
    for node in ConcurrencyView:
        filenode = evaluate_optional_template_file("filenode.tmplt")
        if evaluate_template_file("trigger.tmplt") is "TRUE":
            for partition in node.partitions:
                filepart = evaluate_optional_template_file("filepart.tmplt")
                for thread in partition.threads:
                    filethread = evaluate_optional_template_file("filethread.tmplt")
                    evaluate_template_file("thread.tmplt") and (save as filethread if filethread is not empty)
                for block in partition.blocks:
                    fileblock = evaluate_optional_template_file("fileblock.tmplt")
                    for block.protected_interfaces:
                        evaluate_template_file("pi.tmplt")
                    for block.unprotected_interfaces:
                        evaluate_template_file("pi.tmplt")
                    for block.required_interfaces:
                        evaluate_template_file("ri.tmplt")
                    evaluate_template_file("block.tmplt") and (save as fileblock if fileblock is not empty)
                partition_content = evaluate_template_file("partition.tmplt")
                if filepart is not empty:
                    save partition_content as filepart
        node_content = evaluate_template_file("node.tmplt")
        if filenode is not empty:
            save node_content as filenode
        all_nodes += node_content
    if filesys is not empty and all_nodes is not empty:
        evaluate_optional_template_file("system.tmplt") and save as filesys

Available Concurrency View templates

Currently kazoo provides the Concurrency View templates (each stored in separate subdirectory of tool-src/kazoo/templates/concurrency_view) listed in table:

Template name Generates Processed
aadl_2_threads build/system.aadl (the actual Concurrency View) Always (Used later by Ocarina to create middleware source code from the Concurrency View)
aadl_3_main build/main.aadl (AADL project entry point) Always (Used later by Ocarina to process the Concurrency View)
aadl_4_makefile build/Makefile.taste Always
ada_pohi_gpr
  • for every node: Makefike.<node name>
  • for every partition: <partition name>.gpr
Only when PolyORB-HI-Ada middleware should be used (default)
ada_wrappers_body for every partition: build/<partition name>/<partition name>_taste_interface.adb Only when PolyORB-HI-Ada middleware should be used (default)
ada_wrappers_source for every partition: build/<partition name>/<partition name>_taste_interface.ads Only when PolyORB-HI-Ada middleware should be used (default)
air_cgpr for every partition: build/<node name>/air.cgpr (Cross-compiler configuration for the TSP/AIR hypervisor) Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
air_gpr for every partition: build/<node name>/_air.gpr Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
air_makefile build/Makefile.air Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
air_port_polling for every partition: build/<node name>/<partition name>/air_polling.c Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
c_pohi_gpr
  • for every node: build/<node name>/Makefile.<node name>
  • for every partition build/<node name>/<partition name>.gpr
Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
c_pohi_rtems_with_ada_cgpr for every partition: build/<node name>/rtems_ada.cgpr Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
c_pohi_rtems_with_ada_gpr for every partition: build/<node name>/<partition name>_rtems_ada.gpr Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
drivers_config build/drivers_config.asn Always
pohic_makefile_workaround for every partition: build/<node name>/gather_<partition name>_filelist.sh Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
pohic_wrappers_body for every partition: build/<node name>/<partition name>_polyorb_interface.c Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).
pohic_wrappers_header for every partition: build/<node name>/<partition name>_polyorb_interface.h Only when PolyORB-HI-C middleware should be used (--polyorb-hi-c option).