forked from M-Labs/artiq-zynq
cxp upconn: fifo expose the sinks directly
This commit is contained in:
parent
c53c17e861
commit
2346848541
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue