aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-options.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-01-06 16:55:37 +0100
committerTristan Gingold <tgingold@free.fr>2019-01-06 19:42:13 +0100
commita29a52833f5d8d3281b56d0ec4540c5ea272a560 (patch)
treeee6b3bfa3f30f3789b4e3367e6a85bd7105206ed /src/grt/grt-options.adb
parentd15e01d94c1d6561a38e3780f9199a55611fde7f (diff)
downloadghdl-a29a52833f5d8d3281b56d0ec4540c5ea272a560.tar.gz
ghdl-a29a52833f5d8d3281b56d0ec4540c5ea272a560.tar.bz2
ghdl-a29a52833f5d8d3281b56d0ec4540c5ea272a560.zip
simul: fix handling of time resolution.
Diffstat (limited to 'src/grt/grt-options.adb')
-rw-r--r--src/grt/grt-options.adb38
1 files changed, 22 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;