Skip to content

Commit 3f2ea18

Browse files
Remove stable register from elastic buffer (#1181)
This register has been made obsolete by moving control logic to software. We should have removed it as part of that process, but it slipped through the cracks.
1 parent df31033 commit 3f2ea18

File tree

8 files changed

+38
-64
lines changed

8 files changed

+38
-64
lines changed

bittide-instances/src/Bittide/Instances/Hitl/SoftUgnDemo/Core.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ core (refClk, refRst) (bitClk, bitRst, bitEna) rxClocks rxResets =
241241
-- Stop management unit
242242

243243
-- Start internal links
244-
(_relDatCount, _underflow, _overflow, _ebStables, Fwd rxs1) <-
245-
unzip5Vec
244+
(_relDatCount, _underflow, _overflow, Fwd rxs1) <-
245+
unzip4Vec
246246
<| ( Vec.vecCircuits
247247
$ xilinxElasticBufferWb
248248
bitClk
@@ -331,12 +331,12 @@ core (refClk, refRst) (bitClk, bitRst, bitEna) rxClocks rxResets =
331331
withBittideClockResetEnable :: forall r. ((HiddenClockResetEnable Bittide) => r) -> r
332332
withBittideClockResetEnable = withClockResetEnable bitClk bitRst bitEna
333333

334-
uncurry5 ::
335-
(a -> b -> c -> d -> e -> f) ->
336-
(a, b, c, d, e) ->
337-
f
338-
uncurry5 fn (a, b, c, d, e) = fn a b c d e
334+
uncurry4 ::
335+
(a -> b -> c -> d -> e) ->
336+
(a, b, c, d) ->
337+
e
338+
uncurry4 fn (a, b, c, d) = fn a b c d
339339

340-
unzip5Vec ::
341-
Circuit (Vec n (a, b, c, d, e)) (Vec n a, Vec n b, Vec n c, Vec n d, Vec n e)
342-
unzip5Vec = applyC unzip5 (uncurry5 zip5)
340+
unzip4Vec ::
341+
Circuit (Vec n (a, b, c, d)) (Vec n a, Vec n b, Vec n c, Vec n d)
342+
unzip4Vec = applyC unzip4 (uncurry4 zip4)

bittide-instances/src/Bittide/Instances/Hitl/SwitchDemo/Core.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ core (refClk, refRst) (bitClk, bitRst, bitEna) rxClocks rxResets =
204204
-- Stop management unit
205205

206206
-- Start internal links
207-
(_relDatCount, _underflow, _overflow, _ebStables, Fwd rxs1) <-
208-
unzip5Vec
207+
(_relDatCount, _underflow, _overflow, Fwd rxs1) <-
208+
unzip4Vec
209209
<| ( Vec.vecCircuits
210210
$ xilinxElasticBufferWb
211211
bitClk
@@ -294,12 +294,12 @@ core (refClk, refRst) (bitClk, bitRst, bitEna) rxClocks rxResets =
294294
withBittideClockResetEnable :: forall r. ((HiddenClockResetEnable Bittide) => r) -> r
295295
withBittideClockResetEnable = withClockResetEnable bitClk bitRst bitEna
296296

297-
uncurry5 ::
298-
(a -> b -> c -> d -> e -> f) ->
299-
(a, b, c, d, e) ->
300-
f
301-
uncurry5 fn (a, b, c, d, e) = fn a b c d e
297+
uncurry4 ::
298+
(a -> b -> c -> d -> e) ->
299+
(a, b, c, d) ->
300+
e
301+
uncurry4 fn (a, b, c, d) = fn a b c d
302302

303-
unzip5Vec ::
304-
Circuit (Vec n (a, b, c, d, e)) (Vec n a, Vec n b, Vec n c, Vec n d, Vec n e)
305-
unzip5Vec = applyC unzip5 (uncurry5 zip5)
303+
unzip4Vec ::
304+
Circuit (Vec n (a, b, c, d)) (Vec n a, Vec n b, Vec n c, Vec n d)
305+
unzip4Vec = applyC unzip4 (uncurry4 zip4)

bittide-instances/src/Bittide/Instances/Hitl/SwitchDemoGppe/Core.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ core (refClk, refRst) (bitClk, bitRst, bitEna) rxClocks rxResets =
269269
-- Stop management unit
270270

271271
-- Start internal links
272-
(_relDatCount, _underflow, _overflow, _ebStables, Fwd rxs1) <-
273-
unzip5Vec
272+
(_relDatCount, _underflow, _overflow, Fwd rxs1) <-
273+
unzip4Vec
274274
<| ( Vec.vecCircuits
275275
$ xilinxElasticBufferWb
276276
bitClk
@@ -357,12 +357,12 @@ core (refClk, refRst) (bitClk, bitRst, bitEna) rxClocks rxResets =
357357
withBittideClockResetEnable :: forall r. ((HiddenClockResetEnable Bittide) => r) -> r
358358
withBittideClockResetEnable = withClockResetEnable bitClk bitRst bitEna
359359

360-
uncurry5 ::
361-
(a -> b -> c -> d -> e -> f) ->
362-
(a, b, c, d, e) ->
363-
f
364-
uncurry5 fn (a, b, c, d, e) = fn a b c d e
360+
uncurry4 ::
361+
(a -> b -> c -> d -> e) ->
362+
(a, b, c, d) ->
363+
e
364+
uncurry4 fn (a, b, c, d) = fn a b c d
365365

366-
unzip5Vec ::
367-
Circuit (Vec n (a, b, c, d, e)) (Vec n a, Vec n b, Vec n c, Vec n d, Vec n e)
368-
unzip5Vec = applyC unzip5 (uncurry5 zip5)
366+
unzip4Vec ::
367+
Circuit (Vec n (a, b, c, d)) (Vec n a, Vec n b, Vec n c, Vec n d)
368+
unzip4Vec = applyC unzip4 (uncurry4 zip4)

bittide-instances/src/Bittide/Instances/Pnr/ElasticBuffer.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import Bittide.ClockControl (RelDataCount)
1515
import Bittide.ElasticBuffer (
1616
ElasticBufferData,
1717
Overflow,
18-
Stable,
1918
Underflow,
2019
xilinxElasticBufferWb,
2120
)
@@ -34,15 +33,14 @@ elasticBufferWb ::
3433
, "dataCount" ::: Signal Fast (RelDataCount 6)
3534
, "underflow" ::: Signal Fast Underflow
3635
, "overflow" ::: Signal Fast Overflow
37-
, "stable" ::: Signal Fast Stable
3836
, "readData" ::: Signal Fast (ElasticBufferData (Unsigned 64))
3937
)
40-
elasticBufferWb clkRead rstRead clkWrite wbIn wdata = (wbOut, dataCount, underflow, overflow, stable, readData)
38+
elasticBufferWb clkRead rstRead clkWrite wbIn wdata = (wbOut, dataCount, underflow, overflow, readData)
4139
where
42-
((SimOnly _mm, wbOut), (dataCount, underflow, overflow, stable, readData)) =
40+
((SimOnly _mm, wbOut), (dataCount, underflow, overflow, readData)) =
4341
withBittideByteOrder
4442
$ toSignals
4543
(xilinxElasticBufferWb clkRead rstRead d6 clkWrite wdata)
46-
(((), wbIn), ((), (), (), (), ()))
44+
(((), wbIn), ((), (), (), ()))
4745

4846
makeTopEntity 'elasticBufferWb

bittide/src/Bittide/ElasticBuffer.hs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ xilinxElasticBufferWb ::
271271
( CSignal readDom (RelDataCount n)
272272
, CSignal readDom Underflow
273273
, CSignal readDom Overflow
274-
, CSignal readDom Stable
275274
, CSignal readDom (ElasticBufferData a)
276275
)
277276
xilinxElasticBufferWb clkRead rstRead SNat clkWrite wdata =
@@ -281,7 +280,6 @@ xilinxElasticBufferWb clkRead rstRead SNat clkWrite wdata =
281280
, wbDataCount
282281
, wbUnderflow
283282
, wbOverflow
284-
, wbStable
285283
] <-
286284
deviceWb "ElasticBuffer" -< wb
287285

@@ -346,11 +344,4 @@ xilinxElasticBufferWb clkRead rstRead SNat clkWrite wdata =
346344
False
347345
-< (wbOverflow, Fwd (flip orNothing True <$> overflow1))
348346

349-
-- Stable register: Software can set this to indicate buffer is ready
350-
(stableOut, _stableActivity) <-
351-
registerWbI
352-
(registerConfig "stable"){access = WriteOnly}
353-
False
354-
-< (wbStable, Fwd (pure Nothing))
355-
356-
idC -< (dataCountOut, underflowOut, overflowOut, stableOut, Fwd readData)
347+
idC -< (dataCountOut, underflowOut, overflowOut, Fwd readData)

firmware-binaries/demos/soft-ugn-mu/src/main.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,8 @@ fn main() -> ! {
100100
}
101101
}
102102

103-
for (i, eb) in elastic_buffers.iter().enumerate() {
104-
uwriteln!(
105-
uart,
106-
"Elastic Buffer {}, frames changed: {}",
107-
i,
108-
eb_changes[i]
109-
)
110-
.unwrap();
111-
eb.set_stable(true);
103+
for (i, &changes) in eb_changes.iter().enumerate() {
104+
uwriteln!(uart, "Elastic Buffer {}, frames changed: {}", i, changes).unwrap();
112105
}
113106

114107
uwriteln!(uart, "Switch transceiver channels to user mode..").unwrap();

firmware-binaries/demos/switch-demo1-mu/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ impl LinkStartup {
9292
self.center_eb(elastic_buffer);
9393

9494
if all_stable {
95-
elastic_buffer.set_stable(true);
9695
UgnCaptureState::Done
9796
} else {
9897
self.state

firmware-binaries/demos/switch-demo2-mu/src/main.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,8 @@ fn main() -> ! {
7171
}
7272
}
7373

74-
for (i, eb) in elastic_buffers.iter().enumerate() {
75-
uwriteln!(
76-
uart,
77-
"Elastic Buffer {}, frames changed: {}",
78-
i,
79-
eb_changes[i]
80-
)
81-
.unwrap();
82-
eb.set_stable(true);
74+
for (i, &changes) in eb_changes.iter().enumerate() {
75+
uwriteln!(uart, "Elastic Buffer {}, frames changed: {}", i, changes).unwrap();
8376
}
8477

8578
uwriteln!(uart, "Switch transceiver channels to user mode..").unwrap();

0 commit comments

Comments
 (0)