Commit 23066b61 authored by Maxime Perrotin's avatar Maxime Perrotin

Minor fixes here and there

parent 8916a922
......@@ -28,8 +28,6 @@ package body TASTE.Backend.Code_Generators is
Prefix_Skeletons : constant String := Prefix & "skeletons/";
Prefix_Wrappers : constant String := Prefix & "glue/language_wrappers";
Prefix_Middleware : constant String :=
Prefix & "glue/middleware_interface";
-- Return a Tag list of ASN.1 Modules for the headers
function Get_Module_List return Tag is
......@@ -95,7 +93,7 @@ package body TASTE.Backend.Code_Generators is
end Generate_Global_Makefile;
-- Render a set (Tag) of interfaces by applying a template
function Process_Interfaces (Interfaces : ST_Interfaces.Vector;
function Process_Interfaces (Interfaces : Template_Vectors.Vector;
Path : String) return Tag
is
Result : Tag;
......@@ -210,7 +208,7 @@ package body TASTE.Backend.Code_Generators is
& Exception_Message (E);
end Process_Template;
-- Main loop generating skeletons for each function
-- Main loop generating output for each function
-- Prefix is where the templates are located
-- Output_Base is the output folder defined in the command line
-- Output_Sub is where the code shall be generated (e.g. "src")
......@@ -294,9 +292,9 @@ package body TASTE.Backend.Code_Generators is
-- Data needed to process trigger.tmplt
Trig_Tmpl : constant Translate_Set :=
+Assoc ("Name", Each.Name)
+Assoc ("Name", Each.Name)
& Assoc ("Language", Language_Spelling (Each))
& Assoc ("Is_Type", Each.Is_Type)
& Assoc ("Is_Type", Each.Is_Type)
& Assoc ("Instance_Of",
Each.Instance_Of.Value_Or (US ("")))
& Assoc ("C_Middleware", Model.Configuration.Use_POHIC)
......@@ -339,11 +337,6 @@ package body TASTE.Backend.Code_Generators is
Model.Configuration.Output_Dir.Element
& "/",
Output_Sub => "wrappers/");
Generate_From_Templates (Prefix => Prefix_Middleware,
Output_Base =>
Model.Configuration.Output_Dir.Element
& "/",
Output_Sub => "middleware_glue/");
end if;
end Generate;
......@@ -402,7 +395,7 @@ package body TASTE.Backend.Code_Generators is
function Func_Template (F : Taste_Terminal_Function) return Func_As_Template
is
use Ctxt_Params;
use ST_Interfaces;
use Template_Vectors;
Result : Func_As_Template;
List_Of_PIs : Tag;
List_Of_RIs : Tag;
......
......@@ -13,13 +13,14 @@ package TASTE.Backend.Code_Generators is
package Template_Vectors is new Indefinite_Vectors (Natural, Translate_Set);
package ST_Interfaces is new Indefinite_Vectors (Natural, Translate_Set);
-- package ST_Interfaces is new Indefinite_Vectors
-- (Natural, Translate_Set);
type Func_As_Template is
record
Header : Translate_set;
Provided : ST_Interfaces.Vector;
Required : ST_Interfaces.Vector;
Provided : Template_Vectors.Vector;
Required : Template_Vectors.Vector;
end record;
package Func_Maps is new Indefinite_Ordered_Maps (String, Func_As_Template);
......
......@@ -119,7 +119,7 @@ package body TASTE.Dump is
Dest_Nodes,
Dest_Ports : Vector_Tag;
function Process_Interfaces (Interfaces : St_Interfaces.Vector)
function Process_Interfaces (Interfaces : Template_Vectors.Vector)
return Unbounded_String
is
Result : Unbounded_String;
......
......@@ -10,7 +10,7 @@ all: debug
debug:
@@TABLE@@
gprbuild -p -v -P @_LOWER:Partition_Names_@.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
gprbuild -p -P @_LOWER:Partition_Names_@.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
@@END_TABLE@@
release:
......
......@@ -11,4 +11,6 @@
// Required interfaces of function @_Name_@
@_Required_@
@@END_IF@@
#include "@_LOWER:Name_@_vm_if.h"
@_Protected_PIs_@
......@@ -41,8 +41,8 @@
#include "timeInMS.h"
#endif
//#include "C_ASN1_Types.h"
#include "../../../dataview/C/dataview-uniq.h"
#include "C_ASN1_Types.h"
#include "dataview-uniq.h"
@@-- For blackbox devices, don't generate the RI code here, because their parameters are different
@@-- (they are already encoded, not using native ASN.1 types)
......
@@-- The following tags are available in this template:
@@--
@@-- @_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 encoding (Default, Native, UPER, ACN)
@@-- @_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 encoding (Default, Native, UPER, ACN)
@@-- @_Remote_Function_Names_@ : Vector tag listing the connected interface(s)
@@-- @_Remote_Interface_Names_@ : |_ Corresponding interface name
@@-- note, there are more tags, see in taste-interface_view.adb, in To_Template(Taste_Interface)
@@IF@@ @_EXIST:Param_Names_@
void @_LOWER:Parent_Function_@_RI_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
......@@ -28,25 +31,28 @@ void @_LOWER:Parent_Function_@_RI_@_LOWER:Name_@(void)
{
puts ("[TASTE] @_LOWER:Parent_Function_@_RI_@_LOWER:Name_@ called");
#ifdef __unix__
// Log MSC data on Linux when environment variable is set
static int innerMsc = -1;
if (-1 == innerMsc)
innerMsc = (NULL != getenv("TASTE_INNER_MSC"))?1:0;
if (1 == innerMsc) {
long long msc_time = getTimeInMilliseconds();
@@TABLE'TERSE@@
@@IF@@ @_Param_Directions_@ = PARAM_IN
PrintASN1@_REPLACE_ALL(-/_):Param_Types_@ ("INNERDATA: @_LOWER:Name_@::@_REPLACE_ALL(-/_):Param_Types_@::@_LOWER:Param_Names_@", IN_@_LOWER:Param_Names_@);
@@END_IF@@
@@END_TABLE@@
puts(""); // add newline
#ifdef __unix__
// Log MSC data on Linux when environment variable is set
static int innerMsc = -1;
if (-1 == innerMsc)
innerMsc = (NULL != getenv("TASTE_INNER_MSC"))?1:0;
if (1 == innerMsc) {
long long msc_time = getTimeInMilliseconds();
@@TABLE'TERSE@@
@@IF@@ @_Param_Directions_@ = PARAM_IN
PrintASN1@_REPLACE_ALL(-/_):Param_Types_@ ("INNERDATA: @_LOWER:Name_@::@_REPLACE_ALL(-/_):Param_Types_@::@_LOWER:Param_Names_@", IN_@_LOWER:Param_Names_@);
@@END_IF@@
@@END_TABLE@@
puts(""); // add newline
@@-- Had to comment the line below, because we miss the destination function (in place of gnc)
@@-- When we have multicast me need to to emit the line several times (and need to add support)
//printf ("INNER: @_LOWER:Parent_Function_@,gnc,@_LOWER:Name_@,%lld\n", msc_time);
fflush(stdout);
}
#endif
@@TABLE@@
// Log message to @_Remote_Function_Names_@ (corresponding PI: @_Remote_Interface_Names_@)
printf ("INNER: @_LOWER:Parent_Function_@,@_LOWER:Remote_Function_Names_@,@_LOWER:Name_@,%lld\n", msc_time);
@@END_TABLE@@
fflush(stdout);
}
#endif
@@TABLE'TERSE@@
@@IF@@ @_Param_Directions_@ = PARAM_IN
// Encode parameter @_Param_Names_@
......
......@@ -35,7 +35,7 @@
#pragma once
#include "../../../dataview/C/dataview-uniq.h"
#include "dataview-uniq.h"
#ifdef __cplusplus
extern "C" {
......
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