diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-12-05 05:12:16 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-12-05 05:12:16 +0100 |
commit | 237ff6b3749f8e8bcab5040fcb04feeec77da92b (patch) | |
tree | 0840018131793a294e2f98c5c0a76f434fee4695 /src/vhdl/simulate/simul-elaboration.adb | |
parent | 619a6e10cbcd439ba2a499ea74357774e9d4ffae (diff) | |
download | ghdl-237ff6b3749f8e8bcab5040fcb04feeec77da92b.tar.gz ghdl-237ff6b3749f8e8bcab5040fcb04feeec77da92b.tar.bz2 ghdl-237ff6b3749f8e8bcab5040fcb04feeec77da92b.zip |
simul: handle interface subprogram.
Diffstat (limited to 'src/vhdl/simulate/simul-elaboration.adb')
-rw-r--r-- | src/vhdl/simulate/simul-elaboration.adb | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/vhdl/simulate/simul-elaboration.adb b/src/vhdl/simulate/simul-elaboration.adb index 57088afd5..7cfb0c352 100644 --- a/src/vhdl/simulate/simul-elaboration.adb +++ b/src/vhdl/simulate/simul-elaboration.adb @@ -404,15 +404,21 @@ package body Simul.Elaboration is if Get_Kind (Decl) = Iir_Kind_Package_Instantiation_Declaration then -- Elaborate the body now. - declare - Uninst : constant Iir := Get_Uninstantiated_Package_Decl (Decl); - Uninst_Info : constant Sim_Info_Acc := Get_Info (Uninst); - Bod : constant Iir := Get_Package_Body (Uninst); - begin - Instance.Uninst_Scope := Uninst_Info; + if Get_Package_Body (Decl) /= Null_Iir then + -- Macro-expanded. Elaborate_Declarative_Part - (Instance, Get_Declaration_Chain (Bod)); - end; + (Instance, Get_Declaration_Chain (Get_Package_Body (Decl))); + else + -- Shared body. + declare + Uninst : constant Iir := Get_Uninstantiated_Package_Decl (Decl); + Bod : constant Iir := Get_Package_Body (Uninst); + begin + Instance.Uninst_Scope := Get_Info (Uninst); + Elaborate_Declarative_Part + (Instance, Get_Declaration_Chain (Bod)); + end; + end if; end if; end Elaborate_Package_Declaration; @@ -1060,6 +1066,9 @@ package body Simul.Elaboration is -- to determine the value of the constant. when Iir_Kind_Interface_Package_Declaration => Create_Object (Instance, Get_Info (Decl).Pkg_Slot); + when Iir_Kinds_Interface_Subprogram_Declaration => + -- Macro-expanded. + null; when others => Error_Kind ("elaborate_generic_clause", Decl); end case; @@ -1158,6 +1167,8 @@ package body Simul.Elaboration is end; goto Continue; + when Iir_Kind_Association_Element_Subprogram => + goto Continue; when others => Error_Kind ("elaborate_generic_map_aspect", Assoc); end case; |