Skip to content

Fix CRC residue matching - #2

Closed
aca-logimentor wants to merge 2 commits into
mainfrom
codex/bugfix-crc-residue-init
Closed

aca-logimentor wants to merge 2 commits into
mainfrom
codex/bugfix-crc-residue-init

Conversation

@aca-logimentor

@aca-logimentor aca-logimentor commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • compare CRC check state against the computed residue instead of all-zero, so xorout-based CRCs can validate data plus transmitted CRC
  • add synchronous init_i reloads for serial and parallel CRC engines, and keep match_o stable while dv_i is low
  • reflect parallel input bits per byte for reflected CRCs on wide buses, add g_xor_out length checks, and allow CRC widths up to 64 bits
  • make init/xor generic width mismatches fail elaboration in synthesis by assigning them directly to constrained constants
  • cover serial flush_i behavior and document match_o, init_i, and flush_i semantics
  • add an Unreleased changelog entry for the match_o compatibility change

Root Cause

The check path assumed that appending the CRC always drives the internal register to zero. That is only true when the appended CRC is the internal un-xored register value, or when xorout is zero. Standard transmitted CRC fields include xorout, so the final state is the algorithm residue instead.

Validation

  • VUNIT_SIMULATOR=ghdl .\.venv\Scripts\python.exe sim\scripts\run.py --level fast --clean --output-path vunit_out
  • Result: 142/142 passed

@aca-logimentor aca-logimentor changed the title [codex] Fix CRC residue matching Fix CRC residue matching Jul 3, 2026
@aca-logimentor
aca-logimentor deleted the codex/bugfix-crc-residue-init branch July 3, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant