From d8b55e17cad36f3f34f57434ab6c97b2c2afa964 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 2 Feb 2016 20:48:55 +0100 Subject: simul: support of package instantiation. --- src/vhdl/simulate/execution.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/vhdl/simulate/execution.adb') diff --git a/src/vhdl/simulate/execution.adb b/src/vhdl/simulate/execution.adb index b299d648e..25774f1e9 100644 --- a/src/vhdl/simulate/execution.adb +++ b/src/vhdl/simulate/execution.adb @@ -42,6 +42,7 @@ with Grt_Interface; with Grt.Values; with Grt.Errors; with Grt.Std_Logic_1164; +with Sem_Inst; package body Execution is @@ -3274,9 +3275,15 @@ package body Execution is function Execute_Function_Body (Instance : Block_Instance_Acc; Func : Iir) return Iir_Value_Literal_Acc is - Subprg_Body : constant Iir := Get_Subprogram_Body (Func); + Subprg_Body : Iir; Res : Iir_Value_Literal_Acc; begin + Subprg_Body := Get_Subprogram_Body (Func); + if Subprg_Body = Null_Iir then + pragma Assert (Sem_Inst.Get_Origin (Func) /= Null_Iir); + Subprg_Body := Get_Subprogram_Body (Sem_Inst.Get_Origin (Func)); + end if; + Current_Process.Instance := Instance; Elaborate_Declarative_Part -- cgit v1.2.3