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
3aca4c7c
Commit
3aca4c7c
authored
Apr 28, 2019
by
Maxime Perrotin
Browse files
Add optional generation of one file per partition
partition = process
parent
1a45000e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/taste-concurrency_view.adb
View file @
3aca4c7c
...
@@ -157,6 +157,8 @@ package body TASTE.Concurrency_View is
...
@@ -157,6 +157,8 @@ package body TASTE.Concurrency_View is
others
=>
False
);
others
=>
False
);
Output_File
:
File_Type
;
Output_File
:
File_Type
;
Threads
:
Unbounded_String
;
Threads
:
Unbounded_String
;
CV_Out_Dir
:
constant
String
:=
CV
.
Base_Output_Path
.
Element
&
"/concurrency_view/"
;
begin
begin
Start_Search
(
Search
=>
ST
,
Start_Search
(
Search
=>
ST
,
Pattern
=>
""
,
Pattern
=>
""
,
...
@@ -197,6 +199,16 @@ package body TASTE.Concurrency_View is
...
@@ -197,6 +199,16 @@ package body TASTE.Concurrency_View is
Thread_Src_Port
:
Vector_Tag
;
Thread_Src_Port
:
Vector_Tag
;
Thread_Dst_Name
:
Vector_Tag
;
Thread_Dst_Name
:
Vector_Tag
;
Thread_Dst_Port
:
Vector_Tag
;
Thread_Dst_Port
:
Vector_Tag
;
-- Optionally generate partition code in separate files
-- (if filepart.tmplt is present and contains a filename)
File_Id
:
constant
String
:=
Path
&
"/filepart.tmplt"
;
Part_Check
:
constant
Boolean
:=
Exists
(
File_Id
);
Part_Tag
:
constant
Translate_Set
:=
+
Assoc
(
"Partition_Name"
,
Partition_Name
);
Part_File_Name
:
constant
String
:=
(
if
Part_Check
then
Strip_String
(
Parse
(
File_Id
,
Part_Tag
))
else
""
);
Part_Content
:
Unbounded_String
;
begin
begin
for
T
of
Partition
.
Threads
loop
for
T
of
Partition
.
Threads
loop
declare
declare
...
@@ -255,7 +267,23 @@ package body TASTE.Concurrency_View is
...
@@ -255,7 +267,23 @@ package body TASTE.Concurrency_View is
&
Assoc
(
"Thread_Src_Port"
,
Thread_Src_Port
)
&
Assoc
(
"Thread_Src_Port"
,
Thread_Src_Port
)
&
Assoc
(
"Thread_Dst_Name"
,
Thread_Dst_Name
)
&
Assoc
(
"Thread_Dst_Name"
,
Thread_Dst_Name
)
&
Assoc
(
"Thread_Dst_Port"
,
Thread_Dst_Port
);
&
Assoc
(
"Thread_Dst_Port"
,
Thread_Dst_Port
);
return
Parse
(
Path
&
"/partition.tmplt"
,
Partition_Assoc
);
Part_Content
:=
Parse
(
Path
&
"/partition.tmplt"
,
Partition_Assoc
);
-- Save the content of the partition in a file
-- (if required at template folder level)
if
Part_File_Name
/=
""
then
Create_Path
(
CV_Out_Dir
&
Node_Name
);
Create
(
File
=>
Output_File
,
Mode
=>
Out_File
,
Name
=>
CV_Out_Dir
&
Node_Name
&
"/"
&
Part_File_Name
);
Put_Line
(
Output_File
,
To_String
(
Part_Content
));
Close
(
Output_File
);
end
if
;
return
To_String
(
Part_Content
);
end
Generate_Partition
;
end
Generate_Partition
;
-- Generate the code for one node
-- Generate the code for one node
...
@@ -278,19 +306,17 @@ package body TASTE.Concurrency_View is
...
@@ -278,19 +306,17 @@ package body TASTE.Concurrency_View is
return
Parse
(
Path
&
"/node.tmplt"
,
Node_Assoc
);
return
Parse
(
Path
&
"/node.tmplt"
,
Node_Assoc
);
end
Generate_Node
;
end
Generate_Node
;
Nodes
:
Unbounded_String
;
Nodes
:
Unbounded_String
;
CV_Out_Dir
:
constant
String
:=
Tmpl_File
:
constant
String
:=
Path
&
"/filesys.tmplt"
;
CV
.
Base_Output_Path
.
Element
&
"/concurrency_view/"
;
Tmpl_Sys
:
constant
String
:=
Path
&
"/system.tmplt"
;
Tmpl_File
:
constant
String
:=
Path
&
"/filesys.tmplt"
;
Valid_Dir
:
constant
Boolean
:=
Exists
(
Tmpl_File
);
Tmpl_Sys
:
constant
String
:=
Path
&
"/system.tmplt"
;
File_Sys
:
constant
String
:=
Valid_Dir
:
constant
Boolean
:=
Exists
(
Tmpl_File
);
File_Sys
:
constant
String
:=
(
if
Valid_Dir
then
Strip_String
(
Parse
(
Tmpl_File
))
else
""
);
(
if
Valid_Dir
then
Strip_String
(
Parse
(
Tmpl_File
))
else
""
);
Trig_Sys
:
constant
Boolean
:=
Exists
(
Tmpl_Sys
);
Trig_Sys
:
constant
Boolean
:=
Exists
(
Tmpl_Sys
);
Set_Sys
:
Translate_Set
;
Set_Sys
:
Translate_Set
;
Node_Names
:
Vector_Tag
;
-- List of nodes
Node_Names
:
Vector_Tag
;
-- List of nodes
Node_CPU
:
Vector_Tag
;
-- Corresponding CPU name
Node_CPU
:
Vector_Tag
;
-- Corresponding CPU name
Node_CPU_Cls
:
Vector_Tag
;
-- Corresponding CPU classifier
Node_CPU_Cls
:
Vector_Tag
;
-- Corresponding CPU classifier
Partition_Names
:
Vector_Tag
;
-- List of processes
Partition_Names
:
Vector_Tag
;
-- List of processes
Partition_Node
:
Vector_Tag
;
-- Corresponding node name
Partition_Node
:
Vector_Tag
;
-- Corresponding node name
Partition_CPU
:
Vector_Tag
;
-- Corresponding CPU name
Partition_CPU
:
Vector_Tag
;
-- Corresponding CPU name
...
@@ -311,7 +337,8 @@ package body TASTE.Concurrency_View is
...
@@ -311,7 +337,8 @@ package body TASTE.Concurrency_View is
else
""
);
else
""
);
-- Check if file already exists
-- Check if file already exists
Present
:
constant
Boolean
:=
Present
:
constant
Boolean
:=
(
File_Name
/=
""
and
Exists
(
Output_Dir
&
File_Name
));
(
File_Name
/=
""
and
then
Exists
(
Output_Dir
&
"/"
&
File_Name
));
Trig_Tmpl
:
constant
Translate_Set
:=
Trig_Tmpl
:
constant
Translate_Set
:=
+
Assoc
(
"Filename_Is_Present"
,
Present
);
+
Assoc
(
"Filename_Is_Present"
,
Present
);
Trigger
:
constant
Boolean
:=
Trigger
:
constant
Boolean
:=
...
...
templates/concurrency_view/aadl_1_nodes/filepart.tmplt
0 → 100644
View file @
3aca4c7c
@@-- 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/aadl_2_threads/filepart.tmplt
0 → 100644
View file @
3aca4c7c
@@-- 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/filepart.tmplt
0 → 100644
View file @
3aca4c7c
@@-- 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_source/filepart.tmplt
0 → 100644
View file @
3aca4c7c
@@-- 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
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