Commit 241f85f2 authored by Maxime Perrotin's avatar Maxime Perrotin

Add list of RI's parent function to template

parent 3953a1b2
......@@ -436,13 +436,15 @@ package body TASTE.Backend.Code_Generators is
List_Of_RIs : Tag;
List_Of_Sync_PIs : Tag;
List_Of_ASync_PIs : Tag;
List_Of_Sync_RIs : Tag;
List_Of_ASync_RIs : Tag;
List_Of_Sync_RIs : Vector_Tag;
Sync_RIs_Parent : Vector_Tag; -- Parent function of the sync RI
List_Of_ASync_RIs : Vector_Tag;
Async_RIs_Parent : Vector_Tag; -- Parent function of the async RI
Timers : Tag;
Property_Names : Vector_Tag;
Property_Values : Vector_Tag;
CP_Names : Vector_Tag; -- For Context Parameters
CP_Types : Vector_Tag; -- For Context Parameters
CP_Names : Vector_Tag; -- For Context Parameters
CP_Types : Vector_Tag; -- For Context Parameters
Interface_Tmplt : Interface_As_Template;
begin
Result.Header := +Assoc ("Name", F.Name)
......@@ -480,8 +482,13 @@ package body TASTE.Backend.Code_Generators is
case Each.RCM is
when Cyclic_Operation | Sporadic_Operation =>
List_Of_ASync_RIs := List_Of_ASync_RIs & Each.Name;
-- Find remote function name (only one remote per RI)
Async_RIs_Parent := Async_RIs_Parent
& Each.Remote_Interfaces.First_Element.Function_Name;
when others =>
List_Of_Sync_RIs := List_Of_Sync_RIs & Each.Name;
List_Of_Sync_RIs := List_Of_Sync_RIs & Each.Name;
Sync_RIs_Parent := Sync_RIs_Parent
& Each.Remote_Interfaces.First_Element.Function_Name;
end case;
end loop;
......@@ -502,8 +509,10 @@ package body TASTE.Backend.Code_Generators is
& Assoc ("List_Of_RIs", List_Of_RIs)
& Assoc ("List_Of_Sync_PIs", List_Of_Sync_PIs)
& Assoc ("List_Of_Sync_RIs", List_Of_Sync_RIs)
& Assoc ("Sync_RIs_Parent", Sync_RIs_Parent)
& Assoc ("List_Of_ASync_PIs", List_Of_ASync_PIs)
& Assoc ("List_Of_ASync_RIs", List_Of_ASync_RIs)
& Assoc ("Async_RIs_Parent", Async_RIs_Parent)
& Assoc ("Property_Names", Property_Names)
& Assoc ("Property_Values", Property_Values)
& Assoc ("CP_Names", CP_Names)
......
......@@ -30,6 +30,7 @@ package TASTE.Backend is
when Language_System_C => "System_C", -- Not supported
when Language_VDM => "VDM", -- Partial support
when Language_VHDL => "VHDL",
when Language_VHDL_BRAVE => "VHDL_BRAVE",
when Language_MicroPython => "MicroPython",
when Language_None => "None");
end TASTE.Backend;
......@@ -6,8 +6,10 @@
@@-- @_List_Of_RIs_@ : List of all Required Interfaces (just names)
@@-- @_List_Of_Sync_PIs@ : List of synchronous Provided Interfaces
@@-- @_List_Of_Sync_RIs@ : List of synchronous Required Interfaces
@@-- @_Sync_RIs_Parent@ : ... and corresponding Parent function name
@@-- @_List_Of_ASync_PIs@ : List of asynchronous Provided Interfaces
@@-- @_List_Of_ASync_RIs@ : List of asynchronous Required Interfaces
@@-- @_Async_RIs_Parent@ : ... and corresponding Parent function name
@@-- @_ASN1_Modules_@ : List of ASN.1 Modules names
@@-- @_ASN1_Files_@ : List of ASN.1 Files with path
@@-- @_Timers_@ : List of timers (just names)
......@@ -46,9 +48,11 @@ void init_@_LOWER:Name_@()
@_LOWER:Name_@_startup();
@@END_IF@@
// Now we must iterate over all synchronous RIs, and call their parent's
// init function. Multiple calls are prevented by the "init" guard
// TODO, we miss a tag giving the parent function of Sync RI
// Iterate over all synchronous RIs, and call their parent's
// init function. Multiple calls are prevented by the "init" guard.
@@TABLE@@
init_@_LOWER:Sync_RIs_Parent_@();
@@END_TABLE@@
}
}
......
......@@ -6,8 +6,10 @@
@@-- @_List_Of_RIs_@ : List of all Required Interfaces (just names)
@@-- @_List_Of_Sync_PIs@ : List of synchronous Provided Interfaces
@@-- @_List_Of_Sync_RIs@ : List of synchronous Required Interfaces
@@-- @_Sync_RIs_Parent@ : ... and corresponding Parent function name
@@-- @_List_Of_ASync_PIs@ : List of asynchronous Provided Interfaces
@@-- @_List_Of_ASync_RIs@ : List of asynchronous Required Interfaces
@@-- @_Async_RIs_Parent@ : ... and corresponding Parent function name
@@-- @_ASN1_Modules_@ : List of ASN.1 Modules names
@@-- @_ASN1_Files_@ : List of ASN.1 Files with path
@@-- @_Timers_@ : List of timers (just names)
......
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