@@ -15,10 +15,10 @@ class FIFOTestCase(FHDLTestCase):
15
15
def test_depth_wrong (self ):
16
16
with self .assertRaisesRegex (TypeError ,
17
17
r"^FIFO width must be a non-negative integer, not -1$" ):
18
- FIFOInterface (width = - 1 , depth = 8 , fwft = True )
18
+ FIFOInterface (width = - 1 , depth = 8 )
19
19
with self .assertRaisesRegex (TypeError ,
20
20
r"^FIFO depth must be a non-negative integer, not -1$" ):
21
- FIFOInterface (width = 8 , depth = - 1 , fwft = True )
21
+ FIFOInterface (width = 8 , depth = - 1 )
22
22
23
23
def test_sync_depth (self ):
24
24
self .assertEqual (SyncFIFO (width = 8 , depth = 0 ).depth , 0 )
@@ -68,8 +68,8 @@ class FIFOModel(Elaboratable, FIFOInterface):
68
68
"""
69
69
Non-synthesizable first-in first-out queue, implemented naively as a chain of registers.
70
70
"""
71
- def __init__ (self , * , width , depth , fwft , r_domain , w_domain ):
72
- super ().__init__ (width = width , depth = depth , fwft = fwft )
71
+ def __init__ (self , * , width , depth , r_domain , w_domain ):
72
+ super ().__init__ (width = width , depth = depth )
73
73
74
74
self .r_domain = r_domain
75
75
self .w_domain = w_domain
@@ -90,11 +90,8 @@ def elaborate(self, platform):
90
90
91
91
m .d .comb += self .r_rdy .eq (self .level > 0 )
92
92
m .d .comb += r_port .addr .eq ((consume + 1 ) % self .depth )
93
- if self .fwft :
94
- m .d .comb += self .r_data .eq (r_port .data )
93
+ m .d .comb += self .r_data .eq (r_port .data )
95
94
with m .If (self .r_en & self .r_rdy ):
96
- if not self .fwft :
97
- m .d [self .r_domain ] += self .r_data .eq (r_port .data )
98
95
m .d [self .r_domain ] += consume .eq (r_port .addr )
99
96
100
97
m .d .comb += self .w_rdy .eq (self .level < self .depth )
@@ -136,7 +133,7 @@ def __init__(self, fifo, r_domain, w_domain):
136
133
def elaborate (self , platform ):
137
134
m = Module ()
138
135
m .submodules .dut = dut = self .fifo
139
- m .submodules .gold = gold = FIFOModel (width = dut .width , depth = dut .depth , fwft = dut . fwft ,
136
+ m .submodules .gold = gold = FIFOModel (width = dut .width , depth = dut .depth ,
140
137
r_domain = self .r_domain , w_domain = self .w_domain )
141
138
142
139
m .d .comb += [
@@ -150,19 +147,7 @@ def elaborate(self, platform):
150
147
m .d .comb += Assert (dut .r_level == gold .r_level )
151
148
m .d .comb += Assert (dut .w_level == gold .w_level )
152
149
153
- if dut .fwft :
154
- m .d .comb += Assert (dut .r_rdy
155
- .implies (dut .r_data == gold .r_data ))
156
- else :
157
- # past_dut_r_rdy = Past(dut.r_rdy, domain=self.r_domain)
158
- past_dut_r_rdy = Signal .like (dut .r_rdy , attrs = {"amaranth.sample_reg" : True })
159
- m .d [self .r_domain ] += past_dut_r_rdy .eq (dut .r_rdy )
160
-
161
- # past_dut_r_en = Past(dut.r_en, domain=self.r_domain)
162
- past_dut_r_en = Signal .like (dut .r_en , attrs = {"amaranth.sample_reg" : True })
163
- m .d [self .r_domain ] += past_dut_r_en .eq (dut .r_en )
164
-
165
- m .d .comb += Assert ((past_dut_r_rdy & past_dut_r_en ).implies (dut .r_data == gold .r_data ))
150
+ m .d .comb += Assert (dut .r_rdy .implies (dut .r_data == gold .r_data ))
166
151
167
152
return m
168
153
@@ -219,12 +204,7 @@ def elaborate(self, platform):
219
204
read_2 = Signal (fifo .width )
220
205
with m .State ("READ" ):
221
206
m .d .comb += fifo .r_en .eq (1 )
222
- if fifo .fwft :
223
- r_rdy = fifo .r_rdy
224
- else : # r_rdy = Past(fifo.r_rdy, domain=self.r_domain)
225
- r_rdy = Signal .like (fifo .r_rdy , attrs = {"amaranth.sample_reg" : True })
226
- m .d [self .r_domain ] += r_rdy .eq (fifo .r_rdy )
227
- with m .If (r_rdy ):
207
+ with m .If (fifo .r_rdy ):
228
208
m .d .sync += [
229
209
read_1 .eq (read_2 ),
230
210
read_2 .eq (fifo .r_data ),
@@ -271,21 +251,11 @@ def check_sync_fifo(self, fifo):
271
251
bound = fifo .depth * 2 + 1 ),
272
252
mode = "hybrid" , depth = fifo .depth * 2 + 1 )
273
253
274
- def test_sync_fwft_pot (self ):
275
- self .check_sync_fifo (SyncFIFO (width = 8 , depth = 4 , fwft = True ))
276
-
277
- def test_sync_fwft_npot (self ):
278
- self .check_sync_fifo (SyncFIFO (width = 8 , depth = 5 , fwft = True ))
279
-
280
- def test_sync_not_fwft_pot (self ):
281
- with warnings .catch_warnings ():
282
- warnings .filterwarnings (action = "ignore" , category = DeprecationWarning )
283
- self .check_sync_fifo (SyncFIFO (width = 8 , depth = 4 , fwft = False ))
254
+ def test_sync_pot (self ):
255
+ self .check_sync_fifo (SyncFIFO (width = 8 , depth = 4 ))
284
256
285
- def test_sync_not_fwft_npot (self ):
286
- with warnings .catch_warnings ():
287
- warnings .filterwarnings (action = "ignore" , category = DeprecationWarning )
288
- self .check_sync_fifo (SyncFIFO (width = 8 , depth = 5 , fwft = False ))
257
+ def test_sync_npot (self ):
258
+ self .check_sync_fifo (SyncFIFO (width = 8 , depth = 5 ))
289
259
290
260
def test_sync_buffered_pot (self ):
291
261
self .check_sync_fifo (SyncFIFOBuffered (width = 8 , depth = 4 ))
0 commit comments