[libre-riscv-dev] [Bug 311] countzero function for Logic Pipeline

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri May 15 12:43:58 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=311

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
i *think* this fixes it:

--- a/src/soc/countzero/countzero.py
+++ b/src/soc/countzero/countzero.py
@@ -53,14 +53,14 @@ class ZeroCounter(Elaboratable):
                 with m.Else():
                     m.d.comb += ret.eq(3)
             with m.Else():
-                with m.If(v[0]):
-                    m.d.comb += ret.eq(0)
-                with m.Elif(v[1]):
-                    m.d.comb += ret.eq(1)
+                with m.If(v[3]):
+                    m.d.comb += ret.eq(3)
                 with m.Elif(v[2]):
                     m.d.comb += ret.eq(2)
+                with m.Elif(v[1]):
+                    m.d.comb += ret.eq(1)
                 with m.Else():
-                    m.d.comb += ret.eq(3)
+                    m.d.comb += ret.eq(0)
             return ret

         r = IntermediateResult()

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list