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

Generate gpr and makefile per node

parent 41911248
......@@ -353,8 +353,16 @@ package body TASTE.Concurrency_View is
Node_Name => Node_Name);
end loop;
Node_Assoc := +Assoc ("Partitions", Partitions)
& Assoc ("Partition_Names", Partition_Names)
& Assoc ("Node_Name", Node_Name);
& Assoc ("Partition_Names", Partition_Names)
& Assoc ("Node_Name", Node_Name)
& Assoc ("CPU_Name",
CV.Nodes (Node_Name).Deployment_Node.CPU_Name)
& Assoc ("CPU_Platform",
CV.Nodes (Node_Name).Deployment_Node.CPU_Platform'Img)
& Assoc ("CPU_Classifier",
CV.Nodes (Node_Name).Deployment_Node.CPU_Classifier)
& Assoc ("Ada_Runtime",
CV.Nodes (Node_Name).Deployment_Node.Ada_Runtime);
return Parse (Path & "/node.tmplt", Node_Assoc);
end Generate_Node;
......
......@@ -344,6 +344,11 @@ package body TASTE.Deployment_View is
US (Get_Name_String (Name (Identifier (Parent_Subcomponent (CPU)))));
Result.CPU_Platform := Get_Execution_Platform (CPU);
if Result.CPU_Platform = Platform_GNAT_Runtime then
Result.Ada_Runtime := US (Get_Name_String (Get_Ada_Runtime (CPU)));
else
Result.Ada_Runtime := US ("");
end if;
if ATN.Namespace (Corresponding_Declaration (CPU)) /= No_Node
then
......@@ -420,6 +425,7 @@ package body TASTE.Deployment_View is
Result.CPU_Name := Partition.CPU_Name;
Result.CPU_Platform := Partition.CPU_Platform;
Result.CPU_Classifier := Partition.CPU_Classifier;
Result.Ada_Runtime := Partition.Ada_Runtime;
end if;
Processes := Next_Node (Processes);
......
......@@ -128,6 +128,7 @@ package TASTE.Deployment_View is
CPU_Name : Unbounded_String;
CPU_Platform : Supported_Execution_Platform;
CPU_Classifier : Unbounded_String;
Ada_Runtime : Unbounded_String; -- when Platform = GNAT_Runtime
Bound_Functions : String_Sets.Set;
end record;
......@@ -139,6 +140,7 @@ package TASTE.Deployment_View is
& Assoc ("CPU_Name", P.CPU_Name)
& Assoc ("CPU_Platform", P.CPU_Platform'Img)
& Assoc ("CPU_Classifier", P.CPU_Classifier)
& Assoc ("Ada_Runtime", P.Ada_Runtime)
& Assoc ("Bound_Functions", To_Template_Tag (P.Bound_Functions)));
package Option_Partition is new Option_Type (Taste_Partition);
......@@ -154,6 +156,7 @@ package TASTE.Deployment_View is
CPU_Name : Unbounded_String;
CPU_Platform : Supported_Execution_Platform;
CPU_Classifier : Unbounded_String;
Ada_Runtime : Unbounded_String; -- when Platform = GNAT_Runtime
end record;
-- Helper function: find the partition where a function is bounded
......
......@@ -3,6 +3,7 @@
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
-- node: @_Node_Name_@
@_Partitions_@
......@@ -3,5 +3,6 @@
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
@_Partitions_@
......@@ -3,4 +3,5 @@
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
......@@ -3,6 +3,7 @@
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
@@-- Ada basic runtime (body)
with System,
......
......@@ -3,6 +3,7 @@
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
@@-- Ada basic runtime (source)
with System,
......
Generate a .gpr to build the system using PolyORB-HI-Ada
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node as defined in the Deployment View
@@-- The content of this file is generated from node.tmplt
@@-- If there is no string defined here, no file will be generated per node,
@@-- (that's an option if the intent is to generate only one file per system)
Makefile.@_LOWER:Node_Name_@
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@_LOWER:Partition_Name_@.gpr
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
# @_Node_Name_@ @_CPU_Name_@ @_Ada_Runtime_@
all:
@@TABLE@@
gprbuild -p -P @_LOWER:Partition_Names_@.gpr
@@END_TABLE@@
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Partition name (usually the name of the binary)
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : Tag: list of thread names
@@-- @_Node_Name_@ : Name of the node containing this partition
@@-- @_Blocks_@ : Code generated for protected functions
@@-- @_Coverage_@ : True if user requested code coverage enable
@@-- @_Package_Name_@ : AADL Package name for the target (e.g. ocarina_porocessors_x86)
@@-- @_CPU_Name_@ : CPU Name (e.g. x86_linux)
@@-- @_CPU_Platform_@ : AADL CPU_Platform (e.g. PLATFORM_NATIVE)
@@-- @_CPU_Classifier_@ : AADL CPU Classifier (e.g. ocarina_processors_x86::x86.linux)
@@-- @_Ada_Runtime_@ : Set if CPU_Platform = PLATFORM_GNAT_RUNTIME
@@-- @_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)
-- Node name : @_Name_@
-- Execution platform : @_CPU_Platform_@
@@IF@@ @_CPU_Platform_@ = "PLATFORM_GNAT_RUNTIME"
-- Ada runtime : @_Ada_Runtime_@
@@END_IF@@
-- with "polyorb_hi";
with "/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-ada/polyorb_hi";
@@IF@@ @_CPU_Platform_@ = "PLATFORM_GNAT_RUNTIME"
project @_CAPITALIZE:Name_@ extends "@_Ada_Runtime_@" is
@@ELSE@@
project @_CAPITALIZE:Name_@ is
@@END_IF@@
-- following to be updated with all relevant source dirs
for Source_Dirs use
(".",
"/home/taste/tool-inst/include/ocarina/runtime/polyorb-hi-ada",
"../deploymentview_final/@_LOWER:Name_@")
& external_as_list("ADA_INCLUDE_PATH", ":");
for Languages use ("Ada", "C");
for Main use ("@_LOWER:Name_@.adb");
package Naming is
-- Custom middleware file names
for Body ("PolyORB_HI.Output_Low_Level") use "polyorb_hi-output_low_level_native.adb";
end Naming;
package Compiler renames PolyORB_HI.Compiler;
package Builder renames PolyORB_HI.Builder;
package Binder renames PolyORB_HI.Binder;
package Linker renames PolyORB_HI.Linker;
package Check renames PolyORB_HI.Check;
package Prove renames PolyORB_HI.Prove;
end @_CAPITALIZE:Name_@;
@@-- 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
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- 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
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- The following tags are available in this template:
@@--
@@-- @_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)
@@-- @_Partition_Names_@ : Vector Tag of partition names
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Threads_@ : Code generated for the threads
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