File tree Expand file tree Collapse file tree 4 files changed +9
-22
lines changed Expand file tree Collapse file tree 4 files changed +9
-22
lines changed Original file line number Diff line number Diff line change 7
7
module async_fifo
8
8
9
9
#(
10
- // Data width
11
10
parameter DSIZE = 8 ,
12
- // Address width
13
11
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
20
13
)(
21
14
input wire wclk,
22
15
input wire wrst_n,
@@ -59,7 +52,7 @@ module async_fifo
59
52
60
53
// The module handling the write requests
61
54
wptr_full
62
- #(ASIZE,AWFULLSIZE )
55
+ #(ASIZE)
63
56
wptr_full (
64
57
.awfull (awfull),
65
58
.wfull (wfull),
@@ -88,7 +81,7 @@ module async_fifo
88
81
89
82
// The module handling read requests
90
83
rptr_empty
91
- #(ASIZE,AREMPTYSIZE )
84
+ #(ASIZE)
92
85
rptr_empty (
93
86
.arempty (arempty),
94
87
.rempty (rempty),
Original file line number Diff line number Diff line change 7
7
module rptr_empty
8
8
9
9
#(
10
- parameter ADDRSIZE = 4 ,
11
- parameter [ADDRSIZE:0 ]AREMPTYSIZE = 1
10
+ parameter ADDRSIZE = 4
12
11
)(
13
12
input wire rclk,
14
13
input wire rrst_n,
@@ -40,7 +39,7 @@ module rptr_empty
40
39
assign raddr = rbin[ADDRSIZE- 1 :0 ];
41
40
assign rbinnext = rbin + (rinc & ~ rempty);
42
41
assign rgraynext = (rbinnext >> 1 ) ^ rbinnext;
43
- assign rgraynextm1 = ((rbinnext + AREMPTYSIZE ) >> 1 ) ^ (rbinnext + AREMPTYSIZE );
42
+ assign rgraynextm1 = ((rbinnext + 1'b1 ) >> 1 ) ^ (rbinnext + 1'b1 );
44
43
45
44
// ---------------------------------------------------------------
46
45
// FIFO empty when the next rptr == synchronized wptr or on reset
Original file line number Diff line number Diff line change 7
7
module wptr_full
8
8
9
9
#(
10
- parameter ADDRSIZE = 4 ,
11
- parameter [ADDRSIZE:0 ]AWFULLSIZE = 1
10
+ parameter ADDRSIZE = 4
12
11
)(
13
12
input wire wclk,
14
13
input wire wrst_n,
@@ -38,7 +37,7 @@ module wptr_full
38
37
assign waddr = wbin[ADDRSIZE- 1 :0 ];
39
38
assign wbinnext = wbin + (winc & ~ wfull);
40
39
assign wgraynext = (wbinnext >> 1 ) ^ wbinnext;
41
- assign wgraynextp1 = ((wbinnext + AWFULLSIZE ) >> 1 ) ^ (wbinnext + AWFULLSIZE );
40
+ assign wgraynextp1 = ((wbinnext + 1'b1 ) >> 1 ) ^ (wbinnext + 1'b1 );
42
41
43
42
// ------------------------------------------------------------------
44
43
// Simplified version of the three necessary full-tests:
Original file line number Diff line number Diff line change @@ -19,8 +19,6 @@ module async_fifo_unit_test;
19
19
20
20
parameter DSIZE = 32 ;
21
21
parameter ASIZE = 4 ;
22
- parameter AREMPTYSIZE = `AEMPTY ;
23
- parameter AWFULLSIZE = `AFULL ;
24
22
parameter FALLTHROUGH = `FALLTHROUGH ;
25
23
parameter MAX_TRAFFIC = 10 ;
26
24
@@ -43,8 +41,6 @@ module async_fifo_unit_test;
43
41
# (
44
42
.DSIZE (DSIZE ),
45
43
.ASIZE (ASIZE ),
46
- .AWFULLSIZE (AWFULLSIZE ),
47
- .AREMPTYSIZE (AREMPTYSIZE ),
48
44
.FALLTHROUGH (FALLTHROUGH )
49
45
)
50
46
dut
@@ -188,7 +184,7 @@ module async_fifo_unit_test;
188
184
`FAIL_IF_NOT_EQUAL (arempty, 0 );
189
185
190
186
winc = 1 ;
191
- for (int i= 0 ; i< AREMPTYSIZE ; i= i+ 1 ) begin
187
+ for (int i= 0 ; i< 1 ; i= i+ 1 ) begin
192
188
193
189
@ (negedge wclk)
194
190
wdata = i;
@@ -206,7 +202,7 @@ module async_fifo_unit_test;
206
202
`UNIT_TEST (" TEST_ALMOST_FULL_FLAG" )
207
203
208
204
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
210
206
211
207
@ (negedge wclk)
212
208
wdata = i;
You can’t perform that action at this time.
0 commit comments