tb: pmd: Avoid waiting on a zero-delay timer

According to cocotb, this is not supported by all backends.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2022-08-06 21:44:13 -04:00
parent 0c5f7fa905
commit e65903456b
1 changed files with 2 additions and 2 deletions

View File

@ -32,13 +32,13 @@ async def test_rx(pmd, delays):
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')
await Timer(random.randrange(1, 8000), units='ps')
await cocotb.start(Clock(pmd.rx_clk_250, 4, units='ns').start())
ins = [random.randrange(2) for _ in range(BITS)]
async def generate_bits():
# random phase
await Timer(random.randrange(0, 8000), units='ps')
await Timer(random.randrange(1, 8000), units='ps')
pmd.signal_detect.value = 1
for i, delay in zip(ins, delays(len(ins))):
pmd.rx.value = i