Commit 5696eda1 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Slightly improve templates

parent 8ff989c7
......@@ -368,6 +368,7 @@ package body TASTE.AADL_Parser is
(Base_Template_Path => Model.Configuration.Binary_Path,
Base_Output_Path => Model.Configuration.Output_Dir,
Deployment => Model.Deployment_View,
Configuration => Model.Configuration,
others => <>);
begin
-- Initialize the lists of nodes and partitions based on the DV
......
......@@ -461,7 +461,8 @@ package body TASTE.Concurrency_View is
end loop;
if Trig_Sys and File_Sys /= "" and Nodes /= "" then
Put_Info ("Generating system concurrency view");
Set_Sys := +Assoc ("Nodes", Nodes)
Set_Sys := CV.Configuration.To_Template
& Assoc ("Nodes", Nodes)
& Assoc ("Node_Names", Node_Names)
& Assoc ("Node_CPU", Node_CPU)
& Assoc ("Node_CPU_Classifier", Node_CPU_Cls)
......
......@@ -105,6 +105,7 @@ package TASTE.Concurrency_View is
-- information is already in the deployment view. It is not repeated here.
type Taste_Concurrency_View is tagged
record
Configuration : Taste_Configuration;
Nodes : CV_Nodes.Map;
Deployment : Complete_Deployment_View;
Base_Template_Path : String_Holder;
......
......@@ -161,26 +161,35 @@ package body TASTE.Parser_Utils is
return Result;
end To_Template_Tag;
procedure Debug_Dump (Config : Taste_Configuration; Output : File_Type) is
Vec : Tag;
Template : Translate_Set;
function To_Template (Config : Taste_Configuration) return Translate_Set is
Vec : Tag;
begin
Template := +Assoc ("Interface_View", Config.Interface_View.Element)
& Assoc ("Deployment_View",
(if Config.Deployment_View.Is_Empty then "<none>"
else Config.Deployment_View.Element))
& Assoc ("Data_View", Config.Data_View.Element)
& Assoc ("Output_Dir", Config.Output_Dir.Element)
& Assoc ("Skeletons", Config.Skeletons)
& Assoc ("Glue", Config.Glue)
& Assoc ("Use_POHIC", Config.Use_POHIC)
& Assoc ("Debug_Flag", Config.Debug_Flag)
& Assoc ("No_StdLib_Flag", Config.No_Stdlib)
& Assoc ("Timer_Resolution", Config.Timer_Resolution);
for Each of Config.Other_Files loop
Vec := Vec & Each;
end loop;
Template := Template & Assoc ("Other_Files", Vec);
return (+Assoc ("Interface_View", Config.Interface_View.Element)
& Assoc ("Deployment_View",
(if Config.Deployment_View.Is_Empty
then "<none>"
else Config.Deployment_View.Element))
& Assoc ("Data_View", Config.Data_View.Element)
& Assoc ("Binary_Path", Config.Binary_Path.Element)
& Assoc ("Check_Data_View", Config.Check_Data_View)
& Assoc ("Output_Dir", Config.Output_Dir.Element)
& Assoc ("Skeletons", Config.Skeletons)
& Assoc ("Glue", Config.Glue)
& Assoc ("Use_POHIC", Config.Use_POHIC)
& Assoc ("Timer_Resolution", Config.Timer_Resolution)
& Assoc ("Debug_Flag", Config.Debug_Flag)
& Assoc ("No_StdLib_Flag", Config.No_Stdlib)
& Assoc ("Timer_Resolution", Config.Timer_Resolution)
& Assoc ("Other_Files", Vec));
end To_Template;
procedure Debug_Dump (Config : Taste_Configuration; Output : File_Type) is
Template : constant Translate_Set := Config.To_Template;
begin
Put_Line (Output,
Parse (Config.Binary_Path.Element & "templates/configuration.tmplt",
Template));
......@@ -192,13 +201,11 @@ package body TASTE.Parser_Utils is
function Get_APLC_Binding (E : Node_Id) return List_Id is
APLC_Binding : constant Name_Id :=
Get_String_Name ("taste::aplc_binding");
Get_String_Name ("taste::aplc_binding");
begin
if Is_Defined_Property (E, APLC_Binding) then
return Get_List_Property (E, APLC_Binding);
else
return No_List;
end if;
return (if Is_Defined_Property (E, APLC_Binding)
then Get_List_Property (E, APLC_Binding)
else No_List);
end Get_APLC_Binding;
------------------------
......@@ -206,11 +213,7 @@ package body TASTE.Parser_Utils is
------------------------
function Get_Interface_Name (D : Node_Id) return Name_Id is
Interface_Name : constant Name_id :=
Get_String_Name ("taste::interfacename");
begin
return Get_String_Property (D, Interface_Name);
end Get_Interface_Name;
(Get_String_Property (D, Get_String_Name ("taste::interfacename")));
--------------------------------------------
-- Get all properties as a Map Key/String --
......
......@@ -144,6 +144,8 @@ package TASTE.Parser_Utils is
Other_Files : String_Vectors.Vector;
end record;
function To_Template (Config : Taste_Configuration) return Translate_Set;
procedure Debug_Dump (Config : Taste_Configuration;
Output : File_Type);
procedure Parse_Command_Line (Result : out Taste_Configuration);
......
......@@ -8,6 +8,12 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
-- Input file for the taste orchestrator: do not edit
-- This file was generated automatically by taste/kazoo
......
......@@ -10,6 +10,10 @@
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
-- Input file for the taste orchestrator: do not edit
-- This file was generated automatically by taste/kazoo
......
......@@ -8,12 +8,38 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
-- Input file for the taste orchestrator: do not edit
-- This file was generated automatically by taste/kazoo
system Taste
properties
Ocarina_Config::AADL_Files => ("InterfaceView.aadl", "DeploymentView.aadl", "system.aadl", "D_view.aadl", "ocarina_components.aadl", "TASTE_IV_Properties.aadl", "TASTE_DV_Properties.aadl");
Ocarina_Config::AADL_Files =>
("@_Interface_View_@",
"@_Deployment_View_@",
"@_Data_View_@",
"system.aadl",
@@IF@@ not @_No_Stdlib_Flag_@
"ocarina_components.aadl",
@@END_IF@@
@@IF@@ @_Other_Files'Length_@ > 0
@@INLINE( )(,\n)(,\n)@@
@@TABLE@@
"@_Other_Files_@"
@@END_TABLE@@
@@END_INLINE@@
@@END_IF@@
"TASTE_IV_Properties.aadl",
"TASTE_DV_Properties.aadl");
@@IF@@ @_Use_POHIC_@
Ocarina_Config::Generator => polyorb_hi_c;
@@ELSE@@
Ocarina_Config::Generator => polyorb_hi_ada;
@@END_IF@@
Ocarina_Config::Generator_Options => ();
Ocarina_Config::AADL_Version => AADLv2;
Ocarina_Config::Needed_Property_Sets => (
......
......@@ -8,6 +8,12 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
-- The system contains these nodes:
@@TABLE@@
......
......@@ -8,6 +8,12 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
-- The system contains these nodes:
@@TABLE@@
......
......@@ -8,3 +8,9 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
......@@ -8,3 +8,9 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
......@@ -8,3 +8,9 @@
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- 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)
......@@ -3,7 +3,7 @@ KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view/D_view.aadl && \
cp DataView.aadl output/concurrency_view && \
cd output/concurrency_view && ocarina -x main.aadl
test-parse: clean
......
......@@ -3,7 +3,7 @@ KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view/D_view.aadl && \
cp DataView.aadl output/concurrency_view && \
cd output/concurrency_view && ocarina -x main.aadl
test-parse: clean
......
......@@ -3,7 +3,7 @@ KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view/D_view.aadl && \
cp DataView.aadl output/concurrency_view && \
cd output/concurrency_view && ocarina -x main.aadl
test-parse: clean
......
......@@ -3,7 +3,7 @@ KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view/D_view.aadl && \
cp DataView.aadl output/concurrency_view && \
cd output/concurrency_view && ocarina -x main.aadl
test-parse: clean
......
......@@ -3,7 +3,7 @@ KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view/D_view.aadl && \
cp DataView.aadl output/concurrency_view && \
cd output/concurrency_view && ocarina -x main.aadl
test-parse: clean
......
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