Commit Graph

9 Commits

Author SHA1 Message Date
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 93e91e3eb0 pcs: Fix some lint
There were two unused variables; remove them. The wrong type of
assignments were used; fix them.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 15:21:15 -04:00
Sean Anderson d2b4f9b061 pcs: rx: Add premature end state
Without this state, receiving would immediately go low. However, figure
24-11 shows that receiving should go low only after an additional code
group (the second idle) is received.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 15:18:26 -04:00
Sean Anderson e4bbc08620 pcs: tx: Calculate idle correctly when there is no new data
When the PMA has no new data for us, idle should be determined based on
raw_bits[11:2]. However, we just calculated that last cycle, so we can
reuse it.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 14:54:04 -04:00
Sean Anderson 0dea0304af pcs: tx: Process link failure synchronously
There's no strict requirement for us to handle linke failures immediately.
The PMA's link timer will ensure the signal stays low, so we don't have to
worry about missing it. This fixes some strange Xs during initialization.

Fixes: d351291 ("Initial commit")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2022-08-06 14:51:23 -04:00
Sean Anderson 1d65661bd3 Add pmd 2022-08-06 14:02:44 -04:00
Sean Anderson d351291ff8 Initial commit 2022-05-23 20:57:03 -04:00