aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-02 19:48:17 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-02 20:24:52 +0200
commitc3b78f3370c1def22ff7240045d174fb120714e9 (patch)
tree5a23d1658b640d9eb3980d7c64a46e8124707c93
parent749a21ac4d7a55be99f4f91ec31ff762586589b3 (diff)
downloadghdl-c3b78f3370c1def22ff7240045d174fb120714e9.tar.gz
ghdl-c3b78f3370c1def22ff7240045d174fb120714e9.tar.bz2
ghdl-c3b78f3370c1def22ff7240045d174fb120714e9.zip
grt: slightly simplify the interface.
-rw-r--r--src/grt/grt-main.adb11
-rw-r--r--src/grt/grt-main.ads7
-rw-r--r--src/grt/grt-processes.ads4
-rw-r--r--src/vhdl/simulate/simul-simulation-main.adb6
4 files changed, 7 insertions, 21 deletions
diff --git a/src/grt/grt-main.adb b/src/grt/grt-main.adb
index 2dda446cf..29a12cb6b 100644
--- a/src/grt/grt-main.adb
+++ b/src/grt/grt-main.adb
@@ -117,7 +117,7 @@ package body Grt.Main is
Grt.Options.Argv := Argv;
end Run_Options;
- function Run_Init return C_Boolean
+ function Run_Elab return C_Boolean
is
Stop : Boolean;
begin
@@ -146,11 +146,6 @@ package body Grt.Main is
Grt.Signals.Init;
- return True;
- end Run_Init;
-
- function Run_Elab return C_Boolean is
- begin
if Flag_Stats then
Stats.Start_Elaboration;
end if;
@@ -199,10 +194,6 @@ package body Grt.Main is
Ok : C_Boolean;
Status : Integer;
begin
- Ok := Run_Init;
- if not Ok then
- return;
- end if;
Ok := Run_Elab;
if not Ok then
return;
diff --git a/src/grt/grt-main.ads b/src/grt/grt-main.ads
index af14add20..2a37175ba 100644
--- a/src/grt/grt-main.ads
+++ b/src/grt/grt-main.ads
@@ -38,12 +38,7 @@ package Grt.Main is
-- What Run does.
- -- Initialization: decode options, but no elaboration.
- -- Return False in case of error.
- function Run_Init return C_Boolean;
- pragma Export (C, Run_Init, "grt_main_init");
-
- -- Elaborate the design. Return False in case of error.
+ -- Initialize and elaborate the design. Return False in case of error.
function Run_Elab return C_Boolean;
pragma Export (C, Run_Elab, "grt_main_elab");
diff --git a/src/grt/grt-processes.ads b/src/grt/grt-processes.ads
index 7a5577c11..de470f1f7 100644
--- a/src/grt/grt-processes.ads
+++ b/src/grt/grt-processes.ads
@@ -45,12 +45,12 @@ package Grt.Processes is
-- Broken down version of Simulation.
function Simulation_Init return Integer;
- pragma Export (C, Simulation_Init, "__ghdl_simulation_init");
+ pragma Export (Ada, Simulation_Init, "__ghdl_simulation_init");
function Simulation_Cycle return Integer;
procedure Simulation_Finish;
function Simulation_Step return Integer;
- pragma Export (C, Simulation_Step, "__ghdl_simulation_step");
+ pragma Export (Ada, Simulation_Step, "__ghdl_simulation_step");
-- Return value:
-- 0: delta cycle
-- 1: non-delta cycle
diff --git a/src/vhdl/simulate/simul-simulation-main.adb b/src/vhdl/simulate/simul-simulation-main.adb
index fcac44e3d..956d0f3dc 100644
--- a/src/vhdl/simulate/simul-simulation-main.adb
+++ b/src/vhdl/simulate/simul-simulation-main.adb
@@ -1212,7 +1212,7 @@ package body Simul.Simulation.Main is
procedure Simulation_Entity (Top_Conf : Iir_Design_Unit)
is
use Grt.Errors;
- Stop : Boolean;
+ Ok : C_Boolean;
Status : Integer;
begin
Break_Time := Std_Time'Last;
@@ -1225,8 +1225,8 @@ package body Simul.Simulation.Main is
Debug (Reason_Start);
end if;
- Grt.Main.Run_Elab (Stop);
- if Stop then
+ Ok := Grt.Main.Run_Elab;
+ if not Ok then
return;
end if;