aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_inst.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-12-05 03:17:52 +0100
committerTristan Gingold <tgingold@free.fr>2016-12-05 03:25:22 +0100
commit5d3ea061ee2741422f7946c62edf65b58fccce48 (patch)
treeec0cce96e2dbd44b479daea0c1587c447f6bb47c /src/vhdl/sem_inst.adb
parent0a7fc14d1cb3fe7bb465102e5c27f1efbd54d511 (diff)
downloadghdl-5d3ea061ee2741422f7946c62edf65b58fccce48.tar.gz
ghdl-5d3ea061ee2741422f7946c62edf65b58fccce48.tar.bz2
ghdl-5d3ea061ee2741422f7946c62edf65b58fccce48.zip
vhdl08: support top-level macro-expanded package instantiation declarations.
Fixes #199
Diffstat (limited to 'src/vhdl/sem_inst.adb')
-rw-r--r--src/vhdl/sem_inst.adb10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vhdl/sem_inst.adb b/src/vhdl/sem_inst.adb
index caba67456..b396e6327 100644
--- a/src/vhdl/sem_inst.adb
+++ b/src/vhdl/sem_inst.adb
@@ -861,8 +861,7 @@ package body Sem_Inst is
function Instantiate_Package_Body (Inst : Iir) return Iir
is
- Inst_Decl : constant Iir := Get_Package_Origin (Inst);
- Pkg : constant Iir := Get_Uninstantiated_Package_Decl (Inst_Decl);
+ Pkg : constant Iir := Get_Uninstantiated_Package_Decl (Inst);
Prev_Instance_File : constant Source_File_Entry := Instance_File;
Mark : constant Instance_Index_Type := Prev_Instance_Table.Last;
Res : Iir;
@@ -877,7 +876,6 @@ package body Sem_Inst is
Set_Instance (Pkg, Inst);
declare
Pkg_Hdr : constant Iir := Get_Package_Header (Pkg);
- Inst_Hdr : constant Iir := Get_Package_Header (Inst);
Pkg_El : Iir;
Inst_El : Iir;
Inter_El : Iir;
@@ -886,7 +884,7 @@ package body Sem_Inst is
-- In the body, references to interface object are redirected to the
-- instantiated interface objects.
Pkg_El := Get_Generic_Chain (Pkg_Hdr);
- Inst_El := Get_Generic_Chain (Inst_Hdr);
+ Inst_El := Get_Generic_Chain (Inst);
while Is_Valid (Pkg_El) loop
if Get_Kind (Pkg_El) in Iir_Kinds_Interface_Object_Declaration then
Set_Instance (Pkg_El, Inst_El);
@@ -897,8 +895,8 @@ package body Sem_Inst is
-- In the body, references to interface type are substitued to the
-- mapped type.
- Inst_El := Get_Generic_Map_Aspect_Chain (Inst_Hdr);
- Inter_El := Get_Generic_Chain (Inst_Hdr);
+ Inst_El := Get_Generic_Map_Aspect_Chain (Inst);
+ Inter_El := Get_Generic_Chain (Inst);
while Is_Valid (Inst_El) loop
case Get_Kind (Inst_El) is
when Iir_Kind_Association_Element_Type =>