liteeth: pep8 (E261, E271)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 09:07:50 +0000 (11:07 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 09:07:50 +0000 (11:07 +0200)
12 files changed:
misoclib/com/liteeth/core/etherbone/record.py
misoclib/com/liteeth/core/ip/checksum.py
misoclib/com/liteeth/core/udp/__init__.py
misoclib/com/liteeth/example_designs/test/test_udp.py
misoclib/com/liteeth/mac/frontend/sram.py
misoclib/com/liteeth/phy/gmii_mii.py
misoclib/com/liteeth/test/model/arp.py
misoclib/com/liteeth/test/model/etherbone.py
misoclib/com/liteeth/test/model/icmp.py
misoclib/com/liteeth/test/model/ip.py
misoclib/com/liteeth/test/model/mac.py
misoclib/com/liteeth/test/model/udp.py

index 887169d8466761e53ddfc872e68a41a47c6ae37f..4171c6f34d6f0351390bd0261f34fb01b9e2017b 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 24d13ce98459b038d2a3be914b3bfd2a5ab77b50..7ad77b961f39bea06dcdbc4051beec5171bbaf66 100644 (file)
@@ -4,8 +4,8 @@ from misoclib.com.liteeth.generic import *
 
 class LiteEthIPV4Checksum(Module):
     def __init__(self, words_per_clock_cycle=1, skip_checksum=False):
-        self.reset = Signal() # XXX FIXME InsertReset generates incorrect verilog
-        self.ce = Signal()    # XXX FIXME InsertCE generates incorrect verilog
+        self.reset = Signal()  # XXX FIXME InsertReset generates incorrect verilog
+        self.ce = Signal()     # XXX FIXME InsertCE generates incorrect verilog
         self.header = Signal(ipv4_header_len*8)
         self.value = Signal(16)
         self.done = Signal()
index ec5ac2b787ee2a299a05eaadd9cba833cd480efc..f6a1dfdfc71a6044bff5ec76f2f43fd26b1940b9 100644 (file)
@@ -28,7 +28,7 @@ class LiteEthUDPTX(Module):
             packetizer.sink.src_port.eq(sink.src_port),
             packetizer.sink.dst_port.eq(sink.dst_port),
             packetizer.sink.length.eq(sink.length + udp_header_len),
-            packetizer.sink.checksum.eq(0), # Disabled (MAC CRC is enough)
+            packetizer.sink.checksum.eq(0),  # Disabled (MAC CRC is enough)
             packetizer.sink.data.eq(sink.data)
         ]
 
index 8d147292b68470e8ef948a467bb5f99657f32a3d..6e98d07dee41a638c61dcbbdfd365f93871515c7 100644 (file)
@@ -40,7 +40,7 @@ def check(p1, p2):
 def generate_packet(seed, length):
     r = []
     for i in range(length):
-        r.append(seed_to_data(seed, True)%0xff) # XXX FIXME
+        r.append(seed_to_data(seed, True)%0xff)  # XXX FIXME
         seed += 1
     return r, seed
 
@@ -66,7 +66,7 @@ def test(fpga_ip, udp_port, test_size):
         while tx_seed < test_size:
             tx_packet, tx_seed = generate_packet(tx_seed, 1024)
             tx_sock.sendto(bytes(tx_packet), (fpga_ip, udp_port))
-            time.sleep(0.001) # XXX: FIXME, Python limitation?
+            time.sleep(0.001)  # XXX: FIXME, Python limitation?
 
     receive_thread = threading.Thread(target=receive)
     receive_thread.start()
index f5f1168cc245f31578fda0d0218a6dca3fe3afdd..34ae2a827ec299e9263d2e03cc4ac216413e0cc4 100644 (file)
@@ -11,7 +11,7 @@ class LiteEthMACSRAMWriter(Module, AutoCSR):
         self.crc_error = Signal()
 
         slotbits = max(log2_int(nslots), 1)
-        lengthbits = log2_int(depth*4) # length in bytes
+        lengthbits = log2_int(depth*4)  # length in bytes
 
         self._slot = CSRStatus(slotbits)
         self._length = CSRStatus(lengthbits)
@@ -121,7 +121,7 @@ class LiteEthMACSRAMReader(Module, AutoCSR):
         self.source = source = Source(eth_phy_description(dw))
 
         slotbits = max(log2_int(nslots), 1)
-        lengthbits = log2_int(depth*4) # length in bytes
+        lengthbits = log2_int(depth*4)  # length in bytes
         self.lengthbits = lengthbits
 
         self._start = CSR()
index fdc349d2518eddfeafd479dd05d987fb29e9dcc0..10b17f79fba5594636dd721ec60181f2bbced0ec 100644 (file)
@@ -86,7 +86,7 @@ class LiteEthGMIIMIIClockCounter(Module, AutoCSR):
         counter = RenameClockDomains(Counter(32), "eth_rx")
         self.submodules += counter
         self.comb += [
-            counter.reset.eq(self._reset.storage), #slow, don't need CDC
+            counter.reset.eq(self._reset.storage),  # slow, don't need CDC
             counter.ce.eq(1),
         ]
         self.specials += MultiReg(counter.value, self._value.status)
