Commit 25d2154c authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add param of remote thread

parent 731c3dfa
......@@ -337,7 +337,8 @@ package body TASTE.AADL_Parser is
New_P : constant Port :=
(Name => Port_Name,
Remote_Thread => Remote_Thread_Name,
Remote_PI => Dist.Interface_Name);
Remote_PI => Dist.Interface_Name,
RI => RI);
begin
Ports_Map.Include (Key => To_String (Port_Name),
New_Item => New_P);
......
......@@ -108,24 +108,30 @@ package body TASTE.Concurrency_View is
-- This function translates a thread definition into a template
function To_Template (T : AADL_Thread) return Translate_Set is
Remote_Thread : Vector_Tag;
Remote_PI : Vector_Tag;
Remote_Thread : Vector_Tag;
Remote_PI : Vector_Tag;
Remote_PI_Param : Vector_Tag;
begin
for Out_Port of T.Output_Ports loop
Remote_Thread := Remote_Thread & To_String (Out_Port.Remote_Thread);
Remote_PI := Remote_PI & To_String (Out_Port.Remote_PI);
Remote_PI_Param := Remote_PI_Param
& (if Out_Port.RI.Params.Length > 0
then Out_Port.RI.Params.First_Element.Sort
else US (""));
end loop;
return Result : constant Translate_Set :=
T.PI.To_Template -- Template of the PI used to create the thread
& Assoc ("Thread_Name", To_String (T.Name))
& Assoc ("Entry_Port_Name", To_String (T.Entry_Port_Name))
& Assoc ("RCM", To_String (T.RCM))
& Assoc ("Pro_Block_Name", To_String (T.Protected_Block_Name))
& Assoc ("Node_Name", To_String (T.Node.Value_Or
& Assoc ("Thread_Name", To_String (T.Name))
& Assoc ("Entry_Port_Name", To_String (T.Entry_Port_Name))
& Assoc ("RCM", To_String (T.RCM))
& Assoc ("Pro_Block_Name", To_String (T.Protected_Block_Name))
& Assoc ("Node_Name", To_String (T.Node.Value_Or
(Taste_Node'(Name => US (""), others => <>)).Name))
& Assoc ("Remote_Threads", Remote_Thread)
& Assoc ("Remote_PIs", Remote_PI);
& Assoc ("Remote_Threads", Remote_Thread)
& Assoc ("Remote_PIs", Remote_PI)
& Assoc ("Remote_PI_Params", Remote_PI_Param);
end To_Template;
-- Generate the the code by iterating over template folders
......
......@@ -59,7 +59,8 @@ package TASTE.Concurrency_View is
record
Name : Unbounded_String;
Remote_Thread : Unbounded_String;
Remote_PI : Unbounded_String;
Remote_PI : Unbounded_String; -- Remote PI name
RI : Taste_Interface;
end record;
package Ports is new Indefinite_Ordered_Maps (String, Port);
......
@@-- 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
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_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
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_Remote_PI_Params_@ : |_ Optional param of the remote thread
@@-- 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_@, _Encodings_@, _Directions_@ : param vector tag
......@@ -22,29 +23,42 @@ public
thread @_Thread_Name_@
features
INPORT_@_Entry_Port_Name_@ : in event <MISSING> port <MISSING>
@@INLINE( )()()@@
@@IF@@ @_Param_Names'Length_@ > 0
INPORT_@_Entry_Port_Name_@ : in event data port @_Param_Types_@
@@ELSE@@
INPORT_@_Entry_Port_Name_@ : in event port
@@END_IF@@
@@END_INLINE@@
{ Compute_Execution_Time => @_WCET_@ .. @_WCET_@ ms;
Queue_Size => @_Queue_Size_@;
Compute_Entrypoint_Source_Text => "@_Thread_Name_@_Wrappers.@_Entry_Port_Name_@"; };
@@TABLE@@
OUTPUT_@_Remote_PIs_@ : out event <MISSING> port <MISSING>;
@@INLINE( )(\n )()@@
@@IF@@ @_Param_Names'Length_@ > 0
OUTPUT @_Remote_PIs_@ : out event data port @_Param_Types_@;
@@ELSE@@
OUTPUT @_Remote_PIs_@ : out event port;
@@END_IF@@
@@END_INLINE@@
@@END_TABLE@@
end @_Thread_Name_@;
thread implementation @_Name_@.others
properties
Initialize_Entrypoint_Source_Text => "@_Name_@_Wrappers.C_Init_@_Name_@";
Dispatch_Protocol =>
@@INLINE( )()()@@
@@IF@@ @_RCM_@ = "SPORADIC_OPERATION"
Sporadic;
Dispatch_Protocol = Sporadic;
@@ELSE@@
Periodic;
Dispatch_Protocol => Periodic;
@@END_IF@@
@@END_INLINE@@
Period => @_Period_@;
Dispatch_Offset => 0;
Dispatch_Offset => 0;
Compute_Execution_Time => @_WCET_@ .. @_WCET_@ ms;
Stack_Size => 50 KBytes;
Priority => <How should I know?>;
Priority => 1;
end @_Name_@.others;
end @_Name_@_Thread;
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