From c491c60b7d9ee890f33ce33db199b733b0527dd7 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 28 Nov 2020 11:33:57 +0100 Subject: [PATCH] soc/cores/prbs/PRBSRX: add pause signal to pause errors counting. Simplify CDC when passing the errors to software by allowing the values to stabilized. --- litex/soc/cores/prbs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litex/soc/cores/prbs.py b/litex/soc/cores/prbs.py index 1cb527995..2010ab7b3 100644 --- a/litex/soc/cores/prbs.py +++ b/litex/soc/cores/prbs.py @@ -132,6 +132,7 @@ class PRBS31Checker(PRBSChecker): class PRBSRX(Module): def __init__(self, width, reverse=False): self.config = Signal(2) + self.pause = Signal() self.i = Signal(width) self.errors = Signal(32) @@ -162,7 +163,7 @@ class PRBSRX(Module): self.sync += [ If(config == 0, self.errors.eq(0) - ).Elif(self.errors != (2**32-1), + ).Elif(~self.pause & (self.errors != (2**32-1)), If(config == 0b01, self.errors.eq(self.errors + (prbs7.errors != 0)) ).Elif(config == 0b10,