hi, i am going to use easics tool for generating crc32 verilog code (8bit input)
formatting link
. i was able to implement correctly.but i need more info to how use this crc to generate FCS of a ethernet packt.
i heard about there must be some bit reversal before applying to crc generator. but i am not clear about it .can any one guide me to what have to data stream before applying to crc and when checksum created if further processing had to be done on checksum
The crc you need to apply is the CRC32 AUTODIN II. This is to be applied to all bits after the frame start. In 10/100M ethernet each 4-bits is in reverse order (low nibble - high nibble). So you may need to swap these before feeding the bits to the crc32 generator.
A C example of this crc is at:
formatting link
You can use it for verification this way: cat pktdata | cksum -o 3 | perl -ne 'if( /^(\d+)/ ){ printf("%08X\n",$1); }'
A tip is to capture some packets and use them as reference to verify your crc is correct. Watch out for the order of bits coming out of the crc generator aswell, sometimes these may need swapping aswell. A quick way to find accidential bit swaps is to display the number in binrary like this: perl -e 'printf("%032b\n",2);'
tahanks sky46. i try to download above c file but i borweser can locate the c file. i think some thing wrong with URL. i really appritiate if u can post a verilog code for this implemntaion.i found following c code from other forum . it seems it works correctly. but i don't know whether this is the one you mentioned as crc32 atuodin II . following is the c code //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include
crc_table_adr=crc_out[3:0] ^ data[7:4]; #100 crc_out=(crc_out>>4)^crc_table_data; end
end endmodule ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.