Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
5d33ca75
Commit
5d33ca75
authored
Nov 07, 2019
by
bouazizrahma
Committed by
Jerome Hugues
Nov 07, 2019
Browse files
update c_common-subprograms to support BA dispatch pattern for sporadic threads
parent
a9253320
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-c_common-subprograms.adb
View file @
5d33ca75
...
...
@@ -639,16 +639,37 @@ package body Ocarina.Backends.C_Common.Subprograms is
declare
BA
:
Node_Id
;
PL
:
List_Id
;
P
:
constant
Supported_Thread_Dispatch_Protocol
:=
Get_Thread_Dispatch_Protocol
(
E
);
begin
BA
:=
Get_Behavior_Specification
(
E
);
if
BANu
.
Length
(
BATN
.
States
(
BA
))
>
1
then
if
P
=
Thread_Periodic
or
else
(
P
=
Thread_Sporadic
and
then
Compute_Nb_On_Dispatch_Transitions
(
E
)
=
1
)
then
PL
:=
No_List
;
elsif
P
=
Thread_Sporadic
and
then
Compute_Nb_On_Dispatch_Transitions
(
E
)
>
1
then
PL
:=
Make_List_Id
(
Make_Parameter_Specification
(
Defining_Identifier
=>
Make_Defining_Identifier
(
VN
(
V_Next_Complete_State
)),
Parameter_Type
=>
Make_Pointer_Type
(
RE
(
RE_Ba_Automata_State_T
))));
end
if
;
N
:=
Make_Extern_Entity_Declaration
(
Make_Function_Specification
(
Defining_Identifier
=>
Make_Defining_Identifier
(
Map_C_BA_Related_Function_Name
(
S
,
States_Initialization
=>
True
)),
Parameters
=>
No_List
,
Parameters
=>
PL
,
Return_Type
=>
New_Node
(
CTN
.
K_Void
)));
Append_Node_To_List
(
N
,
...
...
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