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
1152537c
Commit
1152537c
authored
Nov 24, 2021
by
Maxime Perrotin
Browse files
Add list of asn1 modules to partition.tmplt
parent
d16afe2b
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/kazoo.adb
View file @
1152537c
...
...
@@ -30,7 +30,7 @@ begin
Model
.
Preprocessing
;
Model
.
Add_Concurrency_View
;
Model
.
Add_CV_Properties
;
Model
.
Concurrency_View
.
Generate_CV
;
Model
.
Generate_
Concurrency_View
;
end
if
;
Model
.
Generate_Code
;
...
...
src/taste-aadl_parser.adb
View file @
1152537c
...
...
@@ -440,6 +440,7 @@ package body TASTE.AADL_Parser is
(
Base_Template_Path
=>
Model
.
Configuration
.
Binary_Path
,
Base_Output_Path
=>
Model
.
Configuration
.
Output_Dir
,
Deployment
=>
Model
.
Deployment_View
.
Element
,
Data_View
=>
Model
.
Data_View
,
Configuration
=>
Model
.
Configuration
,
others
=>
<>
);
use
String_Vectors
;
...
...
@@ -780,6 +781,16 @@ package body TASTE.AADL_Parser is
raise
Quit_Taste
;
end
Generate_Code
;
procedure
Generate_Concurrency_View
(
Model
:
TASTE_Model
)
is
begin
Model
.
Concurrency_View
.
Generate_Code
;
exception
when
Error
:
Concurrency_View_Error
|
Ada
.
IO_Exceptions
.
Name_Error
=>
Put_Error
(
"Concurrency View : "
&
Ada
.
Exceptions
.
Exception_Message
(
Error
));
raise
Quit_Taste
;
end
Generate_Concurrency_View
;
function
Process_Function
(
F
:
in
out
Taste_Terminal_Function
)
return
Function_Maps
.
Map
is
...
...
src/taste-aadl_parser.ads
View file @
1152537c
...
...
@@ -33,8 +33,8 @@ package TASTE.AADL_Parser is
type
TASTE_Model
is
tagged
record
Interface_View
:
Complete_Interface_View
;
Deployment_View
:
Deployment_View_Holder
;
Data_View
:
Taste_Data_View
;
Deployment_View
:
aliased
Deployment_View_Holder
;
Data_View
:
aliased
Taste_Data_View
;
Concurrency_View
:
Taste_Concurrency_View
;
Configuration
:
Taste_Configuration
;
end
record
;
...
...
@@ -68,6 +68,9 @@ package TASTE.AADL_Parser is
procedure
Dump
(
Model
:
TASTE_Model
);
procedure
Generate_Code
(
Model
:
TASTE_Model
);
-- Process Templates from the templates/concurrency_view subfolder
procedure
Generate_Concurrency_View
(
Model
:
TASTE_Model
);
private
procedure
Build_TASTE_AST
(
Model
:
out
TASTE_Model
);
procedure
Find_Shared_Libraries
(
Model
:
out
TASTE_Model
);
...
...
src/taste-backend-code_generators.adb
View file @
1152537c
...
...
@@ -39,38 +39,6 @@ package body TASTE.Backend.Code_Generators is
Prefix_Skeletons
:
constant
String
:=
Prefix
&
"skeletons/"
;
Prefix_Wrappers
:
constant
String
:=
Prefix
&
"glue/language_wrappers"
;
-- Return a Tag list of ASN.1 Modules for the headers
function
Get_Module_List
return
Tag
is
Result
:
Tag
;
begin
for
Each
of
Model
.
Data_View
.
ASN1_Files
loop
for
Module
of
Each
.
Modules
loop
Result
:=
Result
&
Module
.
Name
;
end
loop
;
end
loop
;
return
Result
;
end
Get_Module_List
;
-- Return a Tag list of ASN.1 Files
function
Get_ASN1_File_List
return
Tag
is
Result
:
Tag
;
begin
for
Each
of
Model
.
Data_View
.
ASN1_Files
loop
Result
:=
Result
&
Each
.
Path
;
end
loop
;
return
Result
;
end
Get_ASN1_File_List
;
-- Return a Tag list of ACN Files
function
Get_ACN_File_List
return
Tag
is
Result
:
Tag
;
begin
for
Each
of
Model
.
Data_View
.
ACN_Files
loop
Result
:=
Result
&
Each
;
end
loop
;
return
Result
;
end
Get_ACN_File_List
;
-- Generate a global Makefile (processing all functions)
-- and a global project file (.pro) for Space Creator
procedure
Generate_Global_Makefile
is
...
...
@@ -146,9 +114,9 @@ package body TASTE.Backend.Code_Generators is
&
Assoc
(
"Is_FPGA"
,
Is_FPGA_Tag
)
&
Assoc
(
"CPU_Platform"
,
CPU_Platform_Tag
)
&
Assoc
(
"Unique_Languages"
,
Unique_Languages
)
&
Assoc
(
"ASN1_Files"
,
Get_ASN1_File_List
)
&
Assoc
(
"ACN_Files"
,
Get_ACN_File_List
)
&
Assoc
(
"ASN1_Modules"
,
Get_Module_List
);
&
Assoc
(
"ASN1_Files"
,
Model
.
Data_View
.
Get_ASN1_File_List
)
&
Assoc
(
"ACN_Files"
,
Model
.
Data_View
.
Get_ACN_File_List
)
&
Assoc
(
"ASN1_Modules"
,
Model
.
Data_View
.
Get_Module_List
);
Put_Debug
(
"Generating global Makefile"
);
Create
(
File
=>
Output_File
,
...
...
@@ -282,8 +250,8 @@ package body TASTE.Backend.Code_Generators is
Function_Makefile_Template
(
Model
=>
Model
,
F
=>
F
,
Modules
=>
Get_Module_List
,
Files
=>
Get_ASN1_File_List
)
Modules
=>
Model
.
Data_View
.
Get_Module_List
,
Files
=>
Model
.
Data_View
.
Get_ASN1_File_List
)
&
Assoc
(
"List_Of_PIs"
,
List_Of_PIs
);
Make_Path
:
constant
String
:=
Path
&
"makefile.tmplt"
;
...
...
@@ -303,8 +271,10 @@ package body TASTE.Backend.Code_Generators is
&
Assoc
(
"Required_Interfaces"
,
Process_Interfaces
(
Func_Tmpl
.
Required
,
Path
))
&
Assoc
(
"ASN1_Modules"
,
Get_Module_List
)
&
Assoc
(
"ASN1_Files"
,
Get_ASN1_File_List
);
&
Assoc
(
"ASN1_Modules"
,
Model
.
Data_View
.
Get_Module_List
)
&
Assoc
(
"ASN1_Files"
,
Model
.
Data_View
.
Get_ASN1_File_List
);
Content
:
constant
String
:=
Parse
(
Path
&
"function.tmplt"
,
Func_Map
);
...
...
src/taste-concurrency_view.adb
View file @
1152537c
...
...
@@ -4,8 +4,6 @@
-- *********************************************************************** --
with
Ada
.
Directories
,
Ada
.
IO_Exceptions
,
Ada
.
Exceptions
,
Ada
.
Characters
.
Latin_1
,
-- Ada.Strings.Fixed,
GNAT
.
Directory_Operations
,
-- Contains Dir_Name
...
...
@@ -560,6 +558,7 @@ package body TASTE.Concurrency_View is
&
Assoc
(
"Threads"
,
Part_Threads
)
&
Assoc
(
"Thread_Names"
,
Thread_Names
)
&
Assoc
(
"Thread_Has_Param"
,
Thread_Has_Param
)
&
Assoc
(
"ASN1_Modules"
,
CV
.
Data_View
.
Get_Module_List
)
&
Assoc
(
"Node_Name"
,
Node_Name
)
&
Assoc
(
"Blocks"
,
Blocks
)
&
Assoc
(
"Block_Names"
,
Block_Names
)
...
...
@@ -1004,14 +1003,4 @@ package body TASTE.Concurrency_View is
End_Search
(
ST
);
end
Generate_Code
;
procedure
Generate_CV
(
CV
:
Taste_Concurrency_View
)
is
begin
CV
.
Generate_Code
;
exception
when
Error
:
Concurrency_View_Error
|
Ada
.
IO_Exceptions
.
Name_Error
=>
Put_Error
(
"Concurrency View : "
&
Ada
.
Exceptions
.
Exception_Message
(
Error
));
raise
Quit_Taste
;
end
Generate_CV
;
end
TASTE
.
Concurrency_View
;
src/taste-concurrency_view.ads
View file @
1152537c
...
...
@@ -13,7 +13,8 @@ with Ada.Containers.Indefinite_Ordered_Maps,
Templates_Parser
,
TASTE
.
Parser_Utils
,
TASTE
.
Interface_View
,
TASTE
.
Deployment_View
;
TASTE
.
Deployment_View
,
TASTE
.
Data_View
;
use
Ada
.
Containers
,
Ada
.
Strings
.
Unbounded
,
...
...
@@ -21,7 +22,8 @@ use Ada.Containers,
Templates_Parser
,
TASTE
.
Parser_Utils
,
TASTE
.
Interface_View
,
TASTE
.
Deployment_View
;
TASTE
.
Deployment_View
,
TASTE
.
Data_View
;
package
TASTE
.
Concurrency_View
is
...
...
@@ -159,6 +161,7 @@ package TASTE.Concurrency_View is
Configuration
:
Taste_Configuration
;
Nodes
:
CV_Nodes
.
Map
;
Deployment
:
Complete_Deployment_View
;
Data_View
:
Taste_Data_View
;
Base_Template_Path
:
String_Holder
;
Base_Output_Path
:
String_Holder
;
end
record
;
...
...
@@ -167,6 +170,6 @@ package TASTE.Concurrency_View is
Output
:
File_Type
);
-- Generate the concurrency view using templates
procedure
Generate_C
V
(
CV
:
Taste_Concurrency_View
);
procedure
Generate_C
ode
(
CV
:
Taste_Concurrency_View
);
end
TASTE
.
Concurrency_View
;
src/taste-data_view.adb
View file @
1152537c
...
...
@@ -195,6 +195,35 @@ package body TASTE.Data_View is
end
loop
;
end
Debug_Dump
;
function
Get_Module_List
(
DV
:
Taste_Data_View
)
return
Tag
is
Result
:
Tag
;
begin
for
Each
of
DV
.
ASN1_Files
loop
for
Module
of
Each
.
Modules
loop
Result
:=
Result
&
Module
.
Name
;
end
loop
;
end
loop
;
return
Result
;
end
Get_Module_List
;
function
Get_ASN1_File_List
(
DV
:
Taste_Data_View
)
return
Tag
is
Result
:
Tag
;
begin
for
Each
of
DV
.
ASN1_Files
loop
Result
:=
Result
&
Each
.
Path
;
end
loop
;
return
Result
;
end
Get_ASN1_File_List
;
function
Get_ACN_File_List
(
DV
:
Taste_Data_View
)
return
Tag
is
Result
:
Tag
;
begin
for
Each
of
DV
.
ACN_Files
loop
Result
:=
Result
&
Each
;
end
loop
;
return
Result
;
end
Get_ACN_File_List
;
procedure
Export_ASN1_Files
(
DV
:
Taste_Data_View
;
Output_Path
:
String
)
is
begin
for
Idx
in
DV
.
ASN1_Files
.
Iterate
loop
...
...
src/taste-data_view.ads
View file @
1152537c
...
...
@@ -8,6 +8,7 @@
with
Text_IO
,
Ada
.
Containers
.
Indefinite_Ordered_Maps
,
Ada
.
Strings
.
Unbounded
,
Templates_Parser
,
Ocarina
,
Ocarina
.
Types
,
TASTE
.
Parser_Utils
;
...
...
@@ -15,6 +16,7 @@ with Text_IO,
use
Text_IO
,
Ada
.
Containers
,
Ada
.
Strings
.
Unbounded
,
Templates_Parser
,
Ocarina
,
Ocarina
.
Types
,
TASTE
.
Parser_Utils
;
...
...
@@ -67,6 +69,11 @@ package TASTE.Data_View is
procedure
Debug_Dump
(
DV
:
Taste_Data_View
;
Output
:
File_Type
);
-- Functions converting the AST into Templates Parser tags
function
Get_Module_List
(
DV
:
Taste_Data_View
)
return
Tag
;
function
Get_ASN1_File_List
(
DV
:
Taste_Data_View
)
return
Tag
;
function
Get_ACN_File_List
(
DV
:
Taste_Data_View
)
return
Tag
;
-- Make a local copy of ASN.1 files to allow project export
procedure
Export_ASN1_Files
(
DV
:
Taste_Data_View
;
Output_Path
:
String
);
...
...
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