autopep8 cleanup
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 31 May 2018 15:10:42 +0000 (16:10 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 31 May 2018 15:10:42 +0000 (16:10 +0100)
src/bsv/interface_decl.py
src/bsv/pinmux_generator.py

index a1313f46d027d785a031673ebc19e72e3a0c1e61..b24e13de7b9b17a3da0e663271c3c7c047beaf8c 100644 (file)
@@ -150,8 +150,8 @@ class Interface(object):
                 pname = self.pname(p['name']).format(*args)
                 if p.get('outen') is True:
                     outname = self.ifacefmtoutfn(pname)
-                    ganged.append("%s_outen" % outname) # match wirefmt
-            
+                    ganged.append("%s_outen" % outname)  # match wirefmt
+
             gangedfmt = '{%s} = duplicate(%s);'
             res.append(gangedfmt % (',\n  '.join(ganged), name))
         return '\n'.join(res) + '\n\n'
@@ -166,7 +166,7 @@ class Interface(object):
             if p.get('outen') is True:
                 outname = self.ifacefmtoutfn(name)
                 params.append('outputval:%s_out,' % outname)
-                params.append('output_en:%s_outen,' % outname) # match busfmt
+                params.append('output_en:%s_outen,' % outname)  # match busfmt
                 params.append('input_en:~%s_outen,' % outname)
             elif p.get('action'):
                 outname = self.ifacefmtoutfn(name)
@@ -289,8 +289,8 @@ class Interfaces(UserDict):
                 elif ln[1] == 'inout':
                     d['outen'] = True
                     if len(ln) == 3:
-                        bus = ln[2] 
-                        if not ganged.has_key(bus):
+                        bus = ln[2]
+                        if bus not in ganged:
                             ganged[bus] = []
                         ganged[bus].append(name)
                 spec.append(d)
index 5eeabf5eb4df6350ccd32bdf8812646e02faaa9b..26082dbab9a4965b7f4abe00d526e2ad57524548 100644 (file)
@@ -81,11 +81,11 @@ def pinmuxgen(pth=None, verify=True):
 
     # copy over template and library files
     shutil.copyfile(os.path.join(cwd, 'Makefile.template'),
-                os.path.join(bp, 'Makefile'))
+                    os.path.join(bp, 'Makefile'))
     cwd = os.path.join(cwd, 'bsv_lib')
     for fname in ['AXI4_Lite_Types.bsv', 'Semi_FIFOF.bsv']:
         shutil.copyfile(os.path.join(cwd, fname),
-                    os.path.join(bl, fname))
+                        os.path.join(bl, fname))
 
     bus = os.path.join(bp, 'busenable.bsv')
     pmp = os.path.join(bp, 'pinmux.bsv')
@@ -108,9 +108,10 @@ def write_bus(bus, p, ifaces):
 def get_cell_bit_width(p):
     max_num_cells = 0
     for cell in p.muxed_cells:
-            max_num_cells = max(len(cell)-1, max_num_cells)
+        max_num_cells = max(len(cell) - 1, max_num_cells)
     return int(math.log(max_num_cells, 2))
 
+
 def write_pmp(pmp, p, ifaces):
     # package and interface declaration followed by
     # the generic io_cell definition