Commit 0c46f836 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Complete support of timer manager for simulation target

parent 0e9e0b81
......@@ -46,6 +46,11 @@
chmod +x $@
echo "./@_Partition_Name_@ & sleep 1 ; ./@_Name_@ ; pkill -INT @_Partition_Name_@" > ../binaries/run_@_Partition_Name_@_partition
chmod +x ../binaries/run_@_Partition_Name_@_partition
@@ELSIF@@ @_Language_@ = Timer_Manager and @_Target_@ = SIMU
@_LOWER:Name_@:
# Generate Ada code from SDL for the Timer Manager in simulation mode
$(MAKE) -j -C ../@_LOWER:Name_@/Timer_Manager generate-code
touch $@
@@ELSE@@
@_LOWER:Name_@:
touch $@
......
......@@ -4,7 +4,7 @@
@@-- 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_partition.ascii
@@TABLE@@
@@IF@@ @_Block_Languages_@ = SDL
@@IF@@ @_Block_Languages_@ = SDL or (@_Block_Languages_@ = Timer_Manager and @_Target_@ = SIMU)
@@SET@@ Has_SDL = TRUE
@@END_IF@@
@@END_TABLE@@
......@@ -54,12 +54,15 @@
@@END_IF@@
touch $@
@@IF@@ @_Target_@ = SIMU
@@-- For simulation target, add simulation.asn and uPER encoders
@_LOWER:Name_@_simu: @_REPLACE_ALL(,/ ):LOWER:Block_Names_@
@@IF@@ @_Has_SDL_@
@@INLINE( args=$$\(python3 -c "import os, sys; print\(' '.join\({os.path.basename\(f\):f for f in sys.argv[1:]}.values\(\)\)\)" )( )(\); \\\n mkdir -p ..\/dataview\/Ada; asn1scc -Ada -uPER -equal --target allboards -typePrefix asn1Scc -o ..\/dataview\/Ada $$args ; taste-asn1-gser -o ..\/dataview\/Ada\/src --raw $$args)@@
@@TABLE@@
@@IF@@ @_Block_Languages_@ = SDL
@@IF@@ @_Block_Languages_@ = Timer_Manager
../@_LOWER:Block_Names_@/Timer_Manager/code/@_LOWER:Block_Names_@_datamodel.asn
@@ELSIF@@ @_Block_Languages_@ = SDL
@@-- Use wildcard because in the case of the SDL to C backend the _datamodel files are not generated (yet)
@@IF@@ @_Block_Instance_Of_@ = ""
${wildcard ../@_LOWER:Block_Names_@/SDL/code/@_LOWER:Block_Names_@_datamodel.asn}
......@@ -75,6 +78,7 @@
@@END_INLINE@@
@@END_IF@@
touch $@
@@END_IF@@ @@-- simu target
@@IF@@ @_CPU_Platform_@ = PLATFORM_LEON_RTEMS_POSIX or @_CPU_Platform_@ = PLATFORM_AIR or @_CPU_Platform_@ = PLATFORM_RPI
# Build of partition @_Name_@ with the additional generation of adainit symbol
......
......@@ -12,7 +12,7 @@ BEGIN
-- Import the SDL function states needed for the global system state
@@INLINE( )(\n )()@@
@@TABLE'ALIGN_ON(" ")@@
@@IF@@ @_Block_Languages_@ = SDL
@@IF@@ @_Block_Languages_@ = SDL or @_Block_Languages_@ = Timer_Manager
@@IF@@ @_Block_Instance_Of_@ /= ""
@_CAPITALIZE:REPLACE_ALL(_/-):Block_Instance_Of_@-Context FROM @_CAPITALIZE:REPLACE_ALL(_/-):Block_Instance_Of_@-Datamodel
@@ELSE@@
......@@ -82,7 +82,7 @@ BEGIN
@@END_INLINE@@
@@INLINE( )(,\n )()@@
@@TABLE'ALIGN_ON(" ")@@
@@IF@@ @_Block_Languages_@ = SDL
@@IF@@ @_Block_Languages_@ = SDL or @_Block_Languages_@ = Timer_Manager
@@IF@@ @_Block_Instance_Of_@ /= ""
@_LOWER:REPLACE_ALL(_/-):Block_Names_@ @_CAPITALIZE:REPLACE_ALL(_/-):Block_Instance_Of_@-Context
@@ELSE@@
......
......@@ -42,6 +42,9 @@ library project @_CAPITALIZE:Name_@_Simulator is
@@IF@@ @_Block_Languages_@ = SDL
"../../@_LOWER:Block_Names_@/SDL/code",
"../../@_LOWER:Block_Names_@/SDL/wrappers",
@@ELSIF@@ @_Block_Languages_@ = Timer_Manager
"../../@_LOWER:Block_Names_@/Timer_Manager/code",
"../../@_LOWER:Block_Names_@/Timer_Manager/wrappers",
@@ELSE@@
@@IF@@ @_Block_Languages_@ /= GUI
@@-- Don't compile the GUI C source code, not used in simulation mode
......
......@@ -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@@ (@_EXIST:List_Of_RIs_@ or @_EXIST:Timers_@) and not @_Is_Type_@ and (@_Language_@ = Ada or @_Language_@ = SDL or (@_Language_@ = GUI and @_Target_@ = SIMU))
@@IF@@ (@_EXIST:List_Of_RIs_@ or @_EXIST:Timers_@) and not @_Is_Type_@ and (@_Language_@ = Ada or @_Language_@ = SDL or ((@_Language_@ = GUI or @_Language_@ = Timer_Manager) and @_Target_@ = SIMU))
TRUE
@@END_IF@@
......@@ -17,7 +17,7 @@ procedure @_CAPITALIZE:Name_@
@@END_TABLE@@
@@END_INLINE@@
@@IF@@ @_Language_@ /= GUI
@@IF@@ @_Language_@ = SDL
@@IF@@ @_Language_@ = SDL or @_Language_@ = Timer_Manager
-- Set the current context (provided by the simulation API)
@@IF@@ @_Parent_Instance_Of_@ = ""
@_CAPITALIZE:Parent_Function_@.Ctxt := Global_State.@_CAPITALIZE:Parent_Function_@;
......@@ -25,13 +25,17 @@ procedure @_CAPITALIZE:Name_@
@_CAPITALIZE:Parent_Function_@.@_CAPITALIZE:Parent_Function_@_Instance.Ctxt := Global_State.@_CAPITALIZE:Parent_Function_@;
@@END_IF@@
@@END_IF@@
@@IF@@ @_Language_@ = Ada or @_Language_@ = SDL or @_Language_@ = Timer_Manager
@_CAPITALIZE:Parent_Function_@.@_CAPITALIZE:Name_@
@@ELSE@@
C_@_CAPITALIZE:Name_@
@@END_IF@@
@@INLINE( \()(,\n )(\);)@@
@@TABLE'ALIGN_ON("=>")@@
@_CAPITALIZE:Param_Names_@ => @_CAPITALIZE:Param_Names_@
@@END_TABLE@@
@@END_INLINE@@
@@IF@@ @_Language_@ = SDL
@@IF@@ @_Language_@ = SDL or @_Language_@ = Timer_Manager
-- Update the global state
@@IF@@ @_Parent_Instance_Of_@ = ""
Global_State.@_CAPITALIZE:Parent_Function_@ := @_CAPITALIZE:Parent_Function_@.Ctxt;
......@@ -47,7 +51,7 @@ procedure @_CAPITALIZE:Name_@
procedure @_CAPITALIZE:Name_@ (Global_State : in out asn1SccSystem_State) is
begin
@@IF@@ @_Language_@ /= GUI
@@IF@@ @_Language_@ = SDL
@@IF@@ @_Language_@ = SDL or @_Language_@ = Timer_Manager
-- Set the current context (provided by the simulation API)
@@IF@@ @_Parent_Instance_Of_@ = ""
@_CAPITALIZE:Parent_Function_@.Ctxt := Global_State.@_CAPITALIZE:Parent_Function_@;
......@@ -55,8 +59,12 @@ begin
@_CAPITALIZE:Parent_Function_@.@_CAPITALIZE:Parent_Function_@_Instance.Ctxt := Global_State.@_CAPITALIZE:Parent_Function_@;
@@END_IF@@
@@END_IF@@
@@IF@@ @_Language_@ = Ada or @_Language_@ = SDL or @_Language_@ = Timer_Manager
@_CAPITALIZE:Parent_Function_@.@_CAPITALIZE:Name_@;
@@IF@@ @_Language_@ = SDL
@@ELSE@@
C_@_CAPITALIZE:Name_@;
@@END_IF@@
@@IF@@ @_Language_@ = SDL or @_Language_@ = Timer_Manager
-- Update the global state
@@IF@@ @_Parent_Instance_Of_@ = ""
Global_State.@_CAPITALIZE:Parent_Function_@ := @_CAPITALIZE:Parent_Function_@.Ctxt;
......
......@@ -8,7 +8,7 @@
with @_CAPITALIZE:ASN1_Modules_@; use @_CAPITALIZE:ASN1_Modules_@;
@@END_TABLE@@
with Simulation_Dataview; use Simulation_Dataview;
@@IF@@ @_Language_@ = Ada or @_Language_@ = SDL
@@IF@@ @_Language_@ = Ada or @_Language_@ = SDL or @_Language_@ = Timer_Manager
with @_CAPITALIZE:Name_@;
@@END_IF@@
......
......@@ -16,7 +16,26 @@ procedure @_CAPITALIZE:Name_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
@@IF@@ @_Language_@ /= Ada and @_Language_@ /= SDL and @_Language_@ /= Timer_Manager
@@-- for non-Ada functions we must import the C symbol of the PI
-- Interface to the C implementation of the interface
procedure C_@_CAPITALIZE:Name_@
@@INLINE( \()(;\n )(\)\n)@@
@@TABLE'ALIGN_ON(":")@@
@@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_@_PI_@_Name_@";
@@END_IF@@ @@-- non-Ada/SDL
@@ELSE@@ @@-- no params
procedure @_CAPITALIZE:Name_@ (Global_State : in out asn1SccSystem_State);
@@IF@@ @_Language_@ /= Ada and @_Language_@ /= SDL and @_Language_@ /= Timer_Manager
procedure C_@_CAPITALIZE:Name_@
with Import, Convention => C, Link_Name => "@_LOWER:Parent_Function_@_PI_@_Name_@";
@@END_IF@@
@@END_IF@@
@@END_IF@@
@@-- OpenGEODE's generate code goes into the "code" folder
@@IF@@ @_Language_@ = SDL
@@IF@@ @_Language_@ = SDL or @_Language_@ = Timer_Manager
../code/@_LOWER:Name_@_ri.ads
@@ELSE@@
@_LOWER:Name_@_ri.ads
......@@ -14,6 +14,7 @@ package @_CAPITALIZE:Name_@_RI is
@_Required_Interfaces'Indent_@
@@IF@@ @_Language_@ /= Timer_Manager
@@TABLE@@
-- Timer @_Timers_@ Set and Reset functions
procedure Set_@_CAPITALIZE:Timers_@ (Val : in out asn1SccT_UInt32);
......@@ -21,6 +22,7 @@ package @_CAPITALIZE:Name_@_RI is
procedure Reset_@_CAPITALIZE:Timers_@;
@@END_TABLE@@
@@END_IF@@
procedure Check_Queue (Res : out adaasn1rtl.Asn1Boolean)
with Import, Convention => C, Link_Name => "@_LOWER:Name_@_check_queue";
end @_CAPITALIZE:Name_@_RI;
@@IF@@ (@_Language_@ = Ada or @_Language_@ = SDL) and not @_Is_Type_@
@@IF@@ (@_Language_@ = Ada or @_Language_@ = SDL or (@_Language_@ = Timer_Manager and @_Target_@ = SIMU)) 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