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
62e7f0ca
Commit
62e7f0ca
authored
Sep 20, 2019
by
bouazizrahma
Committed by
Jerome Hugues
Sep 23, 2019
Browse files
Start implementation of mapping many transitions in BA of a sporadic thread
parent
fff1ccb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/backends/ocarina-backends-c_common-ba.adb
View file @
62e7f0ca
...
...
@@ -594,14 +594,16 @@ package body Ocarina.Backends.C_Common.BA is
&
"subprogram are not supported"
,
Fatal
=>
True
);
elsif
AINU
.
Is_Thread
(
S
)
then
if
Get_Thread_Dispatch_Protocol
(
S
)
=
Thread_Periodic
then
if
Get_Thread_Dispatch_Protocol
(
S
)
=
Thread_Periodic
or
else
Get_Thread_Dispatch_Protocol
(
S
)
=
Thread_Sporadic
then
Map_C_Many_Transitions_Of_A_Thread
(
S
,
Declarations
,
Statements
);
else
Display_Error
(
"The mapping of many transitions i
n the BA of a non-periodic
"
&
"thread is not supported
"
,
Fatal
=>
True
);
(
"The mapping of many
BA
transitions i
s only
"
&
" supported of periodic or sporadic threads
"
,
Fatal
=>
True
);
end
if
;
end
if
;
end
if
;
...
...
@@ -1975,17 +1977,28 @@ package body Ocarina.Backends.C_Common.BA is
Declarations
:
List_Id
;
Statements
:
List_Id
)
is
N
:
Node_Id
;
begin
Map_BA_States_To_C_Types
(
S
);
Make_States_Initialization_Function
(
S
);
if
Is_To_Make_Init_Sequence
(
S
)
then
Make_BA_Initialization_Function
(
S
);
end
if
;
if
Get_Thread_Dispatch_Protocol
(
S
)
=
Thread_Periodic
then
if
Is_To_Make_Init_Sequence
(
S
)
then
Make_BA_Initialization_Function
(
S
);
end
if
;
Make_BA_Body_Function
(
S
,
Declarations
,
Statements
);
Make_BA_Body_Function
(
S
,
Declarations
,
Statements
);
elsif
Get_Thread_Dispatch_Protocol
(
S
)
=
Thread_Sporadic
then
N
:=
Message_Comment
(
"Mapping many transitions in BA of Sporadic thread."
);
CTU
.
Append_Node_To_List
(
N
,
Statements
);
Map_C_Implementation_of_BA_Body_Function
(
S
,
Declarations
,
Statements
);
end
if
;
end
Map_C_Many_Transitions_Of_A_Thread
;
...
...
src/backends/po_hi_c/ocarina-backends-po_hi_c-activity.adb
View file @
62e7f0ca
...
...
@@ -1144,7 +1144,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
----------------------------------------
procedure
Make_Thread_Behavior_Specification
is
N
:
Node_Id
;
N
,
N1
:
Node_Id
;
Parameter_List
:
constant
List_Id
:=
New_List
(
CTN
.
K_List_Id
);
Def_Idt
:
Node_Id
;
begin
...
...
@@ -1172,16 +1172,46 @@ package body Ocarina.Backends.PO_HI_C.Activity is
if
P
=
Thread_Sporadic
then
Append_Node_To_List
(
Make_Defining_Identifier
(
VN
(
V_Port
))
,
Call_Parameters
);
N
:=
Make_Variable_Address
(
Make_Defining_Identifier
(
VN
(
V_Port
))
);
Append_Node_To_List
(
N
,
Call_Parameters
);
N
:=
Make_Parameter_Specification
(
Make_Defining_Identifier
(
VN
(
V_Port
)),
Parameter_Type
=>
RE
(
RE_Port_T
));
Parameter_Type
=>
CTU
.
Make_Pointer_Type
(
RE
(
RE_Port_T
))
)
;
Append_Node_To_List
(
N
,
Parameter_List
);
-- add data subcomponents of the thread to the call_parameters
-- of the procedure <<thread_instance_name>>_ba_body
if
not
AAU
.
Is_Empty
(
Subcomponents
(
E
))
then
N1
:=
First_Node
(
Subcomponents
(
E
));
while
Present
(
N1
)
loop
if
AAU
.
Is_Data
(
Corresponding_Instance
(
N1
))
then
N
:=
Make_Variable_Address
(
Map_C_Defining_Identifier
(
N1
));
Append_Node_To_List
(
N
,
Call_Parameters
);
N
:=
Make_Parameter_Specification
(
Map_C_Defining_Identifier
(
N1
),
Parameter_Type
=>
CTU
.
Make_Pointer_Type
(
Map_C_Data_Type_Designator
(
Corresponding_Instance
(
N1
))));
Append_Node_To_List
(
N
,
Parameter_List
);
end
if
;
N1
:=
Next_Node
(
N1
);
end
loop
;
end
if
;
end
if
;
N
:=
...
...
@@ -1429,7 +1459,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
-- when the BA of the thread has more than one state **/
--
-- producer_th_states_initialization ();
if
P
=
Thread_Periodic
then
if
P
=
Thread_Periodic
or
else
P
=
Thread_Sporadic
then
declare
BA
:
Node_Id
;
begin
...
...
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