tb: pmd: Don't die if pmd.delay is absent

We set this signal for debugging purposes, so don't die if it's absent
(such as in a post-synthesis simulation).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2022-08-06 15:51:27 -04:00
parent e79807cdff
commit 24ec0a4150
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ async def test_rx(pmd):
delay_dist = NormalDist(8000, 1400 / NormalDist().inv_cdf(1-2e-9))
for i, delay in zip(ins, (int(delay) for delay in delay_dist.samples(len(ins)))):
pmd.rx.value = i
try:
pmd.delay.value = delay
except AttributeError:
pass
await Timer(delay, units='ps')
#await Timer(8100, units='ps')
pmd.signal_detect.value = 0