Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow writes to VSSTATUS.XS #2984

Merged
merged 2 commits into from
May 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/scala/rocket/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ class CSRFile(
io.gstatus.sd := io.gstatus.fs.andR || io.gstatus.xs.andR || io.gstatus.vs.andR
io.gstatus.uxl := (if (usingUser) log2Ceil(xLen) - 4 else 0)
io.gstatus.sd_rv32 := xLen == 32 && io.gstatus.sd
io.gstatus.xs := (if (usingRoCC) UInt(3) else UInt(0))

Phantom1003 marked this conversation as resolved.
Show resolved Hide resolved
val exception = insn_call || insn_break || io.exception
assert(PopCount(insn_ret :: insn_call :: insn_break :: io.exception :: Nil) <= 1, "these conditions must be mutually exclusive")
Expand Down Expand Up @@ -1343,7 +1344,6 @@ class CSRFile(
reg_vsstatus.sum := new_vsstatus.sum
reg_vsstatus.fs := formFS(new_vsstatus.fs)
reg_vsstatus.vs := formVS(new_vsstatus.vs)
if (usingRoCC) reg_vsstatus.xs := Fill(2, new_vsstatus.xs.orR)
}
when (decoded_addr(CSRs.vsip)) {
val new_vsip = new MIP().fromBits((read_hip & ~read_hideleg) | ((wdata << 1) & read_hideleg))
Expand Down