From 550943a8340900fae01faac333656a6ad4fb50ea Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 11 Dec 2017 18:43:04 +0100 Subject: simul: create_subprogram_instance: handle protected --- src/vhdl/simulate/simul-execution.adb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/vhdl/simulate/simul-execution.adb b/src/vhdl/simulate/simul-execution.adb index 2eb890c54..0020bb2d3 100644 --- a/src/vhdl/simulate/simul-execution.adb +++ b/src/vhdl/simulate/simul-execution.adb @@ -3297,6 +3297,7 @@ package body Simul.Execution is return Block_Instance_Acc is Parent : constant Iir := Get_Parent (Imp); + Bod : Iir; Up_Block: Block_Instance_Acc; Up_Info : Sim_Info_Acc; @@ -3304,8 +3305,14 @@ package body Simul.Execution is Origin : Iir; Label : Iir; begin - pragma Assert (Get_Kind (Imp) in Iir_Kinds_Subprogram_Declaration - or else Get_Kind (Imp) = Iir_Kind_Protected_Type_Body); + case Get_Kind (Imp) is + when Iir_Kinds_Subprogram_Declaration => + Bod := Get_Subprogram_Body (Imp); + when Iir_Kind_Protected_Type_Body => + Bod := Imp; + when others => + Error_Kind ("create_subprogram_instance", Imp); + end case; if Prot_Obj /= null then Up_Block := Prot_Obj; @@ -3333,7 +3340,6 @@ package body Simul.Execution is -- but there are exceptions: there can be multiple spec for the same -- body for shared generic packages. declare - Bod : constant Iir := Get_Subprogram_Body (Label); Func_Info : constant Sim_Info_Acc := Get_Info (Bod); subtype Block_Type is Block_Instance_Type (Func_Info.Nbr_Objects); -- cgit v1.2.3