Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
45ac55a3
Commit
45ac55a3
authored
Dec 06, 2014
by
Julien
Browse files
improve configuration file generation
parent
4c6893bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-deos_conf-mapping.adb
View file @
45ac55a3
...
...
@@ -968,12 +968,67 @@ package body Ocarina.Backends.Deos_Conf.Mapping is
-------------------
function
Map_Partition
(
Process
:
Node_Id
;
Runtime
:
Node_Id
)
return
Node_Id
is
Runtime
:
Node_Id
;
Partition_Identifier
:
Integer
)
return
Node_Id
is
pragma
Unreferenced
(
Process
);
pragma
Unreferenced
(
Runtime
);
Partition_Node
:
Node_Id
;
begin
Partition_Node
:=
Make_XML_Node
(
"Partition"
);
XTU
.
Add_Attribute
(
"Name"
,
Get_Name_String
(
AIN
.
Name
(
Identifier
(
Parent_Subcomponent
(
Runtime
)))),
Partition_Node
);
XTU
.
Add_Attribute
(
"Identifier"
,
Integer
'
Image
(
Partition_Identifier
),
Partition_Node
);
XTU
.
Add_Attribute
(
"Period"
,
"25000000"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"Duration"
,
"6000000"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"ExecutableImageName"
,
Get_Name_String
(
AIN
.
Name
(
Identifier
(
Parent_Subcomponent
(
Runtime
))))
&
".exe"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"MainProcessStackSizeInPages"
,
"1"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"BreakAtStartup"
,
"no"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"InDebugSet"
,
"no"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"MapConfigurationFileTo"
,
"RAM"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"ExecuteFrom"
,
"RAM"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"PartitionUsesFPU"
,
"no"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"ProcessStackSpaceInPages"
,
"6"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"MinimumProcessStackSizeInBytes"
,
"512"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"ProcessQuota"
,
"4"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"BlackboardQuota"
,
"1"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"BlackboardMessageSpaceInBytes"
,
"256"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"BufferQuota"
,
"0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"BufferMessageSpaceInBytes"
,
"0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"SemaphoreQuota"
,
"0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"EventQuota"
,
"1"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"MaximumPartitionLockLevel"
,
"16"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"MinimumProcessPriority"
,
"1"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"MaximumProcessPriority"
,
"239"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"LoggingFunction"
,
""
,
Partition_Node
);
XTU
.
Add_Attribute
(
"DeosKernelAttributeAccess"
,
"no"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"ProcessStackGapSizeInDwords"
,
"0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"ProcessStackTagIntervalInDwords"
,
"0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"SourcePortSharedMemoryType"
,
"DeosSharedMemory"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"PlatformResourcePhysicalAddress"
,
"0x0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"PlatformResourceSizeInPages"
,
"0"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"PlatformResourceCachePolicy"
,
"off"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"HealthMonitorEventLogSize"
,
"30"
,
Partition_Node
);
XTU
.
Add_Attribute
(
"EventLoggingEnabled"
,
"yes"
,
Partition_Node
);
return
Partition_Node
;
end
Map_Partition
;
...
...
src/backends/ocarina-backends-deos_conf-mapping.ads
View file @
45ac55a3
...
...
@@ -17,7 +17,8 @@ package Ocarina.Backends.Deos_Conf.Mapping is
function
Map_Virtual_Processor
(
E
:
Node_Id
)
return
Node_Id
;
function
Map_Processor
(
E
:
Node_Id
)
return
Node_Id
;
function
Map_Partition
(
Process
:
Node_Id
;
Runtime
:
Node_Id
)
return
Node_Id
;
Runtime
:
Node_Id
;
Partition_Identifier
:
Integer
)
return
Node_Id
;
function
Map_Bus
(
E
:
Node_Id
)
return
Node_Id
;
function
Map_Port_Connection
(
E
:
Node_Id
)
return
Node_Id
;
function
Map_Process_Memory
(
Process
:
Node_Id
)
return
Node_Id
;
...
...
src/backends/ocarina-backends-deos_conf-partitions.adb
View file @
45ac55a3
...
...
@@ -21,10 +21,12 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
package
AINU
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
package
XTN
renames
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
package
XTU
renames
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
Root_Node
:
Node_Id
:=
No_Node
;
Partitions_Node
:
Node_Id
:=
No_Node
;
Memory_Regions
:
Node_Id
:=
No_Node
;
Partition_Identifier
:
Integer
:=
0
;
procedure
Visit_Architecture_Instance
(
E
:
Node_Id
);
procedure
Visit_Component_Instance
(
E
:
Node_Id
);
...
...
@@ -47,6 +49,14 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
N
:
Node_Id
;
begin
N
:=
Make_XML_Node
(
"MemoryRegion"
);
XTU
.
Add_Attribute
(
"Name"
,
"Initial RAM Pool"
,
N
);
XTU
.
Add_Attribute
(
"Type"
,
"Initial RAM Pool"
,
N
);
XTU
.
Add_Attribute
(
"Address"
,
"0x0"
,
N
);
XTU
.
Add_Attribute
(
"Size"
,
"0x19000"
,
N
);
XTU
.
Add_Attribute
(
"AccessRights"
,
"READ_WRITE"
,
N
);
XTU
.
Add_Attribute
(
"PlatformMemoryPool"
,
"0"
,
N
);
return
N
;
end
Make_Default_Memory_Region
;
...
...
@@ -203,6 +213,8 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
Push_Entity
(
P
);
Push_Entity
(
U
);
Partition_Identifier
:=
0
;
Current_XML_Node
:=
XTN
.
Root_Node
(
XTN
.
XML_File
(
U
));
Partitions_Node
:=
Make_XML_Node
(
"Partitions"
);
...
...
@@ -258,7 +270,9 @@ package body Ocarina.Backends.Deos_Conf.Partitions is
if
Corresponding_Process
/=
No_Node
then
Append_Node_To_List
(
Map_Partition
(
Corresponding_Process
,
E
),
(
Map_Partition
(
Corresponding_Process
,
E
,
Partition_Identifier
),
XTN
.
Subitems
(
Partitions_Node
));
end
if
;
...
...
src/backends/ocarina-backends-deos_conf-schedule.adb
View file @
45ac55a3
-- with Locations;
with
Ocarina
.
Namet
;
use
Ocarina
.
Namet
;
with
Ocarina
.
ME_AADL
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
with
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
...
...
@@ -20,7 +21,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
-- use Ocarina.Backends.Deos_Conf.Mapping;
package
AINU
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nutils
;
package
AIN
renames
Ocarina
.
ME_AADL
.
AADL_Instances
.
Nodes
;
package
XTN
renames
Ocarina
.
Backends
.
XML_Tree
.
Nodes
;
package
XTU
renames
Ocarina
.
Backends
.
XML_Tree
.
Nutils
;
Root_Node
:
Node_Id
:=
No_Node
;
Schedule_Node
:
Node_Id
:=
No_Node
;
...
...
@@ -157,6 +160,9 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
Schedule_Node
:=
Make_XML_Node
(
"Schedule"
);
XTU
.
Add_Attribute
(
"MajorFrameLength"
,
"Automatic"
,
Schedule_Node
);
Append_Node_To_List
(
Schedule_Node
,
XTN
.
Subitems
(
Current_XML_Node
));
...
...
@@ -183,16 +189,27 @@ package body Ocarina.Backends.Deos_Conf.Schedule is
--------------------------------------
procedure
Visit_Virtual_Processor_Instance
(
E
:
Node_Id
)
is
S
:
Node_Id
;
Time_Window_Node
:
Node_Id
;
begin
if
not
AINU
.
Is_Empty
(
Subcomponents
(
E
))
then
S
:=
First_Node
(
Subcomponents
(
E
));
while
Present
(
S
)
loop
Time_Window_Node
:=
Make_XML_Node
(
"PartitionTimeWindow"
);
Visit
(
Corresponding_Instance
(
S
));
S
:=
Next_Node
(
S
);
end
loop
;
end
if
;
Append_Node_To_List
(
Time_Window_Node
,
XTN
.
Subitems
(
Schedule_Node
));
XTU
.
Add_Attribute
(
"Duration"
,
"6000000"
,
Time_Window_Node
);
XTU
.
Add_Attribute
(
"Offset"
,
"0"
,
Time_Window_Node
);
XTU
.
Add_Attribute
(
"PeriodicProcessingStart"
,
""
,
Time_Window_Node
);
XTU
.
Add_Attribute
(
"RepeatWindowAtNanosecondInterval"
,
"PartitionPeriod"
,
Time_Window_Node
);
XTU
.
Add_Attribute
(
"InhibitEarlyCompletion"
,
"false"
,
Time_Window_Node
);
XTU
.
Add_Attribute
(
"PartitionNameRef"
,
Get_Name_String
(
AIN
.
Name
(
Identifier
(
Parent_Subcomponent
(
E
)))),
Time_Window_Node
);
end
Visit_Virtual_Processor_Instance
;
end
Ocarina
.
Backends
.
Deos_Conf
.
Schedule
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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