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

work on TSP for MORA

parent d70bb288
......@@ -454,10 +454,12 @@ package body TASTE.Concurrency_View is
Node_Names, -- List of nodes
Node_CPU, -- Corresponding CPU name
Node_CPU_Cls, -- Corresponding CPU classifier
Node_Has_Memory : Vector_Tag; -- Corresponding memory flag
Node_Major_Frame, -- Corresponding time frame (TSP)
Node_Has_Memory : Vector_Tag; -- Corresponding memory flag (TSP)
Partition_Names, -- List of partitions
Partition_Node, -- Corresponding node name
Partition_CPU, -- Corresponding CPU name
Partition_Time, -- Corresponding TSP VP time
Partition_VP : Vector_Tag; -- for TSP: VP binding
begin
for Node in CV.Nodes.Iterate loop
......@@ -513,6 +515,8 @@ package body TASTE.Concurrency_View is
Node_Has_Memory := Node_Has_Memory
& (CV.Nodes (Node_Name)
.Deployment_Node.Memory.Name /= "");
Node_Major_Frame := Node_Major_Frame
& CV.Nodes (Node_Name).Deployment_Node.CPU_Duration;
-- Associate partition name, corresponding node and CPU
-- for AADL backends
......@@ -527,6 +531,9 @@ package body TASTE.Concurrency_View is
& CV_Partitions.Element (Partition)
.Deployment_Partition.VP_Name;
Partition_Node := Partition_Node & Node_Name;
Partition_Time := Partition_Time
& CV_Partitions.Element (Partition)
.Deployment_Partition.VP_Duration;
end loop;
Nodes := Nodes & Newline & Node_Content;
......@@ -547,10 +554,12 @@ package body TASTE.Concurrency_View is
& Assoc ("Node_Names", Node_Names)
& Assoc ("Node_CPU", Node_CPU)
& Assoc ("Node_CPU_Classifier", Node_CPU_Cls)
& Assoc ("Node_Major_Frame", Node_Major_Frame)
& Assoc ("Node_Has_Memory", Node_Has_Memory)
& Assoc ("Partition_Names", Partition_Names)
& Assoc ("Partition_Node", Partition_Node)
& Assoc ("Partition_CPU", Partition_CPU)
& Assoc ("Partition_Duration", Partition_Time)
& Assoc ("Partition_VP", Partition_VP)
& Assoc ("Threads", Threads)
& Assoc ("Thread_Names", All_Thread_Names)
......
......@@ -462,6 +462,8 @@ package body TASTE.Deployment_View is
Separate_CPU_Family_From_Instance (Phy_CPU,
Result.CPU_Family,
Result.CPU_Instance);
-- Detect the CPU major frame duration and the time
-- allocation for this specific partition
declare
Major_Frame : constant Time_Type :=
Get_POK_Major_Frame (Phy_CPU);
......@@ -471,16 +473,17 @@ package body TASTE.Deployment_View is
if Major_Frame /= Null_Time
and then Major_Frame.U = Millisecond
then
Put_Info ("Major Frame: " & Major_Frame.T'Img);
Result.CPU_Total_Time := US (Major_Frame.T'Img);
end if; -- otherwise, error?
for Each of Schedule loop
Put_Line (Boolean'Image (
Corresponding_Declaration (Parent_Subcomponent (CPU))
= Each.Partition));
if Each.Partition = CPU then
Put_Info ("Duration for " & To_String (Result.VP_Name)
& " = " & Each.Duration.T'Img);
-- To know if the schedule applies to the current VP,
-- we need to compare it with "Corresponding_Declaration
-- (Parent_Subcomponent (CPU)
if Each.Partition = Corresponding_Declaration
(Parent_Subcomponent (CPU))
then
Result.VP_Duration := US (Each.Duration.T'Img);
end if;
end loop;
end;
......@@ -545,6 +548,7 @@ package body TASTE.Deployment_View is
(Key => To_String (Partition.Name),
New_Item => Partition);
Result.CPU_Name := Partition.CPU_Name;
Result.CPU_Duration := Partition.CPU_Total_Time;
Result.CPU_Family := Partition.CPU_Family;
Result.CPU_Instance := Partition.CPU_Instance;
Result.CPU_Platform := Partition.CPU_Platform;
......
......@@ -137,10 +137,12 @@ package TASTE.Deployment_View is
CPU_Instance : Unbounded_String; -- e.g. rtems_posix
CPU_Platform : Supported_Execution_Platform;
CPU_Classifier : Unbounded_String;
CPU_Total_Time : Unbounded_String := US (""); -- TSP major frame
VP_Package_Name : Unbounded_String := US (""); -- Virtual Processor
VP_Name : Unbounded_String := US ("");
VP_Platform : Supported_Execution_Platform := Platform_None;
VP_Classifier : Unbounded_String := US ("");
VP_Duration : Unbounded_String := US (""); -- TSP frame duration
Memory_Region : Unbounded_String := US (""); -- TSP only
Ada_Runtime : Unbounded_String; -- if CPU_Platform = GNAT_Runtime
Bound_Functions : String_Sets.Set;
......@@ -160,6 +162,7 @@ package TASTE.Deployment_View is
& Assoc ("VP_Name", P.VP_Name)
& Assoc ("VP_Platform", P.VP_Platform'Img)
& Assoc ("VP_Classifier", P.VP_Classifier)
& Assoc ("VP_Duration", P.VP_Duration)
& Assoc ("Memory_Region", P.Memory_Region)
& Assoc ("Ada_Runtime", P.Ada_Runtime)
& Assoc ("Bound_Functions", To_Template_Tag (P.Bound_Functions)));
......@@ -194,6 +197,7 @@ package TASTE.Deployment_View is
CPU_Instance : Unbounded_String; -- e.g. rtems_posix
CPU_Platform : Supported_Execution_Platform;
CPU_Classifier : Unbounded_String;
CPU_Duration : Unbounded_String := US (""); -- TSP Major frame
Ada_Runtime : Unbounded_String; -- when Platform = GNAT_Runtime
end record;
......
......@@ -4,9 +4,11 @@
@@-- @_Node_Names_@ : Vector Tag of node names
@@-- @_Node_CPU_@ : |_ Corresponding CPU name (eg x86_linux)
@@-- @_Node_CPU_Classifier_@ : |_ CPU Classifier (ocarina...::x86_linux)
@@-- @_Node_Major_Frame_@ : |_ Time in milliseconds allocated to the CPU (TSP only)
@@-- @_Partition_Names_@ : Vector Tag of partition names
@@-- @_Partition_Node_@ : |_ Corresponding node name
@@-- @_Partition_CPU_@ : |_ Corresponding CPU name
@@-- @_Partition_Duration_@ : |_ Corresponding time allocation (TSP only)
@@-- @_Partition_VP_@ : |_ Virtual processor binding (TSP only)
@@-- @_Threads_@ : Code generated for the threads
@@-- @_Thread_Names_@ : List of all threads in the complete system
......@@ -80,6 +82,24 @@ properties
Actual_Memory_Binding => (reference (@_CAPITALIZE:Partition_Node_@_Memory.@_CAPITALIZE:Partition_Names_@_Segment)) applies to @_CAPITALIZE:Partition_Names_@;
@@END_IF@@
@@END_TABLE@@
@@-- TSP: specify the time allocated to each node and on each partition
@@TABLE'ALIGN_ON("applies")@@
@@IF@@ @_Node_Major_Frame_@ /= ""
arinc653::module_major_frame => @_Node_Major_Frame_@ ms applies to @_Node_Names_@_@_Node_CPU_@;
@@END_IF@@
@@END_TABLE@@
@@TABLE@@
@@IF@@ @_Node_Major_Frame_@ /= ""
arinc653::module_schedule => (
@@INLINE( )(,\n )()@@
@@TABLE@@
[partition => reference (@_Partition_Node_@_@_Partition_CPU_@.@_Partition_VP_@); duration => @_Partition_Duration_@ ms; periodic_processing_start => false;]
@@END_TABLE@@
@@END_INLINE@@@@
) applies to @_Node_Names_@_@_Node_CPU_@;
@@END_IF@@
@@END_TABLE@@
end DeploymentView.final;
end Process_Package;
......
......@@ -95,7 +95,7 @@ build-rtems-ada: dataview
@@END_IF@@
cp $(shell taste-config --prefix)/share/AutoGUI/debug_messages.? dataview/C
cp $(shell taste-config --prefix)/share/AutoGUI/timeInMS.? dataview/C
cd dataview/C && msgPrinter ../dataview-uniq.asn && msgPrinterASN1 ../dataview-uniq.asn
cd dataview/C && PROJECT_CACHE=../.cache msgPrinter ../dataview-uniq.asn && PROJECT_CACHE=../.cache msgPrinterASN1 ../dataview-uniq.asn
@@-- Then symlink the files for each function
@@TABLE@@
@@IF@@ @_Language_@ = "SDL"
......
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