4 ms·
Try to implement a general purpose, synthesizable CRC for any polynomial of any size in Verilog without resorting to hard-coded lookup tables. Can't be done.
by kevin_thibedeau 10y ago
Try to implement a general purpose, synthesizable CRC for any polynomial of any size in Verilog without resorting to hard-coded lookup tables.
Can't be done.
One language suffers from a serious lack of expressiveness and forces its users to effectively carve their gates from stone with incessant low level bit twiddling. The other lets you describe high level behavior and have the tooling do all the hard work.
- nrclark 10y agoI actually did this exact thing in Verilog at a former employer, and got pretty good results (at least with the Xilinx toolchain). It just took some creative use of Verilog's 'function' construct. The basic structure was: 1. Write a function that calculated the next bit from a the existing state and the target poly. 2. Write a second function that called that first function repeatedly (once per bit in the target word). 3. Call the second function on the input data for a combinatorial output.