Add cocotb unit tests for protocols/line-codes#1390
Conversation
# Conflicts: # docs/_meta/rtl_regression_handoff.md # docs/_meta/rtl_regression_progress.md
# Conflicts: # docs/_meta/rtl_regression_handoff.md # docs/_meta/rtl_regression_progress.md
Also fix a bug that was found.
There was a problem hiding this comment.
Pull request overview
This PR restructures the protocols/line-codes regression suite into clearer package/entity/integration layers, adds direct encoder/decoder coverage for each line-code family, and fixes an illegal-K disparity edge case in the 12b14b package.
Changes:
- Replaced legacy wrapper-based line-code tests with a layered suite (package wrappers + entity benches + small integration smokes).
- Added shared cocotb utilities in
line_code_test_utils.pyto standardize reset/clocking, encode/decode shims, and test runners. - Fixed
Code12b14bPkg.encode12b14bto avoid using an uninitialized disparity term on illegal-K requests.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/protocols/line_codes/test_LineCode8b10bIntegration.py | Adds small end-to-end smoke coverage using the existing LineCode8b10bTb. |
| tests/protocols/line_codes/test_LineCode8b10b.py | Removes legacy wrapper-based round-trip sweep test. |
| tests/protocols/line_codes/test_LineCode12b14bIntegration.py | Adds small end-to-end smoke coverage (including a short training prefix) using LineCode12b14bTb. |
| tests/protocols/line_codes/test_LineCode12b14b.py | Removes legacy wrapper-based exhaustive round-trip test. |
| tests/protocols/line_codes/test_LineCode10b12bIntegration.py | Adds small end-to-end smoke coverage using LineCode10b12bTb. |
| tests/protocols/line_codes/test_LineCode10b12b.py | Removes legacy wrapper-based round-trip sweep test. |
| tests/protocols/line_codes/test_Encoder8b10b.py | Adds encoder entity tests covering flow-control hold and clkEn gating across width/reset variants. |
| tests/protocols/line_codes/test_Encoder10b12b.py | Adds encoder entity tests covering flow-control hold and clkEn gating across reset variants. |
| tests/protocols/line_codes/test_Encoder12b14b.py | Adds encoder entity tests covering flow-control hold and debug disparity behavior across reset variants. |
| tests/protocols/line_codes/test_Decoder8b10b.py | Adds decoder entity tests for malformed symbol error flagging and clkEn gating. |
| tests/protocols/line_codes/test_Decoder10b12b.py | Adds decoder entity tests for malformed symbol error flagging and clkEn gating. |
| tests/protocols/line_codes/test_Decoder12b14b.py | Adds decoder entity tests for malformed symbol error flagging and clkEn gating (incl. debug disparity modes). |
| tests/protocols/line_codes/test_Code8b10bPkg.py | Adds package-level encode/decode coverage using a checked-in wrapper across disparity seeds. |
| tests/protocols/line_codes/test_Code10b12bPkg.py | Adds package-level encode/decode coverage using a checked-in wrapper across disparity seeds. |
| tests/protocols/line_codes/test_Code12b14bPkg.py | Adds package-level encode/decode coverage including illegal-K (invalidK) checks and transition/training sequences. |
| tests/protocols/line_codes/line_code_test_utils.py | Introduces shared test helpers for reset/clocking, package/entity/integration runners, and common assertions. |
| protocols/line-codes/wrappers/LineCode8b10bWrapper.vhd | Removes legacy cocotb-facing wrapper for 8b10b round-trip testing. |
| protocols/line-codes/wrappers/LineCode10b12bWrapper.vhd | Removes legacy cocotb-facing wrapper for 10b12b round-trip testing. |
| protocols/line-codes/wrappers/LineCode12b14bWrapper.vhd | Removes legacy cocotb-facing wrapper for 12b14b round-trip testing. |
| protocols/line-codes/wrappers/Code8b10bPkgWrapper.vhd | Adds checked-in package wrapper to exercise Code8b10bPkg encode/decode procedures directly. |
| protocols/line-codes/wrappers/Code10b12bPkgWrapper.vhd | Adds checked-in package wrapper to exercise Code10b12bPkg encode/decode procedures directly. |
| protocols/line-codes/wrappers/Code12b14bPkgWrapper.vhd | Adds checked-in package wrapper to exercise Code12b14bPkg encode/decode directly, including invalidK. |
| protocols/line-codes/rtl/Code12b14bPkg.vhd | Fixes illegal-K handling to avoid uninitialized disparity usage and preserve dispOut on invalid K. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Rewrite the
protocols/line-codesregression suite into a cleaner package/entity/integration layout, add direct encoder/decoder coverage for all three line-code families, preserve package-level disparity-seed testing with checked-in wrappers, and expand nearby AXI/DMA verification updates already present onverification-2. This branch also drops the temporary planning artifacts underdocs/_metaso the PR stays focused on executable verification changes instead of handoff notes.Details
The line-code test suite is restructured around a shared helper at
tests/protocols/line_codes/line_code_test_utils.pywith three explicit layers:protocols/line-codes/wrappers/Code8b10bPkgWrapper.vhdprotocols/line-codes/wrappers/Code10b12bPkgWrapper.vhdprotocols/line-codes/wrappers/Code12b14bPkgWrapper.vhdtests/protocols/line_codes/test_Encoder8b10b.pytests/protocols/line_codes/test_Decoder8b10b.pytests/protocols/line_codes/test_Encoder10b12b.pytests/protocols/line_codes/test_Decoder10b12b.pytests/protocols/line_codes/test_Encoder12b14b.pytests/protocols/line_codes/test_Decoder12b14b.pytests/protocols/line_codes/test_LineCode8b10bIntegration.pytests/protocols/line_codes/test_LineCode10b12bIntegration.pytests/protocols/line_codes/test_LineCode12b14bIntegration.pyThe old duplicated
LineCode*Wrapper.vhdadapters andtest_LineCode*.pywrapper benches are removed in favor of the cleaner split above.The new package-level coverage exposed and fixes an illegal-K disparity edge case in
protocols/line-codes/rtl/Code12b14bPkg.vhd.