litesata: pep8 (E265)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 13:55:22 +0000 (15:55 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 13 Apr 2015 13:58:58 +0000 (15:58 +0200)
17 files changed:
misoclib/mem/litesata/common.py
misoclib/mem/litesata/core/command/__init__.py
misoclib/mem/litesata/core/link/__init__.py
misoclib/mem/litesata/core/link/cont.py
misoclib/mem/litesata/core/link/crc.py
misoclib/mem/litesata/core/link/scrambler.py
misoclib/mem/litesata/core/transport/__init__.py
misoclib/mem/litesata/example_designs/test/bist.py
misoclib/mem/litesata/example_designs/test/test_la.py
misoclib/mem/litesata/example_designs/test/test_regs.py
misoclib/mem/litesata/frontend/bist.py
misoclib/mem/litesata/phy/ctrl.py
misoclib/mem/litesata/phy/datapath.py
misoclib/mem/litesata/phy/k7/trx.py
misoclib/mem/litesata/test/common.py
misoclib/mem/litesata/test/cont_tb.py
misoclib/mem/litesata/test/hdd.py

index 92e59ca39e42ac6f9312e91fbc1c30ba92ed9a88..bb4aa5331488db9c6f9038256c12170f57e93fef 100644 (file)
@@ -321,7 +321,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 81ecc31e6f29717bf97e4704163a206d6828d4bf..3af25fa45aa28e72d9438b22f386dabce21bc6d8 100644 (file)
@@ -19,7 +19,7 @@ class LiteSATACommandTX(Module):
         self.to_rx = to_rx = Source(tx_to_rx)
         self.from_rx = from_rx = Sink(rx_to_tx)
 
-        ###
+        # # #
 
         self.comb += [
             transport.sink.pm_port.eq(0),
@@ -124,7 +124,7 @@ class LiteSATACommandRX(Module):
         self.to_tx = to_tx = Source(rx_to_tx)
         self.from_tx = from_tx = Sink(tx_to_rx)
 
-        ###
+        # # #
 
         def test_type(name):
             return transport.source.type == fis_types[name]
index 94fea63d945950df957138c829cf7bfdc8d66135..e8a8ca5e56ccd95977467776d6c166ab9fbb083d 100644 (file)
@@ -15,7 +15,7 @@ class LiteSATALinkTX(Module):
         self.sink = Sink(link_description(32))
         self.from_rx = Sink(from_rx)
 
-        ###
+        # # #
 
         self.fsm = fsm = FSM(reset_state="IDLE")
         self.submodules += fsm
@@ -117,7 +117,7 @@ class LiteSATALinkRX(Module):
         self.hold = Signal()
         self.to_tx = Source(from_rx)
 
-        ###
+        # # #
 
         self.fsm = fsm = FSM(reset_state="IDLE")
         self.submodules += fsm
index 6a62193fb0e054f8cf16e88c4f01a4cc95d7f366..341b427ba2d13d5faafdb8cc52ff185f0987efd3 100644 (file)
@@ -7,7 +7,7 @@ class LiteSATACONTInserter(Module):
         self.sink = sink = Sink(description)
         self.source = source = Source(description)
 
-        ###
+        # # #
 
         counter = Counter(max=4)
         self.submodules += counter
@@ -79,7 +79,7 @@ class LiteSATACONTRemover(Module):
         self.sink = sink = Sink(description)
         self.source = source = Source(description)
 
-        ###
+        # # #
 
         is_data = Signal()
         is_cont = Signal()
index b72f739f7b1372aaef755dad28556e1a94097322..8600cf99bb2b3f2bb913af2604fe7071eafc0f00 100644 (file)
@@ -29,7 +29,7 @@ class CRCEngine(Module):
         self.last = Signal(width)
         self.next = Signal(width)
 
-        ###
+        # # #
 
         def _optimize_eq(l):
             """
@@ -93,7 +93,7 @@ class LiteSATACRC(Module):
         self.value = Signal(self.width)
         self.error = Signal()
 
-        ###
+        # # #
 
         engine = CRCEngine(self.width, self.polynom)
         self.submodules += engine
@@ -130,7 +130,7 @@ class CRCInserter(Module):
         self.source = source = Source(layout)
         self.busy = Signal()
 
-        ###
+        # # #
 
         dw = flen(sink.d)
         crc = crc_class(dw)
@@ -206,7 +206,7 @@ class CRCChecker(Module):
         self.source = source = Source(layout)
         self.busy = Signal()
 
-        ###
+        # # #
 
         dw = flen(sink.d)
         crc = crc_class(dw)
index 948c5379abf9ae0ea35b14eed70cd79a53613edd..68dbd53ca735bd4206ae13e4dc89fca250bdc79e 100644 (file)
@@ -15,7 +15,7 @@ class Scrambler(Module):
     def __init__(self):
         self.value = Signal(32)
 
-        ###
+        # # #
 
         context = Signal(16, reset=0xf0f6)
         next_value = Signal(32)
@@ -72,7 +72,7 @@ class LiteSATAScrambler(Module):
         self.sink = sink = Sink(description)
         self.source = source = Source(description)
 
-        ###
+        # # #
 
         scrambler = Scrambler()
         self.submodules += scrambler
index 7d267de3d26d2cea425fd9c789e07739623e715e..4375f6c1ef8f502da31c776270024b690c9738f9 100644 (file)
@@ -29,7 +29,7 @@ class LiteSATATransportTX(Module):
     def __init__(self, link):
         self.sink = sink = Sink(transport_tx_description(32))
 
-        ###
+        # # #
 
         cmd_ndwords = max(fis_reg_h2d_cmd_len, fis_data_cmd_len)
         encoded_cmd = Signal(cmd_ndwords*32)
@@ -133,7 +133,7 @@ class LiteSATATransportRX(Module):
     def __init__(self, link):
         self.source = source = Source(transport_rx_description(32))
 
-        ###
+        # # #
 
         cmd_ndwords = max(fis_reg_d2h_cmd_len, fis_dma_activate_d2h_cmd_len,
                           fis_pio_setup_d2h_cmd_len, fis_data_cmd_len)
index 019e736a995302ea010844903e04d304031f01b1..2b27206c991dc2e5d6b3a785d41ec17f61e66567 100644 (file)
@@ -151,7 +151,7 @@ if __name__ == "__main__":
     args = _get_args()
     wb = LiteScopeUARTDriver(args.port, args.baudrate, "./csr.csv", int(args.busword), debug=False)
     wb.open()
-    ###
+    # # #
     identify = LiteSATABISTIdentifyDriver(wb.regs, "sata_bist")
     generator = LiteSATABISTGeneratorDriver(wb.regs, "sata_bist")
     checker = LiteSATABISTCheckerDriver(wb.regs, "sata_bist")
@@ -204,5 +204,5 @@ if __name__ == "__main__":
 
         except KeyboardInterrupt:
             pass
-    ###
+    # # #
     wb.close()
index 130959865de349f268f2467436e6c102630c71e8..2b6eb57ee835954d243041797b49c6e49fa920b3 100644 (file)
@@ -11,8 +11,7 @@ def main(wb):
     checker = LiteSATABISTCheckerDriver(wb.regs, "sata_bist")
     wb.open()
     regs = wb.regs
-    ###
-
+    # # #
     trig = "now"
     if len(sys.argv) < 2:
         print("No trigger condition, triggering immediately!")
@@ -60,7 +59,7 @@ def main(wb):
 
     la.upload()
     la.save("dump.vcd")
-    ###
+    # # #
     wb.close()
 
     f = open("dump_link.txt", "w")
index 1f29e49b9bcfb8cf39640da70dd57a562bda6177..21deed9d3e926a6eb433930fe809253b6fc95640 100644 (file)
@@ -1,9 +1,9 @@
 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)))
-    ###
+    # # #
     wb.close()
index 6924a1bb933da9f0c6585cebfa01080feaca4ceb..4655cf01578a30752c3cfcdee721db128622ab6d 100644 (file)
@@ -15,7 +15,7 @@ class LiteSATABISTGenerator(Module):
         self.aborted = Signal()
         self.errors = Signal(32)  # Note: Not used for writes
 
-        ###
+        # # #
 
         source, sink = user_port.sink, user_port.source
 
@@ -79,7 +79,7 @@ class LiteSATABISTChecker(Module):
         self.aborted = Signal()
         self.errors = Signal(32)
 
-        ###
+        # # #
 
         source, sink = user_port.sink, user_port.source
 
@@ -163,7 +163,7 @@ class LiteSATABISTUnitCSR(Module, AutoCSR):
         self._errors = CSRStatus(32)
         self._cycles = CSRStatus(32)
 
-        ###
+        # # #
 
         self.submodules += bist_unit
 
@@ -226,7 +226,7 @@ class LiteSATABISTIdentify(Module):
         self.submodules += fifo
         self.source = fifo.source
 
-        ###
+        # # #
 
         source, sink = user_port.sink, user_port.source
 
@@ -274,7 +274,7 @@ class LiteSATABISTIdentifyCSR(Module, AutoCSR):
         self._source_ack = CSR()
         self._source_data = CSRStatus(32)
 
-        ###
+        # # #
 
         self.submodules += bist_identify
         self.comb += [
index 719067002746cd08270478ca70657f372df9470b..fa9080d36766c1435af88c71749d5c69ccb9627a 100644 (file)
@@ -13,7 +13,8 @@ class LiteSATAPHYCtrl(Module):
         self.sink = sink = Sink(phy_description(32))
         self.source = source = Source(phy_description(32))
 
-        ###
+        # # #
+
         self.comb += [
             source.stb.eq(1),
             sink.ack.eq(1)
index 0a3a928d49654a65ae81f4cf276456c8a4c494d2..aad7614bd5801ef98d1b43f176244292059dcf13 100644 (file)
@@ -6,7 +6,7 @@ class LiteSATAPHYDatapathRX(Module):
         self.sink = sink = Sink(phy_description(16))
         self.source = source = Source(phy_description(32))
 
-        ###
+        # # #
 
     # width convertion (16 to 32) and byte alignment
         byte_alignment = Signal()
@@ -57,7 +57,7 @@ class LiteSATAPHYDatapathTX(Module):
         self.sink = sink = Sink(phy_description(32))
         self.source = source = Source(phy_description(16))
 
-        ###
+        # # #
 
     # clock domain crossing
         # (sata_gen3) sys_clk to 300MHz sata_tx clk
@@ -85,7 +85,7 @@ class LiteSATAPHYAlignInserter(Module):
         self.sink = sink = Sink(phy_description(32))
         self.source = source = Source(phy_description(32))
 
-        ###
+        # # #
 
         # send 2 ALIGN every 256 DWORDs
         # used for clock compensation between
@@ -119,7 +119,7 @@ class LiteSATAPHYAlignRemover(Module):
         self.sink = sink = Sink(phy_description(32))
         self.source = source = Source(phy_description(32))
 
-        ###
+        # # #
 
         charisk_match = sink.charisk == 0b0001
         data_match = sink.data == primitives["ALIGN"]
@@ -137,7 +137,7 @@ class LiteSATAPHYDatapath(Module):
         self.sink = sink = Sink(phy_description(32))
         self.source = source = Source(phy_description(32))
 
-        ###
+        # # #
 
     # TX path
         align_inserter = LiteSATAPHYAlignInserter(ctrl)
index deae5d1b30de60dbe8c6aa50b30bc064c0e2c4b7..6e3fbc57580f60106f3fda664b82f81d525a72c5 100644 (file)
@@ -351,7 +351,7 @@ class K7LiteSATAPHYTRX(Module):
                     "p_RX_DDI_SEL": 0,
                     "p_RX_DEFER_RESET_BUF_EN": "TRUE",
 
-                #CDR Attributes
+                # CDR Attributes
                     "p_RXCDR_CFG": rxcdr_cfg,
                     "p_RXCDR_FR_RESET_ON_EIDLE": 0,
                     "p_RXCDR_HOLD_DURING_EIDLE": 0,
index 6472b97dfdf5ebe061ff13787fddd130efaf9a8d..6ecbba8222d975b66b3fa48d756a8788b7b41ec8 100644 (file)
@@ -42,7 +42,9 @@ def randn(max_n):
 class PacketStreamer(Module):
     def __init__(self, description, packet_class):
         self.source = Source(description)
-        ###
+
+        # # #
+
         self.packets = []
         self.packet = packet_class()
         self.packet.done = 1
@@ -89,7 +91,9 @@ class PacketStreamer(Module):
 class PacketLogger(Module):
     def __init__(self, description, packet_class):
         self.sink = Sink(description)
-        ###
+
+        # # #
+
         self.packet_class = packet_class
         self.packet = packet_class()
 
index e0fd614d981194b4c09da54b5b9e69125fee3636..6dae6384051f15728ec96d85adba12cad7b31522 100644 (file)
@@ -88,7 +88,7 @@ class TB(Module):
         yield from self.streamer.send(streamer_packet)
         yield from self.logger.receive(len(test_packet))
         #for d in self.logger.packet:
-        #    print("%08x" %d)
+        #    print("{:08}".format(d))
 
         # check results
         s, l, e = check(streamer_packet, self.logger.packet)
index e75bbff02003ae3a53919e03c75446739df28494..06cb9a2a437cd92eabd533804ee650d51ea54d5f 100644 (file)
@@ -24,7 +24,9 @@ class PHYDword:
 class PHYSource(Module):
     def __init__(self):
         self.source = Source(phy_description(32))
-        ###
+
+        # # #
+
         self.dword = PHYDword()
 
     def send(self, dword):
@@ -42,7 +44,9 @@ class PHYSource(Module):
 class PHYSink(Module):
     def __init__(self):
         self.sink = Sink(phy_description(32))
-        ###
+
+        # # #
+
         self.dword = PHYDword()
 
     def receive(self):
@@ -462,7 +466,6 @@ class HDD(Module):
             transport_debug=False, transport_loopback=False,
             hdd_debug=False,
             ):
-        ###
         self.submodules.phy = PHYLayer()
         self.submodules.link = LinkLayer(self.phy, link_debug, link_random_level)
         self.submodules.transport = TransportLayer(self.link, transport_debug, transport_loopback)