From 04b44b782355c0661b6ec7053f204da9b6185759 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 18 Apr 2023 21:13:34 +0200 Subject: elab-vhdl_insts: set global variable with top instance --- src/synth/elab-vhdl_insts.adb | 2 ++ src/synth/elab-vhdl_insts.ads | 3 +++ 2 files changed, 5 insertions(+) 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; -- cgit v1.2.3