Commit ba0d219e authored by julien.delange's avatar julien.delange
Browse files

* Put he kind of port for each partition port



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@2374 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent d0dda5bd
......@@ -76,6 +76,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Devices_Confvars : Node_Id;
Devices_Buses_Array : Node_Id;
Port_To_Devices : Node_Id;
Global_Port_Kind : Node_Id;
function Is_Added (P : Node_Id; E : Node_Id) return Boolean;
function Added_Internal_Name (P : Node_Id; E : Node_Id) return Name_Id;
......@@ -1142,6 +1143,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Global_Port_List := New_List (CTN.K_Enumeration_Literals);
Global_Port_Names := Make_Array_Values;
Global_Port_Model_Names := Make_Array_Values;
Global_Port_Kind := Make_Array_Values;
Global_Port_To_Entity := Make_Array_Values;
Global_Port_To_Local := Make_Array_Values;
Entity_Enumerator_List := New_List (CTN.K_Enumeration_Literals);
......@@ -1384,10 +1386,74 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
N := Make_Literal
(CV.New_Pointed_Char_Value
(Display_Name (Identifier (F))));
(To_Lower
(Display_Name (Identifier (F)))));
Append_Node_To_List
(N, CTN.Values (Global_Port_Model_Names));
if Is_In (F) then
if Get_Connection_Pattern (F) = Intra_Process then
if Is_Data (F) and then Is_Event (F) then
Append_Node_To_List
(RE (RE_In_Event_Data_Intra_Process),
CTN.Values (Global_Port_Kind));
elsif Is_Data (F) and then not Is_Event (F) then
Append_Node_To_List
(RE (RE_In_Data_Intra_Process),
CTN.Values (Global_Port_Kind));
else
Append_Node_To_List
(RE (RE_In_Event_Intra_Process),
CTN.Values (Global_Port_Kind));
end if;
else
if Is_Data (F) and then Is_Event (F) then
Append_Node_To_List
(RE (RE_In_Event_Data_Inter_Process),
CTN.Values (Global_Port_Kind));
elsif Is_Data (F) and then not Is_Event (F) then
Append_Node_To_List
(RE (RE_In_Data_Inter_Process),
CTN.Values (Global_Port_Kind));
else
Append_Node_To_List
(RE (RE_In_Event_Inter_Process),
CTN.Values (Global_Port_Kind));
end if;
end if;
elsif Is_Out (F) then
if Get_Connection_Pattern (F) = Intra_Process then
if Is_Data (F) and then Is_Event (F) then
Append_Node_To_List
(RE (RE_Out_Event_Data_Intra_Process),
CTN.Values (Global_Port_Kind));
elsif Is_Data (F) and then not Is_Event (F) then
Append_Node_To_List
(RE (RE_Out_Data_Intra_Process),
CTN.Values (Global_Port_Kind));
else
Append_Node_To_List
(RE (RE_Out_Event_Intra_Process),
CTN.Values (Global_Port_Kind));
end if;
else
if Is_Data (F) and then Is_Event (F) then
Append_Node_To_List
(RE (RE_Out_Event_Data_Inter_Process),
CTN.Values (Global_Port_Kind));
elsif Is_Data (F) and then not Is_Event (F) then
Append_Node_To_List
(RE (RE_Out_Data_Inter_Process),
CTN.Values (Global_Port_Kind));
else
Append_Node_To_List
(RE (RE_Out_Event_Inter_Process),
CTN.Values (Global_Port_Kind));
end if;
end if;
end if;
N := Make_Expression
(Make_Defining_Identifier
(Map_C_Enumerator_Name (F)),
......@@ -1715,6 +1781,22 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
CTN.Global_Model_Names_Node
(Backend_Node (Identifier (S))));
Append_Node_To_List (N, CTN.Declarations (Current_File));
N := Make_Expression
(Left_Expr =>
Make_Variable_Declaration
(Defining_Identifier =>
Make_Array_Declaration
(Defining_Identifier =>
RE (RE_Port_Global_Kind),
Array_Size =>
RE (RE_Nb_Ports)),
Used_Type =>
RE (RE_Port_Kind_T)),
Operator => Op_Equal,
Right_Expr =>
Global_Port_Kind);
Append_Node_To_List (N, CTN.Declarations (Current_File));
end if;
if Present (Backend_Node (Identifier (S))) and then
......
......@@ -169,11 +169,24 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Simulink_Init_Func, -- __PO_HI_SIMULINK_INIT
RE_Simulink_Model_Type, -- __PO_HI_SIMULINK_MODEL
RE_Nb_Tasks, -- __PO_HI_NB_TASKS
RE_In_Data_Inter_Process,
RE_In_Data_Intra_Process,
RE_Out_Data_Inter_Process,
RE_Out_Data_Intra_Process,
RE_In_Event_Inter_Process,
RE_In_Event_Intra_Process,
RE_Out_Event_Inter_Process,
RE_Out_Event_Intra_Process,
RE_In_Event_Data_Inter_Process,
RE_In_Event_Data_Intra_Process,
RE_Out_Event_Data_Inter_Process,
RE_Out_Event_Data_Intra_Process,
RE_Need_Driver_Sockets, -- __PO_HI_NEED_DRIVER_SOCKETS
RE_SUCCESS, -- __PO_HI_SUCCESS
RE_Task_Id, -- __po_hi_task_id
RE_Device_Id, -- __po_hi_device_id
RE_Port_Kind_T, -- __po_hi_port_kind_t
RE_Bus_Id, -- __po_hi_bus_id
RE_Entity_T, -- __po_hi_entity_t
RE_Inetport_T, -- __po_hi_inetport_t
......@@ -214,6 +227,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Port_Global_To_Entity, -- __po_hi_port_global_to_entity
RE_Port_Global_To_Device, -- __po_hi_port_global_to_device
RE_Port_Global_Names, -- __po_hi_port_global_names
RE_Port_Global_Kind, -- __po_hi_port_global_kind
RE_Mynode, -- __po_hi_mynode
RE_Node_Port, -- __po_hi_node_port
RE_Node_Addr, -- __po_hi_node_addr
......@@ -325,6 +339,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Asn1_Pkt_T => RH_PO_HI_Marshallers,
RE_Asn1_Buffer_T => RH_PO_HI_Marshallers,
RE_Bool_T => RH_PO_HI_Types,
RE_Port_Kind_T => RH_PO_HI_Types,
RE_Uint8_T => RH_PO_HI_Types,
RE_Int8_T => RH_PO_HI_Types,
RE_Uint16_T => RH_PO_HI_Types,
......@@ -375,6 +390,18 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Bigendian => RH_PO_HI_Transport,
RE_Littleendian => RH_PO_HI_Transport,
RE_Nb_Tasks => RH_Deployment,
RE_In_Data_Inter_Process => RH_PO_HI_Types,
RE_In_Data_Intra_Process => RH_PO_HI_Types,
RE_Out_Data_Inter_Process => RH_PO_HI_Types,
RE_Out_Data_Intra_Process => RH_PO_HI_Types,
RE_In_Event_Inter_Process => RH_PO_HI_Types,
RE_In_Event_Intra_Process => RH_PO_HI_Types,
RE_Out_Event_Inter_Process => RH_PO_HI_Types,
RE_Out_Event_Intra_Process => RH_PO_HI_Types,
RE_In_Event_Data_Inter_Process => RH_PO_HI_Types,
RE_In_Event_Data_Intra_Process => RH_PO_HI_Types,
RE_Out_Event_Data_Inter_Process => RH_PO_HI_Types,
RE_Out_Event_Data_Intra_Process => RH_PO_HI_Types,
RE_Need_Driver_Sockets => RH_Deployment,
RE_SUCCESS => RH_PO_HI_Returns,
......@@ -390,6 +417,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Port_Global_To_Entity => RH_Deployment,
RE_Port_Global_To_Device => RH_Deployment,
RE_Port_Global_Names => RH_Deployment,
RE_Port_Global_Kind => RH_Deployment,
RE_Mynode => RH_Deployment,
RE_Node_Port => RH_Deployment,
RE_Node_Addr => RH_Deployment,
......
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