aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-08-21 10:39:12 +0200
committerTristan Gingold <tgingold@free.fr>2022-08-21 10:39:12 +0200
commit61665a183e94cf8edaebb336c34df24a02ef45fd (patch)
tree27a723c64906a5f7293e47e9cb27c62ca3b33574 /src/synth
parent068988b5f9132ae11ee65ca75ac6e56bc8f2f530 (diff)
downloadghdl-61665a183e94cf8edaebb336c34df24a02ef45fd.tar.gz
ghdl-61665a183e94cf8edaebb336c34df24a02ef45fd.tar.bz2
ghdl-61665a183e94cf8edaebb336c34df24a02ef45fd.zip
simul: rework assertions execution and error handling
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/elab-debugger.adb3
-rw-r--r--src/synth/elab-debugger.ads6
-rw-r--r--src/synth/synth-vhdl_stmts.ads2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/synth/elab-debugger.adb b/src/synth/elab-debugger.adb
index f1138904f..0f5ecb9dc 100644
--- a/src/synth/elab-debugger.adb
+++ b/src/synth/elab-debugger.adb
@@ -1041,6 +1041,9 @@ package body Elab.Debugger is
Current_Loc := Expr;
Debug (Reason_Error);
end if;
+ if Error_Hook /= null then
+ Error_Hook.all;
+ end if;
end Debug_Error;
end Elab.Debugger;
diff --git a/src/synth/elab-debugger.ads b/src/synth/elab-debugger.ads
index cc456dfc1..bb8f91f90 100644
--- a/src/synth/elab-debugger.ads
+++ b/src/synth/elab-debugger.ads
@@ -45,8 +45,14 @@ package Elab.Debugger is
-- To be called in case of execution error, like:
-- * index out of bounds.
+ -- * assertion failuere
procedure Debug_Error (Inst : Synth_Instance_Acc; Expr : Node);
+ -- Hook called in case of fatal error.
+ type Error_Hook_Type is access procedure;
+ pragma Convention (C, Error_Hook_Type);
+ Error_Hook : Error_Hook_Type;
+
function Debug_Current_Instance return Synth_Instance_Acc;
type Menu_Procedure is access procedure (Line : String);
diff --git a/src/synth/synth-vhdl_stmts.ads b/src/synth/synth-vhdl_stmts.ads
index 3922b9242..db78c44d7 100644
--- a/src/synth/synth-vhdl_stmts.ads
+++ b/src/synth/synth-vhdl_stmts.ads
@@ -101,8 +101,6 @@ package Synth.Vhdl_Stmts is
Unit : Node;
Parent_Inst : Synth_Instance_Acc);
- procedure Execute_Assertion_Statement (Inst : Synth_Instance_Acc;
- Stmt : Node);
procedure Execute_Report_Statement (Inst : Synth_Instance_Acc;
Stmt : Node);
procedure Exec_Failed_Assertion (Syn_Inst : Synth_Instance_Acc;