litex/examples/basic/crc.py
Florent Kermarrec e03091e7e2 add generic CRCEngine, CRC32, CRCInserter and CRCChecker
CRCEngine implements a generic and optimized CRC LFSR. It will enable generation of CRC generators and checkers.
CRC32 is an implementation of IEEE 802.3 CRC using the CRCEngine.
CRC32Inserter and CRC32Checker have been tested on an ethernet MAC.
2014-09-26 11:42:10 +08:00

13 lines
341 B
Python

from migen.fhdl.std import *
from migen.genlib.crc import CRC32
from migen.fhdl import verilog
class Example(Module):
def __init__(self, width):
crc32 = CRC32(width)
self.submodules += crc32
self.ios = {crc32.reset, crc32.ce,
crc32.d, crc32.value, crc32.error}
example = Example(8)
print(verilog.convert(example, example.ios))