1
0
Fork 0

Improve QoR of PMP homogeneity checker

This commit is contained in:
Andrew Waterman 2017-03-23 18:02:13 -07:00
parent 0182b6ca07
commit ccd5bc9a91
2 changed files with 6 additions and 3 deletions

@ -1 +1 @@
Subproject commit 3aeba95847a80f92bed639d0b76f4dfbd13a6ee0
Subproject commit e15160d13aca4c007bcab70375eb438d7a204562

View File

@ -89,8 +89,11 @@ class PMP(implicit p: Parameters) extends PMPReg {
private def rangeHomogeneous(x: UInt, pgLevel: UInt, prev: PMP) = {
val beginsAfterLower = !(x < prev.comparand)
val beginsAfterUpper = !(x < comparand)
val endsBeforeLower = pgLevelMap { idxBits => (x >> idxBits) < (prev.comparand >> idxBits) } (pgLevel)
val endsBeforeUpper = pgLevelMap { idxBits => (x >> idxBits) < (comparand >> idxBits) } (pgLevel)
val pgMask = pgLevelMap { idxBits => ((BigInt(1) << paddrBits) - (BigInt(1) << idxBits)).U } (pgLevel)
val endsBeforeLower = (x & pgMask) < (prev.comparand & pgMask)
val endsBeforeUpper = (x & pgMask) < (comparand & pgMask)
endsBeforeLower || beginsAfterUpper || (beginsAfterLower && endsBeforeUpper)
}