aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-11-05 07:37:46 +0100
committerTristan Gingold <tgingold@free.fr>2022-11-05 07:37:46 +0100
commite87e294be1f657f777ee39930c68bc02521ee74b (patch)
treebef10194748776b13b9d4b30afb18a67e9cfccb6 /src/synth
parent71488c4cf570f8055487300a857aa022692730d2 (diff)
downloadghdl-e87e294be1f657f777ee39930c68bc02521ee74b.tar.gz
ghdl-e87e294be1f657f777ee39930c68bc02521ee74b.tar.bz2
ghdl-e87e294be1f657f777ee39930c68bc02521ee74b.zip
netlists-builders: allow building mem_wr_sync without clk and en.
Diffstat (limited to 'src/synth')
-rw-r--r--src/synth/netlists-builders.adb14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb
index d3eaf6a0a..85f4aa84b 100644
--- a/src/synth/netlists-builders.adb
+++ b/src/synth/netlists-builders.adb
@@ -1332,8 +1332,10 @@ package body Netlists.Builders is
pragma Assert (Addr_W > 0);
Data_W : constant Width := Get_Width (Data);
pragma Assert (Data_W * (2**Natural(Addr_W)) >= Mem_W);
- pragma Assert (Get_Width (Clk) = 1);
- pragma Assert (Get_Width (En) = 1);
+ -- Assertions currently disabled as netlists-memories create
+ -- mem_wr_sync without clk/en (and connect them later).
+ -- pragma Assert (Get_Width (Clk) = 1);
+ -- pragma Assert (Get_Width (En) = 1);
Inst : Instance;
O : Net;
begin
@@ -1342,8 +1344,12 @@ package body Netlists.Builders is
Set_Width (O, Mem_W);
Connect (Get_Input (Inst, 0), Pport);
Connect (Get_Input (Inst, 1), Addr);
- Connect (Get_Input (Inst, 2), Clk);
- Connect (Get_Input (Inst, 3), En);
+ if Clk /= No_Net then
+ Connect (Get_Input (Inst, 2), Clk);
+ end if;
+ if En /= No_Net then
+ Connect (Get_Input (Inst, 3), En);
+ end if;
Connect (Get_Input (Inst, 4), Data);
return Inst;
end Build_Mem_Wr_Sync;