1
0
Fork 0

Express PMP mask generator using a carry chain

This allows it to be optimized like an adder, improving QoR when it
is on the critical path.
This commit is contained in:
Andrew Waterman 2017-03-26 11:12:41 -07:00 committed by Andrew Waterman
parent bb42f3bf3b
commit 5d1165c850
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ class PMP(implicit p: Parameters) extends PMPReg {
val mask = UInt(width = paddrBits)
import PMP._
def computeMask = Cat((0 until paddrBits - lgAlign).scanLeft(cfg.a(0))((m, i) => m && addr(i)).asUInt, UInt((BigInt(1) << lgAlign) - 1, lgAlign))
def computeMask = Cat((Cat(addr, cfg.a(0)) + 1) ^ Cat(addr, cfg.a(0)), UInt((BigInt(1) << (lgAlign-1)) - 1, lgAlign-1))
private def comparand = addr << lgAlign
private def pow2Match(x: UInt, lgSize: UInt, lgMaxSize: Int) = {