simplify StageChain.specallocate_setup
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Apr 2019 04:09:07 +0000 (05:09 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Apr 2019 04:09:07 +0000 (05:09 +0100)
src/add/singlepipe.py

index af6b711b8ff0034325571aa13a164c9356fc6caf..54340280c9a80ff1fda30e2c9eaedee9a5d70532 100644 (file)
@@ -410,10 +410,9 @@ class StageChain(StageCls):
             o = self.chain[idx].ospec()     # last assignment survives
             m.d.comb += eq(o, c.process(i)) # process input into "o"
             if idx == len(self.chain)-1:
-                continue
-            ni = self.chain[idx+1].ispec()  # new input on next loop
-            m.d.comb += eq(ni, o)           # assign to next input
-            i = ni
+                break
+            i = self.chain[idx+1].ispec()   # new input on next loop
+            m.d.comb += eq(i, o)            # assign to next input
         return o                            # last loop is the output
 
     def _noallocate_setup(self, m, i):