aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-environment.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-11-28 10:35:20 +0100
committerTristan Gingold <tgingold@free.fr>2021-11-28 12:13:25 +0100
commitd4c36d398f9ca32e5fad23298bcef1ed9473e7f9 (patch)
tree37b24a84457892134f874471bd49ade18cdc2394 /src/synth/synth-environment.adb
parent53a2fdc7927300233c9aec1a4772bd339f930ef5 (diff)
downloadghdl-d4c36d398f9ca32e5fad23298bcef1ed9473e7f9.tar.gz
ghdl-d4c36d398f9ca32e5fad23298bcef1ed9473e7f9.tar.bz2
ghdl-d4c36d398f9ca32e5fad23298bcef1ed9473e7f9.zip
synth: add hooks to support elaboration of foreign instances
Diffstat (limited to 'src/synth/synth-environment.adb')
-rw-r--r--src/synth/synth-environment.adb12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/synth/synth-environment.adb b/src/synth/synth-environment.adb
index 7b5eb5c50..b0bf4d6dd 100644
--- a/src/synth/synth-environment.adb
+++ b/src/synth/synth-environment.adb
@@ -93,6 +93,18 @@ package body Synth.Environment is
Wire_Id_Table.Table (Wid).Gate := Gate;
end Set_Wire_Gate;
+ procedure Replace_Wire_Gate (Wid : Wire_Id; Gate : Net)
+ is
+ Old : constant Net := Wire_Id_Table.Table (Wid).Gate;
+ Inst : constant Instance := Get_Net_Parent (Old);
+ begin
+ Redirect_Inputs (Old, Gate);
+ Remove_Instance (Inst);
+ Set_Location (Get_Net_Parent (Gate), Get_Location (Inst));
+ -- FIXME: attributes ?
+ Wire_Id_Table.Table (Wid).Gate := Gate;
+ end Replace_Wire_Gate;
+
function Get_Wire_Gate (Wid : Wire_Id) return Net is
begin
return Wire_Id_Table.Table (Wid).Gate;