index 22d61a1d9c85949ec95f3d4cfc7dc947936c5708..4cee649c2181877954f9f4d7d42038e0e98ace02 100644 (file)
@@ -43,7 +43,7 @@ class ARPPacket(Packet):
 
 
 class ARP(Module):
-    def  __init__(self, mac, mac_address, ip_address, debug=False):
+    def __init__(self, mac, mac_address, ip_address, debug=False):
         self.mac = mac
         self.mac_address = mac_address
         self.ip_address = ip_address
index c88dee0b534589e54806849d74d3e73bedb64bd2..fc43c2ef647217013833c8f0473ccac1c8c6f533 100644 (file)
@@ -285,7 +285,7 @@ class EtherbonePacket(Packet):
 
 
 class Etherbone(Module):
-    def  __init__(self, udp, debug=False):
+    def __init__(self, udp, debug=False):
         self.udp = udp
         self.debug = debug
         self.tx_packets = []
@@ -301,7 +301,7 @@ class Etherbone(Module):
             print_etherbone(packet)
         udp_packet = udp.UDPPacket(packet)
         udp_packet.src_port = 0x1234  # XXX
-        udp_packet.dst_port = 20000 # XXX
+        udp_packet.dst_port = 20000  # XXX
         udp_packet.length = len(packet)
         udp_packet.checksum = 0
         self.udp.send(udp_packet)
index f55836288e2a2ea07a9f282b6f1c742586633a68..bab9b334add26322bc67da26e9a9bf5b414e4d14 100644 (file)
@@ -41,7 +41,7 @@ class ICMPPacket(Packet):
 
 
 class ICMP(Module):
-    def  __init__(self, ip, ip_address, debug=False):
+    def __init__(self, ip, ip_address, debug=False):
         self.ip = ip
         self.ip_address = ip_address
         self.debug = debug
@@ -65,7 +65,7 @@ class ICMP(Module):
         ip_packet.fragment_offset = 0
         ip_packet.ttl = 0x80
         ip_packet.sender_ip = self.ip_address
-        ip_packet.target_ip = 0x12345678 # XXX
+        ip_packet.target_ip = 0x12345678  # XXX
         ip_packet.checksum = 0
         ip_packet.protocol = icmp_protocol
         self.ip.send(ip_packet)
index 825b4c083851ba6cc8c2bc478d88572c9b19000b..4fe8be4734a118277803f3cf0bf671c7689daa15 100644 (file)
@@ -67,7 +67,7 @@ class IPPacket(Packet):
 
 
 class IP(Module):
-    def  __init__(self, mac, mac_address, ip_address, debug=False, loopback=False):
+    def __init__(self, mac, mac_address, ip_address, debug=False, loopback=False):
         self.mac = mac
         self.mac_address = mac_address
         self.ip_address = ip_address
@@ -95,7 +95,7 @@ class IP(Module):
             print_ip(">>>>>>>>")
             print_ip(packet)
         mac_packet = mac.MACPacket(packet)
-        mac_packet.target_mac = 0x12345678abcd # XXX
+        mac_packet.target_mac = 0x12345678abcd  # XXX
         mac_packet.sender_mac = self.mac_address
         mac_packet.ethernet_type = ethernet_type_ip
         self.mac.send(mac_packet)
index 80b39a865432367a94d85e21dfa48c535d9e3fd8..41d41ab9c8fea71f812f4222d1e310a3f19c13d3 100644 (file)
@@ -53,7 +53,7 @@ class MACPacket(Packet):
         self.preamble_error = self.check_remove_preamble()
         self.crc_error = self.check_remove_crc()
         if self.crc_error or self.preamble_error:
-            raise ValueError # XXX handle this properly
+            raise ValueError  # XXX handle this properly
         else:
             self.decode_remove_header()
 
@@ -89,7 +89,7 @@ class MACPacket(Packet):
 
 
 class MAC(Module):
-    def  __init__(self, phy, debug=False, loopback=False):
+    def __init__(self, phy, debug=False, loopback=False):
         self.phy = phy
         self.debug = debug
         self.loopback = loopback
@@ -129,7 +129,7 @@ class MAC(Module):
                 if self.arp_callback is not None:
                     self.arp_callback(packet)
             else:
-                raise ValueError # XXX handle this properly
+                raise ValueError  # XXX handle this properly
 
 if __name__ == "__main__":
     from misoclib.com.liteeth.test.model.dumps import *
index 7a82668f057e550d9b572d6483f19c4d5f5beee3..fa61ccd6d01aac57c80e43574ced2b22ba6bf637 100644 (file)
@@ -41,7 +41,7 @@ class UDPPacket(Packet):
 
 
 class UDP(Module):
-    def  __init__(self, ip, ip_address, debug=False, loopback=False):
+    def __init__(self, ip, ip_address, debug=False, loopback=False):
         self.ip = ip
         self.ip_address = ip_address
         self.debug = debug
@@ -71,7 +71,7 @@ class UDP(Module):
         ip_packet.fragment_offset = 0
         ip_packet.ttl = 0x80
         ip_packet.sender_ip = self.ip_address
-        ip_packet.target_ip = 0x12345678 # XXX
+        ip_packet.target_ip = 0x12345678  # XXX
         ip_packet.checksum = 0
         ip_packet.protocol = udp_protocol
         self.ip.send(ip_packet)