format file
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 10 Jul 2020 00:21:19 +0000 (17:21 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 10 Jul 2020 00:21:19 +0000 (17:21 -0700)
src/soc/decoder/power_fieldsn.py

index 74fcd00733f0175bd36c31f5b9c8097afbf6548a..6f1b0bae50fc269b67f4800792ca7b695f4e4d72 100644 (file)
@@ -29,17 +29,16 @@ class SignalBitRange(BitRange):
             if stop < 0:
                 stop = len(self) + stop + 1
             for t in range(start, stop, step):
-                t = len(self) - 1 - t # invert field back
+                t = len(self) - 1 - t  # invert field back
                 k = OrderedDict.__getitem__(self, t)
-                res.append(self.signal[self._rev(k)]) # reverse-order here
+                res.append(self.signal[self._rev(k)])  # reverse-order here
             return Cat(*res)
         else:
             if subs < 0:
                 subs = len(self) + subs
-            subs = len(self) - 1 - subs # invert field back
+            subs = len(self) - 1 - subs  # invert field back
             k = OrderedDict.__getitem__(self, subs)
-            return self.signal[self._rev(k)] # reverse-order here
-
+            return self.signal[self._rev(k)]  # reverse-order here
 
 
 class SigDecode(Elaboratable):
@@ -57,13 +56,14 @@ class SigDecode(Elaboratable):
     def ports(self):
         return [self.opcode_in]
 
+
 def create_sigdecode():
     s = SigDecode(32)
     return s
 
+
 if __name__ == '__main__':
     sigdecode = create_sigdecode()
     vl = rtlil.convert(sigdecode, ports=sigdecode.ports())
     with open("decoder.il", "w") as f:
         f.write(vl)
-