pep8 cleanup
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 27 Jul 2018 10:32:56 +0000 (11:32 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 27 Jul 2018 10:32:56 +0000 (11:32 +0100)
src/bsv/interface_decl.py
src/bsv/peripheral_gen/base.py
src/bsv/peripheral_gen/flexbus.py
src/spec/i_class.py

index 78e774cff13ab649b8828cb222da845de10c800b..55faecede353ac939a9ed94e2127a1d312a2290e 100644 (file)
@@ -242,7 +242,6 @@ class InterfaceFmt(object):
         return '\n' + res + '\n'
 
 
-
 class Interface(PeripheralIface, InterfaceFmt):
     """ create an interface from a list of pinspecs.
         each pinspec is a dictionary, see Pin class arguments
@@ -443,7 +442,7 @@ class InterfaceBus(InterfaceFmt):
         self.buspins = filter(lambda x: x.name_.startswith(self.fbus),
                               self.pins_)
         self.nonbuspins = filter(lambda x: not x.name_.startswith(self.fbus),
-                              self.pins_)
+                                 self.pins_)
 
     def get_nonbuspins(self):
         return self.nonbuspins
@@ -538,23 +537,25 @@ class InterfaceLCD(InterfaceBus, Interface):
         InterfaceBus.__init__(self, self.pins, False, ['data_out', None, None],
                               "Bit#({0})", "out")
 
+
 class InterfaceFlexBus(InterfaceMultiBus, Interface):
 
     def __init__(self, ifacename, pinspecs, ganged=None, single=False):
         Interface.__init__(self, ifacename, pinspecs, ganged, single)
         InterfaceMultiBus.__init__(self, self.pins)
         self.add_bus(True, ['ad_out', 'ad_out_en', 'ad_in'],
-                              "Bit#({0})", "ad")
+                     "Bit#({0})", "ad")
         self.add_bus(False, ['bwe', None, None],
-                              "Bit#({0})", "bwe")
+                     "Bit#({0})", "bwe")
         self.add_bus(False, ['tsiz', None, None],
-                              "Bit#({0})", "tsiz")
+                     "Bit#({0})", "tsiz")
         self.add_bus(False, ['cs', None, None],
-                              "Bit#({0})", "cs")
+                     "Bit#({0})", "cs")
 
     def ifacedef2(self, *args):
         return InterfaceMultiBus.ifacedef2(self, *args)
 
+
 class InterfaceSD(InterfaceBus, Interface):
 
     def __init__(self, *args):
@@ -562,6 +563,7 @@ class InterfaceSD(InterfaceBus, Interface):
         InterfaceBus.__init__(self, self.pins, True, ['out', 'out_en', 'in'],
                               "Bit#({0})", "d")
 
+
 class InterfaceNSPI(InterfaceBus, Interface):
 
     def __init__(self, *args):
@@ -570,6 +572,7 @@ class InterfaceNSPI(InterfaceBus, Interface):
                               ['io_out', 'io_out_en', 'io_in'],
                               "Bit#({0})", "io")
 
+
 class InterfaceEINT(Interface):
     """ uses old-style (non-get/put) for now
     """
@@ -592,6 +595,7 @@ class InterfaceGPIO(InterfaceBus, Interface):
         InterfaceBus.__init__(self, self.pins, True, ['out', 'out_en', 'in'],
                               "Vector#({0},Bit#(1))", ifacename[-1])
 
+
 class Interfaces(InterfacesBase, PeripheralInterfaces):
     """ contains a list of interface definitions
     """
index c88080dbb0b6d7e2168875c82d28b9f0df4b88a1..c9c53efbf2ec1486fc7ca73330c8a88551d2cb32 100644 (file)
@@ -178,7 +178,9 @@ else"""
                     n_ = "{0}{1}".format(n, count)
                     n_ = '{0}.{1}'.format(n_, fname)
                     n_ = self.ifname_tweak(pname, 'in', n_)
-                    ret.append("mkConnection({1},\n\t\t\t{0});".format(ps_, n_))
+                    ret.append(
+                        "mkConnection({1},\n\t\t\t{0});".format(
+                            ps_, n_))
         return '\n'.join(ret)
 
     def mk_cellconn(self, *args):
index 8fed54702ac0e2cbfc1849950d7d8eb3735c26d7..7302d469f2e0ed65fa4d65e3ccd3b2266c0e5da9 100644 (file)
@@ -7,7 +7,7 @@ class flexbus(PBase):
         return "import FlexBus_Types::*;"
 
     def num_axi_regs32(self):
-        return 0x4000000 # defines an entire memory range
+        return 0x4000000  # defines an entire memory range
 
     def extfastifinstance(self, name, count):
         return self._extifinstance(name, count, "_out", "", True,
@@ -26,13 +26,13 @@ class flexbus(PBase):
 
     def pinname_in(self, pname):
         return {'ta': 'flexbus_side.tAn',
-               }.get(pname, '')
+                }.get(pname, '')
 
     def pinname_out(self, pname):
         return {'ale': 'flexbus_side.m_ALE',
-                'oe' : 'flexbus_side.m_OEn',
-                'rw' : 'flexbus_side.m_R_Wn',
-               }.get(pname, '')
+                'oe': 'flexbus_side.m_OEn',
+                'rw': 'flexbus_side.m_R_Wn',
+                }.get(pname, '')
 
     def mk_pincon(self, name, count):
         ret = [PBase.mk_pincon(self, name, count)]
@@ -44,13 +44,13 @@ class flexbus(PBase):
         ps = "pinmux.peripheral_side.%s" % sname
         n = "{0}".format(name)
         for stype, ptype in [
-                ('cs', 'm_FBCSn'),
-                ('bwe', 'm_BWEn'),
-                ('tbst', 'm_TBSTn'),
-                ('tsiz', 'm_TSIZ'),
-                ('ad_in', 'm_AD'),
-                ('ad_out', 'm_din'),
-                ('ad_en', 'm_OE32n'),
-            ]:
+            ('cs', 'm_FBCSn'),
+            ('bwe', 'm_BWEn'),
+            ('tbst', 'm_TBSTn'),
+            ('tsiz', 'm_TSIZ'),
+            ('ad_in', 'm_AD'),
+            ('ad_out', 'm_din'),
+            ('ad_en', 'm_OE32n'),
+        ]:
             ret.append(template.format(ps, ptype, n, stype))
         return '\n'.join(ret)
index 11a57b5e21ddfdc19a13b5269b9fbedcc1695a06..6401538f9e2d1605a3bb0863402c39d4cab31679 100644 (file)
@@ -60,7 +60,7 @@ def pinspec():
                       }
 
     ps = PinSpec(pinbanks, fixedpins, function_names,
-                 ['lcd', 'jtag', 'fb' ])
+                 ['lcd', 'jtag', 'fb'])
 
     # Bank A, 0-27
     ps.gpio("", ('A', 0), 0, 0, 28)