aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/synth/netlists-builders.adb8
-rw-r--r--src/synth/netlists-builders.ads1
2 files changed, 6 insertions, 3 deletions
diff --git a/src/synth/netlists-builders.adb b/src/synth/netlists-builders.adb
index ebf9964e8..6836a8d71 100644
--- a/src/synth/netlists-builders.adb
+++ b/src/synth/netlists-builders.adb
@@ -780,9 +780,9 @@ package body Netlists.Builders is
D : Net;
Init : Net) return Net
is
- Wd : constant Width := Get_Width (D);
+ Wd : constant Width := Get_Width (Init);
pragma Assert (Wd /= No_Width);
- pragma Assert (Get_Width (Init) = Wd);
+ pragma Assert (D = No_Net or else Get_Width (D) = Wd);
pragma Assert (Get_Width (Clk) = 1);
Inst : Instance;
O : Net;
@@ -791,7 +791,9 @@ package body Netlists.Builders is
O := Get_Output (Inst, 0);
Set_Width (O, Wd);
Connect (Get_Input (Inst, 0), Clk);
- Connect (Get_Input (Inst, 1), D);
+ if D /= No_Net then
+ Connect (Get_Input (Inst, 1), D);
+ end if;
Connect (Get_Input (Inst, 2), Init);
return O;
end Build_Idff;
diff --git a/src/synth/netlists-builders.ads b/src/synth/netlists-builders.ads
index 4c444bf05..e34baa8ad 100644
--- a/src/synth/netlists-builders.ads
+++ b/src/synth/netlists-builders.ads
@@ -101,6 +101,7 @@ package Netlists.Builders is
Clk : Net;
D : Net) return Net;
-- A flip-flop with an initial value (only for fpga)
+ -- The width is derived from INIT and D can be No_Net.
function Build_Idff (Ctxt : Context_Acc;
Clk : Net;
D : Net;