Commit efcc05e0 authored by julien.delange's avatar julien.delange

also map operations for message transmission for each data



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1378 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent f19d8f17
......@@ -78,9 +78,32 @@ package body Ocarina.Backends.MAST.Main is
function Map_Driver_Scheduling_Server_Name (The_Device : Node_Id)
return Name_Id;
function Make_Driver_Wrapper (The_Device : Node_Id) return Node_Id;
function Map_Operation_Message_Transmission_Name
(The_Data : Node_Id)
return Name_Id;
Root_System_Node : Node_Id := No_Node;
---------------------------------------------
-- Map_Operation_Message_Transmission_Name --
---------------------------------------------
function Map_Operation_Message_Transmission_Name (The_Data : Node_Id)
return Name_Id
is
N : Name_Id;
begin
Set_Str_To_Name_Buffer ("");
Get_Name_String
(Normalize_Name
(Name
(Identifier
(The_Data))));
Add_Str_To_Name_Buffer ("_transmission_operation");
N := Name_Find;
return N;
end Map_Operation_Message_Transmission_Name;
-----------------------------
-- Map_Port_Operation_Name --
-----------------------------
......@@ -88,12 +111,24 @@ package body Ocarina.Backends.MAST.Main is
function Map_Port_Operation_Name (The_Thread : Node_Id; The_Port : Node_Id)
return Name_Id
is
Thread_Name : Name_Id;
Port_Name : Name_Id;
N : Name_Id;
begin
Set_Str_To_Name_Buffer ("");
Get_Name_String (Normalize_Name (Name (Identifier (The_Thread))));
Get_Name_String_And_Append
Thread_Name :=
(Normalize_Name
(Name
(Identifier
(Parent_Subcomponent (The_Thread)))));
Port_Name :=
(Normalize_Name (Name (Identifier (The_Port))));
return Name_Find;
Set_Str_To_Name_Buffer ("");
Get_Name_String (Port_Name);
Add_Str_To_Name_Buffer ("_port_");
Get_Name_String_And_Append (Thread_Name);
N := Name_Find;
return N;
end Map_Port_Operation_Name;
------------------------------------
......@@ -380,6 +415,28 @@ package body Ocarina.Backends.MAST.Main is
CP : constant Supported_Concurrency_Control_Protocol
:= Get_Concurrency_Protocol (E);
begin
N := Make_Operation
(Map_Operation_Message_Transmission_Name (E),
Message_Transmission,
No_List);
if Get_Data_Size (E) /= Null_Size then
MTN.Set_Max_Message_Size
(N, Make_Literal
(New_Numeric_Value
(To_Bytes (Get_Data_Size (E)), 1, 10)));
MTN.Set_Avg_Message_Size
(N, Make_Literal
(New_Numeric_Value
(To_Bytes (Get_Data_Size (E)), 1, 10)));
MTN.Set_Min_Message_Size
(N, Make_Literal
(New_Numeric_Value
(To_Bytes (Get_Data_Size (E)), 1, 10)));
end if;
Append_Node_To_List (N, MTN.Declarations (MAST_File));
if CP = Concurrency_Protected_Access or else
CP = concurrency_Priority_Ceiling or else
Is_Protected_Data (E) or else
......
......@@ -835,6 +835,8 @@ package body Ocarina.Backends.MAST_Tree.Generator is
Write_Line ("Type => Simple,");
elsif Is_Composite (N) then
Write_Line ("Type => Composite,");
elsif Is_Message_Transmission (N) then
Write_Line ("Type => Message_Transmission,");
else
Write_Line ("Type => Enclosing,");
end if;
......@@ -876,6 +878,39 @@ package body Ocarina.Backends.MAST_Tree.Generator is
Generate (Best_Case_Execution_Time (N));
end if;
if Max_Message_Size (N) /= No_Node then
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Max_Message_Size);
Write_Space;
Write (Tok_Assign);
Write_Space;
Generate (Max_Message_Size (N));
end if;
if Avg_Message_Size (N) /= No_Node then
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Avg_Message_Size);
Write_Space;
Write (Tok_Assign);
Write_Space;
Generate (Avg_Message_Size (N));
end if;
if Min_Message_Size (N) /= No_Node then
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Min_Message_Size);
Write_Space;
Write (Tok_Assign);
Write_Space;
Generate (Min_Message_Size (N));
end if;
if not Is_Empty (Operations (N)) then
Write (Tok_Colon);
Write_Eol;
......
......@@ -99,11 +99,15 @@ module Ocarina::Backends::MAST_Tree::Nodes {
interface Operation : MAST_Node {
boolean Is_Simple;
boolean Is_Enclosing;
boolean Is_Message_Transmission;
boolean Is_Composite;
List_Id Operations;
Node_Id Worst_Case_Execution_Time;
Node_Id Best_Case_Execution_Time;
Node_Id Avg_Case_Execution_Time;
Node_Id Max_Message_Size;
Node_Id Avg_Message_Size;
Node_Id Min_Message_Size;
};
......
......@@ -711,15 +711,21 @@ package body Ocarina.Backends.MAST_Tree.Nutils is
MTN.Set_Is_Enclosing (N, False);
MTN.Set_Is_Composite (N, False);
MTN.Set_Is_Simple (N, False);
MTN.Set_Is_Message_Transmission (N, False);
if Op_Kind = Enclosing then
MTN.Set_Is_Enclosing (N, True);
elsif Op_Kind = Composite then
MTN.Set_Is_Composite (N, True);
elsif Op_Kind = Message_Transmission then
MTN.Set_Is_Message_Transmission (N, True);
else
MTN.Set_Is_Simple (N, True);
end if;
MTN.Set_Max_Message_Size (N, No_Node);
MTN.Set_Avg_Message_Size (N, No_Node);
MTN.Set_Min_Message_Size (N, No_Node);
MTN.Set_Worst_Case_Execution_Time (N, No_Node);
MTN.Set_Best_Case_Execution_Time (N, No_Node);
MTN.Set_Avg_Case_Execution_Time (N, No_Node);
......
......@@ -54,6 +54,7 @@ package Ocarina.Backends.MAST_Tree.Nutils is
Tok_Activity_Server,
Tok_Avg_Case_Execution_Time,
Tok_Avg_Context_Switch,
Tok_Avg_Message_Size,
Tok_Avg_ISR_Switch,
Tok_Best_Case_Execution_time,
Tok_Best_Context_Switch,
......@@ -76,12 +77,14 @@ package Ocarina.Backends.MAST_Tree.Nutils is
Tok_Input_Event,
Tok_List_Of_Drivers,
Tok_Max_Blocking,
Tok_Max_Message_Size,
Tok_Max_Packet_Size,
Tok_Max_Packet_Transmission_Time,
Tok_Max_Priority,
Tok_Max_ISR_Switch,
Tok_Message_Partitioning,
Tok_Min_Interarrival,
Tok_Min_Message_Size,
Tok_Min_Packet_Size,
Tok_Min_Packet_Transmission_Time,
Tok_Min_Priority,
......@@ -261,7 +264,7 @@ package Ocarina.Backends.MAST_Tree.Nutils is
return Node_Id;
type Operation_Kind is
(Enclosing, Simple, Composite);
(Enclosing, Simple, Composite, Message_Transmission);
function Make_Operation
(Op_Name : Name_Id;
......
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