aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-04-18 21:13:34 +0200
committerTristan Gingold <tgingold@free.fr>2023-04-18 21:13:34 +0200
commit04b44b782355c0661b6ec7053f204da9b6185759 (patch)
tree110a4260e70cbd2d38b5ab961ab901740f962f36
parent10d6f0c3520c2ebb93091f635014c6cd4c35631f (diff)
downloadghdl-04b44b782355c0661b6ec7053f204da9b6185759.tar.gz
ghdl-04b44b782355c0661b6ec7053f204da9b6185759.tar.bz2
ghdl-04b44b782355c0661b6ec7053f204da9b6185759.zip
elab-vhdl_insts: set global variable with top instance
-rw-r--r--src/synth/elab-vhdl_insts.adb2
-rw-r--r--src/synth/elab-vhdl_insts.ads3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/synth/elab-vhdl_insts.adb b/src/synth/elab-vhdl_insts.adb
index 25984a8fa..ac60a49f9 100644
--- a/src/synth/elab-vhdl_insts.adb
+++ b/src/synth/elab-vhdl_insts.adb
@@ -1042,6 +1042,8 @@ package body Elab.Vhdl_Insts is
pragma Assert (Is_Expr_Pool_Empty);
+ Top_Instance := Top_Inst;
+
Elab_Instance_Body (Top_Inst);
pragma Assert (Areapools.Is_Empty (Expr_Pool));
diff --git a/src/synth/elab-vhdl_insts.ads b/src/synth/elab-vhdl_insts.ads
index 1e78c3329..ca79f762a 100644
--- a/src/synth/elab-vhdl_insts.ads
+++ b/src/synth/elab-vhdl_insts.ads
@@ -21,6 +21,9 @@ with Vhdl.Nodes; use Vhdl.Nodes;
with Elab.Vhdl_Context; use Elab.Vhdl_Context;
package Elab.Vhdl_Insts is
+ -- The result of Elab_Top_Unit, to handle external names.
+ Top_Instance : Synth_Instance_Acc;
+
function Elab_Top_Unit (Config : Node) return Synth_Instance_Acc;
procedure Elab_Generics_Association (Sub_Inst : Synth_Instance_Acc;