Commit 3130ed89 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add parsing of virtual processors

parent b55d9f75
......@@ -460,7 +460,6 @@ package body TASTE.Concurrency_View is
end;
end loop;
if Trig_Sys and File_Sys /= "" and Nodes /= "" then
Put_Info ("Generating system concurrency view");
Set_Sys := CV.Configuration.To_Template
& Assoc ("Nodes", Nodes)
& Assoc ("Node_Names", Node_Names)
......
......@@ -354,6 +354,7 @@ package body TASTE.Deployment_View is
Get_Name_String (ATN.Name (ATN.Identifier (ATN.Namespace
(Corresponding_Declaration (CPU)))));
Result.Package_Name := US (Get_Name_String (Name_Find));
Set_Str_To_Name_Buffer ("");
Get_Name_String
(Get_String_Name (To_String (Result.Package_Name)));
......@@ -367,8 +368,49 @@ package body TASTE.Deployment_View is
end if;
Result.Name :=
US (Get_Name_String (ATN.Name (ATN.Component_Type_Identifier
(Corresponding_Declaration (CI)))));
US (Get_Name_String (ATN.Name (ATN.Component_Type_Identifier
(Corresponding_Declaration (CI)))));
-- If case of virtual processor, find the physical processor it is
-- bounded to, and set the values in the taste partition
if Get_Category_Of_Component (CPU) = CC_Virtual_Processor then
declare
Phy_CPU : constant Node_Id :=
Get_Reference_Property (CPU,
Get_String_Name
("actual_processor_binding"));
Phy_CPU_Name : constant String :=
Get_Name_String
(Name (Identifier (Parent_Subcomponent (Phy_CPU))));
Phy_CPU_Platform : constant Supported_Execution_Platform :=
Get_Execution_Platform (Phy_CPU);
Phy_CPU_Classifier : Unbounded_String;
Phy_CPU_Package_Name : Unbounded_String;
begin
-- Build the classifier string (package::...::cpu....)
Set_Str_To_Name_Buffer ("");
Get_Name_String (ATN.Name (ATN.Identifier (ATN.Namespace
(Corresponding_Declaration (Phy_CPU)))));
Phy_CPU_Package_Name := US (Get_Name_String (Name_Find));
Set_Str_To_Name_Buffer ("");
Get_Name_String (Get_String_Name
(To_String (Phy_CPU_Package_Name)));
Add_Str_To_Name_Buffer ("::");
Get_Name_String_And_Append (Name (Identifier (Phy_CPU)));
Phy_CPU_Classifier := US (Get_Name_String (Name_Find));
Result.VP_Package_Name := Result.Package_Name;
Result.VP_Name := Result.CPU_Name;
Result.VP_Platform := Result.CPU_Platform;
Result.VP_Classifier := Result.CPU_Classifier;
Result.CPU_Name := US (Phy_CPU_Name);
Result.CPU_Platform := Phy_CPU_Platform;
Result.CPU_Classifier := Phy_CPU_Classifier;
Result.Package_Name := Phy_CPU_Package_Name;
end;
end if;
-- Bounded functions
Processes := First_Node (Subcomponents (Depl));
......
......@@ -128,7 +128,11 @@ 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
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 ("");
Ada_Runtime : Unbounded_String; -- if CPU_Platform = GNAT_Runtime
Bound_Functions : String_Sets.Set;
end record;
......@@ -140,6 +144,10 @@ 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 ("VP_Package_Name", P.VP_Package_Name)
& Assoc ("VP_Name", P.VP_Name)
& Assoc ("VP_Platform", P.VP_Platform'Img)
& Assoc ("VP_Classifier", P.VP_Classifier)
& Assoc ("Ada_Runtime", P.Ada_Runtime)
& Assoc ("Bound_Functions", To_Template_Tag (P.Bound_Functions)));
......
......@@ -10,6 +10,9 @@
@@-- @_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)
......
KAZOO=../../kazoo
all: test-parse
cp InterfaceView.aadl output/concurrency_view && \
cp DeploymentView.aadl output/concurrency_view && \
cp DataView.aadl output/concurrency_view && \
cd output/concurrency_view && ocarina -x main.aadl
ocarina -x output/concurrency_view/main.aadl
test-parse: clean
$(KAZOO) --gw \
......
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