From ec04874781073676bfe2c174ccca3297e28301d4 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 5 Mar 2023 00:13:13 -0500 Subject: [PATCH] tb: phy_core: Make signal_status more robust signal_status and must be low for a rising edge before it goes high. At the moment we depend on ClockEnable to wait for a rising edge. Instead, wait for a falling edge explicitly. This makes this test less dependent on how tx_ce is generated. Signed-off-by: Sean Anderson --- tb/phy_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tb/phy_core.py b/tb/phy_core.py index a7d5885..c9ee198 100644 --- a/tb/phy_core.py +++ b/tb/phy_core.py @@ -26,9 +26,9 @@ async def test_transfer(phy): phy.link_monitor_test_mode.value = 1 await cocotb.start(ClockEnable(phy.clk, phy.tx_ce, 5)) await Timer(1) - phy.signal_status.value = 1 await cocotb.start(Clock(phy.clk, 8, units='ns').start()) - await FallingEdge(phy.tx_ce) + await FallingEdge(phy.clk) + phy.signal_status.value = 1 tx_data = list(as_nibbles([0x55, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef])) rx_data = list(as_nibbles((0x55, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10)))