From 9e737d3c57f5f3d0072a5f85b38f8f0106069be2 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 29 Jun 2018 14:24:44 +0200 Subject: [PATCH] soc/cores/code_8b10b: update (from misoc) --- litex/soc/cores/code_8b10b.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/litex/soc/cores/code_8b10b.py b/litex/soc/cores/code_8b10b.py index 2e9428535..342bed76f 100644 --- a/litex/soc/cores/code_8b10b.py +++ b/litex/soc/cores/code_8b10b.py @@ -236,6 +236,7 @@ class Encoder(Module): self.d = [Signal(8) for _ in range(nwords)] self.k = [Signal() for _ in range(nwords)] self.output = [Signal(10) for _ in range(nwords)] + self.disparity = [Signal() for _ in range(nwords)] # # # @@ -246,12 +247,16 @@ class Encoder(Module): for e1, e2 in zip(encoders, encoders[1:]): self.comb += e2.disp_in.eq(e1.disp_out) - for d, k, output, e in zip(self.d, self.k, self.output, encoders): + for d, k, output, disparity, encoder in \ + zip(self.d, self.k, self.output, self.disparity, encoders): self.comb += [ - e.d.eq(d), - e.k.eq(k) + encoder.d.eq(d), + encoder.k.eq(k) + ] + self.sync += [ + output.eq(encoder.output), + disparity.eq(encoder.disp_out) ] - self.sync += output.eq(e.output) class Decoder(Module):