1
0
Fork 0

cxp upconn: fifo expose the sinks directly

This commit is contained in:
morgan 2024-08-30 17:32:51 +08:00
parent c53c17e861
commit 2346848541
1 changed files with 5 additions and 11 deletions

View File

@ -180,10 +180,7 @@ class Packets_Scheduler(Module):
class TxFIFOs(Module): class TxFIFOs(Module):
def __init__(self, cxp_phy_layout, nfifos, fifo_depth): def __init__(self, cxp_phy_layout, nfifos, fifo_depth):
self.sink_full = Signal(nfifos) self.sink = []
self.sink_stb = Signal(nfifos)
self.sink_data = [Signal(8) for _ in range(nfifos)]
self.sink_k = [Signal() for _ in range(nfifos)]
self.source_ack = Array(Signal() for _ in range(nfifos)) self.source_ack = Array(Signal() for _ in range(nfifos))
self.source_data = Array(Signal(8) for _ in range(nfifos)) self.source_data = Array(Signal(8) for _ in range(nfifos))
@ -195,17 +192,14 @@ class TxFIFOs(Module):
for i in range(nfifos): for i in range(nfifos):
fifo = stream.SyncFIFO(cxp_phy_layout, fifo_depth) fifo = stream.SyncFIFO(cxp_phy_layout, fifo_depth)
setattr(self.submodules, "tx_fifo" + str(i), fifo) setattr(self.submodules, "tx_fifo" + str(i), fifo)
self.sync += [ self.sink += [fifo.sink]
fifo.sink.stb.eq(self.sink_stb[i]),
self.sink_full[i].eq(fifo.sink.ack),
fifo.sink.data.eq(self.sink_data[i]),
fifo.sink.k.eq(self.sink_k[i]),
self.sync += [
If(self.source_ack[i], If(self.source_ack[i],
# reset ack after asserted # reset ack after asserted
# since upconn clk run much slower, the ack will be high for longer than expected which will result in data loss
self.source_ack[i].eq(0), self.source_ack[i].eq(0),
fifo.source.ack.eq(1), fifo.source.ack.eq(1),
).Else( ).Else(