From 3c9c6023c38ed1272634a7d2aed5dbe1c318842a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 5 Apr 2021 09:20:04 +0200 Subject: vhdl and libraries: add support for binding to a foreign module --- src/vhdl/vhdl-utils.adb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/vhdl/vhdl-utils.adb') diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb index 70596c929..578576e1e 100644 --- a/src/vhdl/vhdl-utils.adb +++ b/src/vhdl/vhdl-utils.adb @@ -712,6 +712,7 @@ package body Vhdl.Utils is end if; pragma Assert (Kind_In (Unit, Iir_Kind_Design_Unit, + Iir_Kind_Foreign_Module, Iir_Kind_Entity_Aspect_Entity)); Add_Element (Get_Dependence_List (Target), Unit); @@ -1503,13 +1504,17 @@ package body Vhdl.Utils is Name : constant Iir := Get_Entity_Name (Decl); Res : constant Iir := Get_Named_Entity (Name); begin - if Res = Vhdl.Std_Package.Error_Mark then + if Res = Null_Iir or else Res = Vhdl.Std_Package.Error_Mark then return Null_Iir; end if; - pragma Assert (Res = Null_Iir - or else Get_Kind (Res) = Iir_Kind_Entity_Declaration); - return Res; + case Get_Kind (Res) is + when Iir_Kind_Entity_Declaration + | Iir_Kind_Foreign_Module => + return Res; + when others => + raise Internal_Error; + end case; end Get_Entity; function Get_Configuration (Aspect : Iir) return Iir -- cgit v1.2.3