From 15bc89b633b601dbc338041dc977494f6c38fc7f Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 31 Oct 2015 07:13:55 +0100 Subject: Rework --stop-time to not display a message if simulation is already finished. --- src/grt/grt-processes.adb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/grt/grt-processes.adb') diff --git a/src/grt/grt-processes.adb b/src/grt/grt-processes.adb index feb3123..242a9e5 100644 --- a/src/grt/grt-processes.adb +++ b/src/grt/grt-processes.adb @@ -1088,6 +1088,17 @@ package body Grt.Processes is end if; exit when Status = Run_Finished; + if Next_Time > Stop_Time + and then Next_Time /= Std_Time'Last + then + -- FIXME: Implement with a callback instead ? This could be done + -- in 2 steps: an after_delay for the time and then a read_only + -- to finish the current cycle. Note that no message should be + -- printed if the simulation is already finished at the stop time. + Info ("simulation stopped by --stop-time"); + exit; + end if; + if Current_Delta = 0 then Grt.Hooks.Call_Cycle_Hooks; end if; -- cgit