From b9a0d1dbc37525fe41b42884a83879b392026f28 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 18 Jan 2023 15:47:10 +0100 Subject: [PATCH] soc/cores/prbs/PRBSChecker: Improve errors timings. --- litex/soc/cores/prbs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/cores/prbs.py b/litex/soc/cores/prbs.py index 1fb8688a7..662f62fcb 100644 --- a/litex/soc/cores/prbs.py +++ b/litex/soc/cores/prbs.py @@ -110,7 +110,7 @@ class PRBSChecker(Module): curval = [state[i] for i in range(n_state)] for i in reversed(range(n_in)): correctv = Reduce("XOR", [curval[tap] for tap in taps]) - self.comb += self.errors[i].eq(self.i[i] != correctv) + self.sync += self.errors[i].eq(self.i[i] != correctv) curval.insert(0, self.i[i]) curval.pop() self.sync += state.eq(Cat(*curval[:n_state])) @@ -121,7 +121,7 @@ class PRBSChecker(Module): self.submodules += idle_timer self.sync += i_last.eq(self.i) self.comb += idle_timer.wait.eq(self.i == i_last) - self.comb += If(idle_timer.done, self.errors.eq(2**n_in-1)) + self.sync += If(idle_timer.done, self.errors.eq(2**n_in-1)) class PRBS7Checker(PRBSChecker): def __init__(self, n_out):