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
9f561b09
Commit
9f561b09
authored
Oct 26, 2018
by
Maxime Perrotin
Browse files
Work on concurrency view
parent
d10c3754
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/aadl_parser.adb
View file @
9f561b09
...
...
@@ -11,7 +11,9 @@ begin
Model
:
constant
TASTE_Model
:=
Parse_Project
;
Transformed
:
TASTE_Model
:=
Transform
(
Model
);
begin
Transformed
.
Add_Concurrency_View
;
if
Transformed
.
Configuration
.
Glue
then
Transformed
.
Add_Concurrency_View
;
end
if
;
Transformed
.
Dump
;
Transformed
.
Generate_Build_Script
;
Transformed
.
Generate_Code
;
...
...
src/taste-aadl_parser.adb
View file @
9f561b09
...
...
@@ -245,6 +245,43 @@ package body TASTE.AADL_Parser is
return
Nothing
;
end
Find_Binding
;
procedure
Set_Calling_Threads
(
CV
:
in
out
Taste_Concurrency_View
)
is
Visited_Threads
:
String_Sets
.
Set
;
procedure
Rec_Add_Calling_Thread
(
Thread_Id
:
String
;
Block_Id
:
String
;
Visited
:
in
out
String_Sets
.
Set
)
is
use
String_Sets
;
Current_Thread
:
constant
String_Sets
.
Set
:=
To_Set
(
Thread_Id
);
begin
if
Current_Thread
.
Is_Subset
(
Of_Set
=>
Visited
)
then
return
;
else
Visited
:=
Visited
or
Current_Thread
;
end
if
;
-- First add thread to its corresponding protected function
CV
.
Blocks
(
Block_Id
).
Calling_Threads
.
Insert
(
Thread_Id
);
-- Then recurse on its (Un)protected RIs.
for
RI
of
CV
.
Blocks
(
Block_Id
).
Required
loop
if
RI
.
RCM
=
Protected_Operation
or
RI
.
RCM
=
Unprotected_Operation
then
for
Remote
of
RI
.
Remote_Interfaces
loop
Rec_Add_Calling_Thread
(
Thread_Id
=>
Thread_Id
,
Block_Id
=>
To_String
(
Remote
.
Function_Name
),
Visited
=>
Visited
);
end
loop
;
end
if
;
end
loop
;
end
Rec_Add_Calling_Thread
;
begin
for
Each
of
CV
.
Threads
loop
Rec_Add_Calling_Thread
(
Thread_Id
=>
To_String
(
Each
.
Name
),
Block_Id
=>
To_String
(
Each
.
Protected_Block_Name
),
Visited
=>
Visited_Threads
);
end
loop
;
end
Set_Calling_Threads
;
-- Find the output ports of a thread by following the connections
function
Get_Output_Ports
(
Model
:
TASTE_Model
;
F
:
Taste_Terminal_Function
)
return
Ports
.
Map
...
...
@@ -265,6 +302,10 @@ package body TASTE.AADL_Parser is
else
Visited
:=
Visited
or
Current_Function
;
end
if
;
if
Func
.
Is_Type
then
-- Ignore function types, only work with instances
return
;
end
if
;
for
RI
of
Func
.
Required
loop
if
RI
.
RCM
=
Unprotected_Operation
or
RI
.
RCM
=
Protected_Operation
...
...
@@ -355,7 +396,6 @@ package body TASTE.AADL_Parser is
Node
=>
Block
.
Node
,
Output_Ports
=>
Get_Output_Ports
(
Model
,
F
));
begin
-- Todo: add Thread.Output_Ports
Result
.
Threads
.
Include
(
Key
=>
To_String
(
Thread
.
Name
),
New_Item
=>
Thread
);
...
...
@@ -364,12 +404,13 @@ package body TASTE.AADL_Parser is
end
loop
;
Block
.
Required
:=
F
.
Required
;
-- Find calling threads and add them to Block.Calling_Threads
-- Add the block to the Concurrency View
Result
.
Blocks
.
Insert
(
Key
=>
To_String
(
Block
.
Name
),
New_Item
=>
Block
);
end
;
end
loop
;
-- Find and set protected blocks calling threads
Set_Calling_Threads
(
Result
);
Model
.
Concurrency_View
:=
Result
;
end
Add_Concurrency_View
;
...
...
test/test8/DeploymentView.aadl
View file @
9f561b09
...
...
@@ -74,6 +74,6 @@ PROPERTIES
Taste::coordinates => "0 0 297000 210000";
Taste::version => "2.0";
Taste::interfaceView => "InterfaceView.aadl";
Taste::HWLibraries => ("
../../..
/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
Taste::HWLibraries => ("
/home/taste
/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl");
END deploymentview::DV;
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