From e79807cdff26335f31ed02fbd4676a9eb2f8abc6 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 6 Aug 2022 15:47:39 -0400 Subject: [PATCH] tb: pmd: Ensure signal_detect starts low To make sure that pmd.signal_status comes up at the right time, keep signal_detect low at the start of simulation. We don't need to set pmd.rx, because X is the default value (or rather Z is, but it's the same for our purposes). Fixes: 1d65661 ("Add pmd") Signed-off-by: Sean Anderson --- tb/pmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tb/pmd.py b/tb/pmd.py index d5b4a09..48e1ff0 100644 --- a/tb/pmd.py +++ b/tb/pmd.py @@ -8,7 +8,8 @@ from cocotb.triggers import RisingEdge, Timer @cocotb.test(timeout_time=100, timeout_unit='us') async def test_rx(pmd): - pmd.rx.value = BinaryValue('X') + pmd.signal_detect.value = 0 + await Timer(1) await cocotb.start(Clock(pmd.rx_clk_125, 8, units='ns').start()) # random phase await Timer(random.randrange(0, 8000), units='ps')