Commit c659f261 authored by Julien's avatar Julien
Browse files

Update mapping rules

parent d4c144fb
...@@ -977,6 +977,9 @@ package body Ocarina.Backends.Deos_Conf.Mapping is ...@@ -977,6 +977,9 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
function Map_Sampling_Port (Port : Node_Id) return Node_Id is function Map_Sampling_Port (Port : Node_Id) return Node_Id is
Sampling_Port : Node_Id; Sampling_Port : Node_Id;
Size : Unsigned_Long_Long; Size : Unsigned_Long_Long;
Source_Port : Node_Id;
Source_Process : Node_Id;
Source_Runtime : Node_Id;
begin begin
Sampling_Port := Make_XML_Node ("SamplingPort"); Sampling_Port := Make_XML_Node ("SamplingPort");
Size := To_Bytes (Get_Data_Size Size := To_Bytes (Get_Data_Size
...@@ -996,8 +999,31 @@ package body Ocarina.Backends.Deos_Conf.Mapping is ...@@ -996,8 +999,31 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
elsif Is_Out (Port) then elsif Is_Out (Port) then
XTU.Add_Attribute ("Direction", "SOURCE", Sampling_Port); XTU.Add_Attribute ("Direction", "SOURCE", Sampling_Port);
end if; end if;
if Is_In (Port) then
Source_Port := Item (AIN.First_Node (Sources (Port)));
Source_Process := Parent_Component
(Source_Port);
Source_Runtime := Parent_Subcomponent
(Get_Partition_Runtime
(Source_Process));
XTU.Add_Attribute
("SourcePortName",
Get_Name_String
(Map_Port_Name (Source_Port)),
Sampling_Port);
XTU.Add_Attribute
("SourcePartitionName",
Get_Name_String
(Display_Name
(Identifier
(Source_Runtime))),
Sampling_Port);
else
XTU.Add_Attribute ("SourcePartitionName", "", Sampling_Port); XTU.Add_Attribute ("SourcePartitionName", "", Sampling_Port);
XTU.Add_Attribute ("SourcePortName", "", Sampling_Port); XTU.Add_Attribute ("SourcePortName", "", Sampling_Port);
end if;
XTU.Add_Attribute ("CustomIOFunction", "", Sampling_Port); XTU.Add_Attribute ("CustomIOFunction", "", Sampling_Port);
XTU.Add_Attribute ("AccessRateInNanoseconds", "12500000", Sampling_Port); XTU.Add_Attribute ("AccessRateInNanoseconds", "12500000", Sampling_Port);
return Sampling_Port; return Sampling_Port;
...@@ -1011,6 +1037,9 @@ package body Ocarina.Backends.Deos_Conf.Mapping is ...@@ -1011,6 +1037,9 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
Queuing_Port : Node_Id; Queuing_Port : Node_Id;
Size : Unsigned_Long_Long; Size : Unsigned_Long_Long;
Queue_Size : Long_Long; Queue_Size : Long_Long;
Source_Port : Node_Id;
Source_Process : Node_Id;
Source_Runtime : Node_Id;
begin begin
Queuing_Port := Make_XML_Node ("QueuingPort"); Queuing_Port := Make_XML_Node ("QueuingPort");
Size := To_Bytes (Get_Data_Size Size := To_Bytes (Get_Data_Size
...@@ -1040,8 +1069,31 @@ package body Ocarina.Backends.Deos_Conf.Mapping is ...@@ -1040,8 +1069,31 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
elsif Is_Out (Port) then elsif Is_Out (Port) then
XTU.Add_Attribute ("Direction", "SOURCE", Queuing_Port); XTU.Add_Attribute ("Direction", "SOURCE", Queuing_Port);
end if; end if;
if Is_In (Port) then
Source_Port := Item (AIN.First_Node (Sources (Port)));
Source_Process := Parent_Component
(Source_Port);
Source_Runtime := Parent_Subcomponent
(Get_Partition_Runtime
(Source_Process));
XTU.Add_Attribute
("SourcePortName",
Get_Name_String
(Map_Port_Name (Source_Port)),
Queuing_Port);
XTU.Add_Attribute
("SourcePartitionName",
Get_Name_String
(Display_Name
(Identifier
(Source_Runtime))),
Queuing_Port);
else
XTU.Add_Attribute ("SourcePartitionName", "", Queuing_Port); XTU.Add_Attribute ("SourcePartitionName", "", Queuing_Port);
XTU.Add_Attribute ("SourcePortName", "", Queuing_Port); XTU.Add_Attribute ("SourcePortName", "", Queuing_Port);
end if;
XTU.Add_Attribute ("CustomIOFunction", "", Queuing_Port); XTU.Add_Attribute ("CustomIOFunction", "", Queuing_Port);
return Queuing_Port; return Queuing_Port;
end Map_Queuing_Port; end Map_Queuing_Port;
...@@ -1179,38 +1231,11 @@ package body Ocarina.Backends.Deos_Conf.Mapping is ...@@ -1179,38 +1231,11 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
function Map_Port_Name (E : Node_Id) return Name_Id function Map_Port_Name (E : Node_Id) return Name_Id
is is
N : Name_Id; N : Name_Id;
Port : Node_Id;
begin begin
--
-- Typically, the following block of code is used
-- to prefix the port name by the parent subcomponent
-- name. For DeOS, we do not prefix by the subcomponent,
-- Port Name have to be the same.
--
if Get_Connection_Pattern (E) = Inter_Process
then
if Is_Out (E) then
Port := Item (AIN.First_Node (Destinations (E)));
else
Port := E;
end if;
Get_Name_String Get_Name_String
(Display_Name (Display_Name (Identifier (E)));
(Identifier
(Parent_Subcomponent
(Parent_Component (Port)))));
Add_Str_To_Name_Buffer ("_");
Get_Name_String_And_Append
(Display_Name (Identifier (Port)));
N := Name_Find; N := Name_Find;
end if;
return (To_Lower (N)); return (To_Lower (N));
end Map_Port_Name; end Map_Port_Name;
......
Supports Markdown
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