Commit d7489203 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Iterate on the templates

parent a26a56f3
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
@@-- @_Thread_Names_@ : Tag: list of thread names @@-- @_Thread_Names_@ : Tag: list of thread names
@@-- @_Node_Name_@ : Name of the node containing this partition @@-- @_Node_Name_@ : Name of the node containing this partition
@@-- @_Blocks_@ : Code generated for protected functions @@-- @_Blocks_@ : Code generated for protected functions
@@-- @_Block_Names@ : Tag: list of block (user functions) names @@-- @_Block_Names@ : Vector Tag: list of block (user functions) names
@@-- @_Block_Languages@ : |_ Corresponding implementation language
@@-- @_Coverage_@ : True if user requested code coverage enable @@-- @_Coverage_@ : True if user requested code coverage enable
@@-- @_Package_Name_@ : AADL Package name for the target (e.g. ocarina_porocessors_x86) @@-- @_Package_Name_@ : AADL Package name for the target (e.g. ocarina_porocessors_x86)
@@-- @_CPU_Name_@ : CPU Name (e.g. x86_linux) @@-- @_CPU_Name_@ : CPU Name (e.g. x86_linux)
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
* Timers : @_Timers_@ * Timers : @_Timers_@
*/ */
#include <stdbool.h>
#include "@_LOWER:Name_@_vm_if.h" #include "@_LOWER:Name_@_vm_if.h"
void init_@_LOWER:Name_@() void init_@_LOWER:Name_@()
...@@ -52,6 +53,7 @@ void init_@_LOWER:Name_@() ...@@ -52,6 +53,7 @@ void init_@_LOWER:Name_@()
// init function. Multiple calls are prevented by the "init" guard. // init function. Multiple calls are prevented by the "init" guard.
@@END_IF@@ @@END_IF@@
@@TABLE@@ @@TABLE@@
extern void init_@_LOWER:Sync_RIs_Parent_@();
init_@_LOWER:Sync_RIs_Parent_@(); init_@_LOWER:Sync_RIs_Parent_@();
@@END_TABLE@@ @@END_TABLE@@
} }
......
...@@ -59,7 +59,7 @@ extern "C" { ...@@ -59,7 +59,7 @@ extern "C" {
@@IF@@ @_Language_@ = "C" or @_Language_@ = "CPP" @@IF@@ @_Language_@ = "C" or @_Language_@ = "CPP"
#include "@_LOWER:Name_@.h" #include "@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "GUI" @@ELSIF@@ @_Language_@ = "GUI"
#include "@_LOWER:Name_@_gui_header.h" // Mmmh? #include "@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "RTDS" @@ELSIF@@ @_Language_@ = "RTDS"
#include "glue_@_LOWER:Name_@.h" #include "glue_@_LOWER:Name_@.h"
@@ELSIF@@ @_Language_@ = "MicroPython" @@ELSIF@@ @_Language_@ = "MicroPython"
......
...@@ -17,7 +17,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@ ...@@ -17,7 +17,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@ @@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@ @@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN" @@IF@@ @_Param_Directions_@ = "PARAM_IN"
void *IN_@_LOWER:Param_Names_@, size_t IN_@_LOWER:Param_Names_@_len const char *IN_@_LOWER:Param_Names_@, size_t IN_@_LOWER:Param_Names_@_len
@@ELSE@@ @@ELSE@@
void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len
@@END_IF@@ @@END_IF@@
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#pragma once #pragma once
#include "dataview-uniq.h" #include "../../../dataview/C/dataview-uniq.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
@@-- @_Unique_Languages_@ : List of all languages used in the system @@-- @_Unique_Languages_@ : List of all languages used in the system
@@-- @_ASN1_Files_@ : List of all ASN.1 files @@-- @_ASN1_Files_@ : List of all ASN.1 files
@@-- @_ASN1_Modules_@ : List of all ASN.1 modules @@-- @_ASN1_Modules_@ : List of all ASN.1 modules
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
OUTDIR := $(dir $(MAKEFILE_PATH))
all: dataviews all: dataviews
dataviews: dataviews:
...@@ -20,37 +23,32 @@ dataviews: ...@@ -20,37 +23,32 @@ dataviews:
; do cat $$f; echo; done > dataview/dataview-uniq.asn ; do cat $$f; echo; done > dataview/dataview-uniq.asn
@@END_INLINE@@ @@END_INLINE@@
@@-- Then generate Dataviews once per target language @@-- Then generate Dataviews once per target language
echo @_Unique_Languages_@
@@TABLE@@ @@TABLE@@
@@IF@@ @_Unique_Languages_@ /= "GUI" @@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
@@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL" @@SET@@ Lang=Ada
@@SET@@ Lang=Ada @@SET@@ Post=cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh
@@SET@@ Post=cd dataview/Ada && rm -f gnat.cfg GPS_project.gpr IgnoredExaminerWarnings.wrn runSpark.sh @@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C" or @_Unique_Languages_@ = "GUI"
@@ELSIF@@ @_Unique_Languages_@ = "C" or @_Unique_Languages_@ = "CPP" or @_Unique_Languages_@ = "Blackbox_C" @@SET@@ Lang=C
@@SET@@ Lang=C @@SET@@ Post=# Blackboxes, C, GUI, and C++ all use the same C data model
@@SET@@ Post=# Blackboxes, C and C++ all use the same C data model @@ELSE@@
@@ELSE@@ @@SET@@ Lang=@_Unique_Languages_@
@@SET@@ Lang=@_Unique_Languages_@ @@END_IF@@
@@END_IF@@ @@INLINE( )(\n )(\n)@@
@@INLINE( )(\n )(\n)@@ mkdir -p dataview/@_Lang_@
mkdir -p dataview/@_Lang_@ PROJECT_CACHE=dataview/.cache asn2dataModel -o dataview/@_Lang_@ -to@_Lang_@ dataview/dataview-uniq.asn \
PROJECT_CACHE=dataview/.cache asn2dataModel -o dataview/@_Lang_@ -to@_Lang_@ dataview/dataview-uniq.asn \ @@INLINE( )( \\\n )(\n )@@
@@TABLE@@ @@TABLE@@
@_REPLACE(,/ ):CP_Files_@ @_REPLACE(,/ ):CP_Files_@
@@END_TABLE@@ @@END_TABLE@@
@_Post_@
@@END_INLINE@@ @@END_INLINE@@
@@END_IF@@ @_Post_@
@@END_INLINE@@
@@END_TABLE@@ @@END_TABLE@@
@@-- Then symlink the files for each function @@-- Then symlink the files for each function
@@TABLE@@ @@TABLE@@
@@IF@@ @_Language_@ = "Ada" @@IF@@ @_Language_@ = "SDL"
ln -fs ${PWD}/dataview/Ada/*.ads @_LOWER:Function_Names_@/Ada/src
@@ELSIF@@ @_Language_@ = "C" or @_Language_@ = "CPP" or @_Language_@ = "GUI" or @_Language_@ = "Blackbox_C"
ln -fs ${PWD}/dataview/C/*.h @_LOWER:Function_Names_@/@_Language_@/src
@@ELSIF@@ @_Language_@ = "SDL"
ln -fs ${PWD}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src ln -fs ${PWD}/dataview/dataview-uniq.asn @_LOWER:Function_Names_@/@_Language_@/src
@@ELSE@@
ln -fs ${PWD}/dataview/@_Language_@/* @_LOWER:Function_Names_@/@_Language_@/src
@@END_IF@@ @@END_IF@@
@@END_TABLE@@ @@END_TABLE@@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment