frameline GW: move err cnt out & improve timing

This commit is contained in:
morgan 2025-01-16 12:33:20 +08:00
parent 56b1553bdb
commit 249bcb4900

View File

@ -122,7 +122,8 @@ class CXPCRC32(Module):
class CXPCRC32_Checker(Module):
"""Verify crc in stream data packet"""
def __init__(self):
self.error_cnt = Signal(16)
# TODO: handle the error into a counter
self.error = Signal()
self.sink = stream.Endpoint(word_layout_dchar)
self.source = stream.Endpoint(word_layout_dchar)
@ -140,7 +141,7 @@ class CXPCRC32_Checker(Module):
fsm.act("RESET",
crc.reset.eq(1),
If(crc.error, NextValue(self.error_cnt, self.error_cnt + 1)),
self.error.eq(crc.error),
NextState("CHECKING"),
)