Skip to content

Commit

Permalink
PTW do not count pte_hit/miss on L2TLB hits (#2688)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingallsj authored Oct 28, 2020
1 parent 45ce649 commit 1db05c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/scala/rocket/PTW.scala
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,11 @@ class PTW(n: Int)(implicit edge: TLEdgeOut, p: Parameters) extends CoreModule()(

(hit && count < pgLevels-1, Mux1H(hits, data))
}
val pte_hit = RegNext(false.B)
io.dpath.perf.pte_miss := false
io.dpath.perf.pte_hit := false
io.dpath.perf.pte_hit := pte_hit && (state === s_req) && !io.dpath.perf.l2hit
assert(!(io.dpath.perf.l2hit && (io.dpath.perf.pte_miss || io.dpath.perf.pte_hit)),
"PTE Cache Hit/Miss Performance Monitor Events are lower priority than L2TLB Hit event")

val l2_refill = RegNext(false.B)
l2_refill_wire := l2_refill
Expand Down Expand Up @@ -308,10 +311,9 @@ class PTW(n: Int)(implicit edge: TLEdgeOut, p: Parameters) extends CoreModule()(
is (s_req) {
when (pte_cache_hit) {
count := count + 1
io.dpath.perf.pte_hit := true
pte_hit := true
}.otherwise {
next_state := Mux(io.mem.req.ready, s_wait1, s_req)
io.dpath.perf.pte_miss := io.mem.req.ready
}
}
is (s_wait1) {
Expand All @@ -320,6 +322,7 @@ class PTW(n: Int)(implicit edge: TLEdgeOut, p: Parameters) extends CoreModule()(
}
is (s_wait2) {
next_state := s_wait3
io.dpath.perf.pte_miss := true
when (io.mem.s2_xcpt.ae.ld) {
resp_ae := true
next_state := s_ready
Expand Down

0 comments on commit 1db05c5

Please sign in to comment.