Skip to content

Commit 9172f26

Browse files
committed
Fix: Roll-back v1.2.0 and remove almost flags threshold
1 parent fa6f6a0 commit 9172f26

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

rtl/async_fifo.v

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@
77
module async_fifo
88

99
#(
10-
// Data width
1110
parameter DSIZE = 8,
12-
// Address width
1311
parameter ASIZE = 4,
14-
// Almost full thresold
15-
parameter AWFULLSIZE = 1,
16-
// Almost empty thresold
17-
parameter AREMPTYSIZE = 1,
18-
// First word fall-through without latency
19-
parameter FALLTHROUGH = "TRUE"
12+
parameter FALLTHROUGH = "TRUE" // First word fall-through without latency
2013
)(
2114
input wire wclk,
2215
input wire wrst_n,
@@ -59,7 +52,7 @@ module async_fifo
5952

6053
// The module handling the write requests
6154
wptr_full
62-
#(ASIZE,AWFULLSIZE)
55+
#(ASIZE)
6356
wptr_full (
6457
.awfull (awfull),
6558
.wfull (wfull),
@@ -88,7 +81,7 @@ module async_fifo
8881

8982
// The module handling read requests
9083
rptr_empty
91-
#(ASIZE,AREMPTYSIZE)
84+
#(ASIZE)
9285
rptr_empty (
9386
.arempty (arempty),
9487
.rempty (rempty),

rtl/rptr_empty.v

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
module rptr_empty
88

99
#(
10-
parameter ADDRSIZE = 4,
11-
parameter [ADDRSIZE:0]AREMPTYSIZE = 1
10+
parameter ADDRSIZE = 4
1211
)(
1312
input wire rclk,
1413
input wire rrst_n,
@@ -40,7 +39,7 @@ module rptr_empty
4039
assign raddr = rbin[ADDRSIZE-1:0];
4140
assign rbinnext = rbin + (rinc & ~rempty);
4241
assign rgraynext = (rbinnext >> 1) ^ rbinnext;
43-
assign rgraynextm1 = ((rbinnext + AREMPTYSIZE) >> 1) ^ (rbinnext + AREMPTYSIZE);
42+
assign rgraynextm1 = ((rbinnext + 1'b1) >> 1) ^ (rbinnext + 1'b1);
4443

4544
//---------------------------------------------------------------
4645
// FIFO empty when the next rptr == synchronized wptr or on reset

rtl/wptr_full.v

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
module wptr_full
88

99
#(
10-
parameter ADDRSIZE = 4,
11-
parameter [ADDRSIZE:0]AWFULLSIZE = 1
10+
parameter ADDRSIZE = 4
1211
)(
1312
input wire wclk,
1413
input wire wrst_n,
@@ -38,7 +37,7 @@ module wptr_full
3837
assign waddr = wbin[ADDRSIZE-1:0];
3938
assign wbinnext = wbin + (winc & ~wfull);
4039
assign wgraynext = (wbinnext >> 1) ^ wbinnext;
41-
assign wgraynextp1 = ((wbinnext + AWFULLSIZE) >> 1) ^ (wbinnext + AWFULLSIZE);
40+
assign wgraynextp1 = ((wbinnext + 1'b1) >> 1) ^ (wbinnext + 1'b1);
4241

4342
//------------------------------------------------------------------
4443
// Simplified version of the three necessary full-tests:

sim/async_fifo_unit_test.sv

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ module async_fifo_unit_test;
1919

2020
parameter DSIZE = 32;
2121
parameter ASIZE = 4;
22-
parameter AREMPTYSIZE = `AEMPTY;
23-
parameter AWFULLSIZE = `AFULL;
2422
parameter FALLTHROUGH = `FALLTHROUGH;
2523
parameter MAX_TRAFFIC = 10;
2624

@@ -43,8 +41,6 @@ module async_fifo_unit_test;
4341
#(
4442
.DSIZE (DSIZE),
4543
.ASIZE (ASIZE),
46-
.AWFULLSIZE (AWFULLSIZE),
47-
.AREMPTYSIZE (AREMPTYSIZE),
4844
.FALLTHROUGH (FALLTHROUGH)
4945
)
5046
dut
@@ -188,7 +184,7 @@ module async_fifo_unit_test;
188184
`FAIL_IF_NOT_EQUAL(arempty, 0);
189185

190186
winc = 1;
191-
for (int i=0; i<AREMPTYSIZE; i=i+1) begin
187+
for (int i=0; i<1; i=i+1) begin
192188

193189
@(negedge wclk)
194190
wdata = i;
@@ -206,7 +202,7 @@ module async_fifo_unit_test;
206202
`UNIT_TEST("TEST_ALMOST_FULL_FLAG")
207203

208204
winc = 1;
209-
for (int i=0; i<2**ASIZE-AWFULLSIZE; i=i+1) begin
205+
for (int i=0; i<2**ASIZE-1; i=i+1) begin
210206

211207
@(negedge wclk)
212208
wdata = i;

0 commit comments

Comments
 (0)