diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-21 21:28:17 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-22 07:32:57 +0200 |
commit | f8b99802f4ac7057e15bf23cb9fa37955d75abb4 (patch) | |
tree | 6c9586ccae5672064d1ed6b7bfa9b8f08b28ff2d /src/vhdl | |
parent | 1bbec5cda2fcebd9190b1cdb05a102f40dee87c3 (diff) | |
download | ghdl-f8b99802f4ac7057e15bf23cb9fa37955d75abb4.tar.gz ghdl-f8b99802f4ac7057e15bf23cb9fa37955d75abb4.tar.bz2 ghdl-f8b99802f4ac7057e15bf23cb9fa37955d75abb4.zip |
synth: minor rework.
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. |