mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-10 01:08:40 -08:00
example/ZCU106: Add XFCP to ZCU106 example design for monitoring and control
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -21,7 +21,9 @@ TOPLEVEL = $(COCOTB_TOPLEVEL)
|
||||
VERILOG_SOURCES += ../../rtl/$(DUT).sv
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/eth/taxi_eth_mac_1g_fifo.f
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/eth/us/taxi_eth_mac_25g_us.f
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/lss/taxi_uart.f
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/xfcp/taxi_xfcp_if_uart.f
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/xfcp/taxi_xfcp_switch.sv
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/xfcp/taxi_xfcp_mod_stats.f
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/sync/taxi_sync_reset.sv
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/sync/taxi_sync_signal.sv
|
||||
VERILOG_SOURCES += ../../lib/taxi/rtl/io/taxi_debounce_switch.sv
|
||||
|
||||
@@ -71,8 +71,8 @@ class TB:
|
||||
self.sfp_sources.append(BaseRSerdesSource(ch.ch_inst.serdes_rx_data, ch.ch_inst.serdes_rx_hdr, ch.ch_inst.rx_clk, slip=ch.ch_inst.serdes_rx_bitslip, reverse=True))
|
||||
self.sfp_sinks.append(BaseRSerdesSink(ch.ch_inst.serdes_tx_data, ch.ch_inst.serdes_tx_hdr, ch.ch_inst.tx_clk, reverse=True))
|
||||
|
||||
self.uart_source = UartSource(dut.uart_rxd, baud=115200, bits=8, stop_bits=1)
|
||||
self.uart_sink = UartSink(dut.uart_txd, baud=115200, bits=8, stop_bits=1)
|
||||
self.uart_source = UartSource(dut.uart_rxd, baud=2000000, bits=8, stop_bits=1)
|
||||
self.uart_sink = UartSink(dut.uart_txd, baud=2000000, bits=8, stop_bits=1)
|
||||
|
||||
dut.btnu.setimmediatevalue(0)
|
||||
dut.btnl.setimmediatevalue(0)
|
||||
@@ -106,25 +106,6 @@ class TB:
|
||||
await RisingEdge(self.dut.clk_125mhz)
|
||||
|
||||
|
||||
async def uart_test(tb, source, sink):
|
||||
tb.log.info("Test UART")
|
||||
|
||||
tx_data = b"FPGA Ninja"
|
||||
|
||||
tb.log.info("UART TX: %s", tx_data)
|
||||
|
||||
await source.write(tx_data)
|
||||
|
||||
rx_data = bytearray()
|
||||
|
||||
while len(rx_data) < len(tx_data):
|
||||
rx_data.extend(await sink.read())
|
||||
|
||||
tb.log.info("UART RX: %s", rx_data)
|
||||
|
||||
tb.log.info("UART test done")
|
||||
|
||||
|
||||
async def mac_test(tb, source, sink):
|
||||
tb.log.info("Test MAC")
|
||||
|
||||
@@ -216,10 +197,6 @@ async def run_test(dut):
|
||||
|
||||
tests = []
|
||||
|
||||
tb.log.info("Start UART test")
|
||||
|
||||
tests.append(cocotb.start_soon(uart_test(tb, tb.uart_source, tb.uart_sink)))
|
||||
|
||||
for k in range(len(tb.sfp_sources)):
|
||||
if dut.SFP_RATE.value == 0:
|
||||
tb.log.info("Start SFP %d 1G MAC loopback test", k)
|
||||
@@ -264,7 +241,9 @@ def test_fpga_core(request, sfp_rate):
|
||||
os.path.join(rtl_dir, f"{dut}.sv"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "eth", "taxi_eth_mac_1g_fifo.f"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "eth", "us", "taxi_eth_mac_25g_us.f"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "lss", "taxi_uart.f"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "xfcp", "taxi_xfcp_if_uart.f"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "xfcp", "taxi_xfcp_switch.sv"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "xfcp", "taxi_xfcp_mod_stats.f"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "sync", "taxi_sync_reset.sv"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "sync", "taxi_sync_signal.sv"),
|
||||
os.path.join(lib_dir, "taxi", "rtl", "io", "taxi_debounce_switch.sv"),
|
||||
|
||||
Reference in New Issue
Block a user