mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
e03091e7e2
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.
13 lines
341 B
Python
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))
|