aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-insts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-13 17:02:45 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-13 17:02:45 +0200
commit0aac4efd094b6b7ec0254f2bc4c2b994ed35c417 (patch)
tree7eafc1378abe8336cf79d0aa3b7fd0398a2b0107 /src/synth/synth-insts.adb
parent25b2dfe55c659ac84e54b0db82dff2461d9bd286 (diff)
downloadghdl-0aac4efd094b6b7ec0254f2bc4c2b994ed35c417.tar.gz
ghdl-0aac4efd094b6b7ec0254f2bc4c2b994ed35c417.tar.bz2
ghdl-0aac4efd094b6b7ec0254f2bc4c2b994ed35c417.zip
synth: also try to open files (during synthesis) relative to current unit.
Fix #1190
Diffstat (limited to 'src/synth/synth-insts.adb')
-rw-r--r--src/synth/synth-insts.adb5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb
index f022ac71d..2013d4939 100644
--- a/src/synth/synth-insts.adb
+++ b/src/synth/synth-insts.adb
@@ -52,6 +52,7 @@ with Synth.Decls; use Synth.Decls;
with Synth.Expr; use Synth.Expr;
with Synth.Source; use Synth.Source;
with Synth.Debugger;
+with Synth.Files_Operations;
package body Synth.Insts is
Root_Instance : Synth_Instance_Acc;
@@ -1464,6 +1465,10 @@ package body Synth.Insts is
return;
end if;
+ -- Save the current architecture, so that files can be open using a
+ -- path relative to the architecture filename.
+ Synth.Files_Operations.Set_Design_Unit (Arch);
+
Synth_Dependencies (Root_Instance, Get_Design_Unit (Arch));
Set_Instance_Module (Syn_Inst, Inst.M);