Commit 9519b229 authored by Laura Alexandra Sequeira Gouveia's avatar Laura Alexandra Sequeira Gouveia
Browse files

Template and template generation updated to include usage on new

aadl2glueC option to specify HW mapper to use.
parent 67adcfdb
...@@ -3,13 +3,15 @@ with Ada.Characters.Handling, ...@@ -3,13 +3,15 @@ with Ada.Characters.Handling,
Ada.Containers.Ordered_Sets, Ada.Containers.Ordered_Sets,
Ada.Exceptions, Ada.Exceptions,
Ada.Directories, Ada.Directories,
TASTE.Parser_Utils; TASTE.Parser_Utils,
TASTE.Deployment_View;
use Ada.Characters.Handling, use Ada.Characters.Handling,
Ada.Containers, Ada.Containers,
Ada.Exceptions, Ada.Exceptions,
Ada.Directories, Ada.Directories,
TASTE.Parser_Utils; TASTE.Parser_Utils,
TASTE.Deployment_View;
-- This package covers the generation of code for all supported languages -- This package covers the generation of code for all supported languages
-- There is no code that is specific to one particular language. The package -- There is no code that is specific to one particular language. The package
...@@ -22,7 +24,8 @@ package body TASTE.Backend.Code_Generators is ...@@ -22,7 +24,8 @@ package body TASTE.Backend.Code_Generators is
All_CP_Files : Tag; -- List of Context Parameters ASN.1 files All_CP_Files : Tag; -- List of Context Parameters ASN.1 files
Template : constant IV_As_Template := Template : constant IV_As_Template :=
Interface_View_Template (Model.Interface_View); Interface_View_Template (Model.Interface_View);
DV : constant Deployment_View_Holder :=
Model.Deployment_View;
-- Path to the input templates files -- Path to the input templates files
Prefix : constant String := Prefix : constant String :=
Model.Configuration.Binary_Path.Element & "/templates/"; Model.Configuration.Binary_Path.Element & "/templates/";
...@@ -72,7 +75,9 @@ package body TASTE.Backend.Code_Generators is ...@@ -72,7 +75,9 @@ package body TASTE.Backend.Code_Generators is
Functions_Tag, Functions_Tag,
Language_Tag, Language_Tag,
Has_Context_Param_Tag, Has_Context_Param_Tag,
Is_Type_Tag : Vector_Tag; Is_Type_Tag,
Is_FPGA_Tag,
CPU_Platform_Tag : Vector_Tag;
Content_Set : Translate_Set; Content_Set : Translate_Set;
Tmplt : constant String := Prefix_Skeletons Tmplt : constant String := Prefix_Skeletons
& "makefile.tmplt"; & "makefile.tmplt";
...@@ -87,15 +92,39 @@ package body TASTE.Backend.Code_Generators is ...@@ -87,15 +92,39 @@ package body TASTE.Backend.Code_Generators is
Is_Type_Tag := Is_Type_Tag & Each.Is_Type; Is_Type_Tag := Is_Type_Tag & Each.Is_Type;
Has_Context_Param_Tag := Has_Context_Param_Tag Has_Context_Param_Tag := Has_Context_Param_Tag
& (not Each.Context_Params.Is_Empty); & (not Each.Context_Params.Is_Empty);
if Each.User_Properties.Contains
("TASTE_IV_Properties::FPGA_Configurations")
then
Is_FPGA_Tag := Is_FPGA_Tag & True;
else
Is_FPGA_Tag := Is_FPGA_Tag & False;
end if;
if not DV.Is_Empty then
for Each_Node of Model.Deployment_View.Element.Nodes loop
for Each_Partition of Each_Node.Partitions loop
if Each_Partition.Bound_Functions.Contains
(To_String (Each.Name))
then
CPU_Platform_Tag := CPU_Platform_Tag
& Each_Node.CPU_Platform'Img;
end if;
end loop;
end loop;
end if;
end loop; end loop;
for Each of Languages loop for Each of Languages loop
Unique_Languages := Unique_Languages & To_String (Each); Unique_Languages := Unique_Languages & To_String (Each);
end loop; end loop;
Content_Set := +Assoc ("Function_Names", Functions_Tag) Content_Set := +Assoc ("Function_Names", Functions_Tag)
& Assoc ("Language", Language_Tag) & Assoc ("Language", Language_Tag)
& Assoc ("Is_Type", Is_Type_Tag) & Assoc ("Is_Type", Is_Type_Tag)
& Assoc ("CP_Files", All_CP_Files) & Assoc ("CP_Files", All_CP_Files)
& Assoc ("Has_Context_Param", Has_Context_Param_Tag) & Assoc ("Has_Context_Param", Has_Context_Param_Tag)
& Assoc ("Is_FPGA", Is_FPGA_Tag)
& Assoc ("CPU_Platform", CPU_Platform_Tag)
& Assoc ("Unique_Languages", Unique_Languages) & Assoc ("Unique_Languages", Unique_Languages)
& Assoc ("ASN1_Files", Get_ASN1_File_List) & Assoc ("ASN1_Files", Get_ASN1_File_List)
& Assoc ("ACN_Files", Get_ACN_File_List) & Assoc ("ACN_Files", Get_ACN_File_List)
...@@ -440,4 +469,5 @@ package body TASTE.Backend.Code_Generators is ...@@ -440,4 +469,5 @@ package body TASTE.Backend.Code_Generators is
end loop; end loop;
return Result; return Result;
end Interface_View_Template; end Interface_View_Template;
end TASTE.Backend.Code_Generators; end TASTE.Backend.Code_Generators;
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
@@-- @_Function_Names_@ : Combined table: list of fuction names... @@-- @_Function_Names_@ : Combined table: list of fuction names...
@@-- @_Language_@ : ... and corresponding implementation language @@-- @_Language_@ : ... and corresponding implementation language
@@-- @_Is_Type_@ : ... and flag if it is a function type @@-- @_Is_Type_@ : ... and flag if it is a function type
@@-- @_Has_Context_Param_@ : ... and flag to indicate if function has context parameters @@-- @_Has_Context_Param_@ : ... and flag to indicate if function has context parameters
@@-- @_Is_FPGA_@ : ... and true if it is an FPGA Function
@@-- @_CPU_Platform_@ : ... and respective CPU platform
@@-- @_CP_Files_@ : List of all context parameters ASN.1 files @@-- @_CP_Files_@ : List of all context parameters ASN.1 files
@@-- @_Unique_Languages_@ : List of all languages used in the system @@-- @_Unique_Languages_@ : List of all languages used in the system
@@-- @_ASN1_Files_@ : List of all ASN.1 files @@-- @_ASN1_Files_@ : List of all ASN.1 files
...@@ -138,7 +140,11 @@ ${DATAVIEW_AADLV2}: ${DATAVIEW_UNIQ} ...@@ -138,7 +140,11 @@ ${DATAVIEW_AADLV2}: ${DATAVIEW_UNIQ}
@@TABLE@@ @@TABLE@@
@@IF@@ not @_Is_Type_@ @@IF@@ not @_Is_Type_@
@_LOWER:Function_Names_@/@_Language_@/wrappers/aadl2glueC_built: @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_mini_cv.aadl ${DATAVIEW_AADLV1} @_LOWER:Function_Names_@/@_Language_@/wrappers/aadl2glueC_built: @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_mini_cv.aadl ${DATAVIEW_AADLV1}
@@IF@@ @_Is_FPGA_@ and @_CPU_Platform_@ = PLATFORM_ZYNQ
aadl2glueC -fpga ZYNQZC706 -o $(dir $@) $^
@@ELSE@@
aadl2glueC -o $(dir $@) $^ aadl2glueC -o $(dir $@) $^
@@END_IF@@
touch $@ touch $@
@@END_IF@@ @@END_IF@@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment