pep8 cleanup
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 21 Jul 2018 03:38:38 +0000 (04:38 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 21 Jul 2018 03:38:38 +0000 (04:38 +0100)
src/bsv/peripheral_gen.py
src/ifacebase.py

index 82d8db6d3ee80f0a370b270d2fab80c0753ef496..b2352bda47346ac02833b8791f0fb8787ed3716c 100644 (file)
@@ -51,7 +51,7 @@ class PBase(object):
             typ = p['type']
             pname = p['name']
             #n = "{0}{1}".format(self.name, self.mksuffix(name, count))
-            n = name#"{0}{1}".format(self.name, self.mksuffix(name, count))
+            n = name  # "{0}{1}".format(self.name, self.mksuffix(name, count))
             ret.append("    //%s %s" % (n, str(p)))
             sname = self.peripheral.pname(pname).format(count)
             ps = "pinmux.peripheral_side.%s" % sname
@@ -80,7 +80,9 @@ class PBase(object):
                         ps_ = ps + '_in'
                     else:
                         ps_ = ps
-                    ret.append("    rule con_%s%d_%s_in" % (name, count, pname))
+                    ret.append(
+                        "    rule con_%s%d_%s_in" %
+                        (name, count, pname))
                     ret.append("      {1}.{2}({0});".format(ps_, n, fname))
                     ret.append("    endrule")
         return '\n'.join(ret)
@@ -95,9 +97,9 @@ class PBase(object):
         return i
 
     def __mk_connection(self, con, aname):
-        txt =  "        mkConnection (slow_fabric.v_to_slaves\n" + \
-               "                    [fromInteger(valueOf({1}))],\n" + \
-               "                    {0});"
+        txt = "        mkConnection (slow_fabric.v_to_slaves\n" + \
+            "                    [fromInteger(valueOf({1}))],\n" + \
+            "                    {0});"
 
         print "PBase __mk_connection", self.name, aname
         if not con:
@@ -129,6 +131,7 @@ class PBase(object):
     def pinname_tweak(self, pname, typ, txt):
         return txt
 
+
 class uart(PBase):
 
     def slowimport(self):
@@ -287,7 +290,7 @@ class gpio(PBase):
     def mkslow_peripheral(self):
         return "        MUX#(%(name)s) mux{0} <- mkmux();\n" + \
                "        GPIO#(%(name)s) gpio{0} <- mkgpio();" % \
-                    {'name': self.name}
+            {'name': self.name}
 
     def mk_connection(self, count):
         print "GPIO mk_conn", self.name, count
@@ -506,15 +509,16 @@ class PeripheralInterfaces(object):
                 ret.append(txt)
         return '\n'.join(list(filter(None, ret)))
 
+
 class PFactory(object):
     def getcls(self, name):
         for k, v in {'uart': uart,
-                'rs232': rs232,
-                'twi': twi,
-                'qspi': qspi,
-                'pwm': pwm,
-                'gpio': gpio
-                }.items():
+                     'rs232': rs232,
+                     'twi': twi,
+                     'qspi': qspi,
+                     'pwm': pwm,
+                     'gpio': gpio
+                     }.items():
             if name.startswith(k):
                 return v
         return None
index 3a3bf1d245d41dc8ed311e3dd9dd7bda20e76b5c..0d6d25039ecb38be3c7afbacbd6a4f2b81ee036b 100644 (file)
@@ -47,7 +47,7 @@ class InterfacesBase(UserDict):
         # finds the interface type, e.g sd_d0 returns "inout"
         for iface in self.values():
             typ = iface.getifacetype(fname)
-            #if fname.startswith('pwm'):
+            # if fname.startswith('pwm'):
             #   print fname, iface.ifacename, typ
             if typ:
                 return typ