From a6ed4c5c090e91fccd16e4667351f37db0bb92cf Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 14 Dec 2021 09:35:17 +0100 Subject: [PATCH] cores/prbs: Change wrap parameter to with_errors_saturation (opposite) and disable saturation by default. --- litex/soc/cores/prbs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/litex/soc/cores/prbs.py b/litex/soc/cores/prbs.py index 61f69ca7a..498af82da 100644 --- a/litex/soc/cores/prbs.py +++ b/litex/soc/cores/prbs.py @@ -137,7 +137,7 @@ class PRBS31Checker(PRBSChecker): # PRBS RX ------------------------------------------------------------------------------------------ class PRBSRX(Module): - def __init__(self, width, reverse=False, wrap=False): + def __init__(self, width, reverse=False, with_errors_saturation=False): self.config = Signal(2) self.pause = Signal() self.i = Signal(width) @@ -147,14 +147,14 @@ class PRBSRX(Module): config = Signal(2) - # Optional bits reversing + # Optional bits reversing. prbs_data = self.i if reverse: new_prbs_data = Signal(width) self.comb += new_prbs_data.eq(prbs_data[::-1]) prbs_data = new_prbs_data - # Checkers + # Checkers. self.specials += MultiReg(self.config, config) prbs7 = PRBS7Checker(width) prbs15 = PRBS15Checker(width) @@ -166,11 +166,11 @@ class PRBSRX(Module): prbs31.i.eq(prbs_data) ] - # Errors count + # Errors count (with optional saturation). self.sync += [ If(config == 0, errors.eq(0) - ).Elif(~self.pause & ((errors != (2**32-1)) | wrap), + ).Elif(~self.pause & (~with_errors_saturation | (errors != (2**32-1))), If(config == 0b01, errors.eq(errors + (prbs7.errors != 0)) ).Elif(config == 0b10,