liteeth: pep8 (E265)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 09:23:27 +0000 (11:23 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 09:27:01 +0000 (11:27 +0200)
35 files changed:
misoclib/com/liteeth/core/arp/__init__.py
misoclib/com/liteeth/core/etherbone/packet.py
misoclib/com/liteeth/core/etherbone/probe.py
misoclib/com/liteeth/core/etherbone/record.py
misoclib/com/liteeth/core/etherbone/wishbone.py
misoclib/com/liteeth/core/icmp/__init__.py
misoclib/com/liteeth/core/ip/__init__.py
misoclib/com/liteeth/core/ip/checksum.py
misoclib/com/liteeth/core/tty/__init__.py
misoclib/com/liteeth/core/udp/__init__.py
misoclib/com/liteeth/example_designs/test/test_la.py
misoclib/com/liteeth/example_designs/test/test_regs.py
misoclib/com/liteeth/generic/__init__.py
misoclib/com/liteeth/generic/depacketizer.py
misoclib/com/liteeth/generic/dispatcher.py
misoclib/com/liteeth/generic/packetizer.py
misoclib/com/liteeth/mac/core/crc.py
misoclib/com/liteeth/mac/core/gap.py
misoclib/com/liteeth/mac/core/last_be.py
misoclib/com/liteeth/mac/core/padding.py
misoclib/com/liteeth/mac/core/preamble.py
misoclib/com/liteeth/mac/frontend/sram.py
misoclib/com/liteeth/mac/frontend/wishbone.py
misoclib/com/liteeth/phy/gmii.py
misoclib/com/liteeth/phy/gmii_mii.py
misoclib/com/liteeth/phy/loopback.py
misoclib/com/liteeth/phy/mii.py
misoclib/com/liteeth/phy/sim.py
misoclib/com/liteeth/test/common.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 5d010a1b299757c18837997eb4644261e0f640fc..e564248bcecb12ade440110ea9b835f0c58a0211 100644 (file)
@@ -24,7 +24,9 @@ class LiteEthARPTX(Module):
     def __init__(self, mac_address, ip_address):
         self.sink = sink = Sink(_arp_table_layout)
         self.source = source = Source(eth_mac_description(8))
-        ###
+
+        # # #
+
         self.submodules.packetizer = packetizer = LiteEthARPPacketizer()
 
         counter = Counter(max=max(arp_header_len, eth_min_len))
@@ -88,7 +90,9 @@ class LiteEthARPRX(Module):
     def __init__(self, mac_address, ip_address):
         self.sink = sink = Sink(eth_mac_description(8))
         self.source = source = Source(_arp_table_layout)
-        ###
+
+        # # #
+
         self.submodules.depacketizer = depacketizer = LiteEthARPDepacketizer()
         self.comb += Record.connect(sink, depacketizer.sink)
 
@@ -139,12 +143,14 @@ class LiteEthARPRX(Module):
 class LiteEthARPTable(Module):
     def __init__(self, clk_freq, max_requests=8):
         self.sink = sink = Sink(_arp_table_layout)             # from arp_rx
-        self.source = source = Source(_arp_table_layout)     # to arp_tx
+        self.source = source = Source(_arp_table_layout)       # to arp_tx
 
         # Request/Response interface
         self.request = request = Sink(arp_table_request_layout)
         self.response = response = Source(arp_table_response_layout)
-        ###
+
+        # # #
+
         request_timeout = Timeout(clk_freq//10)
         request_counter = Counter(max=max_requests)
         request_pending = FlipFlop()
index fa8d76a30a2c6e8f3376b3755d24aede174da310..5f5155f335f99057c20da5bda445770a31ce21fb 100644 (file)
@@ -17,7 +17,9 @@ class LiteEthEtherbonePacketTX(Module):
     def __init__(self, udp_port):
         self.sink = sink = Sink(eth_etherbone_packet_user_description(32))
         self.source = source = Source(eth_udp_user_description(32))
-        ###
+
+        # # #
+
         self.submodules.packetizer = packetizer = LiteEthEtherbonePacketPacketizer()
         self.comb += [
             packetizer.sink.stb.eq(sink.stb),
@@ -68,7 +70,9 @@ class LiteEthEtherbonePacketRX(Module):
     def __init__(self):
         self.sink = sink = Sink(eth_udp_user_description(32))
         self.source = source = Source(eth_etherbone_packet_user_description(32))
-        ###
+
+        # # #
+
         self.submodules.depacketizer = depacketizer = LiteEthEtherbonePacketDepacketizer()
         self.comb += Record.connect(sink, depacketizer.sink)
 
index bc25fe37bfe6926e5709e917aa954d1e5bc9a7e5..9e9671f71b7cbb3712003767f834743cc8567f37 100644 (file)
@@ -6,7 +6,9 @@ class LiteEthEtherboneProbe(Module):
     def __init__(self):
         self.sink = sink = Sink(eth_etherbone_packet_user_description(32))
         self.source = source = Source(eth_etherbone_packet_user_description(32))
-        ###
+
+        # # #
+
         self.submodules.fsm = fsm = FSM(reset_state="IDLE")
         fsm.act("IDLE",
             sink.ack.eq(1),
index 4171c6f34d6f0351390bd0261f34fb01b9e2017b..e0cfc7feb4be33f819d398d7f232b2f325bb3572 100644 (file)
@@ -26,7 +26,9 @@ class LiteEthEtherboneRecordReceiver(Module):
     def __init__(self, buffer_depth=256):
         self.sink = sink = Sink(eth_etherbone_record_description(32))
         self.source = source = Source(eth_etherbone_mmap_description(32))
-        ###
+
+        # # #
+
         fifo = SyncFIFO(eth_etherbone_record_description(32), buffer_depth, buffered=True)
         self.submodules += fifo
         self.comb += Record.connect(sink, fifo.sink)
@@ -98,7 +100,9 @@ class LiteEthEtherboneRecordSender(Module):
     def __init__(self, buffer_depth=256):
         self.sink = sink = Sink(eth_etherbone_mmap_description(32))
         self.source = source = Source(eth_etherbone_record_description(32))
-        ###
+
+        # # #
+
         pbuffer = PacketBuffer(eth_etherbone_mmap_description(32), buffer_depth)
         self.submodules += pbuffer
         self.comb += Record.connect(sink, pbuffer.sink)
@@ -148,7 +152,8 @@ class LiteEthEtherboneRecord(Module):
     def __init__(self, endianness="big"):
         self.sink = sink = Sink(eth_etherbone_packet_user_description(32))
         self.source = source = Sink(eth_etherbone_packet_user_description(32))
-        ###
+
+        # # #
 
         # receive record, decode it and generate mmap stream
         self.submodules.depacketizer = depacketizer = LiteEthEtherboneRecordDepacketizer()
index d6d2b375ec945e2cbb9cd859a949496f0b46a23e..fbaf06304b4e4d551083ee4a328a4b87cd426027 100644 (file)
@@ -8,7 +8,8 @@ class LiteEthEtherboneWishboneMaster(Module):
         self.sink = sink = Sink(eth_etherbone_mmap_description(32))
         self.source = source = Source(eth_etherbone_mmap_description(32))
         self.bus = bus = wishbone.Interface()
-        ###s
+
+        # # #
 
         self.submodules.data = data = FlipFlop(32)
         self.comb += data.d.eq(bus.dat_r)
index 720a377b83713328d8f95e251adf07842cb3e89d..379a2086ae18f763472535a2cb3b131f22059ad8 100644 (file)
@@ -17,7 +17,9 @@ class LiteEthICMPTX(Module):
     def __init__(self, ip_address):
         self.sink = sink = Sink(eth_icmp_user_description(8))
         self.source = source = Source(eth_ipv4_user_description(8))
-        ###
+
+        # # #
+
         self.submodules.packetizer = packetizer = LiteEthICMPPacketizer()
         self.comb += [
             packetizer.sink.stb.eq(sink.stb),
@@ -63,7 +65,9 @@ class LiteEthICMPRX(Module):
     def __init__(self, ip_address):
         self.sink = sink = Sink(eth_ipv4_user_description(8))
         self.source = source = Source(eth_icmp_user_description(8))
-        ###
+
+        # # #
+
         self.submodules.depacketizer = depacketizer = LiteEthICMPDepacketizer()
         self.comb += Record.connect(sink, depacketizer.sink)
 
@@ -118,7 +122,9 @@ class LiteEthICMPEcho(Module):
     def __init__(self):
         self.sink = sink = Sink(eth_icmp_user_description(8))
         self.source = source = Source(eth_icmp_user_description(8))
-        ###
+
+        # # #
+
         self.submodules.buffer = PacketBuffer(eth_icmp_user_description(8), 128, 2)
         self.comb += [
             Record.connect(sink, self.buffer.sink),
index 553f131c1e671ca11c284beb4a2df3257debed5e..baa4d6565be12d49cdda7f73ba164f614db7da81 100644 (file)
@@ -20,7 +20,9 @@ class LiteEthIPTX(Module):
         self.sink = sink = Sink(eth_ipv4_user_description(8))
         self.source = source = Source(eth_mac_description(8))
         self.target_unreachable = Signal()
-        ###
+
+        # # #
+
         self.submodules.checksum = checksum = LiteEthIPV4Checksum(skip_checksum=True)
         self.comb += [
             checksum.ce.eq(sink.stb & sink.sop),
@@ -108,7 +110,9 @@ class LiteEthIPRX(Module):
     def __init__(self, mac_address, ip_address):
         self.sink = sink = Sink(eth_mac_description(8))
         self.source = source = Source(eth_ipv4_user_description(8))
-        ###
+
+        # # #
+
         self.submodules.depacketizer = depacketizer = LiteEthIPV4Depacketizer()
         self.comb += Record.connect(sink, depacketizer.sink)
 
index 7ad77b961f39bea06dcdbc4051beec5171bbaf66..dce3e014f1bd55333688f9c9368b93a8e16c02f7 100644 (file)
@@ -9,7 +9,9 @@ class LiteEthIPV4Checksum(Module):
         self.header = Signal(ipv4_header_len*8)
         self.value = Signal(16)
         self.done = Signal()
-        ###
+
+        # # #
+
         s = Signal(17)
         r = Signal(17)
         n_cycles = 0
index 4a0917b3d2c34a81e734c8143ac2ed6cff720fab..d88d72730e0af8bd2c1e5ec51db2cc25403782a1 100644 (file)
@@ -6,7 +6,9 @@ class LiteEthTTYTX(Module):
     def __init__(self, ip_address, udp_port, fifo_depth=None):
         self.sink = sink = Sink(eth_tty_description(8))
         self.source = source = Source(eth_udp_user_description(8))
-        ###
+
+        # # #
+
         if fifo_depth is None:
             self.comb += [
                 source.stb.eq(sink.stb),
@@ -64,7 +66,9 @@ class LiteEthTTYRX(Module):
     def __init__(self, ip_address, udp_port, fifo_depth=None):
         self.sink = sink = Sink(eth_udp_user_description(8))
         self.source = source = Source(eth_tty_description(8))
-        ###
+
+        # # #
+
         valid = Signal()
         self.comb += valid.eq(
             (sink.ip_address == ip_address) &
index f6a1dfdfc71a6044bff5ec76f2f43fd26b1940b9..60122ea64390020fa3bd97e132e982b2257a6068 100644 (file)
@@ -18,7 +18,9 @@ class LiteEthUDPTX(Module):
     def __init__(self, ip_address):
         self.sink = sink = Sink(eth_udp_user_description(8))
         self.source = source = Source(eth_ipv4_user_description(8))
-        ###
+
+        # # #
+
         self.submodules.packetizer = packetizer = LiteEthUDPPacketizer()
         self.comb += [
             packetizer.sink.stb.eq(sink.stb),
@@ -64,7 +66,9 @@ class LiteEthUDPRX(Module):
     def __init__(self, ip_address):
         self.sink = sink = Sink(eth_ipv4_user_description(8))
         self.source = source = Source(eth_udp_user_description(8))
-        ###
+
+        # # #
+
         self.submodules.depacketizer = depacketizer = LiteEthUDPDepacketizer()
         self.comb += Record.connect(sink, depacketizer.sink)
 
index 1a4dc16995df4aae12c0b54d6a897a46257275c5..674cbca15ef8420c0cf27bd3da7631ec38f474d2 100644 (file)
@@ -7,8 +7,7 @@ def main(wb):
 
     wb.open()
     regs = wb.regs
-    ###
-
+    # # #
     conditions = {}
     la.configure_term(port=0, cond=conditions)
     la.configure_sum("term")
@@ -20,6 +19,5 @@ def main(wb):
 
     la.upload()
     la.save("dump.vcd")
-
-    ###
+    # # #
     wb.close()
index 0050fcaa98ba62044bc1d85753e9b0cd6facbbf5..44f6700a0eae926e7a2cd7d14708fc97ccba16bc 100644 (file)
@@ -1,12 +1,12 @@
 def main(wb):
     wb.open()
     regs = wb.regs
-    ###
+    # # #
     print("sysid     : 0x{:04x}".format(regs.identifier_sysid.read()))
     print("revision  : 0x{:04x}".format(regs.identifier_revision.read()))
     print("frequency : {}MHz".format(int(regs.identifier_frequency.read()/1000000)))
     SRAM_BASE = 0x02000000
     wb.write(SRAM_BASE, [i for i in range(64)])
     print(wb.read(SRAM_BASE, 64))
-    ###
+    # # #
     wb.close()
index 1c5498280f31c9fc0c01869f4b0f08c96b28b3c8..db1aea0fc95ee189f804891de00ab0872288550a 100644 (file)
@@ -68,7 +68,8 @@ class PacketBuffer(Module):
         self.sink = sink = Sink(description)
         self.source = source = Source(description)
 
-        ###
+        # # #
+
         sink_status = EndpointPacketStatus(self.sink)
         source_status = EndpointPacketStatus(self.source)
         self.submodules += sink_status, source_status
index 49d1cf80ec17f21be4f218b804724004fc7d3974..85dec05b3b16edda09e7ded430d95061385abdb1 100644 (file)
@@ -16,7 +16,9 @@ class LiteEthDepacketizer(Module):
         self.sink = sink = Sink(sink_description)
         self.source = source = Source(source_description)
         self.header = Signal(header_length*8)
-        ###
+
+        # # #
+
         dw = flen(sink.data)
 
         header_words = (header_length*8)//dw
index 3f88cff001966187372130eff2a89018fb5be3a5..c11a41ac83c1f678b61cb3db99b8661026aa6608 100644 (file)
@@ -14,7 +14,9 @@ class Dispatcher(Module):
                 self.sel = Signal(len(sinks))
             else:
                 self.sel = Signal(max=len(sinks))
-            ###
+
+            # # #
+
             sop = Signal()
             self.comb += sop.eq(source.stb & source.sop)
             sel = Signal(flen(self.sel))
index 8ad2bf151b3461d7172359dc84941fa090726abf..2088486a79c4e9a0bd7ea2d4741f751c57b7d30f 100644 (file)
@@ -16,7 +16,9 @@ class LiteEthPacketizer(Module):
         self.sink = sink = Sink(sink_description)
         self.source = source = Source(source_description)
         self.header = Signal(header_length*8)
-        ###
+
+        # # #
+
         dw = flen(self.sink.data)
 
         header_reg = Signal(header_length*8)
index 5f0996abc7418c74fb2f91c9e462091dc9bf5b43..d35497912a7f043a50ea46763a6141317ef64e08 100644 (file)
@@ -31,7 +31,7 @@ class LiteEthMACCRCEngine(Module):
         self.last = Signal(width)
         self.next = Signal(width)
 
-        ###
+        # # #
 
         def _optimize_eq(l):
             """
@@ -101,7 +101,7 @@ class LiteEthMACCRC32(Module):
         self.value = Signal(self.width)
         self.error = Signal()
 
-        ###
+        # # #
 
         self.submodules.engine = LiteEthMACCRCEngine(data_width, self.width, self.polynom)
         reg = Signal(self.width, reset=self.init)
@@ -137,7 +137,7 @@ class LiteEthMACCRCInserter(Module):
         self.source = source = Source(description)
         self.busy = Signal()
 
-        ###
+        # # #
 
         dw = flen(sink.data)
         crc = crc_class(dw)
@@ -218,7 +218,7 @@ class LiteEthMACCRCChecker(Module):
         self.source = source = Source(description)
         self.busy = Signal()
 
-        ###
+        # # #
 
         dw = flen(sink.data)
         crc = crc_class(dw)
index 07620113a6571e4da0b1a50eac1d40e07b57822b..d4caf3c64b799b844672dfeb66af48e193f1843e 100644 (file)
@@ -6,7 +6,9 @@ class LiteEthMACGap(Module):
     def __init__(self, dw, ack_on_gap=False):
         self.sink = sink = Sink(eth_phy_description(dw))
         self.source = source = Source(eth_phy_description(dw))
-        ###
+
+        # # #
+
         gap = math.ceil(eth_interpacket_gap/(dw//8))
         self.submodules.counter = counter = Counter(max=gap)
 
index 200c2cd208f992a38e4657fada5526cf52a92685..29844f386e8bc2371fa338f011af0469c2b4a193 100644 (file)
@@ -6,7 +6,9 @@ class LiteEthMACTXLastBE(Module):
     def __init__(self, dw):
         self.sink = sink = Sink(eth_phy_description(dw))
         self.source = source = Source(eth_phy_description(dw))
-        ###
+
+        # # #
+
         ongoing = Signal()
         self.sync += \
             If(sink.stb & sink.ack,
@@ -29,7 +31,9 @@ class LiteEthMACRXLastBE(Module):
     def __init__(self, dw):
         self.sink = sink = Sink(eth_phy_description(dw))
         self.source = source = Source(eth_phy_description(dw))
-        ###
+
+        # # #
+
         self.comb += [
             source.stb.eq(sink.stb),
             source.sop.eq(sink.sop),
index 54003288fe91e1c110d2501de331a281c23698a4..bb41cd6ae137c31ba17c2200caac07c8e758bd4e 100644 (file)
@@ -6,7 +6,9 @@ class LiteEthMACPaddingInserter(Module):
     def __init__(self, dw, packet_min_length):
         self.sink = sink = Sink(eth_phy_description(dw))
         self.source = source = Source(eth_phy_description(dw))
-        ###
+
+        # # #
+
         packet_min_data = math.ceil(packet_min_length/(dw/8))
 
         self.submodules.counter = counter = Counter(max=eth_mtu)
@@ -42,7 +44,9 @@ class LiteEthMACPaddingChecker(Module):
     def __init__(self, dw, packet_min_length):
         self.sink = sink = Sink(eth_phy_description(dw))
         self.source = source = Source(eth_phy_description(dw))
-        ###
+
+        # # #
+
         # XXX see if we should drop the packet when
         # payload size < minimum ethernet payload size
         self.comb += Record.connect(sink, source)
index f82f0787a569e80e61c112194af5fb1e5de4e66b..2854fab9cfcedd2c1eb91bcffcf7d8950aa1fed2 100644 (file)
@@ -7,7 +7,7 @@ class LiteEthMACPreambleInserter(Module):
         self.sink = Sink(eth_phy_description(dw))
         self.source = Source(eth_phy_description(dw))
 
-        ###
+        # # #
 
         preamble = Signal(64, reset=eth_preamble)
         cnt_max = (64//dw)-1
@@ -57,7 +57,7 @@ class LiteEthMACPreambleChecker(Module):
         self.sink = Sink(eth_phy_description(dw))
         self.source = Source(eth_phy_description(dw))
 
-        ###
+        # # #
 
         preamble = Signal(64, reset=eth_preamble)
         cnt_max = (64//dw) - 1
index 34ae2a827ec299e9263d2e03cc4ac216413e0cc4..3a6a8c29cd96d645f06d90c8f88e847288f35732 100644 (file)
@@ -20,7 +20,7 @@ class LiteEthMACSRAMWriter(Module, AutoCSR):
         self.ev.available = EventSourceLevel()
         self.ev.finalize()
 
-        ###
+        # # #
 
         # packet dropped if no slot available
         sink.ack.reset = 1
@@ -133,7 +133,7 @@ class LiteEthMACSRAMReader(Module, AutoCSR):
         self.ev.done = EventSourcePulse()
         self.ev.finalize()
 
-        ###
+        # # #
 
         # command fifo
         fifo = SyncFIFO([("slot", slotbits), ("length", lengthbits)], nslots)
index 053478068f3d5ef44f5c638cccc5684a25dc8661..5b9d55633c57d2fdda6c0cc2d66cb69eb9343319 100644 (file)
@@ -11,7 +11,9 @@ class LiteEthMACWishboneInterface(Module, AutoCSR):
         self.sink = Sink(eth_phy_description(dw))
         self.source = Source(eth_phy_description(dw))
         self.bus = wishbone.Interface()
-        ###
+
+        # # #
+
         # storage in SRAM
         sram_depth = buffer_depth//(dw//8)
         self.submodules.sram = sram.LiteEthMACSRAM(dw, sram_depth, nrxslots, ntxslots)
index a39453b48084399007f5a24024ef7ab1a5797d25..c181a3808f77474d0412044a531e74ab6859ad88 100644 (file)
@@ -7,7 +7,9 @@ from misoclib.com.liteeth.generic import *
 class LiteEthPHYGMIITX(Module):
     def __init__(self, pads, pads_register):
         self.sink = sink = Sink(eth_phy_description(8))
-        ###
+
+        # # #
+
         if hasattr(pads, "tx_er"):
             self.sync += pads.tx_er.eq(0)
         pads_eq = [
@@ -24,7 +26,9 @@ class LiteEthPHYGMIITX(Module):
 class LiteEthPHYGMIIRX(Module):
     def __init__(self, pads):
         self.source = source = Source(eth_phy_description(8))
-        ###
+
+        # # #
+
         dv_d = Signal()
         self.sync += dv_d.eq(pads.dv)
 
@@ -45,7 +49,9 @@ class LiteEthPHYGMIIRX(Module):
 class LiteEthPHYGMIICRG(Module, AutoCSR):
     def __init__(self, clock_pads, pads, with_hw_init_reset, mii_mode=0):
         self._reset = CSRStorage()
-        ###
+
+        # # #
+
         self.clock_domains.cd_eth_rx = ClockDomain()
         self.clock_domains.cd_eth_tx = ClockDomain()
 
index 10b17f79fba5594636dd721ec60181f2bbced0ec..c147f56fbcc525f29d6033bff4e03379c130263b 100644 (file)
@@ -21,7 +21,9 @@ rx_pads_layout = [("rx_er", 1), ("dv", 1), ("rx_data", 8)]
 class LiteEthPHYGMIIMIITX(Module):
     def __init__(self, pads, mode):
         self.sink = sink = Sink(eth_phy_description(8))
-        ###
+
+        # # #
+
         gmii_tx_pads = Record(tx_pads_layout)
         gmii_tx = LiteEthPHYGMIITX(gmii_tx_pads, pads_register=False)
         self.submodules += gmii_tx
@@ -55,7 +57,9 @@ class LiteEthPHYGMIIMIITX(Module):
 class LiteEthPHYGMIIMIIRX(Module):
     def __init__(self, pads, mode):
         self.source = source = Source(eth_phy_description(8))
-        ###
+
+        # # #
+
         pads_d = Record(rx_pads_layout)
         self.sync += [
             pads_d.dv.eq(pads.dv),
@@ -82,7 +86,9 @@ class LiteEthGMIIMIIClockCounter(Module, AutoCSR):
     def __init__(self):
         self._reset = CSRStorage()
         self._value = CSRStatus(32)
-        ###
+
+        # # #
+
         counter = RenameClockDomains(Counter(32), "eth_rx")
         self.submodules += counter
         self.comb += [
index aa046224c9e5e7f25d2febe613383745cbb518be..1d214008913677fc45ac686768e1a5ec6a8b0e8b 100644 (file)
@@ -5,7 +5,9 @@ from misoclib.com.liteeth.generic import *
 class LiteEthPHYLoopbackCRG(Module, AutoCSR):
     def __init__(self):
         self._reset = CSRStorage()
-        ###
+
+        # # #
+
         self.clock_domains.cd_eth_rx = ClockDomain()
         self.clock_domains.cd_eth_tx = ClockDomain()
         self.comb += [
index 8c5659f210dcdd6a62ae4fa23378f67ac1f94803..52ac0d8b5c592ad88ba3c0ef82e2992e50f86e73 100644 (file)
@@ -10,7 +10,9 @@ def converter_description(dw):
 class LiteEthPHYMIITX(Module):
     def __init__(self, pads, pads_register=True):
         self.sink = sink = Sink(eth_phy_description(8))
-        ###
+
+        # # #
+
         if hasattr(pads, "tx_er"):
             self.sync += pads.tx_er.eq(0)
         converter = Converter(converter_description(8), converter_description(4))
@@ -34,7 +36,9 @@ class LiteEthPHYMIITX(Module):
 class LiteEthPHYMIIRX(Module):
     def __init__(self, pads):
         self.source = source = Source(eth_phy_description(8))
-        ###
+
+        # # #
+
         sop = FlipFlop(reset=1)
         self.submodules += sop
 
@@ -59,7 +63,9 @@ class LiteEthPHYMIIRX(Module):
 class LiteEthPHYMIICRG(Module, AutoCSR):
     def __init__(self, clock_pads, pads, with_hw_init_reset):
         self._reset = CSRStorage()
-        ###
+
+        # # #
+
         if hasattr(clock_pads, "phy"):
             self.sync.base50 += clock_pads.phy.eq(~clock_pads.phy)
 
index 3c8268ffddfb99cc10804ea17094be62caf58360..d4067b3ee8b1aa11a4a28420dae306232e0b23e1 100644 (file)
@@ -8,7 +8,7 @@ class LiteEthPHYSimCRG(Module, AutoCSR):
     def __init__(self):
         self._reset = CSRStorage()
 
-        ###
+        # # #
 
         self.clock_domains.cd_eth_rx = ClockDomain()
         self.clock_domains.cd_eth_tx = ClockDomain()
index 69657574fa561ba3615b3dd96059f4f94a56a3b7..4f72b6fa1c2e4593960b488589ba06aed99429f1 100644 (file)
@@ -86,7 +86,9 @@ class PacketStreamer(Module):
     def __init__(self, description, last_be=None):
         self.source = Source(description)
         self.last_be = last_be
-        ###
+
+        # # #
+
         self.packets = []
         self.packet = Packet()
         self.packet.done = True
@@ -130,7 +132,9 @@ class PacketStreamer(Module):
 class PacketLogger(Module):
     def __init__(self, description):
         self.sink = Sink(description)
-        ###
+
+        # # #
+
         self.packet = Packet()
 
     def receive(self):
index 4cee649c2181877954f9f4d7d42038e0e98ace02..88f39b9ebee6e03b93061af3bcfb7dae58128164 100644 (file)
@@ -130,12 +130,12 @@ if __name__ == "__main__":
     packet = ARPPacket(packet)
     # check decoding
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_request_infos)
     # check encoding
     packet.encode()
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_request_infos)
 
     # ARP Reply
@@ -144,12 +144,12 @@ if __name__ == "__main__":
     packet = ARPPacket(packet)
     # check decoding
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_reply_infos)
     # check encoding
     packet.encode()
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_reply_infos)
 
     print("arp errors " + str(errors))
index fc43c2ef647217013833c8f0473ccac1c8c6f533..1ad51b2c5d4a74a6d0e07a0577c282c3699f3ae2 100644 (file)
@@ -349,9 +349,9 @@ if __name__ == "__main__":
     packet.nr = 0
     packet.pr = 0
     packet.pf = 0
-    #print(packet)
+    # print(packet)
     packet.encode()
-    #print(packet)
+    # print(packet)
 
     # Send packet over UDP to check against Wireshark dissector
     import socket
index bab9b334add26322bc67da26e9a9bf5b414e4d14..e293101f7219530f6aab0cc12460a609f4aa16b9 100644 (file)
@@ -89,17 +89,17 @@ if __name__ == "__main__":
     # ICMP packet
     packet = MACPacket(ping_request)
     packet.decode_remove_header()
-    #print(packet)
+    # print(packet)
     packet = IPPacket(packet)
     packet.decode()
-    #print(packet)
+    # print(packet)
     packet = ICMPPacket(packet)
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, ping_request_infos)
     packet.encode()
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, ping_request_infos)
 
     print("icmp errors " + str(errors))
index 4fe8be4734a118277803f3cf0bf671c7689daa15..802815a1bdb79ec3f9ce6a66a5c94366a09e48ff 100644 (file)
@@ -135,19 +135,19 @@ if __name__ == "__main__":
     # UDP packet
     packet = MACPacket(udp)
     packet.decode_remove_header()
-    #print(packet)
+    # print(packet)
     packet = IPPacket(packet)
     # check decoding
     errors += not packet.check_checksum()
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, {})
     # check encoding
     packet.encode()
     packet.insert_checksum()
     errors += not packet.check_checksum()
     packet.decode()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, {})
 
     print("ip errors " + str(errors))
index 41d41ab9c8fea71f812f4222d1e310a3f19c13d3..f61502d4dc3f3a634cb96f2c816f66b3f4a34e53 100644 (file)
@@ -136,20 +136,20 @@ if __name__ == "__main__":
     errors = 0
     packet = MACPacket(arp_request)
     packet.decode_remove_header()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_request_infos)
     packet.encode_header()
     packet.decode_remove_header()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_request_infos)
 
-    #print(packet)
+    # print(packet)
     packet = MACPacket(arp_reply)
     packet.decode_remove_header()
     errors += verify_packet(packet, arp_reply_infos)
     packet.encode_header()
     packet.decode_remove_header()
-    #print(packet)
+    # print(packet)
     errors += verify_packet(packet, arp_reply_infos)
 
     print("mac errors " + str(errors))
index fa61ccd6d01aac57c80e43574ced2b22ba6bf637..22fecb90815f2bed4d67ef5dc954d1cdd3b91897 100644 (file)
@@ -100,19 +100,19 @@ if __name__ == "__main__":
     # UDP packet
     packet = MACPacket(udp)
     packet.decode_remove_header()
-    #print(packet)
+    # print(packet)
     packet = IPPacket(packet)
     packet.decode()
-    #print(packet)
+    # print(packet)
     packet = UDPPacket(packet)
     packet.decode()
-    #print(packet)
+    # print(packet)
     if packet.length != (len(packet)+udp_header_len):
         errors += 1
     errors += verify_packet(packet, udp_infos)
     packet.encode()
     packet.decode()
-    #print(packet)
+    # print(packet)
     if packet.length != (len(packet)+udp_header_len):
         errors += 1
     errors += verify_packet(packet, udp_infos)