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
1694da45
Commit
1694da45
authored
Jul 15, 2019
by
Maxime Perrotin
Browse files
First implementation of async calls
parent
53ec44c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/taste-concurrency_view.adb
View file @
1694da45
...
@@ -89,7 +89,8 @@ package body TASTE.Concurrency_View is
...
@@ -89,7 +89,8 @@ package body TASTE.Concurrency_View is
declare
declare
Basic
:
constant
Translate_Set
:=
PI
.
PI
.
To_Template
Basic
:
constant
Translate_Set
:=
PI
.
PI
.
To_Template
&
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
)
&
Assoc
(
"Calling_Threads"
,
Calling_Threads
);
begin
begin
if
PI
.
PI
.
RCM
=
Protected_Operation
then
if
PI
.
PI
.
RCM
=
Protected_Operation
then
Result
.
Protected_Provided
.
Append
(
Basic
);
Result
.
Protected_Provided
.
Append
(
Basic
);
...
@@ -100,7 +101,8 @@ package body TASTE.Concurrency_View is
...
@@ -100,7 +101,8 @@ package body TASTE.Concurrency_View is
end
loop
;
end
loop
;
for
RI
of
B
.
Required
loop
for
RI
of
B
.
Required
loop
Result
.
Required
.
Append
(
RI
.
To_Template
);
Result
.
Required
.
Append
(
RI
.
To_Template
&
Assoc
(
"Calling_Threads"
,
Calling_Threads
));
end
loop
;
end
loop
;
Result
.
Header
:=
+
Assoc
(
"Name"
,
To_String
(
B
.
Name
))
Result
.
Header
:=
+
Assoc
(
"Name"
,
To_String
(
B
.
Name
))
...
@@ -316,15 +318,21 @@ package body TASTE.Concurrency_View is
...
@@ -316,15 +318,21 @@ package body TASTE.Concurrency_View is
for
PI_Assoc
of
Tmpl
.
Protected_Provided
loop
for
PI_Assoc
of
Tmpl
.
Protected_Provided
loop
Pro_PI_Tag
:=
Pro_PI_Tag
&
Newline
Pro_PI_Tag
:=
Pro_PI_Tag
&
Newline
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
));
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
&
Assoc
(
"Partition_Name"
,
Partition_Name
)));
end
loop
;
end
loop
;
for
PI_Assoc
of
Tmpl
.
Unprotected_Provided
loop
for
PI_Assoc
of
Tmpl
.
Unprotected_Provided
loop
Unpro_PI_Tag
:=
Unpro_PI_Tag
&
Newline
Unpro_PI_Tag
:=
Unpro_PI_Tag
&
Newline
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
));
&
String
'(
Parse
(
Path
&
"/pi.tmplt"
,
PI_Assoc
&
Assoc
(
"Partition_Name"
,
Partition_Name
)));
end
loop
;
end
loop
;
for
RI_Assoc
of
Tmpl
.
Required
loop
for
RI_Assoc
of
Tmpl
.
Required
loop
RI_Tag
:=
RI_Tag
&
Newline
RI_Tag
:=
RI_Tag
&
Newline
&
String
'(
Parse
(
Path
&
"/ri.tmplt"
,
RI_Assoc
));
&
String
'(
Parse
(
Path
&
"/ri.tmplt"
,
RI_Assoc
&
Assoc
(
"Partition_Name"
,
Partition_Name
)));
end
loop
;
end
loop
;
Block_Assoc
:=
Block_Assoc
Block_Assoc
:=
Block_Assoc
&
Assoc
(
"Protected_PIs"
,
Pro_PI_Tag
)
&
Assoc
(
"Protected_PIs"
,
Pro_PI_Tag
)
...
...
templates/concurrency_view/pohic_wrappers_body/pi.tmplt
View file @
1694da45
...
@@ -4,11 +4,13 @@
...
@@ -4,11 +4,13 @@
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Partition_Name_@ : Partition name for parent function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callers
@@-- @_Remote_Function_Names_@ : List of callers
@@-- @_Remote_Interface_Names_@ : |_ caller's interface name
@@-- @_Remote_Interface_Names_@ : |_ caller's interface name
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@()
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@()
...
...
templates/concurrency_view/pohic_wrappers_body/ri.tmplt
View file @
1694da45
...
@@ -4,11 +4,13 @@
...
@@ -4,11 +4,13 @@
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Partition_Name_@ : Partition name for parent function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callees
@@-- @_Remote_Function_Names_@ : List of callees
@@-- @_Remote_Interface_Names_@ : |_ callee's interface name
@@-- @_Remote_Interface_Names_@ : |_ callee's interface name
@@-- @_Calling_Threads_@ : Calling threads of the containing block
// Required interface @_Name_@ in function @_Parent_Function_@
// Required interface @_Name_@ in function @_Parent_Function_@
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
@@INLINE( \()(,\n )(\)\n)@@
...
@@ -22,7 +24,31 @@ void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
...
@@ -22,7 +24,31 @@ void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@END_INLINE@@
@@END_INLINE@@
{
{
@@IF@@ @_Kind_@ = SPORADIC_OPERATION
@@IF@@ @_Kind_@ = SPORADIC_OPERATION
puts("Sporadic call of @_Name_@");
puts("[TASTE] Sporadic call of @_Name_@");
__po_hi_task_id current_task = __po_hi_get_task_id();
@@TABLE@@
// @_Calling_Threads_@ calling thread
if (@_LOWER:Partition_Name_@_@_LOWER:Calling_Threads_@_k == current_task) {
@@IF@@ @_Param_Names'Length_@ > 0
@@INLINE( )( \n )(\n)@@
__po_hi_request_t request;
__po_hi_copy_array(&(request.vars.@_LOWER:Calling_Threads_@_global_outport_@_LOWER:Name_@.@_LOWER:Calling_Threads_@_global_outport_@_LOWER:Name_@.buffer),
@@TABLE@@
IN_buf_@_LOWER:Param_Names_@, size_IN_buf_@_LOWER:Param_Names_@);
@@END_TABLE@@
request.vars.@_LOWER:Calling_Threads_@_global_outport_@_LOWER:Name_@.@_LOWER:Calling_Threads_@_global_outport_@_LOWER:Name_@.length =
@@TABLE@@
size_IN_buf_@_LOWER:Param_Names_@;
@@END_TABLE@@
request.port = @_LOWER:Calling_Threads_@_global_outport_@_LOWER:Name_@;
__po_hi_gqueue_store_out(@_LOWER:Partition_Name_@_@_LOWER:Calling_Threads_@_k, @_LOWER:Calling_Threads_@_local_outport_@_LOWER:Name_@, &request);
__po_hi_send_output(@_LOWER:Partition_Name_@_@_LOWER:Calling_Threads_@_k, @_LOWER:Calling_Threads_@_global_outport_@_LOWER:Name_@);
@@END_INLINE@@
@@END_IF@@
return;
}
@@END_TABLE@@
// calling threads: @_Calling_Threads_@ partition: @_Partition_Name_@
@@ELSIF@@ @_Kind_@ = UNPROTECTED_OPERATION
@@ELSIF@@ @_Kind_@ = UNPROTECTED_OPERATION
@@TABLE@@
@@TABLE@@
@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@
@_LOWER:Remote_Function_Names_@_@_LOWER:Remote_Interface_Names_@
...
...
templates/concurrency_view/pohic_wrappers_header/pi.tmplt
View file @
1694da45
...
@@ -4,11 +4,13 @@
...
@@ -4,11 +4,13 @@
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Partition_Name_@ : Partition name for parent function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callers
@@-- @_Remote_Function_Names_@ : List of callers
@@-- @_Remote_Interface_Names_@ : |_ caller's interface name
@@-- @_Remote_Interface_Names_@ : |_ caller's interface name
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@();
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@();
...
...
templates/concurrency_view/pohic_wrappers_header/ri.tmplt
View file @
1694da45
...
@@ -4,11 +4,13 @@
...
@@ -4,11 +4,13 @@
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Partition_Name_@ : Partition name for parent function
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Remote_Function_Names_@ : List of callees
@@-- @_Remote_Function_Names_@ : List of callees
@@-- @_Remote_Interface_Names_@ : |_ callee's interface name
@@-- @_Remote_Interface_Names_@ : |_ callee's interface name
@@-- @_Calling_Threads_@ : Calling threads of the containing block
// Required interface @_Name_@ in function @_Parent_Function_@
// Required interface @_Name_@ in function @_Parent_Function_@
// This RI is connected to: @_Remote_Function_Names_@
// This RI is connected to: @_Remote_Function_Names_@
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
...
...
Write
Preview
Markdown
is supported
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