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

Prepare template for concurrency makefile

parent ac1465f1
......@@ -414,9 +414,10 @@ package body TASTE.AADL_Parser is
else "");
Block : Protected_Block :=
(Name => F.Name,
Node => Node,
others => <>);
(Name => F.Name,
Language => F.Language,
Node => Node,
others => <>);
begin
if not Node.Has_Value then
-- Ignore functions that are not mapped to a node/partition
......
......@@ -100,6 +100,7 @@ package body TASTE.Concurrency_View is
end loop;
Result.Header := +Assoc ("Name", To_String (B.Name))
& Assoc ("Language", B.Language)
& Assoc ("Calling_Threads", Calling_Threads)
& Assoc ("Node_Name", To_String (B.Node.Value_Or
(Taste_Node'(Name => US (""), others => <>)).Name));
......@@ -203,6 +204,7 @@ package body TASTE.Concurrency_View is
Partition : constant CV_Partition :=
CV.Nodes (Node_Name).Partitions (Partition_Name);
Thread_Names : Tag;
Block_Names : Tag;
Blocks : Unbounded_String;
Partition_Assoc : Translate_Set;
-- Connections between threads:
......@@ -271,6 +273,7 @@ package body TASTE.Concurrency_View is
for B of Partition.Blocks loop
declare
Block_Name : constant String := To_String (B.Name);
Tmpl : constant Block_As_Template :=
B.Prepare_Template;
Block_Assoc : Translate_Set := Tmpl.Header;
......@@ -291,6 +294,7 @@ package body TASTE.Concurrency_View is
then Strip_String (Parse (Block_File_Id, Block_Tag))
else "");
begin
Block_Names := Block_Names & Block_Name;
for PI_Assoc of Tmpl.Provided loop
PI_Tag := PI_Tag & Newline
& String'(Parse (Path & "/pi.tmplt", PI_Assoc));
......@@ -327,6 +331,7 @@ package body TASTE.Concurrency_View is
& Assoc ("Thread_Names", Thread_Names)
& Assoc ("Node_Name", Node_Name)
& Assoc ("Blocks", Blocks)
& Assoc ("Block_Names", Block_Names)
& Assoc ("Thread_Src_Name", Thread_Src_Name)
& Assoc ("Thread_Src_Port", Thread_Src_Port)
& Assoc ("Thread_Dst_Name", Thread_Dst_Name)
......
......@@ -37,6 +37,7 @@ package TASTE.Concurrency_View is
type Protected_Block is tagged
record
Name : Unbounded_String;
Language : Unbounded_String;
Provided : Protected_Block_PIs.Map;
Required : Interfaces_Maps.Map;
Calling_Threads : String_Sets.Set;
......
......@@ -5,6 +5,7 @@
@@-- @_Thread_Names_@ : Tag: list of thread names
@@-- @_Node_Name_@ : Name of the node containing this partition
@@-- @_Blocks_@ : Code generated for protected functions
@@-- @_Block_Names@ : Tag: list of block (user functions) names
@@-- @_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)
......
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@_LOWER:Name_@ :
# Generate DMT glue code for this block (coded in @_Language_@)
@@-- 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)
@@-- 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
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
Makefile.taste
@@-- 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
@@INLINE@@
@_LOWER:Node_Name_@ :
@@TABLE@@
@_LOWER:Partition_Names_@
@@END_TABLE@@
@@END_INLINE@@
@_Partitions_@
@@-- 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
@@-- @_Block_Names@ : Tag: list of block (user functions) names
@@-- @_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)
@@-- @_VP_Name_@ : Virtual processor name on which the partition is bounded
@@-- @_VP_Platform_@ : Virtual processor platform (e.g. PLATFORM_AIR)
@@-- @_VP_Classifier_@ : Virtual processor classifier
@@-- @_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)
@@INLINE@@
@_LOWER:Name_@ :
@@TABLE@@
@_LOWER:Block_Names_@
@@END_TABLE@@
@@END_INLINE@@
@_Blocks_@
@@-- 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
@@-- @_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)
@@INLINE@@
all:
@_LOWER:Node_Names_@
@@END_INLINE@@
@@TABLE@@
make -C @_Node_Names_@ -f Makefile.@_Node_Names_@
@@END_TABLE@@
@_Nodes_@
@@-- The following tags are available in this template:
@@--
@@-- @_Thread_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
@@-- @_RI_Port_Name_@ : |_ Corresponding local RI name
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_Remote_PI_Sorts_@ : |_ Optional param type of the remote thread
@@-- @_Remote_PI_Modules_@ : |_ Asn1 module of the optional param type
@@-- Tags related to the PI that is at the origin of the thread creation:
@@-- @_Name_@, @_Kind_@, @_Parent_Function_@ : shoud be useless here
@@-- @_Param_Names_@, _Types_@, _ASN1_Modules, _Encodings_@, _Directions_@ : param vector tag
@@-- @_Period_@, @_WCET_@, @_Queue_Size_@ : relevant here
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
......@@ -2210,7 +2210,14 @@ with Deployment;
processor leon
end leon;
processor leon3 extends leon
end leon3;
processor implementation leon3.AIR
properties
Deployment::Execution_Platform => AIR;
end leon3.AIR;
processor leon2 extends leon
end leon2;
......@@ -2294,8 +2301,6 @@ end gr740.rtems410_gaisler_posix;
-- Deployment::Execution_Platform => LEON_ORK;
-- end leon.ork;
processor leon3
end leon3;
virtual processor xtratum_partition
end xtratum_partition;
......
KAZOO=../../kazoo
all: test-parse
ocarina -x output/concurrency_view/main.aadl
cd output/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
test-parse: clean
$(KAZOO) --gw \
......
......@@ -9,14 +9,16 @@ test-parse: clean
--glue \
--no-stdlib \
--debug \
../common/libhw.aadl
../common/ocarina_components.aadl
gdb: clean
gdb --args $(KAZOO) --gw \
-o output \
--glue \
--debug
--no-stdlib \
--debug \
../common/ocarina_components.aadl
clean:
rm -rf output
......
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