CRC Generation Tool

Free tool that can be used for creating CRC computation function to be used within HDL design. crc4hdl is available at this repository:
https://github.com/electgon/crc4hdl

Usage:
crc4hdl [options] …
options are:


Example:
crc4hdl -p 104C11DB7 -w 1 -msb -d 32
this will generate CRC for the polynomial 104C11DB7 which of degree 32 (CRC width), The Input data is 1 bit with msb first.
The tool binary is provided for:

Generated Output


Upon successful execution of crc4hdl, one package will be generated "crc_pkg". This package will have one ready function to be called within your design. This function accepts two inputs arguments: Input data and Initial value of the CRC register. For understanding CRC theory and what are input data and initial value, kindly visit www.electgon.com The function will return computed CRC value for the provided segment of data. If you have long packet of data, you can either calculate the CRC of the entire packet at once (but input data width of the function shall be set accordingly), or you can divide this long packet into data segments (for example each of 8 bit width) then calculate the CRC for each segment but the result CRC of one segment shall be provided as CRC initial value of the next data segment.
As an example, there is one testbench is provided in this repository in "simulation" directory to undersdtand how to use the generated CRC function.

Simulation Testbench


For simulating the resulted package, a ready testbench is provided along with the executable so that you can simulate the generated HDL file. But first you have to open the testbench source file "tb_crc_top" and adjust the testbench configuration section:

To execute the provided testbench, there is one „do“ file which is ready to be used in ModelSim/Questa simulators, to run this „do“ file, open ModelSim/Questa then use this command
run sim_crc_top.do


Privacy Policy
Electgon - All Rights Reserved