Skip to content

Commit

Permalink
CSR: sstatus.fs should be read-only zero
Browse files Browse the repository at this point in the history
NutShell does not have F/D extensions. FS is read-only zero.
  • Loading branch information
poemonsense committed May 14, 2024
1 parent 7810deb commit 747a58f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/scala/nutcore/backend/fu/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,13 @@ class CSR(implicit val p: NutCoreConfig) extends NutCoreModule with HasCSRConst{
// Superviser-Level CSRs

// val sstatus = RegInit(UInt(XLEN.W), "h00000000".U)
val sstatusWmask = "hc6122".U(64.W)
val sstatusWmask = (~ZeroExt((
GenMask(63, 20) | // SD, WPRI, UXL, WPRI
GenMask(17, 9) | // WPRI, XS, FS, WPRI, VS
GenMask(7, 6) | // WPRI, UBE
GenMask(4, 2) | // WPRI
GenMask(0) // WPRI
), 64)).asUInt
// Sstatus Write Mask
// -------------------------------------------------------
// 19 9 5 2
Expand Down

0 comments on commit 747a58f

Please sign in to comment.