self.comb += [
Record.connect(sender.source, packetizer.sink),
Record.connect(packetizer.source, source),
- source.length.eq(sender.source.wcount*4 + 4 +etherbone_record_header_len), # XXX improve this
+ source.length.eq(sender.source.wcount*4 + 4 + etherbone_record_header_len), # XXX improve this
source.ip_address.eq(last_ip_address)
]
if endianness is "big":
class LiteEthUDPSlavePort:
def __init__(self, dw):
- self.dw =dw
+ self.dw = dw
self.sink = Sink(eth_udp_user_description(dw))
self.source = Source(eth_udp_user_description(dw))
else:
ref, res = p2, p1
shift = 0
- while((ref[0] != res[0]) and (len(res)>1)):
+ while((ref[0] != res[0]) and (len(res) > 1)):
res.pop(0)
shift += 1
length = min(len(ref), len(res))
rx_packet.append(int(byte))
rx_reference_packet, rx_seed = generate_packet(rx_seed, 1024)
s, l, e = check(rx_reference_packet, rx_packet)
- print("shift "+ str(s) + " / length " + str(l) + " / errors " + str(e))
+ print("shift " + str(s) + " / length " + str(l) + " / errors " + str(e))
def send():
tx_seed = 0
)
fsm.act("INSERT",
self.source.stb.eq(1),
- self.source.sop.eq(cnt==0),
+ self.source.sop.eq(cnt == 0),
chooser(preamble, cnt, self.source.data),
If(cnt == cnt_max,
If(self.source.ack, NextState("COPY"))
demux = Demultiplexer(eth_phy_description(8), 2)
self.submodules += demux
self.comb += [
- demux.sel.eq(mode==modes["MII"]),
+ demux.sel.eq(mode == modes["MII"]),
Record.connect(sink, demux.sink),
Record.connect(demux.source0, gmii_tx.sink),
Record.connect(demux.source1, mii_tx.sink),
if hasattr(pads, "tx_er"):
self.comb += pads.tx_er.eq(0)
self.sync += [
- If(mode==modes["MII"],
+ If(mode == modes["MII"],
pads.tx_en.eq(mii_tx_pads.tx_en),
pads.tx_data.eq(mii_tx_pads.tx_data),
).Else(
mux = Multiplexer(eth_phy_description(8), 2)
self.submodules += mux
self.comb += [
- mux.sel.eq(mode==modes["MII"]),
+ mux.sel.eq(mode == modes["MII"]),
Record.connect(gmii_rx.source, mux.sink0),
Record.connect(mii_rx.source, mux.sink1),
Record.connect(mux.source, source)
self._mode = CSRStorage()
mode = self._mode.storage
# Note: we can use GMII CRG since it also handles tx clock pad used for MII
- self.submodules.crg = LiteEthPHYGMIICRG(clock_pads, pads, with_hw_init_reset, mode==modes["MII"])
+ self.submodules.crg = LiteEthPHYGMIICRG(clock_pads, pads, with_hw_init_reset, mode == modes["MII"])
self.submodules.clock_counter = LiteEthGMIIMIIClockCounter()
self.submodules.tx = RenameClockDomains(LiteEthPHYGMIIMIITX(pads, mode), "eth_tx")
self.submodules.rx = RenameClockDomains(LiteEthPHYGMIIMIIRX(pads, mode), "eth_rx")
else:
ref, res = p2, p1
shift = 0
- while((ref[0] != res[0]) and (len(res)>1)):
+ while((ref[0] != res[0]) and (len(res) > 1)):
res.pop(0)
shift += 1
length = min(len(ref), len(res))
# check results
s, l, e = check(writes_datas, loopback_writes_datas)
- print("shift "+ str(s) + " / length " + str(l) + " / errors " + str(e))
+ print("shift " + str(s) + " / length " + str(l) + " / errors " + str(e))
if __name__ == "__main__":
run_simulation(TB(), ncycles=4096, vcd_name="my.vcd", keep_files=True)
\ No newline at end of file
# check results
s, l, e = check(packet, self.logger.packet)
- print("shift "+ str(s) + " / length " + str(l) + " / errors " + str(e))
+ print("shift " + str(s) + " / length " + str(l) + " / errors " + str(e))
if __name__ == "__main__":
run_simulation(TB(), ncycles=4000, vcd_name="my.vcd", keep_files=True)
# check results
s, l, e = check(tx_payload[:length], rx_payload[:min(length, len(rx_payload))])
- print("shift "+ str(s) + " / length " + str(l) + " / errors " + str(e))
+ print("shift " + str(s) + " / length " + str(l) + " / errors " + str(e))
if __name__ == "__main__":
run_simulation(TB(), ncycles=3000, vcd_name="my.vcd", keep_files=True)
# check results
s, l, e = check(packet, self.logger.packet)
- print("shift "+ str(s) + " / length " + str(l) + " / errors " + str(e))
+ print("shift " + str(s) + " / length " + str(l) + " / errors " + str(e))
if __name__ == "__main__":