aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-12-11 18:43:04 +0100
committerTristan Gingold <tgingold@free.fr>2017-12-11 18:43:04 +0100
commit550943a8340900fae01faac333656a6ad4fb50ea (patch)
treec1d8604ea39fc4fba1a6cabf1cf16c401f573d9e /src
parentce3659abec1037f8dc4ad62eecdaba08884ce348 (diff)
downloadghdl-550943a8340900fae01faac333656a6ad4fb50ea.tar.gz
ghdl-550943a8340900fae01faac333656a6ad4fb50ea.tar.bz2
ghdl-550943a8340900fae01faac333656a6ad4fb50ea.zip
simul: create_subprogram_instance: handle protected
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/simulate/simul-execution.adb12
1 files changed, 9 insertions, 3 deletions
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);