aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/simulate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-11 18:34:44 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-11 18:34:44 +0100
commit911a0bfa0886f638fc82306d67d6b619d07173e6 (patch)
treefa8a1b2ea431ffb1451fb2d034ba947101239320 /src/vhdl/simulate
parent2e1fadbd8c9fe7a3eebba9e54bb5a116caca78ea (diff)
downloadghdl-911a0bfa0886f638fc82306d67d6b619d07173e6.tar.gz
ghdl-911a0bfa0886f638fc82306d67d6b619d07173e6.tar.bz2
ghdl-911a0bfa0886f638fc82306d67d6b619d07173e6.zip
simul: emit proper error message for negative timeout.
Diffstat (limited to 'src/vhdl/simulate')
-rw-r--r--src/vhdl/simulate/simul-execution.adb3
-rw-r--r--src/vhdl/simulate/simul-simulation.adb4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/vhdl/simulate/simul-execution.adb b/src/vhdl/simulate/simul-execution.adb
index b7888608b..e18016c21 100644
--- a/src/vhdl/simulate/simul-execution.adb
+++ b/src/vhdl/simulate/simul-execution.adb
@@ -4638,8 +4638,7 @@ package body Simul.Execution is
Release (Proc.Instance.Marker, Instance_Pool.all);
end Finish_Procedure_Frame;
- procedure Execute_If_Statement
- (Proc : Process_State_Acc; Stmt: Iir_Wait_Statement)
+ procedure Execute_If_Statement (Proc : Process_State_Acc; Stmt : Iir)
is
Clause: Iir;
Cond: Boolean;
diff --git a/src/vhdl/simulate/simul-simulation.adb b/src/vhdl/simulate/simul-simulation.adb
index 5b7035c3f..a674fa784 100644
--- a/src/vhdl/simulate/simul-simulation.adb
+++ b/src/vhdl/simulate/simul-simulation.adb
@@ -18,6 +18,7 @@
with Types; use Types;
with Simul.Execution; use Simul.Execution;
+with Simul.Debugger; use Simul.Debugger;
with Areapools; use Areapools;
with Grt.Signals;
with Grt.Processes;
@@ -524,6 +525,9 @@ package body Simul.Simulation is
Expr := Get_Timeout_Clause (Stmt);
if Expr /= Null_Iir then
Res := Execute_Expression (Instance, Expr);
+ if Res.I64 < 0 then
+ Error_Msg_Exec ("negative timeout clause", Stmt);
+ end if;
Grt.Processes.Ghdl_Process_Wait_Set_Timeout
(Std_Time (Res.I64), null, 0);
end if;