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

map buses and devices



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1368 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent ec6ae4a4
......@@ -211,9 +211,14 @@ package body Ocarina.Backends.MAST.Main is
---------------
procedure Visit_Bus (E : Node_Id) is
pragma Unreferenced (E);
N : Node_Id;
begin
null;
N := MTU.Make_Processing_Resource
(Normalize_Name (Name (Identifier (Parent_Subcomponent (E)))),
PR_Packet_Based_Network);
MTN.Set_Is_Full_Duplex (N, True);
MTU.Append_Node_To_List (N, MTN.Declarations (MAST_File));
end Visit_Bus;
--------------------------------------
......
......@@ -265,6 +265,7 @@ package body Ocarina.Backends.MAST_Tree.Generator is
----------------------------------
procedure Generate_Processing_Resource (N : Node_Id) is
D : Node_Id;
begin
Write_Line ("Processing_Resource (");
Increment_Indentation;
......@@ -283,39 +284,171 @@ package body Ocarina.Backends.MAST_Tree.Generator is
Write_Name (Node_Name (N));
Write_Line (Tok_Colon);
Write_Indentation (-1);
Write (Tok_Avg_ISR_Switch);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Avg_ISR_Switch (N) /= No_Node then
Generate (Avg_ISR_Switch (N));
else
Write_Str ("0.00");
end if;
Write_Line (Tok_Colon);
if Fixed_Priority_Processor (N) or else
Regular_Processor (N) then
Write_Indentation (-1);
Write (Tok_Avg_ISR_Switch);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Avg_ISR_Switch (N) /= No_Node then
Generate (Avg_ISR_Switch (N));
else
Write_Str ("0.00");
end if;
Write_Line (Tok_Colon);
Write_Indentation (-1);
Write (Tok_Best_ISR_Switch);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Best_ISR_Switch (N) /= No_Node then
Generate (Best_ISR_Switch (N));
else
Write_Str ("0.00");
Write_Indentation (-1);
Write (Tok_Best_ISR_Switch);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Best_ISR_Switch (N) /= No_Node then
Generate (Best_ISR_Switch (N));
else
Write_Str ("0.00");
end if;
Write_Line (Tok_Colon);
Write_Indentation (-1);
Write (Tok_Worst_ISR_Switch);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Worst_ISR_Switch (N) /= No_Node then
Generate (Worst_ISR_Switch (N));
else
Write_Str ("0.00");
end if;
end if;
Write_Line (Tok_Colon);
Write_Indentation (-1);
Write (Tok_Worst_ISR_Switch);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Worst_ISR_Switch (N) /= No_Node then
Generate (Worst_ISR_Switch (N));
else
Write_Str ("0.00");
if Packet_Based_Network (N) then
Write_Indentation (-1);
Write (Tok_Speed_Factor);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Speed_Factor (N) /= No_Node then
Generate (Speed_Factor (N));
else
Write_Str ("0.00");
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Throughput);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Throughput (N) /= No_Node then
Generate (Throughput (N));
else
Write_Str ("0.00");
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Transmission);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Is_Simplex (N) then
Write (Tok_Simplex);
elsif Is_Half_Duplex (N) then
Write (Tok_Half_Duplex);
else
Write (Tok_Full_Duplex);
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Max_Blocking);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Max_Blocking (N) /= No_Node then
Generate (Max_Blocking (N));
else
Write_Str ("0.00");
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Max_Packet_Size);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Max_Packet_Size (N) /= No_Node then
Generate (Max_Packet_Size (N));
else
Write_Str ("0.00");
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Min_Packet_Size);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Min_Packet_Size (N) /= No_Node then
Generate (Min_Packet_Size (N));
else
Write_Str ("0.00");
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Max_Packet_Transmission_Time);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Max_Packet_Transmission_Time (N) /= No_Node then
Generate (Max_Packet_Transmission_Time (N));
else
Write_Str ("0.00");
end if;
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_Min_Packet_Transmission_Time);
Write_Space;
Write (Tok_Assign);
Write_Space;
if Min_Packet_Transmission_Time (N) /= No_Node then
Generate (Min_Packet_Transmission_Time (N));
else
Write_Str ("0.00");
end if;
if not Is_Empty (List_Of_Drivers (N)) then
Write (Tok_Colon);
Write_Eol;
Write_Indentation (-1);
Write (Tok_List_Of_Drivers);
Write_Space;
Write (Tok_Assign);
Write_Space;
Write (Tok_Left_Paren);
D := First_Node (List_Of_Drivers (N));
while Present (D) loop
Generate (D);
if Next_Node (D) /= No_Node then
Write (Tok_Colon);
end if;
D := Next_Node (D);
end loop;
Write (Tok_Right_Paren);
end if;
end if;
Write_Line (");");
......
......@@ -35,18 +35,6 @@ module Ocarina::Backends::MAST_Tree::Nodes {
boolean Is_RTA_Overhead_Model_Coupled;
};
interface Processing_Resource : MAST_Node {
Node_Id Max_Interrupt_Priority;
Node_Id Min_Interrupt_Priority;
Node_Id Worst_ISR_Switch;
Node_Id Avg_ISR_Switch;
Node_Id Best_ISR_Switch;
Node_Id Speed_Factor;
boolean Regular_Processor;
boolean Packet_Based_Network;
boolean Fixed_Priority_Processor;
};
interface Scheduling_Server : MAST_Node {
Name_Id Associated_Scheduler;
Node_Id Parameters;
......@@ -85,6 +73,29 @@ module Ocarina::Backends::MAST_Tree::Nodes {
Node_Id Last_Node;
};
interface Processing_Resource : MAST_Node {
Node_Id Max_Interrupt_Priority;
Node_Id Min_Interrupt_Priority;
Node_Id Worst_ISR_Switch;
Node_Id Avg_ISR_Switch;
Node_Id Best_ISR_Switch;
Node_Id Speed_Factor;
boolean Regular_Processor;
boolean Packet_Based_Network;
boolean Fixed_Priority_Processor;
boolean Is_Simplex;
boolean Is_Half_Duplex;
boolean Is_Full_Duplex;
Node_Id Throughput;
Node_Id Max_Blocking;
Node_Id Max_Packet_Size;
Node_Id Min_Packet_Size;
Node_Id Max_Packet_Transmission_Time;
Node_Id Min_Packet_Transmission_Time;
List_Id List_Of_Drivers;
};
interface Operation : MAST_Node {
boolean Is_Simple;
boolean Is_Enclosing;
......
......@@ -295,7 +295,7 @@ package body Ocarina.Backends.MAST_Tree.Nutils is
is
L : List_Id;
begin
L := New_List (K_List_Id);
L := New_List (MTN.K_List_Id);
Append_Node_To_List (N1, L);
if Present (N2) then
Append_Node_To_List (N2, L);
......@@ -549,6 +549,25 @@ package body Ocarina.Backends.MAST_Tree.Nutils is
else
MTN.Set_Packet_Based_Network (N, True);
end if;
MTN.Set_Is_Full_Duplex (N, False);
MTN.Set_Is_Half_Duplex (N, False);
MTN.Set_Is_Simplex (N, False);
MTN.Set_Throughput
(N, Make_Literal (New_Floating_Point_Value (0.0)));
MTN.Set_Max_Blocking
(N, Make_Literal (New_Floating_Point_Value (0.0)));
MTN.Set_Max_Packet_Size
(N, Make_Literal (New_Floating_Point_Value (10.0)));
MTN.Set_Min_Packet_Size
(N, Make_Literal (New_Floating_Point_Value (1.0)));
MTN.Set_Max_Packet_Transmission_Time
(N, Make_Literal (New_Floating_Point_Value (10.0)));
MTN.Set_Min_Packet_Transmission_Time
(N, Make_Literal (New_Floating_Point_Value (0.1)));
MTN.Set_List_Of_Drivers
(N, New_List (MTN.K_List_Id));
return N;
end Make_Processing_Resource;
......
......@@ -66,7 +66,9 @@ package Ocarina.Backends.MAST_Tree.Nutils is
Tok_Driver,
Tok_Event_Handlers,
Tok_External_Events,
Tok_Full_Duplex,
Tok_Fixed_Priority_Policy,
Tok_Half_Duplex,
Tok_Hard_Global_Deadline,
Tok_Host,
Tok_Immediate_Ceiling_Resource,
......@@ -75,11 +77,13 @@ package Ocarina.Backends.MAST_Tree.Nutils is
Tok_List_Of_Drivers,
Tok_Max_Blocking,
Tok_Max_Packet_Size,
Tok_Max_Packet_Transmission_Time,
Tok_Max_Priority,
Tok_Max_ISR_Switch,
Tok_Message_Partitioning,
Tok_Min_Interarrival,
Tok_Min_Packet_Size,
Tok_Min_Packet_Transmission_Time,
Tok_Min_Priority,
Tok_Name,
Tok_Output_Event,
......@@ -96,11 +100,13 @@ package Ocarina.Backends.MAST_Tree.Nutils is
Tok_Scheduling_Server,
Tok_Server_Processing_Resource,
Tok_Server_Sched_Parameters,
Tok_Simplex,
Tok_Speed_Factor,
Tok_Shared_Resource,
Tok_The_Priority,
Tok_Throughput,
Tok_Timing_Requirements,
Tok_Transmission,
Tok_Type,
Tok_Unknown,
Tok_Worst_Case_Execution_Time,
......@@ -206,6 +212,9 @@ package Ocarina.Backends.MAST_Tree.Nutils is
PR_Packet_Based_Network
);
type Transmission_Kind is
(Simplex, Half_Duplex, Full_Duplex);
function Make_Processing_Resource
(PR_Name : Name_Id; PR_Type : Processing_Resource_Kind)
return Node_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