Commit 4c901029 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Improve simulation templates for complex systems

parent fca42e63
......@@ -29,7 +29,7 @@ package body @_CAPITALIZE:Name_@_Events is
return;
end if;
case Evt.Kind is
@@IF@@ @_List_Of_ASync_PIs'Length_@ > 0
@@IF@@ @_List_Of_ASync_PIs'Length_@ > 0 or @_Timers'Length_@ > 0
when Msg_IN_Present =>
case Evt.Msg_In.Kind is
@@TABLE@@
......@@ -44,6 +44,11 @@ package body @_CAPITALIZE:Name_@_Events is
@_CAPITALIZE:Name_@_PI.@_CAPITALIZE:List_Of_ASync_PIs_@ (Global_State => Global_State);
@@END_IF@@
@@END_TABLE@@
@@TABLE@@
@@-- Do the timers too
when @_CAPITALIZE:Timers_@_PRESENT =>
@_CAPITALIZE:Name_@_PI.@_CAPITALIZE:Timers_@ (Global_State => Global_State);
@@END_TABLE@@
end case;
@@END_IF@@
@@IF@@ @_List_Of_ASync_RIs'Length_@ > 0
......@@ -59,7 +64,7 @@ package body @_CAPITALIZE:Name_@_Events is
procedure Print_Event (Event : asn1scc@_CAPITALIZE:Name_@_Event) is
begin
case Event.Kind is
@@IF@@ @_List_Of_ASync_PIs'Length_@ > 0
@@IF@@ @_List_Of_ASync_PIs'Length_@ > 0 or @_Timers'Length_@ > 0
when Msg_IN_Present =>
case Event.Msg_In.Kind is
@@TABLE@@
......@@ -71,6 +76,11 @@ package body @_CAPITALIZE:Name_@_Events is
Put_Line ("()");
@@END_IF@@
@@END_TABLE@@
@@TABLE@@
@@-- Do the timers too
when @_CAPITALIZE:Timers_@_PRESENT =>
Put ("@_Name_@: TIMEOUT @_CAPITALIZE:Timers_@");
@@END_TABLE@@
end case;
@@END_IF@@
@@IF@@ @_List_Of_ASync_RIs'Length_@ > 0
......@@ -86,8 +96,9 @@ package body @_CAPITALIZE:Name_@_Events is
@@END_IF@@
@@END_TABLE@@
@@TABLE@@
when @_CAPITALIZE:List_Of_Sync_RIs_@_PRESENT =>
Put_Line ("@_Name_@ : CALL @_List_Of_Sync_RIs_@");
-- Synchronous calls are not intercepted for the moment
-- when @_CAPITALIZE:List_Of_Sync_RIs_@_PRESENT =>
-- Put_Line ("@_Name_@ : CALL @_List_Of_Sync_RIs_@");
@@END_TABLE@@
end case;
@@END_IF@@
......
......@@ -30,6 +30,7 @@ when @_CAPITALIZE:Name_@_PRESENT =>
(Global_State.@_CAPITALIZE:Remote_Function_Names_@_Queue.Length) := Input_Event;
@@END_IF@@
@@ELSE@@
when @_CAPITALIZE:Name_@_PRESENT =>
Put_Line ("[@_Name_@] PROCEDURE CALL OF @_Name_@");
-- Synchronous calls are not intercepted for the moment
-- when @_CAPITALIZE:Name_@_PRESENT =>
-- Put_Line ("[@_Name_@] PROCEDURE CALL OF @_Name_@");
@@END_IF@@
......@@ -14,7 +14,6 @@
@@END_TABLE@@
@@-- Add timers expiration PIs, except for the Timer Manager function
@@IF@@ @_EXIST:Timers_@ and @_LOWER:Name_@ /= @_LOWER:Partition_Name_@ & _timer_manager
-- Timers:
@@TABLE'ALIGN_ON(" ")@@
@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {}
@@END_TABLE@@
......@@ -30,11 +29,11 @@
@@END_TABLE@@
@@-- Add timers expiration PIs, except for the Timer Manager function
@@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@@
@@-- Timers SET/RESET are synchronous calls, they do not appear as events here
@@-- @@TABLE'ALIGN_ON(" ")@@
@@-- set-@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {val T-UInt32}
@@-- reset-@_REPLACE_ALL(_/-):Timers_@ SEQUENCE {}
@@-- @@END_TABLE@@
@@END_IF@@
@@END_INLINE@@
@@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