Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
52bb99e9
Commit
52bb99e9
authored
Apr 05, 2015
by
Julien
Browse files
Improve mapping rules
parent
c93329d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-deos_conf-mapping.adb
View file @
52bb99e9
...
@@ -2,6 +2,7 @@ with Ada.Strings; use Ada.Strings;
...
@@ -2,6 +2,7 @@ with Ada.Strings; use Ada.Strings;
with
Ada
.
Strings
.
Fixed
;
use
Ada
.
Strings
.
Fixed
;
with
Ada
.
Strings
.
Fixed
;
use
Ada
.
Strings
.
Fixed
;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
with
Utils
;
use
Utils
;
with
Ocarina
.
ME_AADL
;
with
Ocarina
.
ME_AADL
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Entities
;
with
Ocarina
.
ME_AADL
.
AADL_Tree
.
Entities
;
...
@@ -35,6 +36,8 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
...
@@ -35,6 +36,8 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
package
XTN
renames
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
package
XTN
renames
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
package
XTU
renames
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
package
XTU
renames
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
function
Map_Port_Name
(
E
:
Node_Id
)
return
Name_Id
;
procedure
Map_Scheduler
(
E
:
Node_Id
;
N
:
Node_Id
)
is
procedure
Map_Scheduler
(
E
:
Node_Id
;
N
:
Node_Id
)
is
Scheduler
:
Supported_POK_Scheduler
;
Scheduler
:
Supported_POK_Scheduler
;
R
:
Node_Id
;
R
:
Node_Id
;
...
@@ -979,21 +982,10 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
...
@@ -979,21 +982,10 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
Size
:=
To_Bytes
(
Get_Data_Size
Size
:=
To_Bytes
(
Get_Data_Size
(
Corresponding_Instance
(
Port
)));
(
Corresponding_Instance
(
Port
)));
if
Is_In
(
Port
)
then
XTU
.
Add_Attribute
(
"Name"
,
XTU
.
Add_Attribute
(
"Name"
,
Get_Name_String
Get_Name_String
(
Map_Port_Name
(
Port
)),
(
AIN
.
Name
(
Identifier
(
Port
))),
Sampling_Port
);
Sampling_Port
);
else
XTU
.
Add_Attribute
(
"Name"
,
Get_Name_String
(
AIN
.
Name
(
Identifier
(
Item
(
AIN
.
First_Node
(
Destinations
(
Port
)))))),
Sampling_Port
);
end
if
;
XTU
.
Add_Attribute
(
"MaxMessageSize"
,
XTU
.
Add_Attribute
(
"MaxMessageSize"
,
Trim
(
Unsigned_Long_Long
'
Image
Trim
(
Unsigned_Long_Long
'
Image
(
Size
),
Left
),
(
Size
),
Left
),
...
@@ -1029,21 +1021,10 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
...
@@ -1029,21 +1021,10 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
Queue_Size
:=
1
;
Queue_Size
:=
1
;
end
if
;
end
if
;
if
Is_In
(
Port
)
then
XTU
.
Add_Attribute
(
"Name"
,
XTU
.
Add_Attribute
(
"Name"
,
Get_Name_String
Get_Name_String
(
Map_Port_Name
(
Port
)),
(
AIN
.
Name
(
Identifier
(
Port
))),
Queuing_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"
,
XTU
.
Add_Attribute
(
"MaxMessageSize"
,
Trim
(
Unsigned_Long_Long
'
Image
Trim
(
Unsigned_Long_Long
'
Image
(
Size
),
Left
),
(
Size
),
Left
),
...
@@ -1191,4 +1172,46 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
...
@@ -1191,4 +1172,46 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
return
Partition_Node
;
return
Partition_Node
;
end
Map_Partition
;
end
Map_Partition
;
-------------------
-- Map_Port_Name --
-------------------
function
Map_Port_Name
(
E
:
Node_Id
)
return
Name_Id
is
N
:
Name_Id
;
Port
:
Node_Id
;
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
(
Display_Name
(
Identifier
(
Parent_Subcomponent
(
Parent_Component
(
Port
)))));
Add_Str_To_Name_Buffer
(
"_"
);
Get_Name_String_And_Append
(
Display_Name
(
Identifier
(
Port
)));
N
:=
Name_Find
;
end
if
;
return
(
To_Lower
(
N
));
end
Map_Port_Name
;
end
Ocarina
.
Backends
.
Deos_Conf
.
Mapping
;
end
Ocarina
.
Backends
.
Deos_Conf
.
Mapping
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment