Commit dd7f358e authored by yoogx's avatar yoogx
Browse files

* Minor reformatting

parent 9dd73496
......@@ -245,15 +245,12 @@ package Ocarina.Backends.Properties is
Access_None);
type Supported_Concurrency_Control_Protocol is -- XXX
(None_Specified,
Priority_Inheritance,
Priority_Ceiling);
(None_Specified, Priority_Inheritance, Priority_Ceiling);
type Supported_IEEE754_Precision is
(Precision_Simple, Precision_Double, Precision_None);
type Supported_Number_Representation is
(Signed, Unsigned, None);
type Supported_Number_Representation is (Signed, Unsigned, None);
function Get_Base_Type (D : Node_Id) return List_Id;
-- Return the component instance that defines the base data type
......
......@@ -3363,8 +3363,8 @@ package body Ocarina.Backends.Utils is
-----------------------
function Is_Protected_Data (Data_Component : Node_Id) return Boolean is
Concurrency_Protocol : constant Supported_Concurrency_Control_Protocol
:= Get_Concurrency_Protocol (Data_Component);
Concurrency_Protocol : constant Supported_Concurrency_Control_Protocol :=
Get_Concurrency_Protocol (Data_Component);
begin
return Concurrency_Protocol = Priority_Ceiling;
end Is_Protected_Data;
......@@ -3932,24 +3932,23 @@ package body Ocarina.Backends.Utils is
-- Get_Root_Component --
------------------------
function Get_Root_Component (C : Node_Id)
return Node_Id is
function Get_Root_Component (C : Node_Id) return Node_Id is
begin
if (Parent_Subcomponent (C) = No_Node) then
return C;
end if;
return Get_Root_Component
(Parent_Component (Parent_Subcomponent (C)));
return Get_Root_Component (Parent_Component (Parent_Subcomponent (C)));
end Get_Root_Component;
-----------------------------
-- Find_Associated_Process --
-----------------------------
function Find_Associated_Process (Runtime : Node_Id;
Root_Node : Node_Id := No_Node)
return Node_Id is
function Find_Associated_Process
(Runtime : Node_Id;
Root_Node : Node_Id := No_Node) return Node_Id
is
T : Node_Id;
S : Node_Id;
Current_Node : Node_Id;
......@@ -3960,8 +3959,8 @@ package body Ocarina.Backends.Utils is
Current_Node := Root_Node;
end if;
if Get_Category_Of_Component (Current_Node) = CC_Process and then
Get_Bound_Processor (Current_Node) = Runtime
if Get_Category_Of_Component (Current_Node) = CC_Process
and then Get_Bound_Processor (Current_Node) = Runtime
then
return Current_Node;
end if;
......@@ -3969,8 +3968,7 @@ package body Ocarina.Backends.Utils is
if not AAU.Is_Empty (Subcomponents (Current_Node)) then
S := First_Node (Subcomponents (Current_Node));
while Present (S) loop
T := Find_Associated_Process
(Runtime, Corresponding_Instance (S));
T := Find_Associated_Process (Runtime, Corresponding_Instance (S));
if T /= No_Node then
return T;
......@@ -3987,9 +3985,10 @@ package body Ocarina.Backends.Utils is
-- Get_Partition_Runtime --
---------------------------
function Get_Partition_Runtime (Process : Node_Id;
Root_Node : Node_Id := No_Node)
return Node_Id is
function Get_Partition_Runtime
(Process : Node_Id;
Root_Node : Node_Id := No_Node) return Node_Id
is
T : Node_Id;
S : Node_Id;
Current_Node : Node_Id;
......@@ -4009,8 +4008,7 @@ package body Ocarina.Backends.Utils is
if not AAU.Is_Empty (Subcomponents (Current_Node)) then
S := First_Node (Subcomponents (Current_Node));
while Present (S) loop
T := Get_Partition_Runtime
(Process, Corresponding_Instance (S));
T := Get_Partition_Runtime (Process, Corresponding_Instance (S));
if T /= No_Node then
return T;
......@@ -4036,9 +4034,10 @@ package body Ocarina.Backends.Utils is
-- core. This is the case when we want to allocate one process
-- to a core.
Core_Id := Properties.Get_Core_Id (Get_Bound_Processor
(Corresponding_Instance
(Get_Container_Process (D))));
Core_Id :=
Properties.Get_Core_Id
(Get_Bound_Processor
(Corresponding_Instance (Get_Container_Process (D))));
-- Then, we check whether the thread is directly bound to a core
......
......@@ -476,16 +476,15 @@ package Ocarina.Backends.Utils is
function Get_Associated_Bus (Port : Node_Id) return Node_Id;
function Find_Associated_Process (Runtime : Node_Id;
Root_Node : Node_Id := No_Node)
return Node_Id;
function Find_Associated_Process
(Runtime : Node_Id;
Root_Node : Node_Id := No_Node) return Node_Id;
function Get_Partition_Runtime (Process : Node_Id;
Root_Node : Node_Id := No_Node)
return Node_Id;
function Get_Partition_Runtime
(Process : Node_Id;
Root_Node : Node_Id := No_Node) return Node_Id;
function Get_Root_Component (C : Node_Id)
return Node_Id;
function Get_Root_Component (C : Node_Id) return Node_Id;
function Get_Core_Id (D : Node_Id) return Unsigned_Long_Long;
-- Return the id of the core D is bound to
......
......@@ -185,9 +185,7 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is
end loop;
end if;
Append_Node_To_List
(Connections_Node,
XTN.Subitems (Current_XML_Node));
Append_Node_To_List (Connections_Node, XTN.Subitems (Current_XML_Node));
Pop_Entity;
Pop_Entity;
......@@ -218,43 +216,43 @@ package body Ocarina.Backends.Vxworks653_Conf.Connections is
Partition_Destination := Parent_Component (Port_Destination);
Channel_Node := Make_XML_Node ("Channel");
Add_Attribute ("Id",
Trim (Unsigned_Long_Long'Image
(Channel_Identifier), Left),
Add_Attribute
("Id",
Trim (Unsigned_Long_Long'Image (Channel_Identifier), Left),
Channel_Node);
Source_Node := Make_XML_Node ("Source");
Add_Attribute ("PartitionNameRef",
Get_Name_String
(Map_Partition_Name (E)),
Add_Attribute
("PartitionNameRef",
Get_Name_String (Map_Partition_Name (E)),
Source_Node);
Add_Attribute ("PortNameRef",
Get_Name_String
(C_Common.Mapping.Map_Port_Name
(Port_Source)),
Add_Attribute
("PortNameRef",
Get_Name_String (C_Common.Mapping.Map_Port_Name (Port_Source)),
Source_Node);
Append_Node_To_List (Source_Node,
XTN.Subitems (Channel_Node));
Append_Node_To_List (Source_Node, XTN.Subitems (Channel_Node));
Destination_Node := Make_XML_Node ("Destination");
Add_Attribute ("PortNameRef",
Add_Attribute
("PortNameRef",
Get_Name_String
(C_Common.Mapping.Map_Port_Name
(Port_Destination)),
(C_Common.Mapping.Map_Port_Name (Port_Destination)),
Destination_Node);
Add_Attribute ("PartitionNameRef",
Add_Attribute
("PartitionNameRef",
Get_Name_String
(Map_Partition_Name
(Get_Partition_Runtime
(Partition_Destination))),
(Get_Partition_Runtime (Partition_Destination))),
Destination_Node);
Append_Node_To_List (Destination_Node,
Append_Node_To_List
(Destination_Node,
XTN.Subitems (Channel_Node));
Append_Node_To_List (Channel_Node,
Append_Node_To_List
(Channel_Node,
XTN.Subitems (Connections_Node));
Channel_Identifier := Channel_Identifier + 1;
......
......@@ -68,11 +68,13 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
procedure Visit_Bus_Instance (E : Node_Id);
procedure Visit_Virtual_Processor_Instance (E : Node_Id);
procedure Add_System_Error (XML_Node : Node_Id;
procedure Add_System_Error
(XML_Node : Node_Id;
Identifier : String;
Description : String);
procedure Add_Error_Action (XML_Node : Node_Id;
procedure Add_Error_Action
(XML_Node : Node_Id;
Identifier : String;
Action : String);
......@@ -190,32 +192,34 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
-- Add_System_Error --
------------------------
procedure Add_System_Error (XML_Node : Node_Id;
procedure Add_System_Error
(XML_Node : Node_Id;
Identifier : String;
Description : String) is
Description : String)
is
Intermediate : Node_Id;
begin
Intermediate := Make_XML_Node ("SystemError");
XTU.Add_Attribute ("ErrorIdentifier", Identifier, Intermediate);
XTU.Add_Attribute ("Description", Description, Intermediate);
Append_Node_To_List
(Intermediate, XTN.Subitems (XML_Node));
Append_Node_To_List (Intermediate, XTN.Subitems (XML_Node));
end Add_System_Error;
------------------------
-- Add_Error_Action --
------------------------
procedure Add_Error_Action (XML_Node : Node_Id;
procedure Add_Error_Action
(XML_Node : Node_Id;
Identifier : String;
Action : String) is
Action : String)
is
Intermediate : Node_Id;
begin
Intermediate := Make_XML_Node ("ErrorIDAction");
XTU.Add_Attribute ("ErrorIdentifier", Identifier, Intermediate);
XTU.Add_Attribute ("ErrorAction", Action, Intermediate);
Append_Node_To_List
(Intermediate, XTN.Subitems (XML_Node));
Append_Node_To_List (Intermediate, XTN.Subitems (XML_Node));
end Add_Error_Action;
------------------------------
......@@ -254,53 +258,58 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
Append_Node_To_List (System_HM_Table_Node, XTN.Subitems (HM_Node));
System_State_Node := Make_XML_Node ("SystemState");
XTU.Add_Attribute ("SystemState",
XTU.Add_Attribute
("SystemState",
"HM_PARTITION_MODE",
System_State_Node);
Append_Node_To_List (System_State_Node,
Append_Node_To_List
(System_State_Node,
XTN.Subitems (System_HM_Table_Node));
Error_Id_Level_Node := Make_XML_Node ("ErrorIDLevel");
XTU.Add_Attribute ("ErrorIdentifier",
XTU.Add_Attribute
("ErrorIdentifier",
"HME_DEFAULT",
Error_Id_Level_Node);
XTU.Add_Attribute ("ErrorLevel",
XTU.Add_Attribute
("ErrorLevel",
"HM_PARTITION_LVL",
Error_Id_Level_Node);
Append_Node_To_List (Error_Id_Level_Node,
Append_Node_To_List
(Error_Id_Level_Node,
XTN.Subitems (System_State_Node));
System_State_Node := Make_XML_Node ("SystemState");
XTU.Add_Attribute ("SystemState",
"HM_MODULE_MODE",
System_State_Node);
Append_Node_To_List (System_State_Node,
XTU.Add_Attribute ("SystemState", "HM_MODULE_MODE", System_State_Node);
Append_Node_To_List
(System_State_Node,
XTN.Subitems (System_HM_Table_Node));
Error_Id_Level_Node := Make_XML_Node ("ErrorIDLevel");
XTU.Add_Attribute ("ErrorIdentifier",
XTU.Add_Attribute
("ErrorIdentifier",
"HME_DEFAULT",
Error_Id_Level_Node);
XTU.Add_Attribute ("ErrorLevel",
"HM_MODULE_LVL",
Error_Id_Level_Node);
Append_Node_To_List (Error_Id_Level_Node,
XTU.Add_Attribute ("ErrorLevel", "HM_MODULE_LVL", Error_Id_Level_Node);
Append_Node_To_List
(Error_Id_Level_Node,
XTN.Subitems (System_State_Node));
System_State_Node := Make_XML_Node ("SystemState");
XTU.Add_Attribute ("SystemState",
"HM_PROCESS_MODE",
System_State_Node);
Append_Node_To_List (System_State_Node,
XTU.Add_Attribute ("SystemState", "HM_PROCESS_MODE", System_State_Node);
Append_Node_To_List
(System_State_Node,
XTN.Subitems (System_HM_Table_Node));
Error_Id_Level_Node := Make_XML_Node ("ErrorIDLevel");
XTU.Add_Attribute ("ErrorIdentifier",
"HME_DEFAULT", Error_Id_Level_Node);
XTU.Add_Attribute ("ErrorLevel",
"HM_PROCESS_LVL", Error_Id_Level_Node);
Append_Node_To_List (Error_Id_Level_Node,
XTU.Add_Attribute
("ErrorIdentifier",
"HME_DEFAULT",
Error_Id_Level_Node);
XTU.Add_Attribute ("ErrorLevel", "HM_PROCESS_LVL", Error_Id_Level_Node);
Append_Node_To_List
(Error_Id_Level_Node,
XTN.Subitems (System_State_Node));
-- Building the ModuleHMTable then.
......@@ -310,45 +319,60 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
Append_Node_To_List (Module_HM_Table_Node, XTN.Subitems (HM_Node));
System_State_Node := Make_XML_Node ("SystemState");
Append_Node_To_List (System_State_Node,
Append_Node_To_List
(System_State_Node,
XTN.Subitems (Module_HM_Table_Node));
Add_Error_Action (System_State_Node,
"HME_UNKNOWN", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_NUMERIC_ERROR", "");
Add_Error_Action (System_State_Node,
"HME_POWER_FAIL", "hmDH_HME_POWER_FAIL");
Add_Error_Action (System_State_Node,
"HME_KERNEL", "hmDH_HME_KERNEL");
Add_Error_Action (System_State_Node,
"HME_CONFIG_ERROR", "hmDH_EventLog");
Add_Error_Action (System_State_Node,
"HME_INIT_ERROR", "hmDH_HME_INIT_ERROR");
Add_Error_Action (System_State_Node,
"HME_PARTITION_OVERFLOW", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
Add_Error_Action (System_State_Node, "HME_UNKNOWN", "hmDefaultHandler");
Add_Error_Action (System_State_Node, "HME_NUMERIC_ERROR", "");
Add_Error_Action
(System_State_Node,
"HME_POWER_FAIL",
"hmDH_HME_POWER_FAIL");
Add_Error_Action (System_State_Node, "HME_KERNEL", "hmDH_HME_KERNEL");
Add_Error_Action
(System_State_Node,
"HME_CONFIG_ERROR",
"hmDH_EventLog");
Add_Error_Action
(System_State_Node,
"HME_INIT_ERROR",
"hmDH_HME_INIT_ERROR");
Add_Error_Action
(System_State_Node,
"HME_PARTITION_OVERFLOW",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_PARTITION_MODE_SET",
"hmDH_HME_PARTITION_MODE_SET");
Add_Error_Action (System_State_Node,
"HME_APEX_INTERNAL_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_HM_INTERNAL_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_PORT_INTERNAL_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_LOST_TICKS", "hmDH_HME_LOST_TICKS");
Add_Error_Action (System_State_Node,
"HME_HM_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_HMQ_OVERFLOW", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_DATA_LOSS", "");
Add_Error_Action (System_State_Node,
"HME_HM_DEADLINE_MISSED", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HM_MSG", "hmDH_EventLog");
Add_Error_Action (System_State_Node,
"HME_DEFAULT", "hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_APEX_INTERNAL_ERROR",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_HM_INTERNAL_ERROR",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_PORT_INTERNAL_ERROR",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_LOST_TICKS",
"hmDH_HME_LOST_TICKS");
Add_Error_Action (System_State_Node, "HME_HM_ERROR", "hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_HMQ_OVERFLOW",
"hmDefaultHandler");
Add_Error_Action (System_State_Node, "HME_DATA_LOSS", "");
Add_Error_Action
(System_State_Node,
"HME_HM_DEADLINE_MISSED",
"hmDefaultHandler");
Add_Error_Action (System_State_Node, "HM_MSG", "hmDH_EventLog");
Add_Error_Action (System_State_Node, "HME_DEFAULT", "hmDefaultHandler");
if not AINU.Is_Empty (Subcomponents (E)) then
S := First_Node (Subcomponents (E));
......@@ -405,60 +429,74 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
---------------------------------
function Generate_Partition_HM_Table
(Virtual_Processor : Node_Id)
return Node_Id is
(Virtual_Processor : Node_Id) return Node_Id
is
Partition_HM_Table_Node : Node_Id;
System_State_Node : Node_Id;
Settings_Node : Node_Id;
Trusted_Partition_Node : Node_Id;
begin
Partition_HM_Table_Node := Make_XML_Node ("PartitionHMTable");
XTU.Add_Attribute ("Name",
Get_Name_String
(Map_Partition_Name (Virtual_Processor))
& "_hmtable",
XTU.Add_Attribute
("Name",
Get_Name_String (Map_Partition_Name (Virtual_Processor)) & "_hmtable",
Partition_HM_Table_Node);
System_State_Node := Make_XML_Node ("SystemState");
Append_Node_To_List (System_State_Node,
Append_Node_To_List
(System_State_Node,
XTN.Subitems (Partition_HM_Table_Node));
Add_Error_Action (System_State_Node,
"HME_UNKNOWN", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_NUMERIC_ERROR", "");
Add_Error_Action (System_State_Node,
"HME_POWER_FAIL", "hmDH_HME_POWER_FAIL");
Add_Error_Action (System_State_Node,
"HME_KERNEL", "hmDH_HME_KERNEL");
Add_Error_Action (System_State_Node,
"HME_CONFIG_ERROR", "hmDH_EventLog");
Add_Error_Action (System_State_Node,
"HME_INIT_ERROR", "hmDH_HME_INIT_ERROR");
Add_Error_Action (System_State_Node,
"HME_PARTITION_OVERFLOW", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
Add_Error_Action (System_State_Node, "HME_UNKNOWN", "hmDefaultHandler");
Add_Error_Action (System_State_Node, "HME_NUMERIC_ERROR", "");
Add_Error_Action
(System_State_Node,
"HME_POWER_FAIL",
"hmDH_HME_POWER_FAIL");
Add_Error_Action (System_State_Node, "HME_KERNEL", "hmDH_HME_KERNEL");
Add_Error_Action
(System_State_Node,
"HME_CONFIG_ERROR",
"hmDH_EventLog");
Add_Error_Action
(System_State_Node,
"HME_INIT_ERROR",
"hmDH_HME_INIT_ERROR");
Add_Error_Action
(System_State_Node,
"HME_PARTITION_OVERFLOW",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_PARTITION_MODE_SET",
"hmDH_HME_PARTITION_MODE_SET");
Add_Error_Action (System_State_Node,
"HME_APEX_INTERNAL_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_HM_INTERNAL_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_PORT_INTERNAL_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_LOST_TICKS", "hmDH_HME_LOST_TICKS");
Add_Error_Action (System_State_Node,
"HME_HM_ERROR", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_HMQ_OVERFLOW", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HME_DATA_LOSS", "");
Add_Error_Action (System_State_Node,
"HME_HM_DEADLINE_MISSED", "hmDefaultHandler");
Add_Error_Action (System_State_Node,
"HM_MSG", "hmDH_EventLog");
Add_Error_Action (System_State_Node,
"HME_DEFAULT", "hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_APEX_INTERNAL_ERROR",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_HM_INTERNAL_ERROR",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_PORT_INTERNAL_ERROR",
"hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_LOST_TICKS",
"hmDH_HME_LOST_TICKS");
Add_Error_Action (System_State_Node, "HME_HM_ERROR", "hmDefaultHandler");
Add_Error_Action
(System_State_Node,
"HME_HMQ_OVERFLOW",
"hmDefaultHandler");
Add_Error_Action (System_State_Node, "HME_DATA_LOSS", "");
Add_Error_Action
(System_State_Node,
"HME_HM_DEADLINE_MISSED",
"hmDefaultHandler");
Add_Error_Action (System_State_Node, "HM_MSG", "hmDH_EventLog");
Add_Error_Action (System_State_Node, "HME_DEFAULT", "hmDefaultHandler");
Settings_Node := Make_XML_Node ("Settings");
XTU.Add_Attribute ("maxQueueDepth", "34", Settings_Node);
......@@ -472,16 +510,17 @@ package body Ocarina.Backends.Vxworks653_Conf.Hm is
XTU.Add_Attribute ("eventFilterMask", "0xFFFFFFFF", Settings_Node);
XTU.Add_Attribute ("maxErrorHandlerQueueDepth", "128", Settings_Node);
XTU.Add_Attribute ("errorHandlerQueueThreshold", "126", Settings_Node);
Append_Node_To_List (Settings_Node,
Append_Node_To_List
(Settings_Node,
XTN.Subitems (Partition_HM_Table_Node));
Trusted_Partition_Node := Make_XML_Node ("TrustedPartition");
XTU.Add_Attribute ("NameRef",
Get_Name_String
(Map_Partition_Name
(Virtual_Processor)),
XTU.Add_Attribute
("NameRef",
Get_Name_String (Map_Partition_Name (Virtual_Processor)),
Trusted_Partition_Node);
Append_Node_To_List (Trusted_Partition_Node,
Append_Node_To_List
(Trusted_Partition_Node,
XTN.Subitems (Settings_Node));
return Partition_HM_Table_Node;
......