Commit Graph

8 Commits

Author SHA1 Message Date
Sean Anderson f8bb110caa tb: pmd: Allow a larger range for alignment
If we get a run of 1s (or 0s) at the start of the stream, it may take a
while for us to align. Increase the alignment range. Additionally, from
testing, it appears that negative ranges are never used. Just start at
0.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 21:47:21 -04:00
Sean Anderson e65903456b 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>
2022-08-06 21:47:21 -04:00
Sean Anderson 0c5f7fa905 tb: Parametrize rx tests
In the recieve tests, the harness often has a choice of how fast to feed
data to the module. Up to this point, we have always used the same
strategy (typically random), even when multiple strategies were used
when writing the test. Add parametrization to test different strategies
in each test run. The timing decorator is taken from the cocotb source,
since we can't pass parameters to cocotb.test directly any more.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 21:47:21 -04:00
Sean Anderson 5e1dabf601 tb: pmd: Add helper for printing data
This adds a helper for printing input/output serial data. Early errors
might not have had the offending bits printed, since slicing
doesn't work with negative indices.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 21:47:21 -04:00
Sean Anderson 16dfe09fba tb: pmd: Wait on signal_status and not valid
valid is an internal signal which isn't available in post-synthesis
simulation. Use signal_status instead, which is externally available.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 21:47:21 -04:00
Sean Anderson 24ec0a4150 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>
2022-08-06 21:47:21 -04:00
Sean Anderson e79807cdff 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 <seanga2@gmail.com>
2022-08-06 21:47:21 -04:00
Sean Anderson 1d65661bd3 Add pmd 2022-08-06 14:02:44 -04:00