aboutsummaryrefslogtreecommitdiffstats
path: root/translate/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-02-23 18:38:18 +0100
committerTristan Gingold <tgingold@free.fr>2014-02-23 18:38:18 +0100
commit14d6d7d837636f1589bc2ef1a5e27a9423ec6e24 (patch)
treea476d2b58690f948b53e906eaf8077a7937cae52 /translate/ghdldrv
parentb74cf02f016d958b66e24cd0e7f3c1f5555afefc (diff)
downloadghdl-14d6d7d837636f1589bc2ef1a5e27a9423ec6e24.tar.gz
ghdl-14d6d7d837636f1589bc2ef1a5e27a9423ec6e24.tar.bz2
ghdl-14d6d7d837636f1589bc2ef1a5e27a9423ec6e24.zip
ghdlsimul: set argv0 earlier.
Diffstat (limited to 'translate/ghdldrv')
-rw-r--r--translate/ghdldrv/ghdlsimul.adb31
1 files changed, 23 insertions, 8 deletions
diff --git a/translate/ghdldrv/ghdlsimul.adb b/translate/ghdldrv/ghdlsimul.adb
index 3db83cc83..9cc36717e 100644
--- a/translate/ghdldrv/ghdlsimul.adb
+++ b/translate/ghdldrv/ghdlsimul.adb
@@ -19,7 +19,6 @@
with Ada.Text_IO;
with Ada.Command_Line;
-with Ghdlmain;
with Ghdllocal; use Ghdllocal;
with GNAT.OS_Lib; use GNAT.OS_Lib;
@@ -88,8 +87,16 @@ package body Ghdlsimul is
-- Set options.
procedure Set_Run_Options (Args : Argument_List)
is
+ use Grt.Options;
+ use Types;
Arg : String_Access;
+ Status : Decode_Option_Status;
+ Argv0 : String_Acc;
begin
+ -- Set progname (used for grt error messages)
+ Argv0 := new String'(Ada.Command_Line.Command_Name & ASCII.Nul);
+ Grt.Options.Progname := Grt.Types.To_Ghdl_C_String (Argv0.all'Address);
+
for I in Args'Range loop
Arg := Args (I);
if Arg.all = "--disp-tree" then
@@ -103,8 +110,18 @@ package body Ghdlsimul is
elsif Arg.all = "--trace-simu" then
Simulation.Trace_Simulation := True;
else
- Ghdlmain.Error ("unknown run options '" & Arg.all & "'");
- raise Option_Error;
+ Decode_Option (Arg.all, Status);
+ case Status is
+ when Decode_Option_Last =>
+ exit;
+ when Decode_Option_Help =>
+ -- FIXME: is that correct ?
+ exit;
+ when Decode_Option_Ok =>
+ null;
+ end case;
+ -- Ghdlmain.Error ("unknown run options '" & Arg.all & "'");
+ -- raise Option_Error;
end if;
end loop;
end Set_Run_Options;
@@ -117,12 +134,7 @@ package body Ghdlsimul is
First_Id : Name_Id;
Sec_Id : Name_Id;
Top_Conf : Iir;
- Argv0 : String_Acc;
begin
- -- Set progname (used for grt error messages)
- Argv0 := new String'(Ada.Command_Line.Command_Name & ASCII.Nul);
- Grt.Options.Progname := Grt.Types.To_Ghdl_C_String (Argv0.all'Address);
-
First_Id := Get_Identifier (Prim_Name.all);
if Sec_Name = null then
Sec_Id := Null_Identifier;
@@ -137,6 +149,9 @@ package body Ghdlsimul is
Grtlink.Flag_String := Flags.Flag_String;
Simulation.Simulation_Entity (Top_Conf);
+ exception
+ when Errorout.Execution_Constraint_Error =>
+ null;
end Run;
function Decode_Option (Option : String) return Boolean