Skip to content

Commit

Permalink
mac/crc: Revert 30e66a7 (introducing a regression).
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Apr 8, 2024
1 parent 421e008 commit 9a5d8ca
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions liteeth/mac/crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,18 @@ def __init__(self, data_width):
self.sync += reg.eq(engines[-1].crc_next)

# Select CRC Engine/Result.
crc_next = Signal(self.width)
for n in range(data_width//8):
crc_next = Signal(self.width)
self.comb += [
engines[n].data.eq(self.data),
engines[n].crc_prev.eq(reg),
If(self.be[n],
crc_next.eq(engines[n].crc_next)
crc_next.eq(engines[n].crc_next),
self.value.eq(engines[n].crc_next[::-1] ^ self.init),
self.error.eq(engines[n].crc_next != self.check),
)
]

# Output.
self.comb += [
self.value.eq(crc_next[::-1] ^ self.init),
self.error.eq(crc_next != self.check),
]

# MAC CRC32 Inserter -------------------------------------------------------------------------------

class LiteEthMACCRC32Inserter(LiteXModule):
Expand Down

0 comments on commit 9a5d8ca

Please sign in to comment.