Dynamically configurable CRC (Verilog)
DATA_WIDTH
- Data widthCRC_WIDTH
- Max CRC width
Example: if CRC_WIDTH
set to 32, it is possible to implement any CRC algorithm with polynomial degree up to 32 (CRC4, CRC8, CRC9, CRC16, etc.).
clk
- Input clockresetn
- Asynchronous reset (active-LOW)clear
- CRC Clear/Initializationinit_in
- Init Statepoly_in
- Polinomial (full notation* needs for correct calculation of polynomial degree)data_reverse
- Data Bit-Reversecrc_reverse
- CRC Bit-Reversexorout_in
- CRC Output XOR Maskdata_in
- Input Datadata_in_valid
- Valid Data Flagcrc_out
- Output CRC
Note: Full notation - for example if needs to implement CRC8 (x^8+x^2+x^1+1), then poly_in will be 'b1_0000_0111 or 'h107.
P
- input polynomial (poly_in
)