Merge pull request #1132 from smunaut/prbs

cores/prbs: Add a 'wrap' option to PRBSRX
This commit is contained in:
enjoy-digital 2021-12-14 08:17:08 +01:00 committed by GitHub
commit fda682a4a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ class PRBS31Checker(PRBSChecker):
# PRBS RX ------------------------------------------------------------------------------------------
class PRBSRX(Module):
def __init__(self, width, reverse=False):
def __init__(self, width, reverse=False, wrap=False):
self.config = Signal(2)
self.pause = Signal()
self.i = Signal(width)
@ -170,7 +170,7 @@ class PRBSRX(Module):
self.sync += [
If(config == 0,
errors.eq(0)
).Elif(~self.pause & (errors != (2**32-1)),
).Elif(~self.pause & ((errors != (2**32-1)) | wrap),
If(config == 0b01,
errors.eq(errors + (prbs7.errors != 0))
).Elif(config == 0b10,