Skip to content

Commit 9d7989b

Browse files
committed
Raise error for FIFO depth smaller than two.
1 parent 706ce54 commit 9d7989b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

finn-rtllib/fifo/hdl/Q_srl.v

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ module Q_srl (clock, reset, i_d, i_v, i_r, o_d, o_v, o_r, count, maxcount);
119119
reg i_b_reg // - true iff !full
120120
/* synthesis syn_allow_retiming=0 */ ;
121121

122+
// Parameter Checking
123+
initial begin
124+
if(depth < 2) begin
125+
$error("%m: FIFO depth must be two or higher.");
126+
$finish;
127+
end
128+
end
129+
130+
122131
assign addr_full_ = (state_==state_more) && (addr_==depth-2);
123132
// - queue full
124133
assign addr_zero_ = (addr==0); // - queue contains 2 (or 1,0)

0 commit comments

Comments
 (0)