Commit 81edfe53 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Optimize the connections of the timer manager

parent e33cfc8d
......@@ -325,16 +325,26 @@ package body TASTE.AADL_Parser is
for RI of Partition.Blocks (Block_Id).Ref_Function.Required loop
if RI.RCM = Protected_Operation or RI.RCM = Unprotected_Operation
then
-- Put_Line ("RI: " & To_String (RI.Name));
for Remote of RI.Remote_Interfaces loop
Rec_Add_Calling_Thread
(Thread_Id => Thread_Id,
Block_Id => To_String (Remote.Function_Name));
if Remote.Function_Name /=
Partition.Deployment_Partition.Name & "_Timer_Manager"
then
-- Put_Line (To_String (Remote.Function_Name)
-- & " :: " & To_String (Remote.Language));
-- Timer manager calling thread is only the Tick function
Rec_Add_Calling_Thread
(Thread_Id => Thread_Id,
Block_Id => To_String (Remote.Function_Name));
end if;
end loop;
end if;
end loop;
end Rec_Add_Calling_Thread;
begin
for Each of Partition.Threads loop
-- Put_Line ("Thread: " & To_String (Each.Name) & " - Block: "
-- & To_String (Each.Protected_Block_Name));
Rec_Add_Calling_Thread (Thread_Id => To_String (Each.Name),
Block_Id => To_String
(Each.Protected_Block_Name));
......@@ -342,8 +352,9 @@ package body TASTE.AADL_Parser is
end Set_Calling_Threads;
-- Find the output ports of a thread by following the connections
function Get_Output_Ports (Model : TASTE_Model;
F : Taste_Terminal_Function) return Ports.Map
function Get_Output_Ports (Model : TASTE_Model;
F : Taste_Terminal_Function;
Partition_Name : String) return Ports.Map
is
Result : Ports.Map;
Visited_Functions : String_Sets.Set;
......@@ -374,12 +385,17 @@ package body TASTE.AADL_Parser is
if RI.RCM = Unprotected_Operation or RI.RCM = Protected_Operation
then
Rec_Find_Thread (Ports_Map => Ports_Map,
Visited => Visited,
Func =>
Model.Interface_View.Flat_Functions
for Remote of RI.Remote_Interfaces loop
if Remote.Function_Name /= Partition_Name & "_Timer_Manager"
then
Rec_Find_Thread (Ports_Map => Ports_Map,
Visited => Visited,
Func =>
Model.Interface_View.Flat_Functions
(To_String
(RI.Remote_Interfaces.First_Element.Function_Name)));
end if;
end loop;
else
declare
-- Assume only one remote connection per RI
......@@ -534,7 +550,8 @@ package body TASTE.AADL_Parser is
Protected_Block_name => Block.Ref_Function.Name,
Node => Block.Node,
PI => PI,
Output_Ports => Get_Output_Ports (Model, F),
Output_Ports => Get_Output_Ports
(Model, F, Partition_Name),
Priority => US ("1"),
Dispatch_Offset_Ms => US ("0"),
Stack_Size_In_Bytes => US ("50000"));
......
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