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
eff74260
Commit
eff74260
authored
Jul 24, 2019
by
Maxime Perrotin
Browse files
Work on AST to support TSP
parent
29643af2
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
src/taste-concurrency_view.adb
View file @
eff74260
...
...
@@ -396,6 +396,11 @@ package body TASTE.Concurrency_View is
Partitions
:
Unbounded_String
;
Partition_Names
:
Tag
;
Node_Assoc
:
Translate_Set
;
-- Nodes may contain a list of virtual processors for TSP:
VP_Names
,
VP_Package_Names
,
VP_Platforms
,
VP_Classifiers
:
Vector_Tag
;
begin
for
Partition
in
CV
.
Nodes
(
Node_Name
).
Partitions
.
Iterate
loop
Partition_Names
:=
Partition_Names
...
...
@@ -405,15 +410,30 @@ package body TASTE.Concurrency_View is
(
Partition_Name
=>
CV_Partitions
.
Key
(
Partition
),
Node_Name
=>
Node_Name
);
end
loop
;
for
VP
of
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
Virtual_CPUs
loop
VP_Names
:=
VP_Names
&
VP
.
Name
;
VP_Package_Names
:=
VP_Package_Names
&
VP
.
Package_Name
;
VP_Platforms
:=
VP_Platforms
&
VP
.
Platform
;
VP_Classifiers
:=
VP_Classifiers
&
VP
.
Classifier
;
end
loop
;
Node_Assoc
:=
+
Assoc
(
"Partitions"
,
Partitions
)
&
Assoc
(
"Partition_Names"
,
Partition_Names
)
&
Assoc
(
"VP_Names"
,
VP_Names
)
&
Assoc
(
"VP_Package_Names"
,
VP_Package_Names
)
&
Assoc
(
"VP_Platforms"
,
VP_Platforms
)
&
Assoc
(
"VP_Classifiers"
,
VP_Classifiers
)
&
Assoc
(
"Node_Name"
,
Node_Name
)
&
Assoc
(
"CPU_Name"
,
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Name
)
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Name
)
&
Assoc
(
"CPU_Kind"
,
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Kind
)
&
Assoc
(
"CPU_Platform"
,
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Platform
'
Img
)
&
Assoc
(
"CPU_Classifier"
,
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Classifier
)
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
CPU_Classifier
)
&
Assoc
(
"Package_Name"
,
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
Package_Name
)
&
Assoc
(
"Ada_Runtime"
,
CV
.
Nodes
(
Node_Name
).
Deployment_Node
.
Ada_Runtime
);
return
Parse
(
Path
&
"/node.tmplt"
,
Node_Assoc
);
...
...
src/taste-deployment_view.adb
View file @
eff74260
...
...
@@ -339,7 +339,11 @@ package body TASTE.Deployment_View is
CPU
:=
Get_Bound_Processor
(
CI
);
Result
.
CPU_Name
:=
US
(
Get_Name_String
(
Name
(
Identifier
(
Parent_Subcomponent
(
CPU
)))));
US
(
Get_Name_String
(
Name
(
Identifier
(
Parent_Subcomponent
(
CPU
)))));
-- CPU Kind is e.g. "leon3.air"
Result
.
CPU_Kind
:=
US
(
Get_Name_String
(
Name
(
Identifier
(
CPU
))));
Result
.
CPU_Platform
:=
Get_Execution_Platform
(
CPU
);
if
Result
.
CPU_Platform
=
Platform_GNAT_Runtime
then
...
...
@@ -406,9 +410,22 @@ package body TASTE.Deployment_View is
Result
.
VP_Platform
:=
Result
.
CPU_Platform
;
Result
.
VP_Classifier
:=
Result
.
CPU_Classifier
;
Result
.
CPU_Name
:=
US
(
Phy_CPU_Name
);
Result
.
CPU_Kind
:=
US
(
Get_Name_String
(
Name
(
Identifier
(
Phy_CPU
))));
Result
.
CPU_Platform
:=
Phy_CPU_Platform
;
Result
.
CPU_Classifier
:=
Phy_CPU_Classifier
;
Result
.
Package_Name
:=
Phy_CPU_Package_Name
;
declare
dummy_X
:
constant
Node_Id
:=
Corresponding_Declaration
(
Phy_CPU
);
dummy_Y
:
constant
Node_Id
:=
Parent_Subcomponent
(
Phy_CPU
);
dummy_Z
:
constant
Node_Id
:=
Namespace
(
dummy_X
);
begin
Put_Debug
(
"*** "
&
Get_Name_String
(
Name
(
Identifier
(
dummy_Z
))));
end
;
end
;
end
if
;
...
...
@@ -460,12 +477,25 @@ package body TASTE.Deployment_View is
Result
.
Drivers
.
Append
(
Parse_Device
(
CI
));
elsif
Get_Category_Of_Component
(
CI
)
=
CC_Process
then
Partition
:=
Parse_Partition
(
CI
,
Depl_View_System
);
Result
.
Partitions
.
Insert
(
Key
=>
To_String
(
Partition
.
Name
),
New_Item
=>
Partition
);
Result
.
Partitions
.
Insert
(
Key
=>
To_String
(
Partition
.
Name
),
New_Item
=>
Partition
);
Result
.
CPU_Name
:=
Partition
.
CPU_Name
;
Result
.
CPU_Kind
:=
Partition
.
CPU_Kind
;
Result
.
CPU_Platform
:=
Partition
.
CPU_Platform
;
Result
.
CPU_Classifier
:=
Partition
.
CPU_Classifier
;
Result
.
Ada_Runtime
:=
Partition
.
Ada_Runtime
;
Result
.
Package_Name
:=
Partition
.
Package_Name
;
-- Check if there is a Virtual processor, add it to the list
if
Partition
.
VP_Name
/=
""
then
Result
.
Virtual_CPUs
.
Insert
(
Key
=>
To_String
(
Partition
.
VP_Name
),
New_Item
=>
(
Name
=>
Partition
.
VP_Name
,
Package_Name
=>
Partition
.
VP_Package_Name
,
Platform
=>
US
(
Partition
.
VP_Platform
'
Img
),
Classifier
=>
Partition
.
VP_Classifier
));
end
if
;
end
if
;
Processes
:=
Next_Node
(
Processes
);
...
...
src/taste-deployment_view.ads
View file @
eff74260
...
...
@@ -125,6 +125,7 @@ package TASTE.Deployment_View is
Name
:
Unbounded_String
;
Coverage
:
Boolean
:=
False
;
Package_Name
:
Unbounded_String
;
CPU_Kind
:
Unbounded_String
;
CPU_Name
:
Unbounded_String
;
CPU_Platform
:
Supported_Execution_Platform
;
CPU_Classifier
:
Unbounded_String
;
...
...
@@ -142,6 +143,7 @@ package TASTE.Deployment_View is
&
Assoc
(
"Coverage"
,
P
.
Coverage
)
&
Assoc
(
"Package_Name"
,
P
.
Package_Name
)
&
Assoc
(
"CPU_Name"
,
P
.
CPU_Name
)
&
Assoc
(
"CPU_Kind"
,
P
.
CPU_Kind
)
&
Assoc
(
"CPU_Platform"
,
P
.
CPU_Platform
'
Img
)
&
Assoc
(
"CPU_Classifier"
,
P
.
CPU_Classifier
)
&
AssoC
(
"VP_Package_Name"
,
P
.
VP_Package_Name
)
...
...
@@ -154,14 +156,29 @@ package TASTE.Deployment_View is
package
Option_Partition
is
new
Option_Type
(
Taste_Partition
);
package
Taste_Partitions
is
new
Indefinite_Ordered_Maps
(
String
,
Taste_Partition
);
new
Indefinite_Ordered_Maps
(
String
,
Taste_Partition
);
-- Virtual processors are used in TSP systems to represent partitions
type
Virtual_Processor
is
tagged
record
Name
,
Package_Name
,
Platform
,
Classifier
:
Unbounded_String
;
end
record
;
package
Virtual_Processors
is
new
Indefinite_Ordered_Maps
(
String
,
Virtual_Processor
);
type
Taste_Node
is
tagged
record
Name
:
Unbounded_String
;
Drivers
:
Taste_Drivers
.
Vector
;
Partitions
:
Taste_Partitions
.
Map
;
Virtual_CPUs
:
Virtual_Processors
.
Map
;
Package_Name
:
Unbounded_String
;
CPU_Name
:
Unbounded_String
;
CPU_Kind
:
Unbounded_String
;
CPU_Platform
:
Supported_Execution_Platform
;
CPU_Classifier
:
Unbounded_String
;
Ada_Runtime
:
Unbounded_String
;
-- when Platform = GNAT_Runtime
...
...
templates/concurrency_view/aadl_2_threads/node.tmplt
View file @
eff74260
...
...
@@ -3,6 +3,17 @@
@@-- @_Node_Name_@ : Name of the node from deployment view
@@-- @_Partition_Names_@ : Tag listing the partitions in this node
@@-- @_Partitions_@ : List of rendered code for partitions
@@-- @_VP_Names_@ : Vector tag: list of virtual processors on this node
@@-- VP_Package_Names : |_ Corresponding package name
@@-- VP_Platforms : |_ Corresponding platform name
@@-- VP_Classifiers : |_ Corresponding aadl classifier
@@-- @_CPU_Name_@, _Platform_@, _Classifier_@, _Ada_Runtime_@ : Info about CPU
@@-- In standard TASTE systems there is only one partition per node
-- DEBUG : NODE_Name: @_Node_Name_@ CPU_Name : @_CPU_Name_@ Platform : @_CPU_Platform_@
-- Classifier : @_CPU_Classifier_@ Packagename : @_Package_Name_@ CPU Kind: @_CPU_Kind_@
-- VP Names: @_VP_Names_@
-- @_VP_Package_Names_@
-- @_VP_Platforms_@
-- @_VP_Classifiers_@
@_Partitions_@
test/test-tsp2/DeploymentView.aadl
View file @
eff74260
...
...
@@ -146,6 +146,6 @@ PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("");
Taste::HWLibraries => ("
/home/taste/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl
");
END deploymentview::DV;
test/test-tsp2/expected_cv/FullCV.aadl
0 → 100644
View file @
eff74260
This diff is collapsed.
Click to expand it.
test/test-tsp2/expected_cv/process.aadl
0 → 100644
View file @
eff74260
---------------------------------------------------
-- AADL2.2
-- TASTE type concurrencyview
--
-- generated code: do not edit
---------------------------------------------------
PROPERTY SET AI IS
Root_System : AADLSTRING
APPLIES TO(SYSTEM IMPLEMENTATION);
Disabled_Processing_Tools : LIST OF AADLSTRING
APPLIES TO(SYSTEM IMPLEMENTATION);
END AI;
PACKAGE concurrencyview::CV
PUBLIC
WITH AI;
WITH AIR::portpooling;
WITH DataView;
WITH TSP::DataView;
WITH Arinc653;
WITH ocarina_processors_leon;
WITH deploymentview::DV::TSPNode;
PROCESSOR TSPNode_proc1_cv
EXTENDS ocarina_processors_leon::leon3
END TSPNode_proc1_cv;
PROCESSOR IMPLEMENTATION TSPNode_proc1_cv.final
EXTENDS ocarina_processors_leon::leon3.AIR
SUBCOMPONENTS
part1_VP : VIRTUAL PROCESSOR deploymentview::DV::TSPNode::part1_VP.others;
part2_VP : VIRTUAL PROCESSOR deploymentview::DV::TSPNode::part2_VP.others;
PROPERTIES
SCHEDULING_PROTOCOL => (POSIX_1003_Highest_Priority_First_Protocol) APPLIES TO part1_VP;
SCHEDULING_PROTOCOL => (POSIX_1003_Highest_Priority_First_Protocol) APPLIES TO part2_VP;
ARINC653::DAL => LEVEL_A APPLIES TO part1_VP;
ARINC653::DAL => LEVEL_A APPLIES TO part2_VP;
END TSPNode_proc1_cv.final;
PROCESS part1
EXTENDS deploymentview::DV::TSPNode::part1
END part1;
PROCESS IMPLEMENTATION part1.final
SUBCOMPONENTS
helloworld1_task1 : THREAD helloworld1_task1.others;
helloworld1_pi_task1 : SUBPROGRAM helloworld1_pi_task1.final;
END part1.final;
PROCESS part2
EXTENDS deploymentview::DV::TSPNode::part2
END part2;
PROCESS IMPLEMENTATION part2.final
SUBCOMPONENTS
helloworld2_task2 : THREAD helloworld2_task2.others;
helloworld2_pi_task2 : SUBPROGRAM helloworld2_pi_task2.final;
END part2.final;
SYSTEM deploymentview
END deploymentview;
SYSTEM IMPLEMENTATION deploymentview.final
SUBCOMPONENTS
part1 : PROCESS part1.final;
part2 : PROCESS part2.final;
TSPNode_proc1_cv : PROCESSOR TSPNode_proc1_cv.final;
TSPNode_main_memory : MEMORY deploymentview::DV::TSPNode::main_memory.others;
PROPERTIES
AI::ROOT_SYSTEM => "generated";
ACTUAL_PROCESSOR_BINDING => (REFERENCE(TSPNode_proc1_cv.part1_VP)) APPLIES TO part1;
ACTUAL_PROCESSOR_BINDING => (REFERENCE(TSPNode_proc1_cv.part2_VP)) APPLIES TO part2;
ACTUAL_MEMORY_BINDING => (Reference(TSPNode_main_memory.part1_Segment)) APPLIES TO part1;
ACTUAL_MEMORY_BINDING => (Reference(TSPNode_main_memory.part2_Segment)) APPLIES TO part2;
ARINC653::MODULE_MAJOR_FRAME => 3000 ms APPLIES TO TSPNode_proc1_cv;
ARINC653::MODULE_SCHEDULE => (
[PARTITION=>Reference(TSPNode_proc1_cv.part1_VP);Duration=>1500 ms;PERIODIC_PROCESSING_START=>FALSE;],
[PARTITION=>Reference(TSPNode_proc1_cv.part2_VP);Duration=>1500 ms;PERIODIC_PROCESSING_START=>FALSE;]
) APPLIES TO TSPNode_proc1_cv;
END deploymentview.final;
THREAD helloworld1_task1
END helloworld1_task1;
THREAD IMPLEMENTATION helloworld1_task1.others
CALLS
MyCalls : {
MyCall : SUBPROGRAM helloworld1_pi_task1;
};
PROPERTIES
DISPATCH_PROTOCOL => Periodic;
PERIOD => 1000 ms;
DEADLINE => 1000 ms;
COMPUTE_EXECUTION_TIME => 0 ms..3 ms;
ANNEX behavior_specification {**
**};
END helloworld1_task1.others;
THREAD helloworld2_task2
END helloworld2_task2;
THREAD IMPLEMENTATION helloworld2_task2.others
CALLS
MyCalls : {
MyCall : SUBPROGRAM helloworld2_pi_task2;
};
PROPERTIES
DISPATCH_PROTOCOL => Periodic;
PERIOD => 1000 ms;
DEADLINE => 1000 ms;
COMPUTE_EXECUTION_TIME => 0 ms..3 ms;
ANNEX behavior_specification {**
**};
END helloworld2_task2.others;
SUBPROGRAM helloworld1_pi_task1
PROPERTIES
COMPUTE_EXECUTION_TIME => 3 ms..3 ms;
SOURCE_LANGUAGE => (C);
SOURCE_NAME => "helloworld1_pi_task1";
SOURCE_TEXT => ("helloworld1/helloworld1.c");
END helloworld1_pi_task1;
SUBPROGRAM IMPLEMENTATION helloworld1_pi_task1.final
END helloworld1_pi_task1.final;
SUBPROGRAM helloworld2_pi_task2
PROPERTIES
COMPUTE_EXECUTION_TIME => 3 ms..3 ms;
SOURCE_LANGUAGE => (C);
SOURCE_NAME => "helloworld2_pi_task2";
SOURCE_TEXT => ("helloworld2/helloworld2.c");
END helloworld2_pi_task2;
SUBPROGRAM IMPLEMENTATION helloworld2_pi_task2.final
END helloworld2_pi_task2.final;
END concurrencyview::CV;
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