diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdlsimul.adb | 5 | ||||
-rw-r--r-- | src/grt/grt-options.adb | 38 | ||||
-rw-r--r-- | src/grt/grt-options.ads | 3 |
3 files changed, 28 insertions, 18 deletions
diff --git a/src/ghdldrv/ghdlsimul.adb b/src/ghdldrv/ghdlsimul.adb index e0a5ce649..2e304d7ce 100644 --- a/src/ghdldrv/ghdlsimul.adb +++ b/src/ghdldrv/ghdlsimul.adb @@ -141,6 +141,9 @@ package body Ghdlsimul is Grt.Options.Progname := Grt.Types.To_Ghdl_C_String (Argv0.all'Address); Grt.Errors.Set_Error_Stream (Grt.Stdio.stdout); + Grtlink.Flag_String := Flags.Flag_String; + Grt.Options.Set_Time_Resolution; + for I in Args'Range loop Arg := Args (I); if Arg.all = "--disp-tree" then @@ -187,8 +190,6 @@ package body Ghdlsimul is return; end if; - Grtlink.Flag_String := Flags.Flag_String; - Simul.Simulation.Main.Simulation_Entity (Top_Conf); Set_Exit_Status (Exit_Status (Grt.Errors.Exit_Status)); diff --git a/src/grt/grt-options.adb b/src/grt/grt-options.adb index d93ad9e58..e19d491ca 100644 --- a/src/grt/grt-options.adb +++ b/src/grt/grt-options.adb @@ -32,6 +32,26 @@ with Grt.Wave_Opt.File; package body Grt.Options is + procedure Set_Time_Resolution is + begin + case Flag_String (5) is + when 'f' | '-' => + Time_Resolution_Scale := 5; + when 'p' => + Time_Resolution_Scale := 4; + when 'n' => + Time_Resolution_Scale := 3; + when 'u' => + Time_Resolution_Scale := 2; + when 'm' => + Time_Resolution_Scale := 1; + when 's' => + Time_Resolution_Scale := 0; + when others => + Error ("unhandled time resolution"); + end case; + end Set_Time_Resolution; + procedure Help is use Grt.Astdio; @@ -384,22 +404,8 @@ package body Grt.Options is Len : Natural; Status : Decode_Option_Status; begin - case Flag_String (5) is - when 'f' | '-' => - Time_Resolution_Scale := 5; - when 'p' => - Time_Resolution_Scale := 4; - when 'n' => - Time_Resolution_Scale := 3; - when 'u' => - Time_Resolution_Scale := 2; - when 'm' => - Time_Resolution_Scale := 1; - when 's' => - Time_Resolution_Scale := 0; - when others => - Error ("unhandled time resolution"); - end case; + -- Must be done before decoding options. + Set_Time_Resolution; Stop := False; Last_Opt := Argc - 1; diff --git a/src/grt/grt-options.ads b/src/grt/grt-options.ads index fa7e1f660..32852d650 100644 --- a/src/grt/grt-options.ads +++ b/src/grt/grt-options.ads @@ -65,6 +65,9 @@ package Grt.Options is subtype Natural_Time_Scale is Natural range 0 .. 5; Time_Resolution_Scale : Natural_Time_Scale; + -- Set Time_Resolution_Scale from Flag_String. + procedure Set_Time_Resolution; + -- Display options help. -- Should not be called directly. procedure Help; |