Merge pull request #1132 from smunaut/prbs
cores/prbs: Add a 'wrap' option to PRBSRX
This commit is contained in:
commit
fda682a4a6
|
@ -137,7 +137,7 @@ class PRBS31Checker(PRBSChecker):
|
||||||
# PRBS RX ------------------------------------------------------------------------------------------
|
# PRBS RX ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class PRBSRX(Module):
|
class PRBSRX(Module):
|
||||||
def __init__(self, width, reverse=False):
|
def __init__(self, width, reverse=False, wrap=False):
|
||||||
self.config = Signal(2)
|
self.config = Signal(2)
|
||||||
self.pause = Signal()
|
self.pause = Signal()
|
||||||
self.i = Signal(width)
|
self.i = Signal(width)
|
||||||
|
@ -170,7 +170,7 @@ class PRBSRX(Module):
|
||||||
self.sync += [
|
self.sync += [
|
||||||
If(config == 0,
|
If(config == 0,
|
||||||
errors.eq(0)
|
errors.eq(0)
|
||||||
).Elif(~self.pause & (errors != (2**32-1)),
|
).Elif(~self.pause & ((errors != (2**32-1)) | wrap),
|
||||||
If(config == 0b01,
|
If(config == 0b01,
|
||||||
errors.eq(errors + (prbs7.errors != 0))
|
errors.eq(errors + (prbs7.errors != 0))
|
||||||
).Elif(config == 0b10,
|
).Elif(config == 0b10,
|
||||||
|
|
Loading…
Reference in New Issue