diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-01-06 16:55:37 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-01-06 19:42:13 +0100 |
commit | a29a52833f5d8d3281b56d0ec4540c5ea272a560 (patch) | |
tree | ee6b3bfa3f30f3789b4e3367e6a85bd7105206ed /src/grt | |
parent | d15e01d94c1d6561a38e3780f9199a55611fde7f (diff) | |
download | ghdl-a29a52833f5d8d3281b56d0ec4540c5ea272a560.tar.gz ghdl-a29a52833f5d8d3281b56d0ec4540c5ea272a560.tar.bz2 ghdl-a29a52833f5d8d3281b56d0ec4540c5ea272a560.zip |
simul: fix handling of time resolution.
Diffstat (limited to 'src/grt')
-rw-r--r-- | src/grt/grt-options.adb | 38 | ||||
-rw-r--r-- | src/grt/grt-options.ads | 3 |
2 files changed, 25 insertions, 16 deletions
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; |