Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
21111926
Commit
21111926
authored
May 06, 2019
by
Maxime Perrotin
Browse files
Add mutual exclusion
parent
544549f2
Changes
43
Show whitespace changes
Inline
Side-by-side
src/taste-aadl_parser.adb
View file @
21111926
...
@@ -462,6 +462,7 @@ package body TASTE.AADL_Parser is
...
@@ -462,6 +462,7 @@ package body TASTE.AADL_Parser is
Thread
:
constant
AADL_Thread
:=
Thread
:
constant
AADL_Thread
:=
(
Name
=>
F
.
Name
&
"_"
&
PI
.
Name
,
(
Name
=>
F
.
Name
&
"_"
&
PI
.
Name
,
RCM
=>
US
(
PI
.
RCM
'
Img
),
RCM
=>
US
(
PI
.
RCM
'
Img
),
Need_Mutex
=>
(
F
.
Provided
.
Length
>
1
),
Entry_Port_Name
=>
PI
.
Name
,
Entry_Port_Name
=>
PI
.
Name
,
Protected_Block_name
=>
Block
.
Name
,
Protected_Block_name
=>
Block
.
Name
,
Node
=>
Block
.
Node
,
Node
=>
Block
.
Node
,
...
...
src/taste-concurrency_view.adb
View file @
21111926
...
@@ -91,7 +91,11 @@ package body TASTE.Concurrency_View is
...
@@ -91,7 +91,11 @@ package body TASTE.Concurrency_View is
&
Assoc
(
"Protected_Block_Name"
,
To_String
(
PI
.
Name
))
&
Assoc
(
"Protected_Block_Name"
,
To_String
(
PI
.
Name
))
&
Assoc
(
"Caller_Is_Local"
,
PI
.
Local_Caller
);
&
Assoc
(
"Caller_Is_Local"
,
PI
.
Local_Caller
);
begin
begin
Result
.
Provided
.
Append
(
Basic
);
if
PI
.
PI
.
RCM
=
Protected_Operation
then
Result
.
Protected_Provided
.
Append
(
Basic
);
else
Result
.
Unprotected_Provided
.
Append
(
Basic
);
end
if
;
end
;
end
;
end
loop
;
end
loop
;
...
@@ -136,6 +140,7 @@ package body TASTE.Concurrency_View is
...
@@ -136,6 +140,7 @@ package body TASTE.Concurrency_View is
&
Assoc
(
"Thread_Name"
,
To_String
(
T
.
Name
))
&
Assoc
(
"Thread_Name"
,
To_String
(
T
.
Name
))
&
Assoc
(
"Entry_Port_Name"
,
To_String
(
T
.
Entry_Port_Name
))
&
Assoc
(
"Entry_Port_Name"
,
To_String
(
T
.
Entry_Port_Name
))
&
Assoc
(
"RCM"
,
To_String
(
T
.
RCM
))
&
Assoc
(
"RCM"
,
To_String
(
T
.
RCM
))
&
Assoc
(
"Need_Mutex"
,
T
.
Need_Mutex
)
&
Assoc
(
"Pro_Block_Name"
,
To_String
(
T
.
Protected_Block_Name
))
&
Assoc
(
"Pro_Block_Name"
,
To_String
(
T
.
Protected_Block_Name
))
&
Assoc
(
"Node_Name"
,
To_String
(
T
.
Node
.
Value_Or
&
Assoc
(
"Node_Name"
,
To_String
(
T
.
Node
.
Value_Or
(
Taste_Node
'(
Name
=>
US
(
""
),
others
=>
<>
)).
Name
))
(
Taste_Node
'(
Name
=>
US
(
""
),
others
=>
<>
)).
Name
))
...
@@ -278,7 +283,8 @@ package body TASTE.Concurrency_View is
...
@@ -278,7 +283,8 @@ package body TASTE.Concurrency_View is
Tmpl
:
constant
Block_As_Template
:=
Tmpl
:
constant
Block_As_Template
:=
B
.
Prepare_Template
;
B
.
Prepare_Template
;
Block_Assoc
:
Translate_Set
:=
Tmpl
.
Header
;
Block_Assoc
:
Translate_Set
:=
Tmpl
.
Header
;
PI_Tag
:
Unbounded_String
;
Pro_PI_Tag
:
Unbounded_String
;
Unpro_PI_Tag
:
Unbounded_String
;
RI_Tag
:
Unbounded_String
;
RI_Tag
:
Unbounded_String
;
Result
:
Unbounded_String
;
Result
:
Unbounded_String
;
...
@@ -298,8 +304,12 @@ package body TASTE.Concurrency_View is
...
@@ -298,8 +304,12 @@ package body TASTE.Concurrency_View is
Block_Names
:=
Block_Names
&
Block_Name
;
Block_Names
:=
Block_Names
&
Block_Name
;
Block_Languages
:=
Block_Languages
&
B
.
Language
;
Block_Languages
:=
Block_Languages
&
B
.
Language
;
for
PI_Assoc
of
Tmpl
.
Provided
loop
for
PI_Assoc
of
Tmpl
.
Protected_Provided
loop
PI_Tag
:=
PI_Tag
&
Newline
Pro_PI_Tag
:=
Pro_PI_Tag
&
Newline
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
));
end
loop
;
for
PI_Assoc
of
Tmpl
.
Unprotected_Provided
loop
Unpro_PI_Tag
:=
Unpro_PI_Tag
&
Newline
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
));
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
));
end
loop
;
end
loop
;
for
RI_Assoc
of
Tmpl
.
Required
loop
for
RI_Assoc
of
Tmpl
.
Required
loop
...
@@ -307,7 +317,8 @@ package body TASTE.Concurrency_View is
...
@@ -307,7 +317,8 @@ package body TASTE.Concurrency_View is
&
String
'(
Parse
(
Path
&
"/ri.tmplt"
,
RI_Assoc
));
&
String
'(
Parse
(
Path
&
"/ri.tmplt"
,
RI_Assoc
));
end
loop
;
end
loop
;
Block_Assoc
:=
Block_Assoc
Block_Assoc
:=
Block_Assoc
&
Assoc
(
"Provided"
,
PI_Tag
)
&
Assoc
(
"Protected_PIs"
,
Pro_PI_Tag
)
&
Assoc
(
"Unprotected_PIs"
,
Unpro_PI_Tag
)
&
Assoc
(
"Required"
,
RI_Tag
);
&
Assoc
(
"Required"
,
RI_Tag
);
Result
:=
Parse
(
Path
&
"/block.tmplt"
,
Block_Assoc
);
Result
:=
Parse
(
Path
&
"/block.tmplt"
,
Block_Assoc
);
...
...
src/taste-concurrency_view.ads
View file @
21111926
...
@@ -48,7 +48,8 @@ package TASTE.Concurrency_View is
...
@@ -48,7 +48,8 @@ package TASTE.Concurrency_View is
type
Block_As_Template
is
type
Block_As_Template
is
record
record
Header
:
Translate_Set
;
Header
:
Translate_Set
;
Provided
:
Translate_Sets
.
Vector
;
Protected_Provided
:
Translate_Sets
.
Vector
;
Unprotected_Provided
:
Translate_Sets
.
Vector
;
Required
:
Translate_Sets
.
Vector
;
Required
:
Translate_Sets
.
Vector
;
end
record
;
end
record
;
function
Prepare_Template
(
B
:
Protected_Block
)
return
Block_As_Template
;
function
Prepare_Template
(
B
:
Protected_Block
)
return
Block_As_Template
;
...
@@ -70,6 +71,7 @@ package TASTE.Concurrency_View is
...
@@ -70,6 +71,7 @@ package TASTE.Concurrency_View is
record
record
Name
:
Unbounded_String
;
Name
:
Unbounded_String
;
RCM
:
Unbounded_String
;
RCM
:
Unbounded_String
;
Need_Mutex
:
Boolean
:=
False
;
Entry_Port_Name
:
Unbounded_String
;
Entry_Port_Name
:
Unbounded_String
;
Protected_Block_Name
:
Unbounded_String
;
Protected_Block_Name
:
Unbounded_String
;
Output_Ports
:
Ports
.
Map
;
Output_Ports
:
Ports
.
Map
;
...
...
templates/concurrency_view/aadl_1_nodes/block.tmplt
View file @
21111926
@@-- The following tags are available in this template:
@@-- The following tags are available in this template:
@@--
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
templates/concurrency_view/aadl_2_threads/block.tmplt
View file @
21111926
@@-- The following tags are available in this template:
@@-- The following tags are available in this template:
@@--
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
templates/concurrency_view/aadl_2_threads/thread.tmplt
View file @
21111926
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
@@--
@
_Thread_Name_
@
:
Thread
name
@@--
@
_Thread_Name_
@
:
Thread
name
@@--
@
_Entry_Port_Name_
@
:
Name
of
the
PI
@@--
@
_Entry_Port_Name_
@
:
Name
of
the
PI
@@--
@
_RCM_
@
:
One
of
"CYCLIC_OPERATION"
,
"SPORADIC_OPERATION"
@@--
@
_RCM_
@
:
One
of
"CYCLIC_OPERATION"
,
"SPORADIC_OPERATION"
@@--
@
_Need_Mutex_
@
:
True
if
the
PI
is
shared
with
others
in
the
protected
block
@@--
@
_Pro_Block_Name_
@
:
Name
of
the
protected
function
@@--
@
_Pro_Block_Name_
@
:
Name
of
the
protected
function
@@--
@
_Node_Name_
@
:
Name
of
the
deployment
node
@@--
@
_Node_Name_
@
:
Name
of
the
deployment
node
@@--
@
_Remote_Threads_
@
:
Vector
tag
:
output
remote
thread
list
@@--
@
_Remote_Threads_
@
:
Vector
tag
:
output
remote
thread
list
...
...
templates/concurrency_view/aadl_3_main/block.tmplt
View file @
21111926
@@-- The following tags are available in this template:
@@-- The following tags are available in this template:
@@--
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Name_@ : Protected block name
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
templates/concurrency_view/aadl_4_makefile/block.tmplt
View file @
21111926
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
@@-- @_Language_@ : Implementation language
@@-- @_Language_@ : Implementation language
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@_LOWER:Name_@ :
@_LOWER:Name_@ :
# Placeholder if anything has to be done for this function coded in @_Language_@
# Placeholder if anything has to be done for this function coded in @_Language_@
templates/concurrency_view/ada_basic_body/block.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : Protected block name
@@-- @_Calling_Threads_@ : List of calling threads
@@-- @_Node name_@ : Node name
@@-- @_Provided_@ : Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
protected @_CAPITALIZE:Name_@ is -- part of node "@_CAPITALIZE:Node_Name_@"
-- Calling Threads: @_Calling_Threads_@
@_Provided'Indent_@
@_Required'Indent_@
end @_CAPITALIZE:Name_@;
templates/concurrency_view/ada_basic_body/fileblock.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- Specify the file name for a protected block
@@-- @_Block_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
templates/concurrency_view/ada_basic_body/filenode.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- The following tags are available in this template:
@@--
@@-- @_Node_Name_@ : Name of the node as defined in the Deployment View
@@-- The content of this file is generated from node.tmplt
@@-- If there is no string defined here, no file will be generated per node,
@@-- (that's an option if the intent is to generate only one file per system)
@_LOWER:Node_Name_@.adb
templates/concurrency_view/ada_basic_body/filepart.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- Specify the file name for a partition
@@-- @_Partition_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
templates/concurrency_view/ada_basic_body/filesys.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- Specify the file name for the complete system (including nodes)
@@-- (no template tag)
system_dump.log
templates/concurrency_view/ada_basic_body/filethread.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- Specify the file name for a thread
@@-- @_Thread_Name_@ is available.
@@-- Don't specify anything if you don't want the file to be created
templates/concurrency_view/ada_basic_body/node.tmplt
deleted
100644 → 0
View file @
544549f2
@@--
The
following
tags
are
available
in
this
template
:
@@--
@@--
@
_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
@@--
@
_CPU_Name_
@,
_Platform_
@,
_Classifier_
@,
_Ada_Runtime_
@
:
Info
about
CPU
@@--
In
standard
TASTE
systems
there
is
only
one
partition
per
node
@@--
Ada
basic
runtime
(
body
)
with
System
,
Ada
.
Real_Time
,
System_Time
;
use
System
;
package
body
@
_CAPITALIZE
:
Node_Name_
@
is
package
body
Periodic_Task
is
task
body
Periodic_Thread
is
use
Ada
.
Real_Time
;
Next_Period
:
Time
:=
System_Start_Time
+
Offset
;
begin
Init
;
loop
delay
until
Next_Period
;
Cyclic_Operation
;
Next_Period
:=
Next_Period
+
Milliseconds
(
Period
);
end
loop
;
end
Periodic_Thread
;
end
Periodic_Task
;
@
_Partitions
'Indent_@
end @_CAPITALIZE:Node_Name_@;
templates/concurrency_view/ada_basic_body/partition.tmplt
deleted
100644 → 0
View file @
544549f2
@@--
The
following
tags
are
available
in
this
template
:
@@--
@@--
@
_Name_
@
:
Partition
name
(
usually
the
name
of
the
binary
)
@@--
@
_Threads_
@
:
Code
generated
for
the
threads
@@--
@
_Thread_Names_
@
:
Tag
:
list
of
thread
names
@@--
@
_Node_Name_
@
:
Name
of
the
node
containing
this
partition
@@--
@
_Blocks_
@
:
Code
generated
for
protected
functions
@@--
@
_Coverage_
@
:
True
if
user
requested
code
coverage
enable
@@--
@
_Package_Name_
@
:
AADL
Package
name
for
the
target
(
e
.
g
.
ocarina_porocessors_x86
)
@@--
@
_CPU_Name_
@
:
CPU
Name
(
e
.
g
.
x86_linux
)
@@--
@
_CPU_Platform_
@
:
AADL
CPU_Platform
(
e
.
g
.
PLATFORM_NATIVE
)
@@--
@
_CPU_Classifier_
@
:
AADL
CPU
Classifier
(
e
.
g
.
ocarina_processors_x86
::
x86
.
linux
)
@@--
@
_Bound_Functions_
@
:
List
of
user
functions
from
Interface
view
@@--
@
_Thread_Src_Name_
@
:
Vector
tag
:
connection
thread
name
(
source
)
@@--
@
_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
)
package
body
@
_CAPITALIZE
:
Name_
@
is
--
Coverage
:
@
_Coverage_
@
--
Package
Name
:
@
_Package_Name_
@
--
CPU
Name
:
@
_CPU_Name_
@
--
CPU
Platform
:
@
_CPU_Platform_
@
--
CPU
Classifier
:
@
_CPU_Classifier_
@
--
Bound
Functions
:
@
_Bound_Functions_
@
@
_Threads
'Indent_@
@_Blocks'
Indent_
@
end
@
_CAPITALIZE
:
Name_
@;
templates/concurrency_view/ada_basic_body/pi.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
procedure @_CAPITALIZE:Name_@ is -- @_Direction_@ of function @_Parent_Function_@
@@TABLE@@
-- @_Param_Names_@ : @_Param_Types_@ (@_Param_Directions_@)
@@END_TABLE@@
end @_CAPITALIZE:Name_@;
templates/concurrency_view/ada_basic_body/ri.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- The following tags are available in this template:
@@--
@@-- @_Name_@ : The name of the interface
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
templates/concurrency_view/ada_basic_body/system.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- The following tags are available in this template:
@@--
@@-- @_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
@@-- @_Thread_Names_@ : List of all threads in the complete system
@@-- @_Target_Packages_@ : List of all target package names in the complete system
@@-- And all the system configuration obtained from the command line:
@@-- Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
@@-- Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
@@-- No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
-- The system contains these nodes:
@@TABLE@@
-- @_TABLE_LINE_@ @_Node_Names_@
@@END_TABLE@@
-- Content:
@_Nodes'Indent_@
templates/concurrency_view/ada_basic_body/thread.tmplt
deleted
100644 → 0
View file @
544549f2
@@-- The following tags are available in this template:
@@--
@@-- @_Thread_Name_@ : Thread name
@@-- @_Entry_Port_Name_@ : Name of the PI
@@-- @_RCM_@ : One of "CYCLIC_OPERATION", "SPORADIC_OPERATION"
@@-- @_Pro_Block_Name_@ : Name of the protected function
@@-- @_Node_Name_@ : Name of the deployment node
@@-- @_Remote_Threads_@ : Vector tag: output remote thread list
@@-- @_RI_Port_Name_@ : |_ Corresponding local RI name
@@-- @_Remote_PIs_@ : |_ Associated PI Name
@@-- @_Remote_PI_Sorts_@ : |_ Optional param type of the remote thread
@@-- @_Remote_PI_Modules_@ : |_ Asn1 module of the optional param type
@@-- Tags related to the PI that is at the origin of the thread creation:
@@-- @_Name_@, @_Kind_@, @_Parent_Function_@ : shoud be useless here
@@-- @_Param_Names_@, _Types_@, _ASN1_Modules, _Encodings_@, _Directions_@ : param vector tag
@@-- @_Period_@, @_WCET_@, @_Queue_Size_@ : relevant here
@@-- @_IF_Property_Names_@, _Values_@ : user properties (vector tag)
@@--
@@-- Matrix of output ports: Remote thread/corresponding remote PI @_Name_@
task @_CAPITALIZE:Thread_Name_@ is
Port : @_Entry_Port_Name_@
Protected Block : @_Pro_Block_Name_@
Node : @_Node_Name_@
Out_Ports :
@@TABLE@@
@_Remote_Threads_@ -> @_Remote_PIs_@
@@END_TABLE@@
end @_CAPITALIZE:Thread_Name_@;
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
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