Commit 139c5dde authored by Maxime Perrotin's avatar Maxime Perrotin

Complete mini-cv templates

parent eb56d743
......@@ -460,11 +460,20 @@ package body TASTE.Backend.Code_Generators is
CP_Types := CP_Types & Each.Sort;
end loop;
-- Add all user-defined properties
for Each of F.User_Properties loop
Property_Names := Property_Names & Each.Name;
Property_Values := Property_Values & Each.Value;
end loop;
-- Add list of all PI names (both synchronous and asynchronous)
for Each of F.Provided loop
Interface_Tmplt := Interface_Template (Each);
Interface_Tmplt.Header := Interface_Tmplt.Header
& Assoc ("Direction", "PI");
& Assoc ("Direction", "PI")
& Assoc ("Property_Names", Property_Names)
& Assoc ("Property_Values", Property_Values)
& Assoc ("Language", Language_Spelling (F));
Result.Provided := Result.Provided & Interface_Tmplt;
List_Of_PIs := List_Of_PIs & Each.Name;
case Each.RCM is
......@@ -479,7 +488,10 @@ package body TASTE.Backend.Code_Generators is
for Each of F.Required loop
Interface_Tmplt := Interface_Template (Each);
Interface_Tmplt.Header := Interface_Tmplt.Header
& Assoc ("Direction", "RI");
& Assoc ("Direction", "RI")
& Assoc ("Property_Names", Property_Names)
& Assoc ("Property_Values", Property_Values)
& Assoc ("Language", Language_Spelling (F));
Result.Required := Result.Required & Interface_Tmplt;
List_Of_RIs := List_Of_RIs & Each.Name;
case Each.RCM is
......@@ -505,12 +517,6 @@ package body TASTE.Backend.Code_Generators is
Timers := Timers & Each;
end loop;
-- Add all user-defined properties
for Each of F.User_Properties loop
Property_Names := Property_Names & Each.Name;
Property_Values := Property_Values & Each.Value;
end loop;
-- Setup the mapping for the template
Result.Header := Result.Header
& Assoc ("List_Of_PIs", List_Of_PIs)
......
......@@ -4,6 +4,9 @@
@@-- @_Direction_@ : "PI" or "RI"
@@-- @_Kind_@ : The RCM Kind
@@-- @_Parent_Function_@ : The name of the function
@@-- @_Language_@ : The implementation language of the function
@@-- @_Property_Names_@ : All AADL properties (names) associated to the function
@@-- @_Property_Values_@ : ... and corresponding values
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
......@@ -14,31 +17,37 @@ FEATURES
@@INLINE( )(\n )(\n)@@
@@TABLE@@
@@IF@@ (@_Param_Directions_@ = "PARAM_IN" and @_Direction_@ = "PI") or (@_Param_Directions_@ = "PARAM_OUT" and @_Direction_@ = "RI")
@_Param_Names_@ : IN PARAMETER DataView::@_REPLACE(-,_):Param_Types_@ {encoding=>@_Param_Encodings;};
@_Param_Names_@ : IN PARAMETER DataView::@_REPLACE_ALL(-/_):Param_Types_@ {encoding=>@_Param_Encodings_@;};
@@ELSE@@
@_Param_Names_@ : OUT PARAMETER DataView::@_REPLACE(-,_):Param_Types_@ {encoding=>@_Param_Encodings;};
@_Param_Names_@ : OUT PARAMETER DataView::@_REPLACE_ALL(-/_):Param_Types_@ {encoding=>@_Param_Encodings_@;};
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@END_IF@@
END @_Name_@;
@@IF@@ @_Language_@ =
SUBPROGRAM IMPLEMENTATION
@@IF@@ @_Direction_@ = "PI"
@@IF@@ @_EXIST:Param_Names_@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
void *IN_@_LOWER:Param_Names_@, size_t IN_@_LOWER:Param_Names_@_len
@@IF@@ @_Language_@ = "GUI" and @_Direction_@ = "PI"
SUBPROGRAM IMPLEMENTATION @_Name_@.GUI_PI
@@ELSIF@@ @_Language_@ = "GUI" and @_Direction_@ = "RI"
SUBPROGRAM IMPLEMENTATION @_Name_@.GUI_RI
@@ELSIF@@ @_Language_@ = "VHDL_BRAVE"
SUBPROGRAM IMPLEMENTATION @_Name_@.VHDL
@@ELSE@@
void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len
SUBPROGRAM IMPLEMENTATION @_Name_@.@_Language_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
PROPERTIES
FV_Name => "@_Parent_Function_@;
@@INLINE( )(\n )(\n)@@
@@TABLE@@
@_Property_Names_@ => "@_Property_Values_@";
@@END_TABLE@@
@@END_INLINE@@
@@IF@@ @_Language_@ = "GUI" and @_Direction_@ = "PI"
END @_Name_@.GUI_PI;
@@ELSIF@@ @_Language_@ = "GUI" and @_Direction_@ = "RI"
END @_Name_@.GUI_RI;
@@ELSIF@@ @_Language_@ = "VHDL_BRAVE"
END @_Name_@.VHDL;
@@ELSE@@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@();
@@END_IF@@
END @_Name_@.@_Language_@;
@@END_IF@@
......@@ -7,6 +7,7 @@
@@-- @_Param_Names_@ : List of parameter names
@@-- @_Param_Types_@ : |_ Corresponding parameter types
@@-- @_Param_Directions_@ : |_ Corresponding direction
@@-- @_Param_Encodings_@ : |_ Corresponding encoding (Default, Native, UPER, ACN)
@@IF@@ @_EXIST:Param_Names_@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
......
Markdown is supported
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