# Pastebin xoImrr0n if hasattr(pads, "dq"): dq = TSTriple(spi_width) self.specials.dq = dq.get_tristate(pads.dq) else: dq = Record([("o", 4), ("i", 4), ("oe", 1)]) self.comb += [ dq_o.eq(dq.o), dq.i.eq(dq_i), dq_oe.eq(dq.oe) ]