diff options
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-utils.adb | 10 | ||||
-rw-r--r-- | src/vhdl/vhdl-utils.ads | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb index 43b3a8d92..1c0a39b4a 100644 --- a/src/vhdl/vhdl-utils.adb +++ b/src/vhdl/vhdl-utils.adb @@ -1570,6 +1570,16 @@ package body Vhdl.Utils is end case; end Get_Entity_From_Entity_Aspect; + function Get_Entity_From_Configuration (Config : Iir) return Iir + is + Conf_Unit : constant Iir := Get_Library_Unit (Config); + Arch : constant Iir := Get_Named_Entity + (Get_Block_Specification (Get_Block_Configuration (Conf_Unit))); + Entity : constant Iir := Vhdl.Utils.Get_Entity (Arch); + begin + return Entity; + end Get_Entity_From_Configuration; + function Is_Nested_Package (Pkg : Iir) return Boolean is begin return Get_Kind (Get_Parent (Pkg)) /= Iir_Kind_Design_Unit; diff --git a/src/vhdl/vhdl-utils.ads b/src/vhdl/vhdl-utils.ads index e8b713799..e80135f04 100644 --- a/src/vhdl/vhdl-utils.ads +++ b/src/vhdl/vhdl-utils.ads @@ -348,6 +348,10 @@ package Vhdl.Utils is -- if ASPECT is open, return Null_Iir; function Get_Entity_From_Entity_Aspect (Aspect : Iir) return Iir; + -- Return the corresponding entity declaration from top-level configuration + -- design unit CONFIG. + function Get_Entity_From_Configuration (Config : Iir) return Iir; + -- Definition from LRM08 4.8 Package bodies -- True if PKG (a package declaration or a package body) is not a library -- unit. Can be true only for vhdl08. |