Commit dd7f358e authored by yoogx's avatar yoogx
Browse files

* Minor reformatting

parent 9dd73496
......@@ -294,8 +294,9 @@ package Ocarina.Backends.PO_HI_Ada.Runtime is
-- Return a designator for entity Id
function RU
(Id : RU_Id; Withed : Boolean := True; Elaborated : Boolean := False)
return Node_Id;
(Id : RU_Id;
Withed : Boolean := True;
Elaborated : Boolean := False) return Node_Id;
-- Return a node for Unit Id
end Ocarina.Backends.PO_HI_Ada.Runtime;
......@@ -385,7 +385,10 @@ package body Ocarina.Backends.PO_HI_Ada is
end if;
Write_Line
(") & external_as_list(""" & "ADA_INCLUDE_PATH" & """, """ & ":" &
(") & external_as_list(""" &
"ADA_INCLUDE_PATH" &
""", """ &
":" &
""");");
Decrement_Indentation;
......
......@@ -380,8 +380,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Entrypoint : constant Node_Id :=
Get_Thread_Activate_Entrypoint (E);
Parameter_List : constant List_Id :=
New_List (CTN.K_List_Id);
Parameter_List : constant List_Id := New_List (CTN.K_List_Id);
begin
if Entrypoint /= No_Node then
Append_Node_To_List
......@@ -1560,10 +1559,10 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Brief => "Used to deliver request to the appropriate ports",
Desc =>
"This function takes a request as argument (\arg request)" &
" and calls the appropriate function for its delivery."
& "To specify which function should be called, it "
& "extracts the receiver entity using the destination "
& "port.",
" and calls the appropriate function for its delivery." &
"To specify which function should be called, it " &
"extracts the receiver entity using the destination " &
"port.",
Has_Header_Spaces => False);
Append_Node_To_List (N, CTN.Declarations (Current_File));
......@@ -2039,9 +2038,9 @@ package body Ocarina.Backends.PO_HI_C.Activity is
"Function that delivers requests to the task " &
Get_Name_String (Name (Identifier (S))),
Desc =>
"When the generated application received a request,"
& " it calls a main delivery function that redirects"
& " to localfunctions for each task. This function (" &
"When the generated application received a request," &
" it calls a main delivery function that redirects" &
" to localfunctions for each task. This function (" &
Get_Name_String
(CTN.Name
(CTN.Defining_Identifier
......
......@@ -1396,8 +1396,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
N :=
Make_Define_Statement
(Defining_Identifier => RE (RE_Port_Type_Content),
Value =>
Make_Defining_Identifier (Nb_Ports_List_Name));
Value => Make_Defining_Identifier (Nb_Ports_List_Name));
Append_Node_To_List (N, CTN.Declarations (Current_File));
end;
......@@ -1837,7 +1836,8 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
(New_Int_Value (Local_Port_Identifier, 1, 10)));
Append_Node_To_List (N, CTN.Declarations (Current_File));
N := Make_Defining_Identifier
N :=
Make_Defining_Identifier
(Map_C_Define_Name (S, Nb_Ports => True));
Append_Node_To_List (N, Nb_Ports_List);
end if;
......
......@@ -491,8 +491,8 @@ package body Ocarina.Backends.PO_HI_C.Main is
Append_Node_To_List (N, CTN.Declarations (Current_File));
if Get_Concurrency_Protocol (Corresponding_Instance (S))
/= None_Specified
if Get_Concurrency_Protocol (Corresponding_Instance (S)) /=
None_Specified
then
N :=
Make_Expression
......@@ -501,7 +501,8 @@ package body Ocarina.Backends.PO_HI_C.Main is
(Defining_Identifier =>
Make_Defining_Identifier
(MN (M_Protected_Id)),
Aggregate_Name => Map_C_Defining_Identifier (S)),
Aggregate_Name =>
Map_C_Defining_Identifier (S)),
Operator => Op_Equal,
Right_Expr =>
CTN.Default_Value_Node
......
......@@ -157,7 +157,7 @@ package body Ocarina.Backends.PO_HI_C.Runtime is
N := New_Node (K_Defining_Identifier);
Set_Name (N, Name);
Local := E = Rh_Subprograms;
Local := E = RH_Subprograms;
RHD (E) := Make_Include_Clause (N, Local);
end loop;
......
......@@ -508,8 +508,9 @@ package body Ocarina.Backends.PO_HI_C is
Instance_Root : Node_Id;
Success : Boolean := True;
procedure Generate_PolyORB_HI_C_Makefile is
new Build_Utils.Makefiles.Generate (PolyORB_HI_C_Makefile);
procedure Generate_PolyORB_HI_C_Makefile is new Build_Utils.Makefiles
.Generate
(PolyORB_HI_C_Makefile);
begin
-- Instantiate the AADL tree
......
......@@ -1339,8 +1339,7 @@ package body Ocarina.Backends.POK_C.Activity is
then
Map_Virtual_Bus_Calls
(AIN.Item
(AIN.First_Node
(AIN.Destinations (F))),
(AIN.First_Node (AIN.Destinations (F))),
CTN.Declarations (Current_File),
WStatements,
Sending,
......@@ -1352,7 +1351,8 @@ package body Ocarina.Backends.POK_C.Activity is
Append_Node_To_List
(Make_Defining_Identifier
(Map_Port_Var
(Item (Source_Port), Current_Device)),
(Item (Source_Port),
Current_Device)),
Call_Parameters);
if Virtual_Bus_Data = No_Node then
......@@ -1542,8 +1542,8 @@ package body Ocarina.Backends.POK_C.Activity is
N := Map_Time (Get_Timeout_Value (F));
end if;
else
N := CTU.Make_Literal
(CV.New_Int_Value (0, 1, 10));
N :=
CTU.Make_Literal (CV.New_Int_Value (0, 1, 10));
end if;
Append_Node_To_List (N, Call_Parameters);
......@@ -1555,8 +1555,8 @@ package body Ocarina.Backends.POK_C.Activity is
Called_Function := RE (RE_Send_Queuing_Message);
Type_Used := RE (RE_Queuing_Port_Id_Type);
else
Called_Function := RE
(RE_Pok_Port_Queueing_Send);
Called_Function :=
RE (RE_Pok_Port_Queueing_Send);
Type_Used := RE (RE_Uint8_T);
end if;
......@@ -1570,8 +1570,7 @@ package body Ocarina.Backends.POK_C.Activity is
(Make_Variable_Declaration
(Defining_Identifier =>
(Make_Defining_Identifier
(Map_Port_Var
(Item (Source_Port)))),
(Map_Port_Var (Item (Source_Port)))),
Used_Type => Type_Used)),
CTN.Declarations (Current_File));
Append_Node_To_List (N, WStatements);
......
......@@ -1166,26 +1166,27 @@ package body Ocarina.Backends.POK_C.Deployment is
Value => CTU.Make_Literal (CV.New_Int_Value (1, 1, 10)));
CTU.Append_Node_To_List
(N, CTN.Declarations (CTU.Current_File));
when Vxworks =>
(N,
CTN.Declarations (CTU.Current_File));
when VXWORKS =>
N :=
CTU.Make_Define_Statement
(Defining_Identifier =>
RE (RE_Ocarina_Runtime_Vxworks653),
(Defining_Identifier => RE (RE_Ocarina_Runtime_Vxworks653),
Value => CTU.Make_Literal (CV.New_Int_Value (1, 1, 10)));
CTU.Append_Node_To_List
(N, CTN.Declarations (CTU.Current_File));
(N,
CTN.Declarations (CTU.Current_File));
when POK | Arinc653 =>
when POK | ARINC653 =>
N :=
CTU.Make_Define_Statement
(Defining_Identifier =>
RE (RE_Ocarina_Runtime_Pok),
(Defining_Identifier => RE (RE_Ocarina_Runtime_Pok),
Value => CTU.Make_Literal (CV.New_Int_Value (1, 1, 10)));
CTU.Append_Node_To_List
(N, CTN.Declarations (CTU.Current_File));
(N,
CTN.Declarations (CTU.Current_File));
end case;
N :=
......
......@@ -153,15 +153,11 @@ package body Ocarina.Backends.POK_C.Main is
if POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
N :=
Make_Call_Profile
(Make_Defining_Identifier
(Get_String_Name ("strcpy")),
Make_List_Id (
Make_Member_Designator
(RE (RE_Name),
Copy_Node (Tattr)),
(Make_Defining_Identifier (Get_String_Name ("strcpy")),
Make_List_Id
(Make_Member_Designator (RE (RE_Name), Copy_Node (Tattr)),
Make_Literal
(CV.New_Pointed_Char_Value
(Name (Identifier (S))))));
(CV.New_Pointed_Char_Value (Name (Identifier (S))))));
Append_Node_To_List (N, Statements);
end if;
......@@ -250,11 +246,11 @@ package body Ocarina.Backends.POK_C.Main is
if Get_Thread_Period (E) /= Null_Time then
if Use_ARINC653_API then
if POK_Flavor = POK then
Member_Value := Map_Time_To_Millisecond
(Get_Thread_Period (E));
Member_Value :=
Map_Time_To_Millisecond (Get_Thread_Period (E));
elsif POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
Member_Value := Map_Time_To_Nanosecond
(Get_Thread_Period (E));
Member_Value :=
Map_Time_To_Nanosecond (Get_Thread_Period (E));
end if;
else
Member_Value := Map_Time (Get_Thread_Period (E));
......@@ -265,7 +261,8 @@ package body Ocarina.Backends.POK_C.Main is
Make_Expression
(Left_Expr =>
Make_Member_Designator
(RE (RE_Period), Copy_Node (Tattr)),
(RE (RE_Period),
Copy_Node (Tattr)),
Operator => Op_Equal,
Right_Expr => Member_Value);
......@@ -290,15 +287,9 @@ package body Ocarina.Backends.POK_C.Main is
N :=
Make_Expression
(Left_Expr =>
Make_Member_Designator
(RE (RE_Stack_Size),
Copy_Node (Tattr)),
Make_Member_Designator (RE (RE_Stack_Size), Copy_Node (Tattr)),
Operator => Op_Equal,
Right_Expr =>
Make_Literal
(New_Int_Value (Stack_Size,
1,
10)));
Right_Expr => Make_Literal (New_Int_Value (Stack_Size, 1, 10)));
Append_Node_To_List (N, Statements);
declare
......@@ -647,21 +638,19 @@ package body Ocarina.Backends.POK_C.Main is
if Get_POK_Refresh_Time (F) /= Null_Time then
if Use_ARINC653_API then
N :=
Map_Time_To_Nanosecond
(Get_POK_Refresh_Time (F));
Map_Time_To_Nanosecond (Get_POK_Refresh_Time (F));
else
N := Map_Time (Get_POK_Refresh_Time (F));
end if;
else
if POK_Flavor = DEOS
or else POK_Flavor = VXWORKS
then
if POK_Flavor = DEOS or else POK_Flavor = VXWORKS then
--
-- DeOS needs a value to refresh the port.
--
N := CTU.Make_Literal
N :=
CTU.Make_Literal
(CV.New_Int_Value (1_000_000, 1, 10));
else
N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10));
......@@ -800,7 +789,8 @@ package body Ocarina.Backends.POK_C.Main is
-- DeOS needs a value to refresh the port.
--
N := CTU.Make_Literal
N :=
CTU.Make_Literal
(CV.New_Int_Value (1_000_000, 1, 10));
else
N := CTU.Make_Literal (CV.New_Int_Value (0, 1, 10));
......
......@@ -138,11 +138,11 @@ package body Ocarina.Backends.POK_C.Naming is
Display_Located_Error
(Loc (Parent_Subcomponent (E)),
"This device or process is not bound to a processor",
Fatal => True, Warning => False);
Fatal => True,
Warning => False);
end if;
Processes_List :=
CTN.Processes (Backend_Node (Identifier (Proc)));
Processes_List := CTN.Processes (Backend_Node (Identifier (Proc)));
N := AINU.Make_Node_Container (E);
......
......@@ -422,7 +422,8 @@ package body Ocarina.Backends.POK_C.Runtime is
-- members are in upper case. Otherwise, we use
-- lower case.
if POK_Flavor = ARINC653 or else POK_Flavor = DEOS
if POK_Flavor = ARINC653
or else POK_Flavor = DEOS
or else POK_Flavor = VXWORKS
then
Name := To_Upper (Name);
......
......@@ -195,7 +195,8 @@ package body Ocarina.Backends.POK_C is
function Use_ARINC653_API return Boolean is
begin
return POK_Flavor = ARINC653 or else POK_Flavor = DEOS
return POK_Flavor = ARINC653
or else POK_Flavor = DEOS
or else POK_Flavor = VXWORKS;
end Use_ARINC653_API;
......
......@@ -35,14 +35,11 @@ with Ocarina.Instances.Queries; use Ocarina.Instances.Queries;
with Ocarina.ME_AADL.AADL_Tree.Nutils;
with Ocarina.ME_AADL.AADL_Instances.Nutils;
with Ocarina.AADL_Values;
use Ocarina.AADL_Values;
with Ocarina.AADL_Values; use Ocarina.AADL_Values;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
use Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.ME_AADL.AADL_Tree.Nodes; use Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.Backends.Properties.Utils;
use Ocarina.Backends.Properties.Utils;
with Ocarina.Backends.Properties.Utils; use Ocarina.Backends.Properties.Utils;
package body Ocarina.Backends.Properties.ARINC653 is
......@@ -76,16 +73,15 @@ package body Ocarina.Backends.Properties.ARINC653 is
-- Schedule_Window_Name := Get_String_Name
-- ("arinc::schedule_window");
Module_Schedule_Name := Get_String_Name
("arinc653::module_schedule");
Module_Schedule_Name := Get_String_Name ("arinc653::module_schedule");
Partition_Name := Get_String_Name ("partition");
Duration_Name := Get_String_Name ("duration");
Periodic_Processing_Start_Name
:= Get_String_Name ("periodic_processing_start");
Periodic_Processing_Start_Name :=
Get_String_Name ("periodic_processing_start");
Partition_Identifier_Name
:= Get_String_Name ("arinc653::partition_identifier");
Partition_Identifier_Name :=
Get_String_Name ("arinc653::partition_identifier");
Is_Initialized := True;
end Init;
......@@ -95,12 +91,12 @@ package body Ocarina.Backends.Properties.ARINC653 is
----------------------------------
function Get_Module_Schedule_Property
(E : Node_Id)
return Schedule_Window_Record_Term_Array
(E : Node_Id) return Schedule_Window_Record_Term_Array
is
pragma Assert (True or else
AINU.Is_Processor (E) or else
AINU.Is_Virtual_Processor (E));
pragma Assert
(True
or else AINU.Is_Processor (E)
or else AINU.Is_Virtual_Processor (E));
Property_Value : List_Id;
......@@ -132,15 +128,14 @@ package body Ocarina.Backends.Properties.ARINC653 is
-- Partition is a component reference
Result (J).Partition :=
Entity
(Reference_Term (Property_Expression (L)));
Entity (Reference_Term (Property_Expression (L)));
elsif Name (Identifier (L)) = Duration_Name then
Result (J).Duration := Convert_Value_To_Time_Type
(Property_Expression (L));
Result (J).Duration :=
Convert_Value_To_Time_Type (Property_Expression (L));
elsif Name (Identifier (L))
= Periodic_Processing_Start_Name
elsif Name (Identifier (L)) =
Periodic_Processing_Start_Name
then
-- Periodic_Processing_Start is an aadlboolean,
-- the corresponding Property_expression is thus
......@@ -170,9 +165,7 @@ package body Ocarina.Backends.Properties.ARINC653 is
-- Get_Partition_Identifier --
------------------------------
function Get_Partition_Identifier
(P : Node_Id)
return Unsigned_Long_Long is
function Get_Partition_Identifier (P : Node_Id) return Unsigned_Long_Long is
begin
return Check_And_Get_Property (P, Partition_Identifier_Name);
end Get_Partition_Identifier;
......
......@@ -40,19 +40,16 @@ package Ocarina.Backends.Properties.ARINC653 is
Periodic_Processing_Start : Boolean;
end record;
type Schedule_Window_Record_Term_Array is array (Natural range <>)
of Schedule_Window_Record_Term;
type Schedule_Window_Record_Term_Array is
array (Natural range <>) of Schedule_Window_Record_Term;
Empty_Schedule_Window_Record_Term_Array :
constant Schedule_Window_Record_Term_Array (1 .. 0)
:= (others => (No_Node, (0, Picosecond), False));
constant Schedule_Window_Record_Term_Array (1 .. 0) :=
(others => (No_Node, (0, Picosecond), False));
function Get_Module_Schedule_Property
(E : Node_Id)
return Schedule_Window_Record_Term_Array;
(E : Node_Id) return Schedule_Window_Record_Term_Array;
function Get_Partition_Identifier
(P : Node_Id)
return Unsigned_Long_Long;
function Get_Partition_Identifier (P : Node_Id) return Unsigned_Long_Long;
end Ocarina.Backends.Properties.ARINC653;
......@@ -36,7 +36,7 @@ with Ocarina.Namet;
with Charset; use Charset;
with Utils;
with Ocarina.ME_AADL.AADL_Tree.Nodes;
with Ocarina.ME_AADL.AADL_Tree.NUtils;
with Ocarina.ME_AADL.AADL_Tree.Nutils;
package body Ocarina.Backends.Properties.Utils is
......@@ -48,7 +48,7 @@ package body Ocarina.Backends.Properties.Utils is
package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package ATNU renames Ocarina.ME_AADL.AADL_Tree.NUtils;
package ATNU renames Ocarina.ME_AADL.AADL_Tree.Nutils;
use type ATN.Node_Kind;
function SA (S : String) return String_Access is (new String'(S));
......@@ -58,25 +58,23 @@ package body Ocarina.Backends.Properties.Utils is
-----------------------------------------
function Print_Value_Of_Property_Association
(AADL_Property_Value : Node_Id)
return String;
(AADL_Property_Value : Node_Id) return String;
function Print_Value_Of_Property_Association
(AADL_Property_Value : Node_Id)
return String is
(AADL_Property_Value : Node_Id) return String
is
begin
if Present (AADL_Property_Value)
and then ATN.Kind (AADL_Property_Value) = ATN.K_Signed_AADLNumber
then
return Ocarina.AADL_Values.Image
(ATN.Value
(ATN.Number_Value
(AADL_Property_Value)))
& " "
& (if Present (ATN.Unit_Identifier (AADL_Property_Value))
then Get_Name_String
(ATN.Display_Name
(ATN.Unit_Identifier (AADL_Property_Value)))
(ATN.Value (ATN.Number_Value (AADL_Property_Value))) &
" " &
(if
Present (ATN.Unit_Identifier (AADL_Property_Value))
then
Get_Name_String
(ATN.Display_Name (ATN.Unit_Identifier (AADL_Property_Value)))
else "");
elsif Present (AADL_Property_Value)
......@@ -85,26 +83,27 @@ package body Ocarina.Backends.Properties.Utils is
-- This property value denotes a literal
return Ocarina.AADL_Values.Image
(ATN.Value (AADL_Property_Value), Quoted => False);
(ATN.Value (AADL_Property_Value),
Quoted => False);
elsif Present (AADL_Property_Value)
and then ATN.Kind (AADL_Property_Value) = ATN.K_Reference_Term
then
-- This property value denotes a reference term
return Get_Name_String (ATN.Display_Name
return Get_Name_String
(ATN.Display_Name
(ATN.First_Node -- XXX must iterate
(ATN.List_Items
(ATN.Reference_Term
(AADL_Property_Value)))));
(ATN.Reference_Term (AADL_Property_Value)))));
elsif Present (AADL_Property_Value)
and then ATN.Kind (AADL_Property_Value) = ATN.K_Enumeration_Term
then
-- This property value denotes an enumeration term
return Get_Name_String (ATN.Display_Name
(ATN.Identifier (AADL_Property_Value)));
return Get_Name_String
(ATN.Display_Name (ATN.Identifier (AADL_Property_Value)));
elsif Present (AADL_Property_Value)
and then ATN.Kind (AADL_Property_Value) = ATN.K_Number_Range_Term
......@@ -113,31 +112,27 @@ package body Ocarina.Backends.Properties.Utils is
return Ocarina.AADL_Values.Image
(ATN.Value
(ATN.Number_Value
(ATN.Lower_Bound
(AADL_Property_Value))))
&
(if Present
(ATN.Unit_Identifier
(ATN.Lower_Bound (AADL_Property_Value)))
(ATN.Number_Value (ATN.Lower_Bound (AADL_Property_Value)))) &
(if
Present
(ATN.Unit_Identifier (ATN.Lower_Bound (AADL_Property_Value)))
then
" " & Get_Name_String
" " &
Get_Name_String
(ATN.Display_Name
(ATN.Unit_Identifier
(ATN.Lower_Bound (AADL_Property_Value))))
else "")
& " .. "
& Ocarina.AADL_Values.Image
else "") &
" .. " &
Ocarina.AADL_Values.Image
(ATN.Value
(ATN.Number_Value
(ATN.Upper_Bound
(AADL_Property_Value))))
&
(if Present
(ATN.Unit_Identifier
(ATN.Upper_Bound (AADL_Property_Value)))
(ATN.Number_Value (ATN.Upper_Bound (AADL_Property_Value)))) &
(if
Present