Skip to content

Commit

Permalink
[rocketv] Supplement vector related csr modification.
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjun-li committed Sep 3, 2024
1 parent 7bf6283 commit 644602b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rocketv/src/CSR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1703,9 +1703,10 @@ class CSR(val parameter: CSRParameter)
val newVType = Mux1H(
Seq(
(vsetvli || vsetivli) -> io.inst(0)(27, 20),
vsetvl -> io.wbRegRS2.get(7, 0)
vsetvl -> io.wbRegRS2.get
)
)
val newTypMSBValid: Bool = (newVType >> 8).asUInt.orR
// todo: xLen -> vector.elen
val vlmulIllList = Seq(0.U, 1.U, 2.U, 3.U)++ Option.when(xLen>=16)(7.U) ++ Option.when(xLen>=32)(6.U) ++ Option.when(xLen>=64)(5.U)
val vlmulIll: Bool = vlmulIllList.map(_ === newVType(2, 0)).reduce(_ || _)
Expand Down Expand Up @@ -1743,6 +1744,9 @@ class CSR(val parameter: CSRParameter)
when(decoded_addr(CSRs.vxrm)) {
vector.get.states("vxrm") := wdata
}
when(decoded_addr(CSRs.vxsat)) {
vector.get.states("vxsat") := wdata
}
when(decoded_addr(CSRs.vcsr)) {
vector.get.states("vxrm") := wdata(2, 1)
vector.get.states("vxsat") := wdata(0)
Expand Down

0 comments on commit 644602b

Please sign in to comment.