soc/cores/code_8b10b: update (from misoc)

This commit is contained in:
Florent Kermarrec 2018-06-29 14:24:44 +02:00
parent d58eb4ecb7
commit 9e737d3c57
1 changed files with 9 additions and 4 deletions

View File

@ -236,6 +236,7 @@ class Encoder(Module):
self.d = [Signal(8) for _ in range(nwords)] self.d = [Signal(8) for _ in range(nwords)]
self.k = [Signal() for _ in range(nwords)] self.k = [Signal() for _ in range(nwords)]
self.output = [Signal(10) 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:]): for e1, e2 in zip(encoders, encoders[1:]):
self.comb += e2.disp_in.eq(e1.disp_out) 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 += [ self.comb += [
e.d.eq(d), encoder.d.eq(d),
e.k.eq(k) encoder.k.eq(k)
]
self.sync += [
output.eq(encoder.output),
disparity.eq(encoder.disp_out)
] ]
self.sync += output.eq(e.output)
class Decoder(Module): class Decoder(Module):