Commit Graph

15 Commits

Author SHA1 Message Date
Sean Anderson 494ef2a2a9 pcs: Split into rx/tx
For easier integration, split the PCS into its rx and tx components.
This was already done on the module level, but now they live in separate
files.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-10-30 21:32:02 -04:00
Sean Anderson 5ac40dbea2 pcs: data_?x -> ?x_data
Rename signals to be properly heirarchal.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-10-16 18:58:29 -04:00
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 f18acfc0b0 tb: pcs: Import things explicitly
Instead of using a wildcard, import used members explicitly. This is
more tenable now that we don't have to import all the valids
separately.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-24 12:27:40 -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 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 fec8a0a9f6 tb: pcs: Don't convert codes to list in pcs_send_codes
This does nothing (especially since we immediately create an iterator)

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-08 00:11:58 -04:00
Sean Anderson fd7673743d tb: pcs: Don't revert to idle after pcs_send_codes
Since 0153975 ("tb: pcs: Send packet spacing packets immediately"), we
have never allowed pma_data_rx to remain idle. There's no need to supply
a default value.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-08 00:08:09 -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 01539759d6 tb: pcs: Send packet spacing packets immediately
This avoids a period of Xs on the inputs.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 21:47:21 -04:00
Sean Anderson d27d0089e6 tb: pcs: Wait for rx_ce when receiving errors
Without .value, pcs.rx_ce always evaluates as truthy.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 15:29:32 -04:00
Sean Anderson fdf3953ce9 tb: pcs: Remove unnecessary parentheses
This is python, not C :)

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 15:28:52 -04:00
Sean Anderson ac69f9208e tb: pcs: Initialize inputs before clocks
Ensure all inputs are initialized before starting the clocks. This
avoids any problems which might occur due to everything being
initialized at once.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 15:27:31 -04:00
Sean Anderson 2b752c4bc1 tb: pcs: Specify clock periods directly
Instead of calculating clock periods based on the desired frequncy,
specify the periods diretly. This silences the following kind of error
caused by floating point rounding:

Unable to accurately represent 8000.000000000001(sec) with the simulator precision of 1e-12

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 15:24:47 -04:00
Sean Anderson d351291ff8 Initial commit 2022-05-23 20:57:03 -04:00