self.submodules.crossbar = LiteSATACrossbar(self.core)
if with_bist:
self.submodules.bist = LiteSATABIST(self.crossbar, with_bist_csr)
-
transport.sink.stb.eq(sink.stb),
transport.sink.sop.eq(dwords_counter.value == 0),
- transport.sink.eop.eq((dwords_counter.value == (fis_max_dwords-1)) | sink.eop),
+ transport.sink.eop.eq((dwords_counter.value == (fis_max_dwords-1)) |
+ sink.eop),
sink.ack.eq(transport.sink.ack),
If(sink.stb & sink.ack,
insert.eq(primitives["HOLDA"]),
).Elif(~scrambler.source.stb,
insert.eq(primitives["HOLD"]),
- ).Elif(scrambler.source.stb & scrambler.source.eop & scrambler.source.ack,
+ ).Elif(scrambler.source.stb &
+ scrambler.source.eop &
+ scrambler.source.ack,
NextState("EOF")
)
)
self.submodules.tx_buffer = PacketBuffer(link_description(32), buffer_depth)
self.submodules.tx = LiteSATALinkTX(phy)
self.submodules.rx = LiteSATALinkRX(phy)
- self.submodules.rx_buffer = PacketBuffer(link_description(32), buffer_depth, almost_full=3*buffer_depth//4)
+ self.submodules.rx_buffer = PacketBuffer(link_description(32), buffer_depth,
+ almost_full=3*buffer_depth//4)
self.comb += [
Record.connect(self.tx_buffer.source, self.tx.sink),
Record.connect(self.rx.to_tx, self.tx.from_rx),
polynom = 0x04C11DB7
init = 0x52325032
check = 0x00000000
+
def __init__(self, dw=32):
self.d = Signal(self.width)
self.value = Signal(self.width)
self.comb += [
counter.ce.eq(sink.stb & link.sink.ack),
- cmd_done.eq((counter.value == cmd_len) & link.sink.stb & link.sink.ack),
+ cmd_done.eq((counter.value == cmd_len) &
+ link.sink.stb &
+ link.sink.ack),
If(cmd_send,
link.sink.stb.eq(sink.stb),
link.sink.sop.eq(counter.value == 0),
]
self.comb += \
- align_detect.eq(self.sink.stb & (self.sink.data == primitives["ALIGN"]))
+ align_detect.eq(self.sink.stb &
+ (self.sink.data == primitives["ALIGN"]))
self.sync += \
If(fsm.ongoing("SEND_ALIGN"),
If(sink.stb,
last_charisk.eq(sink.charisk),
last_data.eq(sink.data)
)
- converter = Converter(phy_description(16), phy_description(32), reverse=False)
+ converter = Converter(phy_description(16),
+ phy_description(32),
+ reverse=False)
converter = InsertReset(RenameClockDomains(converter, "sata_rx"))
self.submodules += converter
self.comb += [
self.comb += Record.connect(sink, fifo.sink)
# width convertion (32 to 16)
- converter = Converter(phy_description(32), phy_description(16), reverse=False)
+ converter = Converter(phy_description(32),
+ phy_description(16),
+ reverse=False)
converter = RenameClockDomains(converter, "sata_tx")
self.submodules += converter
self.comb += [
for data in datas:
stdin += "0x{:08x} ".format(data)
stdin += "exit"
- with subprocess.Popen("./crc", stdin=subprocess.PIPE, stdout=subprocess.PIPE) as process:
+ with subprocess.Popen("./crc",
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE) as process:
process.stdin.write(stdin.encode("ASCII"))
out, err = process.communicate()
return int(out.decode("ASCII"), 16)
def import_scrambler_datas():
- with subprocess.Popen(["./scrambler"], stdin=subprocess.PIPE, stdout=subprocess.PIPE) as process:
+ with subprocess.Popen(["./scrambler"],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE) as process:
process.stdin.write("0x10000".encode("ASCII"))
out, err = process.communicate()
return [int(e, 16) for e in out.decode("utf-8").split("\n")[:-1]]
for v in self[:-1]:
stdin += "0x{:08x} ".format(v)
stdin += "exit"
- with subprocess.Popen("./crc", stdin=subprocess.PIPE, stdout=subprocess.PIPE) as process:
+ with subprocess.Popen("./crc",
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE) as process:
process.stdin.write(stdin.encode("ASCII"))
out, err = process.communicate()
crc = int(out.decode("ASCII"), 16)
for v in self:
stdin += "0x{:08x} ".foramt(v)
stdin += "exit"
- with subprocess.Popen("./crc", stdin=subprocess.PIPE, stdout=subprocess.PIPE) as process:
+ with subprocess.Popen("./crc",
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE) as process:
process.stdin.write(stdin.encode("ASCII"))
out, err = process.communicate()
crc = int(out.decode("ASCII"), 16)
def get_c_values(self, length):
stdin = "0x{:08x}".format(length)
- with subprocess.Popen("./scrambler", stdin=subprocess.PIPE, stdout=subprocess.PIPE) as process:
+ with subprocess.Popen("./scrambler",
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE) as process:
process.stdin.write(stdin.encode("ASCII"))
out, err = process.communicate()
return [int(e, 16) for e in out.decode("ASCII").split("\n")[:-1]]