@@ -11,9 +11,11 @@ import freechips.rocketchip.prci._
11
11
import freechips .rocketchip .subsystem ._
12
12
import freechips .rocketchip .util ._
13
13
14
+ import e2e ._
14
15
import protocol ._
15
16
import interfaces ._
16
17
import sideband ._
18
+ import logphy .{LinkTrainingParams }
17
19
18
20
// TODO: Sideband messaging
19
21
/** Main class to generate manager, client and register nodes on the tilelink diplomacy.
@@ -22,7 +24,11 @@ import sideband._
22
24
* an agnostic interface to generate FDI signalling.
23
25
*/
24
26
class UCITLFront (val tlParams : TileLinkParams , val protoParams : ProtocolLayerParams ,
25
- val fdiParams : FdiParams )
27
+ val fdiParams : FdiParams , val rdiParams : RdiParams ,
28
+ val sbParams : SidebandParams , val myId : BigInt ,
29
+ val linkTrainingParams : LinkTrainingParams ,
30
+ val afeParams : AfeParams ,
31
+ val laneAsyncQueueParams : AsyncQueueParams )
26
32
(implicit p : Parameters ) extends ClockSinkDomain (ClockSinkParameters ())(p) {
27
33
28
34
val device = new SimpleDevice (" ucie-front" , Seq (" ucie,ucie0" ))
@@ -58,20 +64,28 @@ class UCITLFront(val tlParams: TileLinkParams, val protoParams: ProtocolLayerPar
58
64
59
65
class UCITLFrontImp extends Impl {
60
66
val io = IO (new Bundle {
61
- // val sbus_clk = Input(Clock()) // System bus clock
62
- // val sbus_reset = Input(Bool()) // System bus reset
63
- // val lclk = Input(Clock()) // lclk is the FDI signalling clock
64
- // val lreset = Input(Bool()) // should the UCIe modules have its own reset?
65
- val fdi = new Fdi (fdiParams )
67
+ // FDI interface for testing purposes only
68
+ // val fdi = new Fdi(fdiParams)
69
+ // IOs for connecting to the AFE
70
+ val mbAfe = new MainbandAfeIo (afeParams)
71
+ val sbAfe = new SidebandAfeIo (afeParams )
66
72
})
67
73
withClockAndReset(clock, reset) {
68
74
75
+ withClockAndReset(clock, reset) {
76
+
69
77
val fault = RegInit (false .B ) // if fault in ecc code
70
78
71
79
// Instantiate the agnostic protocol layer
72
- val protocol = Module (new ProtocolLayer (fdiParams))
73
- io.fdi <> protocol.io.fdi
74
- protocol.io.fault := fault
80
+ // val protocol = Module(new ProtocolLayer(fdiParams))
81
+ val ucietop = Module (new UCITop (fdiParams, rdiParams,
82
+ sbParams, myId,
83
+ linkTrainingParams,
84
+ afeParams, laneAsyncQueueParams))
85
+ // io.fdi <> ucietop.io.fdi
86
+ ucietop.io.fault := fault
87
+ io.mbAfe <> ucietop.io.mbAfe
88
+ io.sbAfe <> ucietop.io.sbAfe
75
89
76
90
// Hamming encode and decode
77
91
val hammingEncoder = Module (new HammingEncode (protoParams))
@@ -84,13 +98,13 @@ class UCITLFrontImp extends Impl {
84
98
// Sideband node for protocol layer
85
99
val protocol_sb_node = Module (new SidebandNode ((new SidebandParams ), fdiParams))
86
100
87
- protocol_sb_node.io.outer.rx.bits := protocol .io.fdi.lpConfig .bits
88
- protocol_sb_node.io.outer.rx.valid := protocol .io.fdi.lpConfig .valid
89
- protocol .io.fdi.lpConfigCredit := protocol_sb_node.io.outer.rx.credit
101
+ protocol_sb_node.io.outer.rx.bits := ucietop .io.fdi_lpConfig .bits
102
+ protocol_sb_node.io.outer.rx.valid := ucietop .io.fdi_lpConfig .valid
103
+ ucietop .io.fdi_lpConfigCredit := protocol_sb_node.io.outer.rx.credit
90
104
91
- protocol .io.fdi.plConfig .bits := protocol_sb_node.io.outer.tx.bits
92
- protocol .io.fdi.plConfig .valid := protocol_sb_node.io.outer.tx.valid
93
- protocol_sb_node.io.outer.tx.credit := protocol .io.fdi.plConfigCredit
105
+ ucietop .io.fdi_plConfig .bits := protocol_sb_node.io.outer.tx.bits
106
+ ucietop .io.fdi_plConfig .valid := protocol_sb_node.io.outer.tx.valid
107
+ protocol_sb_node.io.outer.tx.credit := ucietop .io.fdi_plConfigCredit
94
108
95
109
protocol_sb_node.io.inner.layer_to_node.bits := Cat (regNode.module.io.sb_csrs.sideband_mailbox_sw_to_node_data_high,
96
110
regNode.module.io.sb_csrs.sideband_mailbox_sw_to_node_data_low,
@@ -145,7 +159,7 @@ class UCITLFrontImp extends Impl {
145
159
// val txTLPayload = Wire(new TLBundleAUnionD(tlParams))
146
160
147
161
val aHasData = manager_edge.hasData(manager_tl.a.bits)
148
- val rx_fire = protocol .io.TLplData_valid
162
+ val rx_fire = ucietop .io.TLplData_valid
149
163
val uciRxPayload = Wire (new UCIRawPayloadFormat (tlParams, protoParams)) // User-defined UCIe flit for streaming
150
164
val uciTxPayload = Wire (new UCIRawPayloadFormat (tlParams, protoParams)) // User-defined UCIe flit for streaming
151
165
@@ -156,15 +170,15 @@ class UCITLFrontImp extends Impl {
156
170
txDTLPayload := 0 .U .asTypeOf(new TLBundleAUnionD (tlParams))
157
171
158
172
/*
159
- manager_tl.a.ready = (inward.io.enq.ready & ~protocol .io.fdi.lpStallAck &
160
- (protocol .io.fdi.plStateStatus === PhyState.active))
173
+ manager_tl.a.ready = (inward.io.enq.ready & ~ucietop .io.fdi_lpStallAck &
174
+ (ucietop .io.TLplStateStatus === PhyState.active))
161
175
inward.io.enq.valid := manager_tl.a.fire
162
176
*/
163
177
164
178
// A request to partner die logic
165
179
// enqueue on the A channel queue
166
- manager_tl.a.ready := (inwardA.io.enq.ready & ~ protocol .io.fdi.lpStallAck &
167
- (protocol .io.fdi.plStateStatus === PhyState .active))
180
+ manager_tl.a.ready := (inwardA.io.enq.ready & ~ ucietop .io.fdi_lpStallAck &
181
+ (ucietop .io.TLplStateStatus === PhyState .active))
168
182
inwardA.io.enq.valid := manager_tl.a.fire
169
183
inwardA.io.enq.bits <> manager_tl.a.bits
170
184
@@ -176,8 +190,8 @@ class UCITLFrontImp extends Impl {
176
190
creditedMsgA.io.credit.bits := uciRxPayload.cmd.tlACredit
177
191
178
192
// D response to partner die's A request logic
179
- client_tl.d.ready := (inwardD.io.enq.ready & ~ protocol .io.fdi.lpStallAck &
180
- (protocol .io.fdi.plStateStatus === PhyState .active))
193
+ client_tl.d.ready := (inwardD.io.enq.ready & ~ ucietop .io.fdi_lpStallAck &
194
+ (ucietop .io.TLplStateStatus === PhyState .active))
181
195
inwardD.io.enq.valid := client_tl.d.fire
182
196
inwardD.io.enq.bits <> client_tl.d.bits
183
197
@@ -237,11 +251,11 @@ class UCITLFrontImp extends Impl {
237
251
tx_pipe.io.enq.bits := uciTxPayload
238
252
tx_pipe.io.enq.valid := txArbiter.io.out.fire
239
253
// Dequeue the TX TL packets and translate to UCIe flit
240
- txArbiter.io.out.ready := protocol .io.fdi.lpData.ready // if pl_trdy is asserted
254
+ txArbiter.io.out.ready := ucietop .io.TLlpData_ready // if pl_trdy is asserted
241
255
// specs implies that these needs to be asserted at the same time
242
- protocol .io.TLlpData_valid := tx_pipe.io.deq.valid & (~ protocol .io.fdi.lpStallAck )
243
- protocol .io.TLlpData_irdy := tx_pipe.io.deq.valid & (~ protocol .io.fdi.lpStallAck )
244
- protocol .io.TLlpData_bits := Cat (tx_pipe.io.deq.bits.asUInt(511 ,64 ), checksum_reg.asUInt) // assign uciTXPayload to the FDI lp data signa
256
+ ucietop .io.TLlpData_valid := tx_pipe.io.deq.valid & (~ ucietop .io.fdi_lpStallAck )
257
+ ucietop .io.TLlpData_irdy := tx_pipe.io.deq.valid & (~ ucietop .io.fdi_lpStallAck )
258
+ ucietop .io.TLlpData_bits := Cat (tx_pipe.io.deq.bits.asUInt(511 ,64 ), checksum_reg.asUInt) // assign uciTXPayload to the FDI lp data signa
245
259
246
260
val creditA = (txArbiter.io.out.bits.msgType === UCIProtoMsgTypes .TLA )
247
261
val creditB = (txArbiter.io.out.bits.msgType === UCIProtoMsgTypes .TLB )
@@ -302,26 +316,25 @@ class UCITLFrontImp extends Impl {
302
316
// =======================
303
317
val rxTLPayload = Wire (new TLBundleAUnionD (tlParams))
304
318
rxTLPayload := 0 .U .asTypeOf(new TLBundleAUnionD (tlParams))
305
- // protocol.io.fdi.lpData.irdy := outward.io.enq.ready
306
-
319
+ // ucietop.io.fdi_lpData.irdy := outward.io.enq.ready
307
320
// map the uciRxPayload and the plData based on the uciPayload formatting
308
321
// map the uciRxPayload to the rxTLPayload TLBundle
309
322
when(rx_fire) {
310
323
// ucie cmd
311
- uciRxPayload.cmd := protocol .io.TLplData_bits (511 , 448 ).asTypeOf(new UCICmdFormat (protoParams))
324
+ uciRxPayload.cmd := ucietop .io.TLplData_bits (511 , 448 ).asTypeOf(new UCICmdFormat (protoParams))
312
325
// ucie header 1
313
- uciRxPayload.header1 := protocol .io.TLplData_bits (447 ,384 ).asTypeOf(new UCIHeader1Format (tlParams))
326
+ uciRxPayload.header1 := ucietop .io.TLplData_bits (447 ,384 ).asTypeOf(new UCIHeader1Format (tlParams))
314
327
// ucie header 2
315
- uciRxPayload.header2 := protocol .io.TLplData_bits (383 , 320 ).asTypeOf(new UCIHeader2Format (tlParams))
328
+ uciRxPayload.header2 := ucietop .io.TLplData_bits (383 , 320 ).asTypeOf(new UCIHeader2Format (tlParams))
316
329
// ucie data payload
317
- uciRxPayload.data(3 ) := protocol .io.TLplData_bits (319 ,256 )
318
- uciRxPayload.data(2 ) := protocol .io.TLplData_bits (255 ,192 )
319
- uciRxPayload.data(1 ) := protocol .io.TLplData_bits (191 ,128 )
320
- uciRxPayload.data(0 ) := protocol .io.TLplData_bits (127 ,64 )
330
+ uciRxPayload.data(3 ) := ucietop .io.TLplData_bits (319 ,256 )
331
+ uciRxPayload.data(2 ) := ucietop .io.TLplData_bits (255 ,192 )
332
+ uciRxPayload.data(1 ) := ucietop .io.TLplData_bits (191 ,128 )
333
+ uciRxPayload.data(0 ) := ucietop .io.TLplData_bits (127 ,64 )
321
334
// ucie ecc
322
- uciRxPayload.ecc := protocol .io.TLplData_bits (63 ,0 )
323
- hammingDecoder.io.data := protocol .io.TLplData_bits (511 ,64 )
324
- hammingDecoder.io.checksum := protocol .io.TLplData_bits (63 ,0 )
335
+ uciRxPayload.ecc := ucietop .io.TLplData_bits (63 ,0 )
336
+ hammingDecoder.io.data := ucietop .io.TLplData_bits (511 ,64 )
337
+ hammingDecoder.io.checksum := ucietop .io.TLplData_bits (63 ,0 )
325
338
326
339
// map the uciRxPayload to the rxTLPayload
327
340
rxTLPayload.address := uciRxPayload.header1.address
@@ -368,10 +381,10 @@ class UCITLFrontImp extends Impl {
368
381
}
369
382
// when the RX queues are ready to get data
370
383
val TLready_to_rcv = outwardA.io.in.ready || outwardD.io.in.ready
371
- protocol .io.TLready_to_rcv := TLready_to_rcv
384
+ ucietop .io.TLready_to_rcv := TLready_to_rcv
372
385
373
386
// soft resets: can be reset or flush and reset, in flush and reset, the packets are
374
387
// sent out before triggering reset
375
- protocol .io.soft_reset := (regNode.module.io.d2d_csrs.d2d_state_can_reset |
388
+ ucietop .io.soft_reset := (regNode.module.io.d2d_csrs.d2d_state_can_reset |
376
389
regNode.module.io.d2d_csrs.d2d_flush_and_reset)
377
- }}}
390
+ }}}}
0 commit comments