Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Ocarina
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
Ocarina
Commits
23c99ceb
Commit
23c99ceb
authored
May 06, 2017
by
hana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update of LNT processor generation.
parent
f4386e25
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
604 additions
and
280 deletions
+604
-280
src/backends/lnt/ocarina-backends-lnt-components.adb
src/backends/lnt/ocarina-backends-lnt-components.adb
+10
-6
src/backends/lnt/ocarina-backends-lnt-components.ads
src/backends/lnt/ocarina-backends-lnt-components.ads
+3
-2
src/backends/lnt/ocarina-backends-lnt-tree_generator.adb
src/backends/lnt/ocarina-backends-lnt-tree_generator.adb
+6
-6
src/backends/lnt/ocarina-backends-lnt-tree_generator.ads
src/backends/lnt/ocarina-backends-lnt-tree_generator.ads
+1
-1
src/backends/lnt/ocarina-backends-lnt-tree_generator_main.adb
...backends/lnt/ocarina-backends-lnt-tree_generator_main.adb
+20
-14
src/backends/lnt/ocarina-backends-lnt-tree_generator_port.adb
...backends/lnt/ocarina-backends-lnt-tree_generator_port.adb
+1
-1
src/backends/lnt/ocarina-backends-lnt-tree_generator_processor.adb
...nds/lnt/ocarina-backends-lnt-tree_generator_processor.adb
+550
-245
src/backends/lnt/ocarina-backends-lnt.adb
src/backends/lnt/ocarina-backends-lnt.adb
+1
-1
src/backends/lnt/ocarina-backends-lnt.ads
src/backends/lnt/ocarina-backends-lnt.ads
+3
-2
src/backends/ocarina-backends-lnt-nodes.idl
src/backends/ocarina-backends-lnt-nodes.idl
+1
-1
src/backends/ocarina-backends-properties.adb
src/backends/ocarina-backends-properties.adb
+8
-1
No files found.
src/backends/lnt/ocarina-backends-lnt-components.adb
View file @
23c99ceb
...
...
@@ -756,7 +756,7 @@ package body Ocarina.Backends.Lnt.Components is
(
Defining_Identifier
:
Node_Id
;
Actual_Gates
:
List_Id
:=
No_List
;
Actual_Parameters
:
List_Id
:=
No_List
;
Is_
Sporadic
:
b
oolean
:=
false
)
Is_
Not_Periodic
:
B
oolean
:=
false
)
return
Node_Id
is
pragma
Assert
(
Defining_Identifier
/=
No_Node
);
...
...
@@ -766,7 +766,7 @@ package body Ocarina.Backends.Lnt.Components is
Set_Identifier
(
N
,
Defining_Identifier
);
Set_Actual_Gates
(
N
,
Actual_Gates
);
Set_Actual_Parameters
(
N
,
Actual_Parameters
);
Set_Is_
Sporadic
(
N
,
Is_Spora
dic
);
Set_Is_
Not_Periodic
(
N
,
Is_Not_Perio
dic
);
return
N
;
end
Make_Process_Instantiation_Statement
;
...
...
@@ -899,17 +899,21 @@ package body Ocarina.Backends.Lnt.Components is
---------------------------
function
Make_Var_Loop_Select
(
Var_Dec
:
List_Id
;
Out_Loop
:
List_Id
;
In_Select
:
List_Id
)
In_Select
:
List_Id
;
With_Select
:
Boolean
:=
true
)
return
Node_Id
is
N
:
Node_Id
;
N_Loop
:
Node_Id
;
L_Var
:
List_Id
;
begin
L_Var
:=
Out_Loop
;
if
With_Select
then
N_Loop
:=
Make_Loop_Statement
(
New_List
(
Make_Select_Statement
(
In_Select
)));
else
N_Loop
:=
Make_Loop_Statement
(
In_Select
);
end
if
;
Append_Node_To_List
(
N_Loop
,
L_Var
);
N
:=
Make_Var_Statement
(
Var_Dec
,
L_Var
);
return
N
;
end
Make_Var_Loop_Select
;
...
...
src/backends/lnt/ocarina-backends-lnt-components.ads
View file @
23c99ceb
...
...
@@ -244,7 +244,7 @@ package Ocarina.Backends.Lnt.Components is
(
Defining_Identifier
:
Node_Id
;
Actual_Gates
:
List_Id
:=
No_List
;
Actual_Parameters
:
List_Id
:=
No_List
;
Is_
Sporadic
:
b
oolean
:=
false
)
Is_
Not_Periodic
:
B
oolean
:=
false
)
return
Node_Id
;
function
Make_Communication_Statement
...
...
@@ -290,6 +290,7 @@ package Ocarina.Backends.Lnt.Components is
function
Make_Var_Loop_Select
(
Var_Dec
:
List_Id
;
Out_Loop
:
List_Id
;
In_Select
:
List_Id
)
In_Select
:
List_Id
;
With_Select
:
Boolean
:=
true
)
return
Node_Id
;
end
Ocarina
.
Backends
.
Lnt
.
Components
;
src/backends/lnt/ocarina-backends-lnt-tree_generator.adb
View file @
23c99ceb
...
...
@@ -50,7 +50,7 @@ package body Ocarina.Backends.LNT.Tree_Generator is
procedure
Get_N_Thread
(
Sys
:
Node_Id
;
Thread_Number
:
in
out
Natural
;
Spora
dic_Thread_Number
:
in
out
Natural
)
is
Not_Perio
dic_Thread_Number
:
in
out
Natural
)
is
Sys_N
:
Node_Id
;
Proc
:
Node_Id
;
Proc_N
:
Node_Id
;
...
...
@@ -64,7 +64,7 @@ package body Ocarina.Backends.LNT.Tree_Generator is
if
Get_Category_Of_Component
(
Proc
)
=
CC_System
then
Get_N_Thread
(
Proc
,
Thread_Number
,
Spora
dic_Thread_Number
);
Not_Perio
dic_Thread_Number
);
end
if
;
if
Get_Category_Of_Component
(
Proc
)
=
CC_Process
then
if
not
AINU
.
Is_Empty
(
Subcomponents
(
Proc
))
then
...
...
@@ -73,11 +73,11 @@ package body Ocarina.Backends.LNT.Tree_Generator is
Thr
:=
Corresponding_Instance
(
Proc_N
);
if
Get_Category_Of_Component
(
Thr
)
=
CC_Thread
then
Thread_Number
:=
Thread_Number
+
1
;
if
(
Get_Thread_Dispatch_Protocol
(
Thr
)
=
Thread_Spora
dic
)
if
(
Get_Thread_Dispatch_Protocol
(
Thr
)
/=
Thread_Perio
dic
)
then
Spora
dic_Thread_Number
:=
Spora
dic_Thread_Number
+
1
;
Not_Perio
dic_Thread_Number
:=
Not_Perio
dic_Thread_Number
+
1
;
end
if
;
end
if
;
Proc_N
:=
AIN
.
Next_Node
(
Proc_N
);
...
...
src/backends/lnt/ocarina-backends-lnt-tree_generator.ads
View file @
23c99ceb
...
...
@@ -33,6 +33,6 @@ package Ocarina.Backends.LNT.Tree_Generator is
procedure
Get_N_Thread
(
Sys
:
Node_Id
;
Thread_Number
:
in
out
Natural
;
Spora
dic_Thread_Number
:
in
out
Natural
);
Not_Perio
dic_Thread_Number
:
in
out
Natural
);
end
Ocarina
.
Backends
.
LNT
.
Tree_Generator
;
src/backends/lnt/ocarina-backends-lnt-tree_generator_main.adb
View file @
23c99ceb
...
...
@@ -78,8 +78,8 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
procedure
Find_Instance_By_Name
(
Key
:
Name_Id
;
Target
:
List_Id
;
Instance
:
out
Node_Id
;
Index
:
out
Natural
;
Is_
Spora
dic
:
out
boolean
);
function
Is_
Spora
dic
(
Index
:
Natural
;
Target
:
List_Id
)
Is_
Not_Perio
dic
:
out
boolean
);
function
Is_
Not_Perio
dic
(
Index
:
Natural
;
Target
:
List_Id
)
return
boolean
;
procedure
Make_Process_Main
;
...
...
@@ -114,7 +114,6 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
L
:=
Sources
(
S
);
-- port_out thread, first connection 1-1
N_Connection
:=
AIN
.
Item
(
AIN
.
First_Node
(
L
));
while
(
AIN
.
Is_In
(
N_Connection
))
loop
L
:=
Sources
(
N_Connection
);
N_Connection
:=
AIN
.
Item
(
AIN
.
First_Node
(
L
));
...
...
@@ -155,6 +154,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
Connection
);
end
if
;
-- Put_Line (Image (Connection));
return
Connection
;
end
Make_Gate_Identifier
;
...
...
@@ -272,7 +272,13 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
S
:=
AIN
.
Next_Node
(
S
);
end
loop
;
end
if
;
if
not
AINU
.
Is_Empty
(
Connections
(
E
))
then
S
:=
AIN
.
First_Node
(
Connections
(
E
));
while
Present
(
S
)
loop
Put_Line
(
Image
(
AIN
.
Display_Name
(
AIN
.
Identifier
(
S
))));
S
:=
AIN
.
Next_Node
(
S
);
end
loop
;
end
if
;
end
Visit_System_Instance
;
----------------------------
...
...
@@ -457,7 +463,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
Aux_N_Port_4
:
Node_Id
;
N_Send
:
Name_Id
;
Connection
:
Name_Id
;
Is_
Spora
dic
:
boolean
:=
false
;
Is_
Not_Perio
dic
:
boolean
:=
false
;
Thread_Identifier
:
constant
Name_Id
:=
New_Identifier
(
AIN
.
Display_Name
(
AIN
.
Identifier
(
E
)),
"Thread_"
);
...
...
@@ -468,7 +474,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
LNT_Thread_Instance_List
,
Thread_Instance
,
Index
,
Is_
Spora
dic
);
Is_
Not_Perio
dic
);
N_Activation
:=
New_Identifier
(
Remove_Prefix_From_Name
(
...
...
@@ -484,7 +490,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
Make_Gate_Declaration
(
Make_Identifier
(
"LNT_Channel_Dispatch"
),
Aux_N_Activation_2
));
if
Is_
Spora
dic
then
if
Is_
Not_Perio
dic
then
N_Event
:=
New_Identifier
(
Remove_Prefix_From_Name
(
" "
,
Get_String_Name
(
Integer
'
Image
(
Index
))),
...
...
@@ -551,7 +557,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
No_List
);
elsif
AIN
.
Is_Event
(
S
)
then
-- event port
if
Is_
Spora
dic
then
if
Is_
Not_Perio
dic
then
Aux_N_Event
:=
BLNu
.
Make_Node_Container
(
N_Event
);
Port_Gates_List
:=
New_List
(
Make_Identifier
(
N_SEND
),
-- SEND_
...
...
@@ -635,7 +641,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
" "
,
Get_String_Name
(
Integer
'
Image
(
I
))),
"ACTIVATION_"
);
BLNu
.
Append_Node_To_List
(
N_Activation
,
Processor_Gates_List
);
if
(
Is_
Spora
dic
(
I
,
LNT_Thread_Instance_List
))
then
if
(
Is_
Not_Perio
dic
(
I
,
LNT_Thread_Instance_List
))
then
N_Activation
:=
New_Identifier
(
Remove_Prefix_From_Name
(
" "
,
Get_String_Name
(
Integer
'
Image
(
I
))),
...
...
@@ -668,7 +674,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
procedure
Find_Instance_By_Name
(
Key
:
Name_Id
;
Target
:
List_Id
;
Instance
:
out
Node_Id
;
Index
:
out
Natural
;
Is_
Spora
dic
:
out
boolean
)
Is_
Not_Perio
dic
:
out
boolean
)
is
N
:
Node_Id
;
Counter
:
Natural
:=
1
;
...
...
@@ -682,7 +688,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
if
((
BLN
.
Name
(
BLN
.
Identifier
(
N
))
=
Key
and
then
BLNu
.
Is_Empty
(
Actual_Gates
(
N
))))
then
Is_
Sporadic
:=
BLN
.
Is_Spora
dic
(
N
);
Is_
Not_Periodic
:=
BLN
.
Is_Not_Perio
dic
(
N
);
Instance
:=
N
;
Index
:=
Counter
;
exit
;
...
...
@@ -693,7 +699,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
end
if
;
end
Find_Instance_By_Name
;
function
Is_
Spora
dic
(
Index
:
Natural
;
Target
:
List_Id
)
function
Is_
Not_Perio
dic
(
Index
:
Natural
;
Target
:
List_Id
)
return
boolean
is
N
:
Node_Id
;
Counter
:
Natural
:=
1
;
...
...
@@ -705,13 +711,13 @@ package body Ocarina.Backends.LNT.Tree_Generator_Main is
while
Present
(
N
)
loop
if
(
Counter
=
Index
)
then
return
BLN
.
Is_
Spora
dic
(
N
);
return
BLN
.
Is_
Not_Perio
dic
(
N
);
end
if
;
N
:=
BLN
.
Next_Node
(
N
);
Counter
:=
Counter
+
1
;
end
loop
;
end
if
;
return
false
;
end
Is_
Spora
dic
;
end
Is_
Not_Perio
dic
;
end
Ocarina
.
Backends
.
LNT
.
Tree_Generator_Main
;
src/backends/lnt/ocarina-backends-lnt-tree_generator_port.adb
View file @
23c99ceb
...
...
@@ -271,7 +271,7 @@ package body Ocarina.Backends.LNT.Tree_Generator_Port is
Definitions_List
:=
New_List
;
Add_LNT_Data_Port
(
Definitions_List
);
Add_LNT_Event_Port
(
Definitions_List
,
false
);
if
(
Spora
dic_Thread_Number
>
0
)
then
if
(
Not_Perio
dic_Thread_Number
>
0
)
then
Add_LNT_Event_Port
(
Definitions_List
,
true
);
end
if
;
...
...
src/backends/lnt/ocarina-backends-lnt-tree_generator_processor.adb
View file @
23c99ceb
This diff is collapsed.
Click to expand it.
src/backends/lnt/ocarina-backends-lnt.adb
View file @
23c99ceb
...
...
@@ -98,7 +98,7 @@ package body Ocarina.Backends.LNT is
Get_N_Thread
(
Root_System
(
Instance_Root
),
Thread_Number
,
Spora
dic_Thread_Number
);
Not_Perio
dic_Thread_Number
);
LNT_Thread_Instance_List
:=
New_List
;
LNT_Threads
:=
Generate_LNT_Thread
(
Instance_Root
);
LNT_Processor
:=
Generate_LNT_Processor
(
Instance_Root
);
...
...
src/backends/lnt/ocarina-backends-lnt.ads
View file @
23c99ceb
...
...
@@ -32,6 +32,7 @@
-- This package generates a pn tree
with
Ocarina
.
Types
;
with
Ocarina
.
Backends
.
Properties
;
package
Ocarina
.
Backends
.
LNT
is
...
...
@@ -47,7 +48,7 @@ package Ocarina.Backends.LNT is
Identifier
:
Name_Id
;
Period
:
Natural
;
Capacity
:
Natural
;
Is_Sporadic
:
boolean
:=
false
;
Dispatch_Protocol
:
Properties
.
Supported_Thread_Dispatch_Protocol
;
end
record
;
type
Thread_Array
is
array
(
Natural
range
<>
)
of
Thread
;
...
...
@@ -55,7 +56,7 @@ package Ocarina.Backends.LNT is
System_Name
:
Name_Id
;
Thread_Number
:
Natural
:=
0
;
Spora
dic_Thread_Number
:
Natural
:=
0
;
Not_Perio
dic_Thread_Number
:
Natural
:=
0
;
Hyperperiod
:
Integer
:=
0
;
LNT_Thread_Instance_List
:
List_Id
:=
No_List
;
...
...
src/backends/ocarina-backends-lnt-nodes.idl
View file @
23c99ceb
...
...
@@ -550,7 +550,7 @@ module Ocarina::Backends::LNT::Nodes {
Node_Id
Identifier
;
List_Id
Actual_Gates
;// G0, ... ,Gn
List_Id
Actual_Parameters
; // list of actual parameters
boolean
Is_
Spora
dic
;
boolean
Is_
Not_Perio
dic
;
}
;
interface
Communication_Statement
:
Node_Id
{
...
...
src/backends/ocarina-backends-properties.adb
View file @
23c99ceb
...
...
@@ -1569,6 +1569,12 @@ package body Ocarina.Backends.Properties is
return
Thread_Hybrid
;
elsif
P_Name
=
Thread_Timed_Name
then
if
not
Is_Defined_Integer_Property
(
T
,
Thread_Period
)
then
Display_Located_Error
(
AIN
.
Loc
(
T
),
"Timed threads must have a period"
,
Fatal
=>
True
);
end
if
;
return
Thread_Timed
;
elsif
P_Name
=
Thread_Background_Name
then
...
...
@@ -1723,7 +1729,8 @@ package body Ocarina.Backends.Properties is
pragma
Assert
(
Is_Thread
(
T
));
case
Get_Thread_Dispatch_Protocol
(
T
)
is
when
Thread_Periodic
|
Thread_Sporadic
|
Thread_Hybrid
|
Thread_ISR
=>
when
Thread_Periodic
|
Thread_Sporadic
|
Thread_Hybrid
|
Thread_Timed
|
Thread_ISR
=>
-- We are sure the thread has a period
The_Period
:=
Get_Time_Property_Value
(
T
,
Thread_Period
);
...
...
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