Commit ccc57b49 authored by yoogx's avatar yoogx

Merge branch 'master' of https://github.com/yoogx/ocarina

parents 0e89cc28 15aac56d
......@@ -1011,6 +1011,60 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
return Sampling_Port;
end Map_Sampling_Port;
----------------------
-- Map_Queuing_Port --
----------------------
function Map_Queuing_Port (Port : Node_Id) return Node_Id is
Queuing_Port : Node_Id;
Size : Unsigned_Long_Long;
Queue_Size : Long_Long;
begin
Queuing_Port := Make_XML_Node ("QueuingPort");
Size := To_Bytes (Get_Data_Size
(Corresponding_Instance (Port)));
Queue_Size := Get_Queue_Size (Port);
if Queue_Size = -1 then
Queue_Size := 1;
end if;
if Is_In (Port) then
XTU.Add_Attribute ("Name",
Get_Name_String
(AIN.Name (Identifier (Port))),
Queuing_Port);
else
XTU.Add_Attribute ("Name",
Get_Name_String
(AIN.Name
(Identifier
(Item
(AIN.First_Node
(Destinations (Port)))))),
Queuing_Port);
end if;
XTU.Add_Attribute ("MaxMessageSize",
Trim (Unsigned_Long_Long'Image
(Size), Left),
Queuing_Port);
XTU.Add_Attribute ("MaxNbMessage",
Trim (Long_Long'Image
(Queue_Size), Left),
Queuing_Port);
if Is_In (Port) then
XTU.Add_Attribute ("Direction", "DESTINATION", Queuing_Port);
elsif Is_Out (Port) then
XTU.Add_Attribute ("Direction", "SOURCE", Queuing_Port);
end if;
XTU.Add_Attribute ("SourcePartitionName", "", Queuing_Port);
XTU.Add_Attribute ("SourcePortName", "", Queuing_Port);
XTU.Add_Attribute ("CustomIOFunction", "", Queuing_Port);
return Queuing_Port;
end Map_Queuing_Port;
-------------------
-- Map_Partition --
-------------------
......
......@@ -45,4 +45,6 @@ package Ocarina.Backends.Deos_Conf.Mapping is
function Map_Sampling_Port (Port : Node_Id) return Node_Id;
function Map_Queuing_Port (Port : Node_Id) return Node_Id;
end Ocarina.Backends.Deos_Conf.Mapping;
......@@ -444,6 +444,7 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
Memory_Segment : Node_Id := No_Node;
Partition_Node : Node_Id;
Sampling_Ports : Node_Id := No_Node;
Queuing_Ports : Node_Id := No_Node;
begin
Corresponding_Process := Find_Associated_Process (E);
......@@ -506,6 +507,7 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
if not AINU.Is_Empty (Features (Corresponding_Process)) then
Sampling_Ports := Make_XML_Node ("SamplingPorts");
Queuing_Ports := Make_XML_Node ("QueuingPorts");
F := First_Node (Features (Corresponding_Process));
while Present (F) loop
......@@ -520,6 +522,15 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
(Map_Sampling_Port (F),
XTN.Subitems (Sampling_Ports));
end if;
if Is_Data (F) and then Is_Event (F)
and then not (Is_In (F) and then Is_Out (F))
then
Append_Node_To_List
(Map_Queuing_Port (F),
XTN.Subitems (Queuing_Ports));
end if;
end if;
F := Next_Node (F);
end loop;
......@@ -533,6 +544,14 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
XTN.Subitems (Partition_Node));
end if;
if Queuing_Ports /= No_Node and then
XTN.Subitems (Queuing_Ports) /= No_List
then
Append_Node_To_List
(Queuing_Ports,
XTN.Subitems (Partition_Node));
end if;
Partition_Identifier := Partition_Identifier + 1;
end if;
......
......@@ -599,6 +599,11 @@ package body Ocarina.Backends.POK_C.Main is
CTU.Append_Node_To_List (N, Statements);
elsif AIN.Is_Data (F) and then not Is_Event (F) then
--
-- Here, we have a sampling port.
--
Append_Node_To_List
(Make_Literal
(CV.New_Pointed_Char_Value (Map_Port_Name (F))),
......
......@@ -135,7 +135,9 @@ package body Ocarina.Backends.POK_C.Runtime is
RE_Header_Table (E) := RH_Apex;
end loop;
RE_Header_Table (RE_Fifo) := RH_Apex;
RE_Header_Table (RE_Pok_Port_Kind_Sampling) := RH_Apex;
RE_Header_Table (RE_Pok_Port_Kind_Queueing) := RH_Apex;
RE_Header_Table (RE_Source) := RH_Apex;
RE_Header_Table (RE_Destination) := RH_Apex;
RE_Header_Table (RE_Pok_Errno_Empty) := RH_Apex;
......
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