1
0

Don't instantiate PTW when UseVM=false

This commit is contained in:
Andrew Waterman 2016-03-25 14:17:25 -07:00
parent 27b3cca046
commit a4685a073f
2 changed files with 27 additions and 23 deletions

View File

@ -125,10 +125,12 @@ class RocketTile(resetSignal: Bool = null)(implicit p: Parameters) extends Tile(
require(uncachedPorts.size == nUncachedTileLinkPorts) require(uncachedPorts.size == nUncachedTileLinkPorts)
require(cachedPorts.size == nCachedTileLinkPorts) require(cachedPorts.size == nCachedTileLinkPorts)
val ptw = Module(new PTW(ptwPorts.size)(dcacheParams)) if (p(UseVM)) {
ptw.io.requestor <> ptwPorts val ptw = Module(new PTW(ptwPorts.size)(dcacheParams))
ptw.io.mem +=: dcPorts ptw.io.requestor <> ptwPorts
core.io.ptw <> ptw.io.dpath ptw.io.mem +=: dcPorts
core.io.ptw <> ptw.io.dpath
}
val dcArb = Module(new HellaCacheArbiter(dcPorts.size)(dcacheParams)) val dcArb = Module(new HellaCacheArbiter(dcPorts.size)(dcacheParams))
dcArb.io.requestor <> dcPorts dcArb.io.requestor <> dcPorts

View File

@ -137,7 +137,7 @@ class TLB(implicit p: Parameters) extends TLBModule()(p) {
val w_array = Mux(priv_s, sw_array.toBits & pum_ok, uw_array.toBits) val w_array = Mux(priv_s, sw_array.toBits & pum_ok, uw_array.toBits)
val x_array = Mux(priv_s, sx_array.toBits, ux_array.toBits) val x_array = Mux(priv_s, sx_array.toBits, ux_array.toBits)
val vm_enabled = io.ptw.status.vm(3) && priv_uses_vm && !io.req.bits.passthrough val vm_enabled = Bool(usingVM) && io.ptw.status.vm(3) && priv_uses_vm && !io.req.bits.passthrough
val bad_va = val bad_va =
if (vpnBits == vpnBitsExtended) Bool(false) if (vpnBits == vpnBitsExtended) Bool(false)
else io.req.bits.vpn(vpnBits) =/= io.req.bits.vpn(vpnBits-1) else io.req.bits.vpn(vpnBits) =/= io.req.bits.vpn(vpnBits-1)
@ -174,26 +174,28 @@ class TLB(implicit p: Parameters) extends TLBModule()(p) {
io.ptw.req.bits.store := r_req.store io.ptw.req.bits.store := r_req.store
io.ptw.req.bits.fetch := r_req.instruction io.ptw.req.bits.fetch := r_req.instruction
when (io.req.fire() && tlb_miss) { if (usingVM) {
state := s_request when (io.req.fire() && tlb_miss) {
r_refill_tag := lookup_tag state := s_request
r_refill_waddr := repl_waddr r_refill_tag := lookup_tag
r_req := io.req.bits r_refill_waddr := repl_waddr
} r_req := io.req.bits
when (state === s_request) { }
when (io.ptw.invalidate) { when (state === s_request) {
when (io.ptw.invalidate) {
state := s_ready
}
when (io.ptw.req.ready) {
state := s_wait
when (io.ptw.invalidate) { state := s_wait_invalidate }
}
}
when (state === s_wait && io.ptw.invalidate) {
state := s_wait_invalidate
}
when (io.ptw.resp.valid) {
state := s_ready state := s_ready
} }
when (io.ptw.req.ready) {
state := s_wait
when (io.ptw.invalidate) { state := s_wait_invalidate }
}
}
when (state === s_wait && io.ptw.invalidate) {
state := s_wait_invalidate
}
when (io.ptw.resp.valid) {
state := s_ready
} }
} }