Commit Graph

7 Commits

Author SHA1 Message Date
Sean Anderson 4646500973 tb: Refactor out ClockEnable
Several interfaces have ce signals. Create a common function for driving
these signals, similar to the Clock function.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-27 13:09:30 -04:00
Sean Anderson 592ba14091 tb: Refactor out with_valids
Parametrizing a test over different methods of generating valid data
will be useful for other tests as well. Refactor it out. We have to bind
valids early in with_valids.test, otherwise we will end up binding
with_valids.valid by reference (causing all tests to use saw_valid).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-24 12:25:07 -04:00
Sean Anderson 15ae994ad6 tb: Fix incorrect valid in send_recovered_bits
At the end of the bitstream, we might not have enough bits for valid=2.
If we don't change it to valid=1, instead of marking an X as valid.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-24 12:18:39 -04:00
Sean Anderson 6800b85a85 tb: Move print_list_at/compare_lists to util
These functions will be useful for other tests. Refactor them out into
utility functions.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-24 12:16:43 -04:00
Sean Anderson c1301ca31a tb: Break out the core of pcs_send_codes into its own function
The PMA also has to deal with "recoverd bitstreams" (that is, inputs which
can have 0, 1, or 2 valid bits). Export the core of pcs_send_codes into its
own function, as it is useful for generating these signals.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-08 00:23:55 -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 d351291ff8 Initial commit 2022-05-23 20:57:03 -04:00