mirror of
https://github.com/SpinalHDL/VexRiscv.git
synced 2025-01-03 03:43:39 -05:00
Merge pull request #213 from occheung/pmp-fix
PMP Plugin: Fix PMP region size & priority
This commit is contained in:
commit
9df704cad9
1 changed files with 2 additions and 2 deletions
|
@ -90,7 +90,7 @@ class PmpSetter(cutoff : Int) extends Component with Pmp {
|
||||||
|
|
||||||
val ones = io.addr & ~(io.addr + 1)
|
val ones = io.addr & ~(io.addr + 1)
|
||||||
io.base := io.addr(xlen - 3 downto cutoff - 2) ^ ones(xlen - 3 downto cutoff - 2)
|
io.base := io.addr(xlen - 3 downto cutoff - 2) ^ ones(xlen - 3 downto cutoff - 2)
|
||||||
io.mask := ~ones(xlen - 2 downto cutoff - 1)
|
io.mask := ~(ones(xlen - 4 downto cutoff - 2) @@ U"1")
|
||||||
}
|
}
|
||||||
|
|
||||||
case class ProtectedMemoryTranslatorPort(bus : MemoryTranslatorBus)
|
case class ProtectedMemoryTranslatorPort(bus : MemoryTranslatorBus)
|
||||||
|
@ -259,7 +259,7 @@ class PmpPlugin(regions : Int, granularity : Int, ioRange : UInt => Bool) extend
|
||||||
}
|
}
|
||||||
|
|
||||||
def getPermission(hits : IndexedSeq[Bool], bit : Int) = {
|
def getPermission(hits : IndexedSeq[Bool], bit : Int) = {
|
||||||
(hits zip state.pmpcfg).map({ case (i, cfg) => i & cfg(bit) }).orR
|
MuxOH(OHMasking.first(hits), state.pmpcfg.map(_(bit)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val dGuard = new Area {
|
val dGuard = new Area {
|
||||||
|
|
Loading…
Reference in a new issue