Commit 8e911908 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Improve templates for simulation

parent bd602925
......@@ -6,42 +6,38 @@
@@IF@@ @_EXIST:List_Of_ASync_PIs_@ or @_EXIST:List_Of_ASync_RIs_@
@@-- Skip synchronous-only functions like Simulink...
@_REPLACE_ALL(_/-):CAPITALIZE:Name_@-Event ::= CHOICE {
@@IF@@ @_EXIST:List_Of_ASync_PIs_@
@@IF@@ @_EXIST:List_Of_ASync_PIs_@ or @_EXIST:Timers_@
msg-in CHOICE {
@@INLINE( )(,\n )()@@
@@TABLE'ALIGN_ON(" ")@@
@_LOWER:REPLACE_ALL(_/-):List_Of_ASync_PIs_@ SEQUENCE { @_LOWER:REPLACE_ALL(_/-):ASync_PI_Param_Name_@ @_ASync_PI_Param_Type_@ }
@@END_TABLE@@
@@-- Add timers expiration PIs, except for the Timer Manager function
@@IF@@ @_LOWER:Name_@ /= @_LOWER:Partition_Name_@ & _timer_manager
@@IF@@ @_EXIST:Timers_@ and @_LOWER:Name_@ /= @_LOWER:Partition_Name_@ & _timer_manager
-- Timers:
@@TABLE'ALIGN_ON(" ")@@
@_LOWER:REPLACE_ALL(_/-):Name_@-@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {}
@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {}
@@END_TABLE@@
@@END_IF@@
@@END_INLINE@@
@@END_IF@@
@@IF@@ @_EXIST:List_Of_ASync_RIs_@
@@IF@@ @_EXIST:List_Of_ASync_RIs_@ or @_EXIST:Timers_@
},
msg-out CHOICE {
@@INLINE( )(,\n )()@@
@@TABLE'ALIGN_ON(" ")@@
@_LOWER:REPLACE_ALL(_/-):List_Of_ASync_RIs_@ SEQUENCE { @_LOWER:REPLACE_ALL(_/-):ASync_RI_Param_Name_@ @_ASync_RI_Param_Type_@ }
@_LOWER:REPLACE_ALL(_/-):List_Of_ASync_RIs_@ SEQUENCE { @_LOWER:REPLACE_ALL(_/-):ASync_RI_Param_Name_@ @_ASync_RI_Param_Type_@ }
@@END_TABLE@@
@@IF@@ @_EXIST:Timers_@ and @_LOWER:Name_@ /= @_LOWER:Partition_Name_@ & _timer_manager
-- Timers:
@@TABLE'ALIGN_ON(" ")@@
set-@_REPLACE_ALL(_/-):Timers_@ SEQUENCE { val T-UInt32 }
reset-@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {}
@@END_TABLE@@
@@END_IF@@
@@END_INLINE@@
@@END_IF@@
@@IF@@ not @_EXIST:Timers_@ or @_LOWER:Name_@ = @_LOWER:Partition_Name_@ & _timer_manager
}
@@ELSE@@
},
@@IF@@ @_LOWER:Name_@ /= @_LOWER:Partition_Name_@ & _timer_manager
@@INLINE( )(,\n )()@@
@@TABLE'ALIGN_ON(" ")@@
set-@_REPLACE_ALL(_/-):Timers_@ T-UInt32
reset-@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {}
@@END_TABLE@@
@@END_INLINE@@
@@END_IF@@
@@END_IF@@
}
@@ELSE@@
@_REPLACE_ALL(_/-):CAPITALIZE:Name_@-Event ::= SEQUENCE {} -- Synchronous function
......
......@@ -16,6 +16,7 @@ library project @_CAPITALIZE:Name_@_Simulator is
"simulation_dataview.ads",
"board_config.ads",
"simulator.ads",
"taste_basictypes.ads",
@_Threads'Indent_@
"adaasn1rtl.ads");
......
......@@ -3,6 +3,13 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_concurrency_view_sub_thread.ascii
@@TABLE@@
@@TABLE'TERSE@@
"@_LOWER:REPLACE_ALL(-/_):Param_ASN1_Modules_@.ads",
@@END_TABLE@@
@@IF@@ @_Language_@ = SDL or @_Language_@ = Ada
"@_LOWER:Pro_Block_Name_@.ads",
"@_LOWER:Pro_Block_Name_@_ri.ads",
@@END_IF@@
@@IF@@ @_Language_@ = SDL
"@_LOWER:Pro_Block_Name_@_datamodel.ads",
@@END_IF@@
......@@ -4,11 +4,16 @@
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_skeletons_sub_function.ascii
-- DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN DURING THE BUILD
with Simulator; use Simulator;
-- Generated by Kazoo (templates/glue/language_wrappers/ri_adb/function.tmplt)
-- Date : @_NOW_@
@@IF@@ @_Target_@ = SIMU
with Simulator; use Simulator;
with Simulation_Dataview; use Simulation_Dataview;
@@END_IF@@
package body @_CAPITALIZE:Name_@_RI is
@@IF@@ @_EXIST:Required_Interfaces_@ and @_Language_@ /= "Blackbox_C"
@@IF@@ @_EXIST:Required_Interfaces_@
@_Required_Interfaces'Indent_@
@@END_IF@@
......
......@@ -19,17 +19,51 @@ procedure @_CAPITALIZE:Name_@
procedure @_CAPITALIZE:Name_@ is
@@END_IF@@
@@IF@@ @_Target_@ = SIMU
@@IF@@ @_Kind_@ = SPORADIC_OPERATION
Event : asn1SccEvents (Kind => @_Parent_Function_@_PRESENT);
begin
Event.@_CAPITALIZE:Parent_Function_@ :=
(Kind => msg_out_PRESENT,
msg_out => (Kind => @_Name_@_PRESENT,
@@IF@@ @_EXIST:Param_Names_@
@_CAPITALIZE:Name_@ =>
@@INLINE( \()(, )(\)\)\);)@@
@@TABLE@@
@_CAPITALIZE:Param_Names_@ => @_CAPITALIZE:Param_Names_@
@@END_TABLE@@@
@@END_INLINE@@
@@ELSE@@
@_CAPITALIZE:Name_@ => (null record)));
@@END_IF@@
Simulation_Event (Event);
@@ELSE@@
@@-- Non-sporadic call
begin
null; -- TODO: implement event for synchronous calls
@@END_IF@@
@@ELSE@@
@@-- Non-simulation targets
procedure C_@_CAPITALIZE:Name_@
@@INLINE( \()(;\n )(\))@@
@@TABLE'ALIGN_ON("out")@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
@_CAPITALIZE:Param_Names_@ : in out asn1Scc@_CAPITALIZE:REPLACE_ALL(-/_):Param_Types_@
@@ELSE@@
@_CAPITALIZE:Param_Names_@ : out asn1Scc@_CAPITALIZE:REPLACE_ALL(-/_):Param_Types_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
with Import,
Convention => C,
Link_Name => "@_LOWER:Parent_Function_@_RI_@_Name_@";
begin
@@IF@@ @_EXIST:Param_Names_@
C_@_CAPITALIZE:Name_@ (@_Param_Names_@);
@@ELSE@@
@@-- No Params
C_@_CAPITALIZE:Name_@;
@@END_IF@@
@@END_IF@@
end @_CAPITALIZE:Name_@;
......@@ -3,6 +3,6 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_skeletons_sub_trigger.ascii
@@IF@@ not @_Is_Type_@ and @_Target_@ = SIMU and (@_Language_@ = C or @_Language_@ = GUI or @_Language_@ = Ada or @_Language_@ = VDM or @_Language_@ = QGenAda or @_Language_@ = QGenC or @_Language_@ = RTDS or @_Language_@ = CPP or @_Language_@ = SDL or @_Language_@ = Blackbox_C or @_Language_@ = MicroPython or @_Language_@ = Timer_Manager or @_Language_@ = SIMULINK)
@@IF@@ (@_EXIST:List_Of_RIs_@ or @_EXIST:Timers_@) and not @_Is_Type_@ and (@_Language_@ = Ada or @_Language_@ = SDL)
TRUE
@@END_IF@@
......@@ -3,6 +3,6 @@
@@-- If you are using vim, go over the URL and pres gx in to follow the link
@@-- If you have no internet access you can also use (with vim) Ctrl-W-f or gf in vim to open the text doc:
@@-- $HOME/tool-inst/share/kazoo/doc/templates_skeletons_sub_trigger.ascii
@@IF@@ not @_Is_Type_@ and @_Target_@ = SIMU and (@_Language_@ = C or @_Language_@ = GUI or @_Language_@ = Ada or @_Language_@ = VDM or @_Language_@ = QGenAda or @_Language_@ = QGenC or @_Language_@ = RTDS or @_Language_@ = CPP or @_Language_@ = SDL or @_Language_@ = Blackbox_C or @_Language_@ = MicroPython or @_Language_@ = Timer_Manager or @_Language_@ = SIMULINK)
TRUE
@@END_IF@@
@@-- @@IF@@ not @_Is_Type_@ and @_Target_@ = SIMU and (@_Language_@ = C or @_Language_@ = GUI or @_Language_@ = Ada or @_Language_@ = VDM or @_Language_@ = QGenAda or @_Language_@ = QGenC or @_Language_@ = RTDS or @_Language_@ = CPP or @_Language_@ = SDL or @_Language_@ = Blackbox_C or @_Language_@ = MicroPython or @_Language_@ = Timer_Manager or @_Language_@ = SIMULINK)
FALSE
@@-- @@END_IF@@
......@@ -3,6 +3,8 @@
@@-- in vim to open the doc: $HOME/tool-inst/share/kazoo/doc/templates_skeletons_sub_function.ascii
@@--
-- DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN DURING THE BUILD
-- Generated by TASTE (Kazoo template templates/skeletons/ada-ri-source/function.tmplt)
-- @_NOW_@
@@TABLE'ALIGN_ON("use ")@@
with @_REPLACE_ALL(-/_):CAPITALIZE:ASN1_Modules_@; use @_REPLACE_ALL(-/_):CAPITALIZE:ASN1_Modules_@;
@@END_TABLE@@
......@@ -13,15 +15,9 @@ package @_CAPITALIZE:Name_@_RI is
@@TABLE@@
-- Timer @_Timers_@ Set and Reset functions
procedure Set_@_CAPITALIZE:Timers_@ (Value : in out asn1SccT_UInt32)
with Import,
Convention => C,
Link_Name => "@_LOWER:Name_@_RI_SET_@_Timers_@";
procedure Set_@_CAPITALIZE:Timers_@ (Val : in out asn1SccT_UInt32);
procedure Reset_@_CAPITALIZE:Timers_@
with Import,
Convention => C,
Link_Name => "@_LOWER:Name_@_RI_RESET_@_Timers_@";
procedure Reset_@_CAPITALIZE:Timers_@;
@@END_TABLE@@
end @_CAPITALIZE:Name_@_RI;
......@@ -5,7 +5,7 @@
@@IF@@ @_EXIST:Param_Names_@
@@INLINE@@
procedure @_CAPITALIZE:Name_@
@@INLINE(\()(; )(\))@@
@@INLINE(\()(; )(\);)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
@_CAPITALIZE:Param_Names_@ : in out asn1Scc@_CAPITALIZE:REPLACE_ALL(-/_):Param_Types_@
......@@ -16,10 +16,7 @@
@@END_INLINE@@
@@END_INLINE@@
@@ELSE@@
procedure @_CAPITALIZE:Name_@
procedure @_CAPITALIZE:Name_@;
@@END_IF@@
with Import,
Convention => C,
Link_Name => "@_LOWER:Parent_Function_@_RI_@_Name_@";
@@END_IF@@
@@IF@@ @_Target_@ /= SIMU and (@_Language_@ = Ada or @_Language_@ = SDL) and not @_Is_Type_@
@@IF@@ (@_Language_@ = Ada or @_Language_@ = SDL) and not @_Is_Type_@
TRUE
@@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