aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-05 08:00:41 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-05 22:19:11 +0100
commit80198720f223c8aebee3961f4015575818a7eff4 (patch)
tree231fe3e9ec02e31f44c005955990dd6a87a891e8 /src
parent52668283c49c40190f68d1ea225ee3496d44d58e (diff)
downloadghdl-80198720f223c8aebee3961f4015575818a7eff4.tar.gz
ghdl-80198720f223c8aebee3961f4015575818a7eff4.tar.bz2
ghdl-80198720f223c8aebee3961f4015575818a7eff4.zip
elab-vhdl_debug: makes work and std visible
Diffstat (limited to 'src')
-rw-r--r--src/synth/elab-vhdl_debug.adb21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/synth/elab-vhdl_debug.adb b/src/synth/elab-vhdl_debug.adb
index 9b0a25454..680f345ac 100644
--- a/src/synth/elab-vhdl_debug.adb
+++ b/src/synth/elab-vhdl_debug.adb
@@ -1165,6 +1165,19 @@ package body Elab.Vhdl_Debug is
end case;
end Foreach_Scopes;
+ procedure Add_Decls_For_Design_Unit (Unit : Iir)
+ is
+ use Vhdl.Sem_Scopes;
+ File : constant Node := Get_Design_File (Unit);
+ begin
+ -- The std library.
+ Add_Name (Libraries.Std_Library);
+ -- The work library.
+ Add_Name (Get_Library (File), Std_Names.Name_Work, False);
+ -- Unit context clauses.
+ Add_Context_Clauses (Unit);
+ end Add_Decls_For_Design_Unit;
+
procedure Add_Decls_For (N : Iir)
is
use Vhdl.Sem_Scopes;
@@ -1174,13 +1187,13 @@ package body Elab.Vhdl_Debug is
declare
Unit : constant Iir := Get_Design_Unit (N);
begin
- Add_Context_Clauses (Unit);
+ Add_Decls_For_Design_Unit (Unit);
-- Add_Name (Unit, Get_Identifier (N), False);
Add_Entity_Declarations (N);
end;
when Iir_Kind_Architecture_Body =>
Open_Declarative_Region;
- Add_Context_Clauses (Get_Design_Unit (N));
+ Add_Decls_For_Design_Unit (Get_Design_Unit (N));
Add_Declarations (Get_Declaration_Chain (N), False);
Add_Declarations_Of_Concurrent_Statement (N);
when Iir_Kind_Package_Body =>
@@ -1188,11 +1201,11 @@ package body Elab.Vhdl_Debug is
Package_Decl : constant Iir := Get_Package (N);
Package_Unit : constant Iir := Get_Design_Unit (Package_Decl);
begin
- Add_Name (Package_Unit);
if Get_Kind (Package_Unit) = Iir_Kind_Design_Unit then
-- Only for top-level packages.
- Add_Context_Clauses (Package_Unit);
+ Add_Decls_For_Design_Unit (Package_Unit);
end if;
+ Add_Name (Package_Unit);
Open_Declarative_Region;
Add_Declarations (Get_Declaration_Chain (Package_Decl), False);
Add_Declarations (Get_Declaration_Chain (N), False);