from migen.fhdl.std import * from migen.actorlib.fifo import AsyncFIFO from migen.actorlib.structuring import Converter from migen.flow.actor import Sink, Source from lib.sata.k7sataphy.std import * class K7SATAPHYRXAlign(Module): def __init__(self, dw=16): self.rxdata_i = Signal(dw) self.rxcharisk_i = Signal(dw//8) self.rxdata_o = Signal(dw) self.rxcharisk_o = Signal(dw//8) ### rxdata_r = Signal(dw) rxcharisk_r = Signal(dw//8) self.sync.sata_rx += [ rxdata_r.eq(self.rxdata_i), rxcharisk_r.eq(self.rxcharisk_i) ] cases = {} cases[1<<0] = [ self.rxdata_o.eq(rxdata_r[0:dw]), self.rxcharisk_o.eq(rxcharisk_r[0:dw//8]) ] for i in range(1, dw//8): cases[1<