Commit 625a3363 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add associations to partition templates

parent b89a7364
......@@ -172,6 +172,7 @@ package body TASTE.Concurrency_View is
Partition : constant CV_Partition :=
CV.Nodes (Node_Name).Partitions (Partition_Name);
Threads : Unbounded_String;
Thread_Names : Tag;
Blocks : Unbounded_String;
Partition_Assoc : Translate_Set;
begin
......@@ -183,6 +184,7 @@ package body TASTE.Concurrency_View is
(Parse (Path & "/thread.tmplt", Thread_Assoc));
begin
Threads := Threads & Newline & Result;
Thread_Names := Thread_Names & To_String (T.Name);
end;
end loop;
for B of Partition.Blocks loop
......@@ -211,8 +213,10 @@ package body TASTE.Concurrency_View is
-- Association includes Name, Coverage, CPU Info, etc.
-- (see taste-deployment_view.ads for the complete list)
Partition_Assoc := Partition.Deployment_Partition.To_Template
& Assoc ("Threads", Threads)
& Assoc ("Blocks", Blocks);
& Assoc ("Threads", Threads)
& Assoc ("Thread_Names", Thread_Names)
& Assoc ("Node_Name", Node_Name)
& Assoc ("Blocks", Blocks);
return Parse (Path & "/partition.tmplt", Partition_Assoc);
end Generate_Partition;
......
......@@ -2,6 +2,8 @@
@@--
@@-- @_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)
......
@@-- 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)
protected @_CAPITALIZE:Name_@ is -- part of node "@_CAPITALIZE:Node_Name_@"
-- Calling Threads: @_Calling_Threads_@
@_Provided'Indent_@
@_Required'Indent_@
end @_CAPITALIZE:Name_@;
@@-- 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)
@_LOWER:Node_Name_@.adb
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
system_dump.log
@@-- 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
@@-- In standard TASTE systems there is only one partition per node
@@-- Ada basic runtime (body)
with System,
Ada.Real_Time,
System_Time;
use System;
package body @_CAPITALIZE:Node_Name_@ is
package body Periodic_Task is
task body Periodic_Thread is
use Ada.Real_Time;
Next_Period : Time := System_Start_Time + Offset;
begin
Init;
loop
delay until Next_Period;
Cyclic_Operation;
Next_Period := Next_Period + Milliseconds (Period);
end loop;
end Periodic_Thread;
end Periodic_Task;
@_Partitions'Indent_@
end @_CAPITALIZE:Node_Name_@;
@@-- 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)
@@-- @_Bound_Functions_@ : List of user functions from Interface view
package body @_CAPITALIZE:Name_@ is
-- Coverage : @_Coverage_@
-- Package Name : @_Package_Name_@
-- CPU Name : @_CPU_Name_@
-- CPU Platform : @_CPU_Platform_@
-- CPU Classifier : @_CPU_Classifier_@
-- Bound Functions : @_Bound_Functions_@
@_Threads'Indent_@
@_Blocks'Indent_@
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
procedure @_CAPITALIZE:Name_@ is -- @_Direction_@ of function @_Parent_Function_@
@@TABLE@@
-- @_Param_Names_@ : @_Param_Types_@ (@_Param_Directions_@)
@@END_TABLE@@
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:
@@--
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Tag (list) of node names
-- The system contains these nodes:
@@TABLE@@
-- @_TABLE_LINE_@ @_Node_Names_@
@@END_TABLE@@
-- Content:
@_Nodes'Indent_@
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Thread name
@@-- @_Entry_Port_Name_@ : Name of the PI
@@-- @_RCM_@ : One of "CYCLIC_OPERATION", "SPORADIC_OPERATION"
@@-- @_Pro_Block_Name_@ : Name of the protected function
@@-- @_Node_Name_@ : Name of the deployment node
@@-- @_Remote_Threads_@ : Vector tag: output remote thread list
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI
task @_CAPITALIZE:Name_@ is
Port : @_Entry_Port_Name_@
Protected Block : @_Pro_Block_Name_@
Node : @_Node_Name_@
Out_Ports :
@@TABLE@@
@_Remote_Threads_@ -> @_Remote_PIs_@
@@END_TABLE@@
end @_CAPITALIZE:Name_@;
@@-- 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)
protected @_CAPITALIZE:Name_@ is -- part of node "@_CAPITALIZE:Node_Name_@"
-- Calling Threads: @_Calling_Threads_@
@_Provided'Indent_@
@_Required'Indent_@
end @_CAPITALIZE:Name_@;
@@-- 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)
@_LOWER:Node_Name_@.ads
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
system_dump.log
@@-- 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
@@-- In standard TASTE systems there is only one partition per node
@@-- Ada basic runtime (source)
with System,
Ada.Real_Time;
use System;
package @_CAPITALIZE:Node_Name_@ is
-- Partitions contained in this package: @_Partition_Names_@
System_Start_Time : constant Time := Ada.Real_Time.Clock;
generic
with procedure Cyclic_Operation;
with procedure Init;
package Periodic_Task is
task type Periodic_Thread (Thread_Priority : Priority;
Period : Positive;
Offset : Time)
with Priority => Thread_Priority;
end Periodic_Thread;
end Periodic_Task;
@_Partitions'Indent_@
end @_CAPITALIZE:Node_Name_@;
@@-- 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)
@@-- @_Bound_Functions_@ : List of user functions from Interface view
package @_CAPITALIZE:Name_@ is
-- Coverage : @_Coverage_@
-- Package Name : @_Package_Name_@
-- CPU Name : @_CPU_Name_@
-- CPU Platform : @_CPU_Platform_@
-- CPU Classifier : @_CPU_Classifier_@
-- Bound Functions : @_Bound_Functions_@
@_Threads'Indent_@
@_Blocks'Indent_@
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
procedure @_CAPITALIZE:Name_@ is -- @_Direction_@ of function @_Parent_Function_@
@@TABLE@@
-- @_Param_Names_@ : @_Param_Types_@ (@_Param_Directions_@)
@@END_TABLE@@
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:
@@--
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Tag (list) of node names
-- The system contains these nodes:
@@TABLE@@
-- @_TABLE_LINE_@ @_Node_Names_@
@@END_TABLE@@
-- Content:
@_Nodes'Indent_@
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