diff options
author | Tristan Gingold <gingold@adacore.com> | 2015-12-01 04:37:27 +0100 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2015-12-03 05:22:59 +0100 |
commit | 6b255aa71f81afeaf4e3c76350ec28793fa8e089 (patch) | |
tree | 087a482e84a48e774ed94cf544b9be399ac86217 /src/vhdl | |
parent | 303e85b03353cd3e9d99d1e350371e5c7f59b6cd (diff) | |
download | ghdl-6b255aa71f81afeaf4e3c76350ec28793fa8e089.tar.gz ghdl-6b255aa71f81afeaf4e3c76350ec28793fa8e089.tar.bz2 ghdl-6b255aa71f81afeaf4e3c76350ec28793fa8e089.zip |
Fix elaboration order in case of recursive instantiation.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/configuration.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vhdl/configuration.adb b/src/vhdl/configuration.adb index 1430eefce..a72a2540a 100644 --- a/src/vhdl/configuration.adb +++ b/src/vhdl/configuration.adb @@ -303,9 +303,10 @@ package body Configuration is Arch := Get_Design_Unit (Arch); end if; Load_Design_Unit (Arch, Aspect); - Add_Design_Unit (Arch, Aspect); - -- Add the default configuration if required. + -- Add the default configuration if required. Must be done + -- before the architecture in case of recursive instantiation: + -- the configuration depends on the architecture. if Add_Default then Config := Get_Default_Configuration_Declaration (Get_Library_Unit (Arch)); @@ -313,6 +314,10 @@ package body Configuration is Add_Design_Unit (Config, Aspect); end if; end if; + + -- Otherwise, simply the architecture. + Add_Design_Unit (Arch, Aspect); + when Iir_Kind_Entity_Aspect_Configuration => Add_Design_Unit (Get_Design_Unit (Get_Configuration (Aspect)), Aspect); |