Commit 8ff989c7 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Improve templates to prepare for tsp support

parent 90a1b501
......@@ -155,10 +155,16 @@ package body TASTE.Concurrency_View is
Current : Directory_Entry_Type;
Filter : constant Filter_Type := (Directory => True,
others => False);
Output_File : File_Type;
Threads : Unbounded_String;
Output_File : File_Type;
CV_Out_Dir : constant String :=
CV.Base_Output_Path.Element & "/concurrency_view/";
-- Tags that are built over the whole system
-- and cleant up between each template folder:
Threads : Unbounded_String;
All_Thread_Names : Tag; -- Complete list of threads
All_Target_Names : Tag; -- List of all targets used (AADL packages)
begin
Start_Search (Search => ST,
Pattern => "",
......@@ -175,6 +181,11 @@ package body TASTE.Concurrency_View is
-- Iterate over the folders containing template files
while More_Entries (ST) loop
-- Clean-up system-wise tags before the next template folder:
Threads := US ("");
Clear (All_Thread_Names);
Clear (All_Target_Names);
Get_Next_Entry (ST, Current);
-- Ignore Unix special directories
......@@ -233,6 +244,7 @@ package body TASTE.Concurrency_View is
begin
Threads := Threads & Newline & Result;
Thread_Names := Thread_Names & Name;
All_Thread_Names := All_Thread_Names & Name;
for P of T.Output_Ports loop
Thread_Src_Name := Thread_Src_Name & Name;
Thread_Src_Port := Thread_Src_Port
......@@ -320,6 +332,9 @@ package body TASTE.Concurrency_View is
& Assoc ("Thread_Dst_Name", Thread_Dst_Name)
& Assoc ("Thread_Dst_Port", Thread_Dst_Port);
All_Target_Names := All_Target_Names
& String'(Get (Get (Partition_Assoc, "Package_Name")));
Part_Content :=
Parse (Path & "/partition.tmplt", Partition_Assoc);
......@@ -453,8 +468,9 @@ package body TASTE.Concurrency_View is
& Assoc ("Partition_Names", Partition_Names)
& Assoc ("Partition_Node", Partition_Node)
& Assoc ("Partition_CPU", Partition_CPU)
& Assoc ("Threads", Threads);
Threads := US (""); -- Reset for next template folder
& Assoc ("Threads", Threads)
& Assoc ("Thread_Names", All_Thread_Names)
& Assoc ("Target_Packages", All_Target_Names);
Create_Path (CV_Out_Dir);
Create (File => Output_File,
Mode => Out_File,
......
......@@ -15,11 +15,6 @@
@@-- @_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)
with @_Package_Name_@;
@@TABLE@@
with @_Thread_Names_@_Thread;
@@END_TABLE@@
process @_CAPITALIZE:Name_@ extends DeploymentView::DV::@_CAPITALIZE:Node_Name_@::@_CAPITALIZE:Name_@
end @_Name_@;
......@@ -34,4 +29,4 @@ connections
port @_CAPITALIZE:Thread_Src_Name_@.OUTPORT_@_CAPITALIZE:Thread_Src_Port_@ -> @_CAPITALIZE:Thread_Dst_Name_@.INPORT_@_CAPITALIZE:Thread_Dst_Port_@;
@@END_TABLE@@
@@END_IF@@
end @_Name_@.final;
end @_CAPITALIZE:Name_@.final;
......@@ -8,6 +8,8 @@
@@-- @_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
-- Input file for the taste orchestrator: do not edit
-- This file was generated automatically by taste/kazoo
......@@ -19,6 +21,12 @@ public
with DataView;
with interfaceview::IV;
with deploymentview::DV;
@@TABLE@@
with @_CAPITALIZE:Thread_Names_@_Thread;
@@END_TABLE@@
@@TABLE@@
with @_CAPITALIZE:Target_Packages_@;
@@END_TABLE@@
@_Nodes_@
......
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