[Libre-soc-bugs] [Bug 450] Create MMU from microwatt mmu.vhdl

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Aug 15 04:17:43 BST 2020


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

--- Comment #51 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
 942         comb += prtable_addr.eq(
 943                  Cat(
 944                   Cat(
 945                    Cat(
 946                     Cat(Const(0b0000, 4), effpid[0:8]),
 947                     (
 948                      (r.prtble[12:36] & ~finalmask[0:24])
 949                      | effpid[8:32]   &  finalmask[0:24]
 950                     )
 951                    ),
 952                    r.prtbl[36:56]
 953                   ),
 954                   Const(0x00, 8)
 955                  )
 956                 )


no need for Cat(Cat(Cat(...)))

just make it Cat(x,y,z,w,a,b)


also lose any call to as_unsigned() because the result of Cat() is always
unsigned.  no need to convert unsigned to unsigned.

also: wherever there is an eq into a full Signal (*not* a slice), and the last
Cat is zeros, then because the default for an assignment *is* zeros if nothing
is assigned, the last zeros can be REMOVED.

if that results in only one item in Cat, then Cat can go, too.

this will allow single lines in a huge number of places.

835   comb += mbits.eq(data[0:5])

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


More information about the libre-soc-bugs mailing list