liteeth: pep8 (E225)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 08:56:18 +0000 (10:56 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 08:56:18 +0000 (10:56 +0200)
misoclib/com/liteeth/core/etherbone/record.py
misoclib/com/liteeth/core/udp/crossbar.py
misoclib/com/liteeth/example_designs/test/test_udp.py
misoclib/com/liteeth/mac/core/preamble.py
misoclib/com/liteeth/phy/gmii_mii.py
misoclib/com/liteeth/test/common.py
misoclib/com/liteeth/test/etherbone_tb.py
misoclib/com/liteeth/test/mac_core_tb.py
misoclib/com/liteeth/test/mac_wishbone_tb.py
misoclib/com/liteeth/test/udp_tb.py

index 90d98a50e7a86f6597571082cdc5ef3d7f2b4645..887169d8466761e53ddfc872e68a41a47c6ae37f 100644 (file)
@@ -174,7 +174,7 @@ class LiteEthEtherboneRecord(Module):
         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":
index 1ea2d0375ce65b797adec2ed659417da5ced621e..1fb31d7a3accb5951f25d06884bcb9a424e114d4 100644 (file)
@@ -13,7 +13,7 @@ class LiteEthUDPMasterPort:
 
 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))
 
index 6b28974dfd354e039f6a8fc28a09587cb7523d33..8d147292b68470e8ef948a467bb5f99657f32a3d 100644 (file)
@@ -26,7 +26,7 @@ def check(p1, p2):
         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))
@@ -59,7 +59,7 @@ def test(fpga_ip, udp_port, test_size):
                 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
index 3394e0e818bd10e3636dc94d7285526dabab0c89..f82f0787a569e80e61c112194af5fb1e5de4e66b 100644 (file)
@@ -34,7 +34,7 @@ class LiteEthMACPreambleInserter(Module):
         )
         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"))
index c207c8b1a56331cab7eb96fe281a3a87750b9fc2..fdc349d2518eddfeafd479dd05d987fb29e9dcc0 100644 (file)
@@ -33,7 +33,7 @@ class LiteEthPHYGMIIMIITX(Module):
         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),
@@ -42,7 +42,7 @@ class LiteEthPHYGMIIMIITX(Module):
         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(
@@ -71,7 +71,7 @@ class LiteEthPHYGMIIMIIRX(Module):
         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)
@@ -98,7 +98,7 @@ class LiteEthPHYGMIIMII(Module, AutoCSR):
         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")
index b1fd494b1dd327a148cdc546d602b312e3560083..69657574fa561ba3615b3dd96059f4f94a56a3b7 100644 (file)
@@ -59,7 +59,7 @@ def check(p1, p2):
         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))
index 0bdc65f9fb156bff571a3a06a5e0419fbcca6db5..1a65c8e09614f847e3609654677abddf0569797c 100644 (file)
@@ -111,7 +111,7 @@ class TB(Module):
 
                 # 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
index b49cbc1aa7c164243c13009fcba5042a82769059..d836fe669d7572e1caf192f555d1518c415f112e 100644 (file)
@@ -57,7 +57,7 @@ class TB(Module):
 
             # 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)
index f0e0f172cc0bfbc4ca124cd87ab8c42cb63ced23..424e3ba4cf7b075ec3213ac22a19058e897cf987 100644 (file)
@@ -143,7 +143,7 @@ class TB(Module):
 
                 # 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)
index 00e1c7891f8e8fbc1d447e8cbfca0259c93c3243..7130eb1081a19acb28b0d191312cd44c1f066085 100644 (file)
@@ -62,7 +62,7 @@ class TB(Module):
 
             # 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__":