Commit d62799a8 authored by jhugues's avatar jhugues
Browse files

* Minor reformatting



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@5936 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent b682b081
...@@ -61,76 +61,76 @@ package body Ocarina.Backends.PN.Components is ...@@ -61,76 +61,76 @@ package body Ocarina.Backends.PN.Components is
package OAV renames Ocarina.AADL_Values; package OAV renames Ocarina.AADL_Values;
procedure Pn_Process_Final_System procedure PN_Process_Final_System
(Pn_Generated : Node_Id; (PN_Generated : Node_Id;
Pn_P_Init_Proc : Pn_Init_Node; PN_P_Init_Proc : PN_Init_Node;
Pn_P_New_Proc : Pn_New_Node; PN_P_New_Proc : PN_New_Node;
Pn_A_Init_Proc : Pn_Init_Arc; PN_A_Init_Proc : PN_Init_Arc;
Pn_A_New_Proc : Pn_New_Node; PN_A_New_Proc : PN_New_Node;
Pn_Dup_Arc_Proc : Pn_Dup_Arc); PN_Dup_Arc_Proc : PN_Dup_Arc);
function Process_Component_Instance function Process_Component_Instance
(Instance : Types.Node_Id; (Instance : Types.Node_Id;
Pn_Generated : Types.Node_Id) PN_Generated : Types.Node_Id)
return Boolean; return Boolean;
function Process_Thread_Instance function Process_Thread_Instance
(Aadl_Instance : Types.Node_Id; (Aadl_Instance : Types.Node_Id;
Pn_Generated : Types.Node_Id) PN_Generated : Types.Node_Id)
return Boolean; return Boolean;
procedure Pn_Process_Thread_Pattern procedure PN_Process_Thread_Pattern
(Aadl_Instance : Types.Node_Id; (Aadl_Instance : Types.Node_Id;
Pn_Thread : Types.Node_Id; PN_Thread : Types.Node_Id;
Pn_Generated : Types.Node_Id; PN_Generated : Types.Node_Id;
Pn_P_Init_Proc : Pn_Init_Node; PN_P_Init_Proc : PN_Init_Node;
Pn_P_New_Proc : Pn_New_Node; PN_P_New_Proc : PN_New_Node;
Pn_T_Init_Proc : Pn_Init_Node; PN_T_Init_Proc : PN_Init_Node;
Pn_T_New_Proc : Pn_New_Node; PN_T_New_Proc : PN_New_Node;
Pn_A_Init_Proc : Pn_Init_Arc; PN_A_Init_Proc : PN_Init_Arc;
Pn_A_New_Proc : Pn_New_Node); PN_A_New_Proc : PN_New_Node);
procedure Pn_Thread_Skeleton procedure PN_Thread_Skeleton
(Aadl_Instance : Types.Node_Id; (Aadl_Instance : Types.Node_Id;
Pn_Thread : Types.Node_Id; PN_Thread : Types.Node_Id;
Pn_Generated : Types.Node_Id; PN_Generated : Types.Node_Id;
Pn_P_Init_Proc : Pn_Init_Node; PN_P_Init_Proc : PN_Init_Node;
Pn_P_New_Proc : Pn_New_Node; PN_P_New_Proc : PN_New_Node;
Pn_T_Init_Proc : Pn_Init_Node; PN_T_Init_Proc : PN_Init_Node;
Pn_T_New_Proc : Pn_New_Node; PN_T_New_Proc : PN_New_Node;
Pn_A_Init_Proc : Pn_Init_Arc; PN_A_Init_Proc : PN_Init_Arc;
Pn_A_New_Proc : Pn_New_Node); PN_A_New_Proc : PN_New_Node);
procedure Pn_Build_Spg_Par procedure PN_Build_Spg_Par
(Aadl_Instance : Types.Node_Id; (Aadl_Instance : Types.Node_Id;
Pn_Generated : Types.Node_Id; PN_Generated : Types.Node_Id;
Spg_Feat : Types.Node_Id; Spg_Feat : Types.Node_Id;
Pn_Spg_Call : Types.Node_Id; PN_Spg_Call : Types.Node_Id;
In_Par : Boolean := True; In_Par : Boolean := True;
Pn_P_Init_Proc : Pn_Init_Node; PN_P_Init_Proc : PN_Init_Node;
Pn_P_New_Proc : Pn_New_Node; PN_P_New_Proc : PN_New_Node;
Pn_T_Init_Proc : Pn_Init_Node; PN_T_Init_Proc : PN_Init_Node;
Pn_T_New_Proc : Pn_New_Node; PN_T_New_Proc : PN_New_Node;
Pn_A_Init_Proc : Pn_Init_Arc; PN_A_Init_Proc : PN_Init_Arc;
Pn_A_New_Proc : Pn_New_Node); PN_A_New_Proc : PN_New_Node);
procedure Pn_Build_Port (Aadl_Instance : Types.Node_Id; procedure PN_Build_Port (Aadl_Instance : Types.Node_Id;
Pn_Generated : Types.Node_Id; PN_Generated : Types.Node_Id;
Pn_Thread : Types.Node_Id; PN_Thread : Types.Node_Id;
F : Types.Value_Id); F : Types.Value_Id);
procedure Pn_Build_Tpn_Port procedure PN_Build_Tpn_Port
(Aadl_Instance : Node_Id; (Aadl_Instance : Node_Id;
Pn_Generated : Types.Node_Id; PN_Generated : Types.Node_Id;
Port_Instance : Node_Id; Port_Instance : Node_Id;
Pn_Port : Node_Id; PN_Port : Node_Id;
Is_Data : Boolean := True); Is_Data : Boolean := True);
procedure Pn_Build_Cpn_Port procedure PN_Build_Cpn_Port
(Aadl_Instance : Node_Id; (Aadl_Instance : Node_Id;
Pn_Generated : Types.Node_Id; PN_Generated : Types.Node_Id;
Port_Instance : Node_Id; Port_Instance : Node_Id;
Pn_Port : Node_Id; PN_Port : Node_Id;
Is_Data : Boolean := True); Is_Data : Boolean := True);
----------------------------------- -----------------------------------
...@@ -149,7 +149,7 @@ package body Ocarina.Backends.PN.Components is ...@@ -149,7 +149,7 @@ package body Ocarina.Backends.PN.Components is
use Ocarina.Backends.PN.Nodes; use Ocarina.Backends.PN.Nodes;
Instance : Node_Id; Instance : Node_Id;
Pn_Generated : Node_Id; PN_Generated : Node_Id;
Success : Boolean := False; Success : Boolean := False;
-- 0 for CPN, 1 for TPN -- 0 for CPN, 1 for TPN
...@@ -162,77 +162,77 @@ package body Ocarina.Backends.PN.Components is ...@@ -162,77 +162,77 @@ package body Ocarina.Backends.PN.Components is
Instance := Root_System (Architecture_Instance); Instance := Root_System (Architecture_Instance);
-- initialization of the Petri Net top box -- initialization of the Petri Net top box
Pn_Generated := Pn_Get_New_Pn_Generated; PN_Generated := PN_Get_New_PN_Generated;
Pn_Init_Pn_Generated (Pn_Generated, PN_Init_PN_Generated (PN_Generated,
Formalism); Formalism);
declare declare
F : constant Value_Type := Get_Value_Type F : constant Value_Type := Get_Value_Type
(OPN.Formalism (Pn_Generated)); (OPN.Formalism (PN_Generated));
begin begin
case F.Ival is case F.Ival is
when 0 => when 0 =>
-- CPN Pattern -- CPN Pattern
Set_Pn_Formalism_Specific_Informations Set_PN_Formalism_Specific_Informations
(Pn_Generated, (PN_Generated,
Pn_Get_New_CPn_Informations); PN_Get_New_CPN_Informations);
if Instance /= No_Node and then Pn_Generated /= No_Node then if Instance /= No_Node and then PN_Generated /= No_Node then
Success := Process_Component_Instance (Instance, Success := Process_Component_Instance (Instance,
Pn_Generated); PN_Generated);
if Success then if Success then
null; null;
end if; end if;
end if; end if;
-- assembly and final processing -- assembly and final processing
Pn_Process_Final_System (Pn_Generated, PN_Process_Final_System (PN_Generated,
Pn_Cpn_Init_Place'Access, PN_Cpn_Init_Place'Access,
Pn_Cpn_Get_New_Place'Access, PN_Cpn_Get_New_Place'Access,
Pn_Cpn_Init_Arc'Access, PN_Cpn_Init_Arc'Access,
Pn_Cpn_Get_New_Arc'Access, PN_Cpn_Get_New_Arc'Access,
Pn_Cpn_Duplicate_Arc'Access); PN_Cpn_Duplicate_Arc'Access);
when 1 => when 1 =>
-- TPN Pattern -- TPN Pattern
-- set specific informations -- set specific informations
Set_Pn_Formalism_Specific_Informations Set_PN_Formalism_Specific_Informations
(Pn_Generated, (PN_Generated,
Pn_Get_New_TPn_Informations); PN_Get_New_TPN_Informations);
if Instance /= No_Node and then Pn_Generated /= No_Node then if Instance /= No_Node and then PN_Generated /= No_Node then
Success := Process_Component_Instance (Instance, Success := Process_Component_Instance (Instance,
Pn_Generated); PN_Generated);
if Success then if Success then
null; null;
end if; end if;
end if; end if;
-- assembly and final processing -- assembly and final processing
Pn_Process_Final_System (Pn_Generated, PN_Process_Final_System (PN_Generated,
Pn_Tpn_Init_Place'Access, PN_Tpn_Init_Place'Access,
Pn_Tpn_Get_New_Place'Access, PN_Tpn_Get_New_Place'Access,
Pn_Tpn_Init_Arc'Access, PN_Tpn_Init_Arc'Access,
Pn_Tpn_Get_New_Arc'Access, PN_Tpn_Get_New_Arc'Access,
Pn_Tpn_Duplicate_Arc'Access); PN_Tpn_Duplicate_Arc'Access);
when others => when others =>
null; null;
end case; end case;
end; end;
return Pn_Generated; return PN_Generated;
end Process_Architecture_Instance; end Process_Architecture_Instance;
------------------------------- -------------------------------
-- Pn_Process_Final_System -- -- PN_Process_Final_System --
------------------------------- -------------------------------
procedure Pn_Process_Final_System procedure PN_Process_Final_System
(Pn_Generated : Node_Id; (PN_Generated : Node_Id;
Pn_P_Init_Proc : Pn_Init_Node; PN_P_Init_Proc : PN_Init_Node;
Pn_P_New_Proc : Pn_New_Node; PN_P_New_Proc : PN_New_Node;
Pn_A_Init_Proc : Pn_Init_Arc; PN_A_Init_Proc : PN_Init_Arc;
Pn_A_New_Proc : Pn_New_Node; PN_A_New_Proc : PN_New_Node;
Pn_Dup_Arc_Proc : Pn_Dup_Arc) PN_Dup_Arc_Proc : PN_Dup_Arc)
is is
use OPN; use OPN;
...@@ -250,8 +250,8 @@ package body Ocarina.Backends.PN.Components is ...@@ -250,8 +250,8 @@ package body Ocarina.Backends.PN.Components is
begin begin
Thread_Iter := OPN.First_Node Thread_Iter := OPN.First_Node
(Pn_Subcomponents (PN_Subcomponents
(Pn_Box (Pn_Generated))); (PN_Box (PN_Generated)));
-- run across subcomponents -- run across subcomponents
while Present (Thread_Iter) loop while Present (Thread_Iter) loop
...@@ -259,12 +259,12 @@ package body Ocarina.Backends.PN.Components is ...@@ -259,12 +259,12 @@ package body Ocarina.Backends.PN.Components is
if OPN.Kind (Thread_Iter) = K_Thread_Pattern then if OPN.Kind (Thread_Iter) = K_Thread_Pattern then
-- run across threads -- run across threads
if OPN.Kind (Pn_Formalism_Specific_Informations (Pn_Generated)) if OPN.Kind (PN_Formalism_Specific_Informations (PN_Generated))
= K_TPN_Specific_Informations then = K_TPN_Specific_Informations then
-- manage processor -- manage processor
declare declare
Pn_Proc : Node_Id; PN_Proc : Node_Id;
Aadl_Proc : constant Node_Id Aadl_Proc : constant Node_Id
:= Get_Bound_Processor (AIN.Corresponding_Instance := Get_Bound_Processor (AIN.Corresponding_Instance
(Get_Container_Process (Get_Container_Process
...@@ -274,44 +274,44 @@ package body Ocarina.Backends.PN.Components is ...@@ -274,44 +274,44 @@ package body Ocarina.Backends.PN.Components is
begin begin
if Aadl_Proc /= No_Node then if Aadl_Proc /= No_Node then
Pn_Proc := Get_Handling (Aadl_Proc, PN_Proc := Get_Handling (Aadl_Proc,
By_Node, By_Node,
H_PN_Proc_Creation); H_PN_Proc_Creation);
if Pn_Proc = No_Node then if PN_Proc = No_Node then
-- create processor -- create processor
Pn_Proc := Pn_Get_New_Processor_Pattern; PN_Proc := PN_Get_New_Processor_Pattern;
Pn_Init_Processor_Pattern (Pn_Proc, PN_Init_Processor_Pattern (PN_Proc,
Aadl_Proc); Aadl_Proc);
-- add place in component -- add place in component
declare declare
P_Proc : Node_Id; P_Proc : Node_Id;
begin begin
P_Proc := Pn_Tpn_Get_New_Place; P_Proc := PN_Tpn_Get_New_Place;
Pn_Tpn_Init_Place (P_Proc, PN_Tpn_Init_Place (P_Proc,
Aadl_Proc, Aadl_Proc,
Get_String_Name ("_Processor"), Get_String_Name ("_Processor"),
Pn_Generated, PN_Generated,
0); 0);
Set_Tokens_Number (P_Proc, Set_Tokens_Number (P_Proc,
New_Integer_Value (1)); New_Integer_Value (1));
-- add place into component -- add place into component
Append_Node_To_List (P_Proc, Append_Node_To_List (P_Proc,
Internal_Places (Pn_Proc)); Internal_Places (PN_Proc));
end; end;
Set_Handling (Aadl_Proc, Set_Handling (Aadl_Proc,
By_Node, By_Node,
H_PN_Proc_Creation, H_PN_Proc_Creation,
Pn_Proc); PN_Proc);
-- add processor into components list -- add processor into components list
Append_Node_To_List (Pn_Proc, Append_Node_To_List (PN_Proc,
Pn_Subcomponents PN_Subcomponents
(Pn_Box (Pn_Generated))); (PN_Box (PN_Generated)));
end if; end if;
-- here we have the processor component -- here we have the processor component
...@@ -320,23 +320,23 @@ package body Ocarina.Backends.PN.Components is ...@@ -320,23 +320,23 @@ package body Ocarina.Backends.PN.Components is
-- first, find dedicated entry in tpn_info to update -- first, find dedicated entry in tpn_info to update
-- priorities -- priorities
if Is_Empty (Priorities if Is_Empty (Priorities
(Pn_Formalism_Specific_Informations (PN_Formalism_Specific_Informations
(Pn_Generated))) then (PN_Generated))) then
-- first entry in the list -- first entry in the list
Proc_Prio_Node := Pn_Get_New_Processor_Priority; Proc_Prio_Node := PN_Get_New_Processor_Priority;
Pn_Init_Processor_Priority (Proc_Prio_Node, PN_Init_Processor_Priority (Proc_Prio_Node,
Aadl_Proc); Aadl_Proc);
Append_Node_To_List Append_Node_To_List
(Proc_Prio_Node, (Proc_Prio_Node,
Priorities Priorities
(Pn_Formalism_Specific_Informations (PN_Formalism_Specific_Informations
(Pn_Generated))); (PN_Generated)));
else else
-- find it -- find it
Proc_Prio_Node := OPN.First_Node Proc_Prio_Node := OPN.First_Node
(Priorities (Priorities
(Pn_Formalism_Specific_Informations (PN_Formalism_Specific_Informations
(Pn_Generated))); (PN_Generated)));
while Present (Proc_Prio_Node) loop while Present (Proc_Prio_Node) loop
if P_Instance (Proc_Prio_Node) = Aadl_Proc then if P_Instance (Proc_Prio_Node) = Aadl_Proc then
-- leave loop -- leave loop
...@@ -353,7 +353,7 @@ package body Ocarina.Backends.PN.Components is ...@@ -353,7 +353,7 @@ package body Ocarina.Backends.PN.Components is
declare declare
Cs_Iter, Spg_Iter, Trans_Iter : Node_Id; Cs_Iter, Spg_Iter, Trans_Iter : Node_Id;
P_Proc : constant Node_Id := P_Proc : constant Node_Id :=
OPN.First_Node (Internal_Places (Pn_Proc)); OPN.First_Node (Internal_Places (PN_Proc));
begin begin
Cs_Iter := OPN.First_Node (Call_Seq (Thread_Iter)); Cs_Iter := OPN.First_Node (Call_Seq (Thread_Iter));
while Present (Cs_Iter) loop while Present (Cs_Iter) loop
...@@ -371,8 +371,8 @@ package body Ocarina.Backends.PN.Components is ...@@ -371,8 +371,8 @@ package body Ocarina.Backends.PN.Components is
declare declare
New_Arc : Node_Id; New_Arc : Node_Id;
begin begin
New_Arc := Pn_A_New_Proc.all; New_Arc := PN_A_New_Proc.all;
Pn_A_Init_Proc (New_Arc, PN_A_Init_Proc (New_Arc,
Th_Instance Th_Instance
(Thread_Iter), (Thread_Iter),
P_Proc, P_Proc,
...@@ -381,7 +381,7 @@ package body Ocarina.Backends.PN.Components is ...@@ -381,7 +381,7 @@ package body Ocarina.Backends.PN.Components is
Append_Node_To_List Append_Node_To_List
(New_Arc, (New_Arc,
Pn_Arcs_In (Trans_Iter)); PN_Arcs_In (Trans_Iter));
end; end;
-- since it is begin, -- since it is begin,
-- its priority needs to be -- its priority needs to be
...@@ -398,8 +398,8 @@ package body Ocarina.Backends.PN.Components is ...@@ -398,8 +398,8 @@ package body Ocarina.Backends.PN.Components is
declare declare
New_Arc : Node_Id; New_Arc : Node_Id;
begin begin
New_Arc := Pn_A_New_Proc.all; New_Arc := PN_A_New_Proc.all;
Pn_A_Init_Proc (New_Arc, PN_A_Init_Proc (New_Arc,
Th_Instance Th_Instance
(Thread_Iter), (Thread_Iter),
Trans_Iter, Trans_Iter,
...@@ -408,7 +408,7 @@ package body Ocarina.Backends.PN.Components is ...@@ -408,7 +408,7 @@ package body Ocarina.Backends.PN.Components is
Append_Node_To_List Append_Node_To_List
(New_Arc, (New_Arc,
Pn_Arcs_Out (Trans_Iter)); PN_Arcs_Out (Trans_Iter));
end; end;
-- handle context switch -- handle context switch
...@@ -418,8 +418,8 @@ package body Ocarina.Backends.PN.Components is ...@@ -418,8 +418,8 @@ package body Ocarina.Backends.PN.Components is
declare declare
New_Arc : Node_Id; New_Arc : Node_Id;
begin begin
New_Arc := Pn_A_New_Proc.all; New_Arc := PN_A_New_Proc.all;
Pn_A_Init_Proc (New_Arc, PN_A_Init_Proc (New_Arc,
Th_Instance Th_Instance
(Thread_Iter), (Thread_Iter),
Trans_Iter, Trans_Iter,
...@@ -428,7 +428,7 @@ package body Ocarina.Backends.PN.Components is ...@@ -428,7 +428,7 @@ package body Ocarina.Backends.PN.Components is
Append_Node_To_List Append_Node_To_List
(New_Arc, (New_Arc,
Pn_Arcs_Out (Trans_Iter)); PN_Arcs_Out (Trans_Iter));
end; end;
-- since it is preemp1, its priority needs -- since it is preemp1, its priority needs
-- to be recorded -- to be recorded
...@@ -444,8 +444,8 @@ package body Ocarina.Backends.PN.Components is ...@@ -444,8 +444,8 @@ package body Ocarina.Backends.PN.Components is
declare declare
New_Arc : Node_Id; New_Arc : Node_Id;
begin begin
New_Arc := Pn_A_New_Proc.all; New_Arc := PN_A_New_Proc.all;
Pn_A_Init_Proc (New_Arc, PN_A_Init_Proc (New_Arc,
Th_Instance Th_Instance
(Thread_Iter), (Thread_Iter),
P_Proc, P_Proc,
...@@ -454,7 +454,7 @@ package body Ocarina.Backends.PN.Components is ...@@ -454,7 +454,7 @@ package body Ocarina.Backends.PN.Components is
Append_Node_To_List Append_Node_To_List
(New_Arc, (New_Arc,
Pn_Arcs_In (Trans_Iter)); PN_Arcs_In (Trans_Iter));
end; end;
-- next -- next
...@@ -471,14 +471,14 @@ package body Ocarina.Backends.PN.Components is ...@@ -471,14 +471,14 @@ package body Ocarina.Backends.PN.Components is
end; end;
end if; -- tpn for processors end if; -- tpn for processors
if OPN.Kind (Pn_Formalism_Specific_Informations (Pn_Generated)) if OPN.Kind (PN_Formalism_Specific_Informations (PN_Generated))
= K_TPN_Specific_Informations then = K_TPN_Specific_Informations then
-- TPN -- TPN
-- set hyperperiod -- set hyperperiod
Set_Hyperperiod (Thread_Iter, Set_Hyperperiod (Thread_Iter,
Hyperperiod Hyperperiod
(Pn_Formalism_Specific_Informations (PN_Formalism_Specific_Informations
(Pn_Generated))); (PN_Generated)));
-- set hyperperiod values to hyperperiod place -- set hyperperiod values to hyperperiod place
declare