Skip to content

Commit

Permalink
Remove redundant TLBExceptions V bit
Browse files Browse the repository at this point in the history
This was introduced by "(185cac8) Add hypervisor extension (#2841)"

This is a dead code, as no circuit is producing and consuming
this bit.

This was discovered when migrating Core.scala to chisel3, where
strict checking was applied for IO and firrtl found this is
not connected.

In the context of hypervisor extension, V bit, or _virtualization
mode_, indicates whether the hart is currently executing in a
guest.

For TLBReq, the V bit is needed as it affects the PTW thus TLB
behavior on whether to do _Two-Stage Address Translation_.

However, the bit is not needed for TLBException. The exceptions
(pf, gf, ae, ma) have no V=1/V=0 variants. Also, there is no point
to add V bit for gf (guest page fault).

The io.resp.gf added below in the original patch also does
not connect io.resp.gf.v. If this V bit should be added
for this specific exception, it should be connected.

I assume this was added accidentally, as the original
"extends CoreBundle()(p)" modification seems irrelevant.
  • Loading branch information
ZenithalHourlyRate authored and jerryz123 committed Feb 22, 2023
1 parent 322a1ca commit abb66a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/scala/rocket/TLB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@ class TLBReq(lgMaxSize: Int)(implicit p: Parameters) extends CoreBundle()(p) {

}

class TLBExceptions(implicit p: Parameters) extends CoreBundle()(p) {
class TLBExceptions extends Bundle {
val ld = Bool()
val st = Bool()
val inst = Bool()
val v = Bool()
}

class TLBResp(implicit p: Parameters) extends CoreBundle()(p) {
Expand Down

0 comments on commit abb66a2

Please sign in to comment.