From c8bd4ded49e392ad89e2ac5e5282386bb23e527d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 30 May 2022 04:13:01 +0200 Subject: synth-vhdl_static_proc: add hook for std.env.finish --- src/synth/synth-vhdl_static_proc.adb | 8 ++++++++ src/synth/synth-vhdl_static_proc.ads | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/synth/synth-vhdl_static_proc.adb b/src/synth/synth-vhdl_static_proc.adb index 0764d35c1..a20865696 100644 --- a/src/synth/synth-vhdl_static_proc.adb +++ b/src/synth/synth-vhdl_static_proc.adb @@ -16,6 +16,8 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +with Types; use Types; + with Vhdl.Errors; use Vhdl.Errors; with Elab.Vhdl_Values; use Elab.Vhdl_Values; @@ -62,6 +64,12 @@ package body Synth.Vhdl_Static_Proc is Synth_File_Read (Syn_Inst, Imp, Loc); when Iir_Predefined_Write => Synth_File_Write (Syn_Inst, Imp, Loc); + when Iir_Predefined_Std_Env_Finish_Status => + if Hook_Finish /= null then + Hook_Finish.all (Syn_Inst, Imp); + else + raise Internal_Error; + end if; when others => Error_Msg_Synth (+Loc, "call to implicit %n is not supported", +Imp); diff --git a/src/synth/synth-vhdl_static_proc.ads b/src/synth/synth-vhdl_static_proc.ads index c7bedbcce..153f8b3cf 100644 --- a/src/synth/synth-vhdl_static_proc.ads +++ b/src/synth/synth-vhdl_static_proc.ads @@ -24,4 +24,8 @@ package Synth.Vhdl_Static_Proc is procedure Synth_Static_Procedure (Syn_Inst : Synth_Instance_Acc; Imp : Node; Loc : Node); + + type Hook_Simulation_Acc is access + procedure (Inst : Synth_Instance_Acc; Imp : Node); + Hook_Finish : Hook_Simulation_Acc; end Synth.Vhdl_Static_Proc; -- cgit v1.2.3