minor error in plru
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 13 Sep 2020 10:36:59 +0000 (11:36 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 13 Sep 2020 10:36:59 +0000 (11:36 +0100)
src/soc/experiment/plru.py

index 3400f8cde2d83aa869b86b2903797b36d29de384..baa68ce2eb53b34eb82be048f8eabd81b5f92176 100644 (file)
@@ -28,10 +28,7 @@ class PLRU(Elaboratable):
             comb += self.lru_o[self.BITS-1-i].eq(tree[node])
             if i != self.BITS-1:
                 comb += node2.eq(node << 1)
-            else:
-                comb += node2.eq(node)
-            if i != self.BITS-1:
-                with m.If(tree[node]):
+                with m.If(tree[node2]):
                     comb += node_next.eq(node2 + 2)
                 with m.Else():
                     comb += node_next.eq(node2 + 1)
@@ -48,9 +45,6 @@ class PLRU(Elaboratable):
                 sync += tree[node].eq(~abit)
                 if i != self.BITS-1:
                     comb += node2.eq(node << 1)
-                else:
-                    comb += node2.eq(node)
-                if i != self.BITS-1:
                     with m.If(abit):
                         comb += node_next.eq(node2 + 2)
                     with m.Else():