Commit 9350c78e authored by hana's avatar hana

Start of AADL Behavior Annex mapping.

parent 23c99ceb
...@@ -573,6 +573,16 @@ package body Ocarina.Backends.LNT.Printer is ...@@ -573,6 +573,16 @@ package body Ocarina.Backends.LNT.Printer is
L_Write ("and"); L_Write ("and");
when K_Or => when K_Or =>
L_Write ("or"); L_Write ("or");
when K_Head =>
L_Write ("head");
when K_Tail =>
L_Write ("tail");
when K_Append =>
L_Write ("append");
when K_Length =>
L_Write ("length");
when K_Reverse =>
L_Write ("reverse");
when others => when others =>
null; null;
end case; end case;
......
...@@ -275,7 +275,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is ...@@ -275,7 +275,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
if not AINU.Is_Empty (Connections (E)) then if not AINU.Is_Empty (Connections (E)) then
S := AIN.First_Node (Connections (E)); S := AIN.First_Node (Connections (E));
while Present (S) loop while Present (S) loop
Put_Line (Image (AIN.Display_Name (AIN.Identifier (S)))); -- Put_Line (Image (AIN.Display_Name (AIN.Identifier (S))));
S := AIN.Next_Node (S); S := AIN.Next_Node (S);
end loop; end loop;
end if; end if;
...@@ -346,7 +346,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is ...@@ -346,7 +346,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
Aux_N_Port_3 := BLNu.Make_Node_Container (N_Port); Aux_N_Port_3 := BLNu.Make_Node_Container (N_Port);
BLNu.Append_Node_To_List (Make_Gate_Declaration BLNu.Append_Node_To_List (Make_Gate_Declaration
(Make_Identifier ("LNT_Channel_Data"), (Make_Identifier ("LNT_Channel_Port"),
N_Port), L_Gates_Declaration); N_Port), L_Gates_Declaration);
BLNu.Append_Node_To_List (Aux_N_Port_1, Device_Gates_List); BLNu.Append_Node_To_List (Aux_N_Port_1, Device_Gates_List);
...@@ -456,6 +456,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is ...@@ -456,6 +456,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
N_Event : Node_Id; N_Event : Node_Id;
Aux_N_Event : Node_Id; Aux_N_Event : Node_Id;
Aux_N_Event_1 : Node_Id;
N_Port : Node_Id; N_Port : Node_Id;
Aux_N_Port_1 : Node_Id; Aux_N_Port_1 : Node_Id;
Aux_N_Port_2 : Node_Id; Aux_N_Port_2 : Node_Id;
...@@ -513,7 +514,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is ...@@ -513,7 +514,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
Aux_N_Port_4 := BLNu.Make_Node_Container (N_Port); Aux_N_Port_4 := BLNu.Make_Node_Container (N_Port);
BLNu.Append_Node_To_List (Make_Gate_Declaration BLNu.Append_Node_To_List (Make_Gate_Declaration
(Make_Identifier ("LNT_Channel_Data"), (Make_Identifier ("LNT_Channel_Port"),
N_Port), L_Gates_Declaration); N_Port), L_Gates_Declaration);
BLNu.Append_Node_To_List (Aux_N_Port_1, Thread_Gates_List); BLNu.Append_Node_To_List (Aux_N_Port_1, Thread_Gates_List);
...@@ -558,7 +559,9 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is ...@@ -558,7 +559,9 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
elsif AIN.Is_Event (S) then elsif AIN.Is_Event (S) then
-- event port -- event port
if Is_Not_Periodic then if Is_Not_Periodic then
Aux_N_Event := BLNu.Make_Node_Container (N_Event); Aux_N_Event := BLNu.Make_Node_Container (N_Event);
Aux_N_Event_1 := BLNu.Make_Node_Container (N_Event);
Port_Gates_List := New_List ( Port_Gates_List := New_List (
Make_Identifier (N_SEND), -- SEND_ Make_Identifier (N_SEND), -- SEND_
Aux_N_Port_3, -- RECEIVE_ Aux_N_Port_3, -- RECEIVE_
...@@ -569,7 +572,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is ...@@ -569,7 +572,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
New_List (Make_Identifier (Integer'Image New_List (Make_Identifier (Integer'Image
(Queue_Size)))); (Queue_Size))));
BLNu.Append_Node_To_List (N_Event, BLNu.Append_Node_To_List (Aux_N_Event_1,
Interface_Connection_Gates_List); Interface_Connection_Gates_List);
else else
Port_Gates_List := New_List ( Port_Gates_List := New_List (
......
...@@ -91,10 +91,10 @@ package body Ocarina.Backends.LNT.Tree_Generator_Port is ...@@ -91,10 +91,10 @@ package body Ocarina.Backends.LNT.Tree_Generator_Port is
No_List, No_List,
New_List ( New_List (
Make_Gate_Declaration Make_Gate_Declaration
(Make_Identifier ("LNT_Channel_Data"), (Make_Identifier ("LNT_Channel_Port"),
Make_Identifier ("Input")), Make_Identifier ("Input")),
Make_Gate_Declaration Make_Gate_Declaration
(Make_Identifier ("LNT_Channel_Data"), (Make_Identifier ("LNT_Channel_Port"),
Make_Identifier ("Output"))), Make_Identifier ("Output"))),
No_List, No_List,
No_List, No_List,
......
...@@ -1454,7 +1454,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is ...@@ -1454,7 +1454,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is
New_List ( New_List (
Make_Communication_Statement Make_Communication_Statement
(Make_Identifier ("ACTIVATION"), (Make_Identifier ("ACTIVATION"),
New_List (Make_Identifier ("T_All")), New_List (Make_Identifier ("T_Dispatch_Completion")),
false, No_Node), false, No_Node),
Make_Assignment_Statement ( Make_Assignment_Statement (
Make_Identifier ("Threads"), Make_Identifier ("Threads"),
...@@ -1485,7 +1485,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is ...@@ -1485,7 +1485,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is
New_List ( New_List (
Make_Communication_Statement Make_Communication_Statement
(Make_Identifier ("ACTIVATION"), (Make_Identifier ("ACTIVATION"),
New_List (Make_Identifier ("T_End")), New_List (Make_Identifier ("T_Preemption_Completion")),
false, No_Node), false, No_Node),
Make_Assignment_Statement ( Make_Assignment_Statement (
Make_Identifier ("Threads"), Make_Identifier ("Threads"),
...@@ -1507,7 +1507,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is ...@@ -1507,7 +1507,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is
New_List ( New_List (
Make_Communication_Statement Make_Communication_Statement
(Make_Identifier ("ACTIVATION"), (Make_Identifier ("ACTIVATION"),
New_List (Make_Identifier ("T_Begin")), New_List (Make_Identifier ("T_Dispatch_Preemption")),
false, No_Node), false, No_Node),
Make_Assignment_Statement ( Make_Assignment_Statement (
Make_Identifier ("Threads"), Make_Identifier ("Threads"),
...@@ -1520,7 +1520,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is ...@@ -1520,7 +1520,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is
New_List (Make_Communication_Statement New_List (Make_Communication_Statement
(Make_Identifier ("ACTIVATION"), (Make_Identifier ("ACTIVATION"),
New_List (Make_Identifier ("T_Preempt")), New_List (Make_Identifier ("T_Preemption")),
false, No_Node))), false, No_Node))),
Make_Assignment_Statement ( Make_Assignment_Statement (
Make_Identifier ("Threads"), Make_Identifier ("Threads"),
...@@ -1532,7 +1532,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is ...@@ -1532,7 +1532,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Processor is
Make_Time_Const (0)))), Make_Time_Const (0)))),
Make_Communication_Statement Make_Communication_Statement
(Make_Identifier ("ACTIVATION"), (Make_Identifier ("ACTIVATION"),
New_List (Make_Identifier ("T_Ok")))), New_List (Make_Identifier ("T_Complete")))),
New_List ( New_List (
Make_Elsif_Statement Make_Elsif_Statement
(Make_Infix_Function_Call_Expression ( (Make_Infix_Function_Call_Expression (
......
...@@ -40,6 +40,11 @@ with Ocarina.ME_AADL; ...@@ -40,6 +40,11 @@ with Ocarina.ME_AADL;
with Ocarina.ME_AADL.AADL_Instances.Nodes; with Ocarina.ME_AADL.AADL_Instances.Nodes;
with Ocarina.ME_AADL.AADL_Instances.Nutils; with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Entities; with Ocarina.ME_AADL.AADL_Instances.Entities;
with Ocarina.ME_AADL_BA.BA_Tree.Nodes;
-- with Ocarina.ME_AADL_BA.BA_Tree.Debug;
with Ocarina.Analyzer.AADL_BA;
with Ocarina.ME_AADL_BA.BA_Tree.Nutils;
with Utils; use Utils; with Utils; use Utils;
use Ocarina.Backends.LNT.Components; use Ocarina.Backends.LNT.Components;
...@@ -63,6 +68,13 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -63,6 +68,13 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
use BLN; use BLN;
use BLNu; use BLNu;
package BATN renames Ocarina.ME_AADL_BA.BA_Tree.Nodes;
package BANu renames Ocarina.ME_AADL_BA.BA_Tree.Nutils;
-- package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
-- use ATN;
use BATN;
use BANu;
procedure Visit (E : Node_Id); procedure Visit (E : Node_Id);
procedure Visit_Architecture_Instance (E : Node_Id); procedure Visit_Architecture_Instance (E : Node_Id);
procedure Visit_Component_Instance (E : Node_Id); procedure Visit_Component_Instance (E : Node_Id);
...@@ -190,9 +202,12 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -190,9 +202,12 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
---------------------------- ----------------------------
procedure Visit_Thread_Instance (E : Node_Id) is procedure Visit_Thread_Instance (E : Node_Id) is
S : Node_Id; S : Node_Id;
BA : Node_Id;
N : Node_Id; N : Node_Id;
N_Activation : Node_Id; N_Activation : Node_Id;
N_Port : Node_Id; N_Port : Node_Id;
N_Variable_Port : Node_Id;
Aux_N_Variable_Port : Node_Id;
Gate : Node_Id; Gate : Node_Id;
Communication : Node_Id; Communication : Node_Id;
Aux_Communication : Node_Id; Aux_Communication : Node_Id;
...@@ -203,19 +218,38 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -203,19 +218,38 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
L_All : List_Id; L_All : List_Id;
L_Gates : List_Id; L_Gates : List_Id;
L_Statements : List_Id; L_Statements : List_Id;
N_Loop : Node_Id; -- When BA
Has_BA : Boolean := false;
Si : Node_Id;
N_Si : Node_Id;
Vi : Node_Id;
N_Vi : Node_Id;
Var_Dec : List_Id;
Out_Loop : List_Id;
In_Select : List_Id;
Variable : Node_Id;
Thread_Identifier : constant Name_Id Thread_Identifier : constant Name_Id
:= AIN.Display_Name (AIN.Identifier (E)); := AIN.Display_Name (AIN.Identifier (E));
begin begin
N_Activation := Make_Identifier ("ACTIVATION"); N_Activation := Make_Identifier ("ACTIVATION");
LNT_States_List := New_List;
Var_Dec := New_List;
Out_Loop := New_List;
L_Out_Port := New_List; L_Out_Port := New_List;
L_In_Port := New_List; L_In_Port := New_List;
L_Begin := New_List (Make_Communication_Statement L_Begin := New_List (Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_Begin")))); (N_Activation, New_List (Make_Identifier
("T_Dispatch_Preemption"))));
L_All := New_List (Make_Communication_Statement L_All := New_List (Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_All")))); (N_Activation, New_List (Make_Identifier
("T_Dispatch_Completion"))));
L_End := New_List (Make_Communication_Statement L_End := New_List (Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_End")))); (N_Activation, New_List (Make_Identifier
("T_Preemption_Completion"))));
L_Gates := New_List (Make_Gate_Declaration
(Make_Identifier ("LNT_Channel_Dispatch"), N_Activation));
-- Visit all the subcomponents of the thread -- Visit all the subcomponents of the thread
if not AINU.Is_Empty (Subcomponents (E)) then if not AINU.Is_Empty (Subcomponents (E)) then
S := AIN.First_Node (Subcomponents (E)); S := AIN.First_Node (Subcomponents (E));
...@@ -224,37 +258,125 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -224,37 +258,125 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
S := AIN.Next_Node (S); S := AIN.Next_Node (S);
end loop; end loop;
end if; end if;
L_Gates := New_List ( -- BA mapping
Make_Gate_Declaration if not AINU.Is_Empty (AIN.Annexes (E)) then
(Make_Identifier ("LNT_Channel_Dispatch"), S := AIN.First_Node (AIN.Annexes (E));
N_Activation)); loop
if (To_Upper (AIN.Display_Name (AIN.Identifier (S))) =
To_Upper (Get_String_Name ("behavior_specification")))
and then Present (AIN.Corresponding_Annex (S))
then
Has_BA := true;
BA := AIN.Corresponding_Annex (S);
if not BANu.Is_Empty (BATN.States (BA)) then
Si := BATN.First_Node (BATN.States (BA));
loop
N_Si := BATN.First_Node (BATN.Identifiers (Si));
loop
if Analyzer.AADL_BA.Is_Initial (BA, N_Si) then
Variable := Make_Var_Declaration (
Make_Identifier ("STATE"),
Make_Identifier ("LNT_Type_States"));
BLNu.Append_Node_To_List (Variable, Var_Dec);
BLNu.Append_Node_To_List (Make_Assignment_Statement
(Make_Identifier ("STATE"), Make_Identifier (
To_Upper (BATN.Display_Name (N_Si)))),
Out_Loop);
end if;
BLNu.Append_Node_To_List (Make_Identifier (
To_Upper (BATN.Display_Name (N_Si))),
LNT_States_List);
N_Si := BATN.Next_Node (N_Si);
exit when No (N_Si);
end loop;
Si := BATN.Next_Node (Si);
exit when No (Si);
end loop;
end if;
if not BANu.Is_Empty (BATN.Variables (BA)) then
Vi := BATN.First_Node (BATN.Variables (BA));
loop
N_Vi := BATN.First_Node (BATN.Identifiers (Vi));
loop
BLNu.Append_Node_To_List (Make_Identifier (
To_Upper (BATN.Display_Name (N_Vi))),
LNT_States_List);
N_Vi := BATN.Next_Node (N_Vi);
exit when No (N_Vi);
end loop;
Vi := BATN.Next_Node (Vi);
exit when No (Vi);
end loop;
end if;
end if;
S := AIN.Next_Node (S);
exit when No (S);
end loop;
end if;
-- end BA mapping
if not AINU.Is_Empty (Features (E)) then if not AINU.Is_Empty (Features (E)) then
S := AIN.First_Node (Features (E)); S := AIN.First_Node (Features (E));
loop loop
if (AIN.Kind (S) = K_Port_Spec_Instance) then if (AIN.Kind (S) = K_Port_Spec_Instance) then
-- gate identifier
N_Port := New_Identifier (To_Upper (AIN.Name N_Port := New_Identifier (To_Upper (AIN.Name
(AIN.Identifier (S))), "AADL_PORT_"); (AIN.Identifier (S))), "PORT_");
-- variable identifier
N_Variable_Port := Make_Identifier (To_Upper (AIN.Name
(AIN.Identifier (S))));
Aux_N_Variable_Port := BLNu.Make_Node_Container
(N_Variable_Port);
-- port variable
Variable := Make_Var_Declaration (N_Variable_Port,
Make_Identifier ("LNT_Type_Data"));
BLNu.Append_Node_To_List (Variable, Var_Dec);
-- gate declaration
Gate := Make_Gate_Declaration ( Gate := Make_Gate_Declaration (
Make_Identifier ("LNT_Channel_Data"), N_Port); Make_Identifier ("LNT_Channel_Port"), N_Port);
BLNu.Append_Node_To_List (Gate, L_Gates); BLNu.Append_Node_To_List (Gate, L_Gates);
-- gate communication
Communication := Make_Communication_Statement
(N_Port, New_List (Make_Identifier ("AADLDATA")));
Aux_Communication := BLNu.Make_Node_Container (Communication);
if AIN.Is_Out (S) then if AIN.Is_Out (S) then
-- port variable initialization
if Has_BA then
BLNu.Append_Node_To_List (Make_Assignment_Statement
(Aux_N_Variable_Port, Make_Identifier ("NONE")),
Out_Loop);
else
BLNu.Append_Node_To_List (Make_Assignment_Statement
(Aux_N_Variable_Port, Make_Identifier ("AADLDATA")),
Out_Loop);
end if;
Communication := Make_Communication_Statement
(N_Port, New_List (Make_Offer_Statement
(No_Node, N_Variable_Port, false)));
Aux_Communication := BLNu.Make_Node_Container
(Communication);
BLNu.Append_Node_To_List (Communication, L_Out_Port); BLNu.Append_Node_To_List (Communication, L_Out_Port);
BLNu.Append_Node_To_List BLNu.Append_Node_To_List (Aux_Communication, L_End);
(Aux_Communication, L_End);
elsif AIN.Is_In (S) then elsif AIN.Is_In (S) then
-- port variable initialization
if Has_BA then
BLNu.Append_Node_To_List (Make_Assignment_Statement
(Aux_N_Variable_Port, Make_Identifier ("NONE")),
Out_Loop);
else
BLNu.Append_Node_To_List (Make_Assignment_Statement
(Aux_N_Variable_Port, Make_Identifier ("EMPTY")),
Out_Loop);
end if;
Communication := Make_Communication_Statement
(N_Port, New_List (Make_Offer_Statement
(No_Node, N_Variable_Port, true)));
Aux_Communication := BLNu.Make_Node_Container
(Communication);
BLNu.Append_Node_To_List (Communication, L_In_Port); BLNu.Append_Node_To_List (Communication, L_In_Port);
BLNu.Append_Node_To_List BLNu.Append_Node_To_List (Aux_Communication, L_Begin);
(Aux_Communication, L_Begin);
end if; end if;
end if; end if;
-- Visit (Corresponding_Instance (S));
S := AIN.Next_Node (S); S := AIN.Next_Node (S);
exit when No (S); exit when No (S);
end loop; end loop;
...@@ -268,10 +390,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -268,10 +390,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
not BLNu.Is_Empty (L_End) or else not BLNu.Is_Empty (L_End) or else
not BLNu.Is_Empty (L_All)) not BLNu.Is_Empty (L_All))
then then
N_Loop := Make_Loop_Statement ( In_Select := New_List (
New_List (
Make_Select_Statement (
New_List (
Make_Select_Statement_Alternative (New_List ( Make_Select_Statement_Alternative (New_List (
Make_Select_Statement ( Make_Select_Statement (
New_List ( New_List (
...@@ -280,17 +399,21 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -280,17 +399,21 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
Make_Select_Statement_Alternative (L_All), Make_Select_Statement_Alternative (L_All),
Make_Select_Statement_Alternative (New_List ( Make_Select_Statement_Alternative (New_List (
Make_Communication_Statement Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_Preempt"))))))), (N_Activation, New_List (Make_Identifier ("T_Preemption"))))))),
Make_Communication_Statement Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_Ok"))))), (N_Activation, New_List (Make_Identifier ("T_Complete"))))),
Make_Select_Statement_Alternative (New_List ( Make_Select_Statement_Alternative (New_List (
Make_Communication_Statement Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_Error"))))), (N_Activation, New_List (Make_Identifier ("T_Error"))))),
Make_Select_Statement_Alternative (New_List ( Make_Select_Statement_Alternative (New_List (
Make_Communication_Statement Make_Communication_Statement
(N_Activation, New_List (Make_Identifier ("T_Stop"))))))))); (N_Activation, New_List (Make_Identifier ("T_Stop"))))));
L_Statements := BLNu.New_List (N_Loop); L_Statements := BLNu.New_List (
Make_Var_Loop_Select (
Var_Dec,
Out_Loop,
In_Select));
else else
L_Statements := BLNu.New_List (Make_Null_Statement); L_Statements := BLNu.New_List (Make_Null_Statement);
end if; end if;
...@@ -338,10 +461,10 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is ...@@ -338,10 +461,10 @@ package body Ocarina.Backends.LNT.Tree_Generator_Thread is
loop loop
if (AIN.Kind (S) = K_Port_Spec_Instance) then if (AIN.Kind (S) = K_Port_Spec_Instance) then
N_Port := New_Identifier (To_Upper (AIN.Name N_Port := New_Identifier (To_Upper (AIN.Name
(AIN.Identifier (S))), "AADL_PORT_"); (AIN.Identifier (S))), "PORT_");
Gate := Make_Gate_Declaration ( Gate := Make_Gate_Declaration (
Make_Identifier ("LNT_Channel_Data"), N_Port); Make_Identifier ("LNT_Channel_Port"), N_Port);
Communication := Make_Communication_Statement Communication := Make_Communication_Statement
(N_Port, New_List (Make_Identifier ("AADLDATA"))); (N_Port, New_List (Make_Identifier ("AADLDATA")));
......
...@@ -108,19 +108,19 @@ package body Ocarina.Backends.LNT.Tree_Generator_Types is ...@@ -108,19 +108,19 @@ package body Ocarina.Backends.LNT.Tree_Generator_Types is
Make_Type_Exp ( Make_Type_Exp (
No_Node, No_Node,
New_List ( New_List (
Make_Type_Constructor (Make_Identifier ("T_Begin"), Make_Type_Constructor (Make_Identifier
No_List, No_List), ("T_Dispatch_Preemption"), No_List, No_List),
Make_Type_Constructor (Make_Identifier ("T_End"), Make_Type_Constructor (Make_Identifier
No_List, No_List), ("T_Preemption_Completion"), No_List, No_List),
Make_Type_Constructor (Make_Identifier ("T_All"), Make_Type_Constructor (Make_Identifier
No_List, No_List), ("T_Dispatch_Completion"), No_List, No_List),
Make_Type_Constructor (Make_Identifier ("T_Preempt"), Make_Type_Constructor (Make_Identifier
No_List, No_List), ("T_Preemption"), No_List, No_List),
Make_Type_Constructor (Make_Identifier ("T_Stop"), Make_Type_Constructor (Make_Identifier ("T_Stop"),
No_List, No_List), No_List, No_List),
Make_Type_Constructor (Make_Identifier ("T_Error"), Make_Type_Constructor (Make_Identifier ("T_Error"),
No_List, No_List), No_List, No_List),
Make_Type_Constructor (Make_Identifier ("T_Ok"), Make_Type_Constructor (Make_Identifier ("T_Complete"),
No_List, No_List)), No_List, No_List)),
false, false, false, false, false, false), false, false, false, false, false, false),
No_List, No_List,
...@@ -140,7 +140,18 @@ package body Ocarina.Backends.LNT.Tree_Generator_Types is ...@@ -140,7 +140,18 @@ package body Ocarina.Backends.LNT.Tree_Generator_Types is
No_List, No_List,
No_List); No_List);
BLNu.Append_Node_To_List (N, L_Types); BLNu.Append_Node_To_List (N, L_Types);
-- When BA
if not Is_Empty (LNT_States_List) then
N := Make_Type_Def
(Make_Identifier ("LNT_Type_States"),
Make_Type_Exp (
No_Node,
LNT_States_List,
false, false, false, false, false, false),
No_List,
No_List);
BLNu.Append_Node_To_List (N, L_Types);
end if;
end Add_LNT_Types; end Add_LNT_Types;
procedure Add_LNT_Channels (L_Channels : List_Id) is procedure Add_LNT_Channels (L_Channels : List_Id) is
...@@ -161,6 +172,31 @@ package body Ocarina.Backends.LNT.Tree_Generator_Types is ...@@ -161,6 +172,31 @@ package body Ocarina.Backends.LNT.Tree_Generator_Types is
Make_Gate_Profile (New_List (Make_Identifier ("LNT_Type_Event"))))); Make_Gate_Profile (New_List (Make_Identifier ("LNT_Type_Event")))));
BLNu.Append_Node_To_List (N, L_Channels); BLNu.Append_Node_To_List (N, L_Channels);
-- When BA
if not Is_Empty (LNT_States_List) then
N := Make_Channel (
Make_Identifier ("LNT_Channel_Event_Port"),
New_List (
Make_Gate_Profile (New_List (Make_Identifier
("Bool")))));
BLNu.Append_Node_To_List (N, L_Channels);
N := Make_Channel (
Make_Identifier ("LNT_Channel_Event_Data_Port"),
New_List (