Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Ocarina
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
Ocarina
Commits
a1647df7
Commit
a1647df7
authored
Dec 30, 2014
by
Julien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to map memory and sampling ports in DEOS conf
parent
12bb75c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
10 deletions
+111
-10
src/backends/ocarina-backends-deos_conf-mapping.adb
src/backends/ocarina-backends-deos_conf-mapping.adb
+33
-0
src/backends/ocarina-backends-deos_conf-mapping.ads
src/backends/ocarina-backends-deos_conf-mapping.ads
+2
-0
src/backends/ocarina-backends-deos_conf-partitions.adb
src/backends/ocarina-backends-deos_conf-partitions.adb
+76
-10
No files found.
src/backends/ocarina-backends-deos_conf-mapping.adb
View file @
a1647df7
...
...
@@ -967,6 +967,39 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
return
Module_HM
;
end
Map_Processor_HM_Table
;
-----------------------
-- Map_Sampling_Port --
-----------------------
function
Map_Sampling_Port
(
Port
:
Node_Id
)
return
Node_Id
is
Sampling_Port
:
Node_Id
;
Size
:
Unsigned_Long_Long
;
begin
Sampling_Port
:=
Make_XML_Node
(
"SamplingPort"
);
Size
:=
To_Bytes
(
Get_Data_Size
(
Corresponding_Instance
(
Port
)));
XTU
.
Add_Attribute
(
"Name"
,
Get_Name_String
(
AIN
.
Name
(
Identifier
(
Port
))),
Sampling_Port
);
XTU
.
Add_Attribute
(
"MaxMessageSize"
,
Trim
(
Unsigned_Long_Long
'
Image
(
Size
),
Left
),
Sampling_Port
);
if
Is_In
(
Port
)
then
XTU
.
Add_Attribute
(
"Direction"
,
"DESTINATION"
,
Sampling_Port
);
elsif
Is_Out
(
Port
)
then
XTU
.
Add_Attribute
(
"Direction"
,
"SOURCE"
,
Sampling_Port
);
end
if
;
XTU
.
Add_Attribute
(
"SourcePartitionName"
,
""
,
Sampling_Port
);
XTU
.
Add_Attribute
(
"SourcePortName"
,
""
,
Sampling_Port
);
XTU
.
Add_Attribute
(
"CustomIOFunction"
,
""
,
Sampling_Port
);
XTU
.
Add_Attribute
(
"AccessRateInNanoseconds"
,
"12500000"
,
Sampling_Port
);
return
Sampling_Port
;
end
Map_Sampling_Port
;
-------------------
-- Map_Partition --
-------------------
...
...
src/backends/ocarina-backends-deos_conf-mapping.ads
View file @
a1647df7
...
...
@@ -43,4 +43,6 @@ package Ocarina.Backends.Deos_Conf.Mapping is
function
Map_Processor_HM_Table
(
Processor
:
Node_Id
)
return
Node_Id
;
function
Map_Sampling_Port
(
Port
:
Node_Id
)
return
Node_Id
;
end
Ocarina
.
Backends
.
Deos_Conf
.
Mapping
;
src/backends/ocarina-backends-deos_conf-partitions.adb
View file @
a1647df7
...
...
@@ -31,8 +31,10 @@
-- --
------------------------------------------------------------------------------
with
Ada
.
Strings
;
use
Ada
.
Strings
;
with
Ada
.
Strings
.
Fixed
;
use
Ada
.
Strings
.
Fixed
;
-- with Ada.Strings; use Ada.Strings;
-- with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with
Ada
.
Text_IO
;
with
Ada
.
Integer_Text_IO
;
with
Ocarina
.
Backends
.
Messages
;
with
Ocarina
.
ME_AADL
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
...
...
@@ -41,13 +43,14 @@ with Ocarina.ME_AADL.AADL_Instances.Entities;
with
Ocarina
.
Backends
.
Utils
;
with
Ocarina
.
Backends
.
Properties
;
with
Ocarina
.
Backends
.
XML_Values
;
with
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
with
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
with
Ocarina
.
Backends
.
Deos_Conf
.
Mapping
;
package
body
Ocarina
.
Backends
.
Deos_Conf
.
Partitions
is
use
Ada
.
Text_IO
;
use
Ada
.
Integer_Text_IO
;
use
Ocarina
.
ME_AADL
;
use
Ocarina
.
Backends
.
Utils
;
...
...
@@ -57,7 +60,6 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
use
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
use
Ocarina
.
Backends
.
Properties
;
use
Ocarina
.
Backends
.
Deos_Conf
.
Mapping
;
use
Ocarina
.
Backends
.
XML_Values
;
package
AIN
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
package
AINU
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
...
...
@@ -94,6 +96,29 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
function
Make_Default_Memory_Region
return
Node_Id
;
function
Make_Memory_Region
(
Segment
:
Node_Id
)
return
Node_Id
;
function
Hex_Print
(
Num
:
in
Integer
;
Num_Of_Digits
:
in
Positive
)
return
String
;
function
Hex_Print
(
Num
:
in
Integer
;
Num_Of_Digits
:
in
Positive
)
return
String
is
Temp_Str
:
String
(
1
..
Num_Of_Digits
+
5
)
:=
(
others
=>
'0'
);
New_Str
:
String
(
1
..
Num_Of_Digits
)
:=
(
others
=>
'0'
);
First_Digit
:
Positive
;
begin
Put
(
To
=>
Temp_Str
,
Item
=>
Num
,
Base
=>
16
);
for
I
in
1
..
Num_Of_Digits
+
4
loop
if
Temp_Str
(
I
)
=
'#'
then
First_Digit
:=
I
+
1
;
exit
;
end
if
;
end
loop
;
New_Str
(
First_Digit
-
4
..
Num_Of_Digits
)
:=
Temp_Str
(
First_Digit
..
Num_Of_Digits
+
4
);
return
New_Str
;
end
Hex_Print
;
--------------------------------
-- Make_Default_Memory_Region --
...
...
@@ -126,15 +151,18 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
XTU
.
Add_Attribute
(
"Name"
,
"Initial RAM Pool"
,
N
);
XTU
.
Add_Attribute
(
"Type"
,
"Initial RAM Pool"
,
N
);
XTU
.
Add_Attribute
(
"Address"
,
New_Numeric_Value
(
Get_Base_Address
(
Segment
),
1
,
16
),
"0x"
&
Hex_Print
(
Integer
(
Get_Base_Address
(
Segment
)),
8
),
N
);
-- Put (Size_Str, To_Bytes
-- (Get_Memory_Size (Segment)), 16);
XTU
.
Add_Attribute
(
"Size"
,
Trim
(
Unsigned_Long_Long
'
Image
(
To_Bytes
(
Get_Memory_Size
(
Segment
))),
Left
),
"0x"
&
Hex_Print
(
Integer
(
To_Bytes
(
Get_Memory_Size
(
Segment
))),
8
),
N
);
XTU
.
Add_Attribute
(
"AccessRights"
,
"READ_WRITE"
,
N
);
XTU
.
Add_Attribute
(
"PlatformMemoryPool"
,
"0"
,
N
);
...
...
@@ -411,9 +439,11 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
procedure
Visit_Virtual_Processor_Instance
(
E
:
Node_Id
)
is
S
:
Node_Id
;
F
:
Node_Id
;
Corresponding_Process
:
Node_Id
:=
No_Node
;
Memory_Segment
:
Node_Id
:=
No_Node
;
Partition_Node
:
Node_Id
;
Sampling_Ports
:
Node_Id
:=
No_Node
;
begin
Corresponding_Process
:=
Find_Associated_Process
(
E
);
...
...
@@ -468,6 +498,42 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
Append_Node_To_List
(
Memory_Regions
,
XTN
.
Subitems
(
Partition_Node
));
--
-- Then, we configure the inter-partitions communication
-- ports (sampling/queueing).
--
if
not
AINU
.
Is_Empty
(
Features
(
Corresponding_Process
))
then
Sampling_Ports
:=
Make_XML_Node
(
"SamplingPorts"
);
F
:=
First_Node
(
Features
(
Corresponding_Process
));
while
Present
(
F
)
loop
if
Kind
(
F
)
=
K_Port_Spec_Instance
and
then
Get_Connection_Pattern
(
F
)
=
Inter_Process
then
if
Is_Data
(
F
)
and
then
not
Is_Event
(
F
)
and
then
not
(
Is_In
(
F
)
and
then
Is_Out
(
F
))
then
Append_Node_To_List
(
Map_Sampling_Port
(
F
),
XTN
.
Subitems
(
Sampling_Ports
));
end
if
;
end
if
;
F
:=
Next_Node
(
F
);
end
loop
;
end
if
;
if
Sampling_Ports
/=
No_Node
and
then
XTN
.
Subitems
(
Sampling_Ports
)
/=
No_List
then
Append_Node_To_List
(
Sampling_Ports
,
XTN
.
Subitems
(
Partition_Node
));
end
if
;
Partition_Identifier
:=
Partition_Identifier
+
1
;
end
if
;
if
not
AINU
.
Is_Empty
(
Subcomponents
(
E
))
then
...
...
Write
Preview
Markdown
is supported
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