PoC.comm.crc
Computes the Cyclic Redundancy Check (CRC) for a data packet as remainder of the polynomial division of the message by the given generator polynomial (GEN).
The computation is unrolled so as to process an arbitrary number of message bits per step. The generated CRC is independent from the chosen processing width.
Entity Declaration:
1library IEEE;
2use IEEE.std_logic_1164.all;
3
4use work.utils.all;
5
6
7entity comm_crc is
8 generic (
9 GEN : bit_vector; -- Generator Polynomial
10 BITS : positive; -- Number of Bits to be processed in parallel
11 CHUNK_BITS : positive := BITS; -- Bus width for 'en' port
12
13 STARTUP_RMD : std_logic_vector := "0";
14 OUTPUT_REGS : boolean := true
15 );
16 port (
17 clk : in std_logic; -- Clock
18
19 set : in std_logic; -- Parallel Preload of Remainder
20 init : in std_logic_vector(abs(mssb_idx(GEN)-GEN'right)-1 downto 0); --