Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
fb85b064
Commit
fb85b064
authored
Apr 27, 2019
by
Maxime Perrotin
Browse files
Iterate on AADL backend for non-distributed systems
parent
068ecfbb
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/taste-concurrency_view.adb
View file @
fb85b064
...
...
@@ -153,7 +153,7 @@ package body TASTE.Concurrency_View is
Filter
:
constant
Filter_Type
:=
(
Directory
=>
True
,
others
=>
False
);
Output_File
:
File_Type
;
Threads
:
Unbounded_String
;
begin
Start_Search
(
Search
=>
ST
,
Pattern
=>
""
,
...
...
@@ -186,7 +186,6 @@ package body TASTE.Concurrency_View is
is
Partition
:
constant
CV_Partition
:=
CV
.
Nodes
(
Node_Name
).
Partitions
(
Partition_Name
);
Threads
:
Unbounded_String
;
Thread_Names
:
Tag
;
Blocks
:
Unbounded_String
;
Partition_Assoc
:
Translate_Set
;
...
...
@@ -286,7 +285,12 @@ package body TASTE.Concurrency_View is
(
if
Valid_Dir
then
Strip_String
(
Parse
(
Tmpl_File
))
else
""
);
Trig_Sys
:
constant
Boolean
:=
Exists
(
Tmpl_Sys
);
Set_Sys
:
Translate_Set
;
Node_Names
:
Tag
;
Node_Names
:
Vector_Tag
;
-- List of nodes
Node_CPU
:
Vector_Tag
;
-- Corresponding CPU name
Node_CPU_Cls
:
Vector_Tag
;
-- Corresponding CPU classifier
Partition_Names
:
Vector_Tag
;
-- List of processes
Partition_Node
:
Vector_Tag
;
-- Corresponding node name
Partition_CPU
:
Vector_Tag
;
-- Corresponding CPU name
begin
for
Node
in
CV
.
Nodes
.
Iterate
loop
declare
...
...
@@ -317,8 +321,28 @@ package body TASTE.Concurrency_View is
else
""
);
begin
if
Trigger
then
-- Associate node name, CPU name and CPU classifier
-- (this is needed for AADL backends)
Node_Names
:=
Node_Names
&
Node_Name
;
Nodes
:=
Nodes
&
Newline
&
Node_Content
;
Node_CPU
:=
Node_CPU
&
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Name
;
Node_CPU_Cls
:=
Node_CPU_Cls
&
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Classifier
;
-- Associate partition name, corresponding node and CPU
-- for AADL backends
for
Partition
in
CV
.
Nodes
(
Node_Name
).
Partitions
.
Iterate
loop
Partition_Names
:=
Partition_Names
&
CV_Partitions
.
Key
(
Partition
);
Partition_CPU
:=
Partition_CPU
&
CV_Partitions
.
Element
(
Partition
)
.
Deployment_Partition
.
CPU_Name
;
Partition_Node
:=
Partition_Node
&
Node_Name
;
end
loop
;
Nodes
:=
Nodes
&
Newline
&
Node_Content
;
if
File_Name
/=
""
then
Create_Path
(
Output_Dir
);
Create
(
File
=>
Output_File
,
...
...
@@ -332,8 +356,15 @@ package body TASTE.Concurrency_View is
end
loop
;
if
Trig_Sys
and
File_Sys
/=
""
then
Put_Info
(
"Generating system concurrency view"
);
Set_Sys
:=
+
Assoc
(
"Nodes"
,
Nodes
)
&
Assoc
(
"Node_Names"
,
Node_Names
);
Set_Sys
:=
+
Assoc
(
"Nodes"
,
Nodes
)
&
Assoc
(
"Node_Names"
,
Node_Names
)
&
Assoc
(
"Node_CPU"
,
Node_CPU
)
&
Assoc
(
"Node_CPU_Classifier"
,
Node_CPU_Cls
)
&
Assoc
(
"Partition_Names"
,
Partition_Names
)
&
Assoc
(
"Partition_Node"
,
Partition_Node
)
&
Assoc
(
"Partition_CPU"
,
Partition_CPU
)
&
Assoc
(
"Threads"
,
Threads
);
Threads
:=
US
(
""
);
-- Reset for next template folder
Create_Path
(
CV_Out_Dir
);
Create
(
File
=>
Output_File
,
Mode
=>
Out_File
,
...
...
@@ -354,13 +385,6 @@ package body TASTE.Concurrency_View is
-- to decide if processes could also have their own files, since
-- in the future they may be more than one process per node (for TSP).
CV
.
Generate_Code
;
-- for Node in CV.Nodes.Iterate loop
-- if CV_Nodes.Key (Node) /= "interfaceview" then
-- CV.Generate_Node (CV_Nodes.Key (Node));
-- end if;
-- end loop;
exception
when
Error
:
Concurrency_View_Error
|
Ada
.
IO_Exceptions
.
Name_Error
=>
Put_Error
(
"Concurrency View : "
...
...
src/taste-deployment_view.adb
View file @
fb85b064
...
...
@@ -417,6 +417,9 @@ package body TASTE.Deployment_View is
Partition
:=
Parse_Partition
(
CI
,
Depl_View_System
);
Result
.
Partitions
.
Insert
(
Key
=>
To_String
(
Partition
.
Name
),
New_Item
=>
Partition
);
Result
.
CPU_Name
:=
Partition
.
CPU_Name
;
Result
.
CPU_Platform
:=
Partition
.
CPU_Platform
;
Result
.
CPU_Classifier
:=
Partition
.
CPU_Classifier
;
end
if
;
Processes
:=
Next_Node
(
Processes
);
...
...
src/taste-deployment_view.ads
View file @
fb85b064
...
...
@@ -147,9 +147,12 @@ package TASTE.Deployment_View is
type
Taste_Node
is
tagged
record
Name
:
Unbounded_String
;
Drivers
:
Taste_Drivers
.
Vector
;
Partitions
:
Taste_Partitions
.
Map
;
Name
:
Unbounded_String
;
Drivers
:
Taste_Drivers
.
Vector
;
Partitions
:
Taste_Partitions
.
Map
;
CPU_Name
:
Unbounded_String
;
CPU_Platform
:
Supported_Execution_Platform
;
CPU_Classifier
:
Unbounded_String
;
end
record
;
-- Helper function: find the partition where a function is bounded
...
...
templates/concurrency_view/aadl_1_nodes/system.tmplt
View file @
fb85b064
@@-- The following tags are available in this template:
@@--
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Tag (list) of node names
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Tag (list) of node names
@@-- @_Partition_Names_@ : Tag (list) of partition names
@@-- @_Threads_@ : Code generated for the threads
-- Input file for the taste orchestrator: do not edit
-- This file was generated automatically by taste/kazoo
...
...
templates/concurrency_view/aadl_2_threads/partition.tmplt
View file @
fb85b064
...
...
@@ -15,17 +15,15 @@
@@-- @_Thread_Dst_Name_@ : Vector tag : connection thread name (dest)
@@-- @_Thread_Src_Port_@ : Vector tag : connection port name (source)
@@-- @_Thread_Dst_Port_@ : Vector tag : connection port name (dest)
@_Threads_@
with @_Package_Name_@;
@@TABLE@@
with @_Thread_Names_@_Thread;
@@END_TABLE@@
process @_Name_@ extends DeploymentView::DV::@_
Node_
Name_@
process @_
CAPITALIZE:
Name_@ extends DeploymentView::DV::@_
CAPITALIZE:Node_Name_@::@_CAPITALIZE:
Name_@
end @_Name_@;
process implementation @_Name_@.final
process implementation @_
CAPITALIZE:
Name_@.final
subcomponents
@@TABLE@@
@_Thread_Names_@ : thread @_Thread_Names_@_Thread::@_Thread_Names_@.others;
...
...
templates/concurrency_view/aadl_2_threads/system.tmplt
View file @
fb85b064
@@--
The
following
tags
are
available
in
this
template
:
@@--
@@--
@
_Nodes_
@
:
Code
generated
for
the
nodes
@@--
@
_Node_Names_
@
:
Tag
(
list
)
of
node
names
@@--
@
_Nodes_
@
:
Code
generated
for
the
nodes
@@--
@
_Node_Names_
@
:
Vector
Tag
of
node
names
@@--
@
_Node_CPU_
@
:
|
_
Corresponding
CPU
name
(
eg
x86_linux
)
@@--
@
_Node_CPU_Classifier_
@
:
|
_
CPU
Classifier
(
ocarina
...::
x86_linux
)
@@--
@
_Partition_Names_
@
:
Vector
Tag
of
partition
names
@@--
@
_Partition_Node_
@
:
|
_
Corresponding
node
name
@@--
@
_Partition_CPU_
@
:
|
_
Corresponding
CPU
name
@@--
@
_Threads_
@
:
Code
generated
for
the
threads
--
Input
file
for
the
taste
orchestrator
:
do
not
edit
--
This
file
was
generated
automatically
by
taste
/
kazoo
package
process_package
@
_Threads_
@
package
Process_Package
public
with
Deployment
;
with
DataView
;
...
...
@@ -14,16 +22,23 @@ public
@
_Nodes_
@
system
d
eployment
v
iew
end
d
eployment
v
iew
;
system
D
eployment
V
iew
end
D
eployment
V
iew
;
system
implementation
d
eployment
v
iew
.
final
system
implementation
D
eployment
V
iew
.
final
subcomponents
<
MISSING
>
@@
TABLE
@@
@
_CAPITALIZE
:
Partition_Names_
@
:
process
@
_CAPITALIZE
:
Partition_Names_
@.
final
;
@@
END_TABLE
@@
@@
TABLE
@@
@
_CAPITALIZE
:
Node_Names_
@
_
@
_Node_CPU_
@
:
processor
@
_CAPITALIZE
:
Node_CPU_Classifier_
@;
@@
END_TABLE
@@
properties
<
MISSING
>
end
deploymentview
.
final
;
@@
TABLE
@@
Actual_Processor_Binding
=>
(
reference
(@
_CAPITALIZE
:
Partition_Node_
@
_
@
_Partition_CPU_
@))
applies
to
@
_CAPITALIZE
:
Partition_Names_
@;
@@
END_TABLE
@@
end
DeploymentView
.
final
;
end
p
rocess_
p
ackage
;
end
P
rocess_
P
ackage
;
--
deploymenttview
.
final
templates/concurrency_view/ada_basic_body/system.tmplt
View file @
fb85b064
...
...
@@ -2,6 +2,8 @@
@@--
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Tag (list) of node names
@@-- @_Partition_Names_@ : Tag (list) of partition names
@@-- @_Threads_@ : Code generated for the threads
-- The system contains these nodes:
@@TABLE@@
...
...
templates/concurrency_view/ada_basic_source/system.tmplt
View file @
fb85b064
...
...
@@ -2,6 +2,8 @@
@@--
@@-- @_Nodes_@ : Code generated for the nodes
@@-- @_Node_Names_@ : Tag (list) of node names
@@-- @_Partition_Names_@ : Tag (list) of partition names
@@-- @_Threads_@ : Code generated for the threads
-- The system contains these nodes:
@@TABLE@@
...
...
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