aboutsummaryrefslogtreecommitdiffstats
path: root/translate/ghdldrv
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-11-02 05:31:01 +0100
committerTristan Gingold <tgingold@free.fr>2014-11-02 05:31:01 +0100
commitad9367ec8a27a56e0a83f91ee0cc50785d076862 (patch)
treebf5179c00bffe556c4d1c6e8146450236a771550 /translate/ghdldrv
parent5d252b8afe1055f752cafc9f5a89feb95cee853f (diff)
downloadghdl-ad9367ec8a27a56e0a83f91ee0cc50785d076862.tar.gz
ghdl-ad9367ec8a27a56e0a83f91ee0cc50785d076862.tar.bz2
ghdl-ad9367ec8a27a56e0a83f91ee0cc50785d076862.zip
Handle packkage instantiation for --chop.
Diffstat (limited to 'translate/ghdldrv')
-rw-r--r--translate/ghdldrv/ghdllocal.adb2
-rw-r--r--translate/ghdldrv/ghdlprint.adb14
2 files changed, 9 insertions, 7 deletions
diff --git a/translate/ghdldrv/ghdllocal.adb b/translate/ghdldrv/ghdllocal.adb
index a94b27928..d15de68f4 100644
--- a/translate/ghdldrv/ghdllocal.adb
+++ b/translate/ghdldrv/ghdllocal.adb
@@ -263,6 +263,8 @@ package body Ghdllocal is
Put ("configuration ");
when Iir_Kind_Package_Declaration =>
Put ("package ");
+ when Iir_Kind_Package_Instantiation_Declaration =>
+ Put ("package instance ");
when Iir_Kind_Package_Body =>
Put ("package body ");
when others =>
diff --git a/translate/ghdldrv/ghdlprint.adb b/translate/ghdldrv/ghdlprint.adb
index 01040002c..45e70e118 100644
--- a/translate/ghdldrv/ghdlprint.adb
+++ b/translate/ghdldrv/ghdlprint.adb
@@ -561,16 +561,16 @@ package body Ghdlprint is
function Build_File_Name_Length (Lib : Iir) return Natural
is
+ Id : constant Name_Id := Get_Identifier (Lib);
Len : Natural;
- Id : Name_Id;
Id1 : Name_Id;
begin
- Id := Get_Identifier (Lib);
Len := Get_Name_Length (Id);
case Get_Kind (Lib) is
when Iir_Kind_Configuration_Declaration
| Iir_Kind_Entity_Declaration
- | Iir_Kind_Package_Declaration =>
+ | Iir_Kind_Package_Declaration
+ | Iir_Kind_Package_Instantiation_Declaration =>
null;
when Iir_Kind_Package_Body =>
Len := Len + 1 + 4; -- add -body
@@ -586,7 +586,7 @@ package body Ghdlprint is
procedure Build_File_Name (Lib : Iir; Res : out String)
is
- Id : Name_Id;
+ Id : constant Name_Id := Get_Identifier (Lib);
P : Natural;
procedure Append (Str : String) is
@@ -595,12 +595,12 @@ package body Ghdlprint is
P := P + Str'Length;
end Append;
begin
- Id := Get_Identifier (Lib);
P := Res'First - 1;
case Get_Kind (Lib) is
when Iir_Kind_Configuration_Declaration
| Iir_Kind_Entity_Declaration
- | Iir_Kind_Package_Declaration =>
+ | Iir_Kind_Package_Declaration
+ | Iir_Kind_Package_Instantiation_Declaration =>
Image (Id);
Append (Name_Buffer (1 .. Name_Length));
when Iir_Kind_Package_Body =>
@@ -614,7 +614,7 @@ package body Ghdlprint is
Image (Id);
Append (Name_Buffer (1 .. Name_Length));
when others =>
- null;
+ raise Internal_Error;
end case;
Append (".vhdl");
end Build_File_Name;