1
0
Fork 0

cxp GW: add test packet to phy

This commit is contained in:
morgan 2024-09-11 10:16:47 +08:00
parent 6b50d83e67
commit d9888d7647
1 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,6 @@
from migen import * from migen import *
from misoc.interconnect.csr import * from misoc.interconnect.csr import *
from misoc.interconnect import stream
from cxp_downconn import CXP_DownConn from cxp_downconn import CXP_DownConn
from cxp_upconn import CXP_UpConn_PHY from cxp_upconn import CXP_UpConn_PHY
@ -22,6 +23,8 @@ class UpConn_Interface(Module, AutoCSR):
self.tx_enable = CSRStorage() self.tx_enable = CSRStorage()
self.tx_busy = CSRStatus() self.tx_busy = CSRStatus()
self.tx_testmode_en = CSRStorage()
# # # # # #
layout = [("data", 8), ("k", 1)] layout = [("data", 8), ("k", 1)]
@ -65,4 +68,15 @@ class UpConn_Interface(Module, AutoCSR):
# 2: All other packets # 2: All other packets
# Control is not timing dependent, all the link layer is done in firmware # Control is not timing dependent, all the link layer is done in firmware
self.submodules.command = command = TX_Command_Packet(layout) self.submodules.command = command = TX_Command_Packet(layout)
self.comb += command.source.connect(upconn_phy.sinks[2]) self.submodules.testseq = testseq = TX_Test_Packet(layout)
self.submodules.mux = mux = stream.Multiplexer(layout, 2)
self.comb += [
command.source.connect(mux.sink0),
testseq.source.connect(mux.sink1),
mux.sel.eq(self.tx_testmode_en.storage),
mux.source.connect(upconn_phy.sinks[2])
]