prefer not to invert when doing if/else.
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 20 Dec 2021 15:01:38 +0000 (15:01 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 20 Dec 2021 15:01:38 +0000 (15:01 +0000)
src/soc/experiment/mmu.py

index f139e85aa3b9fa8c60ae20e07cc5e840471f9d28..1c23e81a6cc90aaabadf9c2e36f05ebd184c82d0 100644 (file)
@@ -168,12 +168,12 @@ class MMU(Elaboratable):
         rts = Signal(6)
         mbits = Signal(6)
 
-        with m.If(~l_in.addr[63]):
-            comb += pgtbl.eq(r.pgtbl0)
-            comb += pt_valid.eq(r.pt0_valid)
-        with m.Else():
+        with m.If(l_in.addr[63]):
             comb += pgtbl.eq(r.pgtbl3)
             comb += pt_valid.eq(r.pt3_valid)
+        with m.Else():
+            comb += pgtbl.eq(r.pgtbl0)
+            comb += pt_valid.eq(r.pt0_valid)
 
         # rts == radix tree size, number of address bits
         # being translated.  takes bits 5:7 and 61:63