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:

 1use     work.utils.all;
 2
 3
 4entity comm_CRC is
 5  generic (
 6    POLYNOMIAL  : bit_vector;                       -- Generator Polynomial
 7    BITS        : positive;                         -- Number of Bits to be processed in parallel
 8    CHUNK_BITS  : positive := BITS;                 -- Bus width for 'en' port
 9
10    INIT        : std_logic_vector   := "0";
11    OUTPUT_REGS : boolean            := true
12  );
13  port (
14    Clock       : in  std_logic;                                -- Clock
15
16    Load        : in  std_logic;                                -- Parallel Preload of Remainder
17    Seed        : in  std_logic_vector(abs(mssb_idx(POLYNOMIAL)-POLYNOMIAL'right)-1 downto 0);  --
18    Enable      : in  std_logic;                                -- Process Input Data (MSB first)
19    ChunkEnable : in  std_logic_vector(CHUNK_BITS-1 downto 0) := (CHUNK_BITS-1 downto 0 => '1'); -- Chunk Enable