Skip to content

Commit

Permalink
Merge pull request #3707 from chipsalliance/vsew_fix
Browse files Browse the repository at this point in the history
VectorDecoder in FPU may need to check v_sew'
  • Loading branch information
jerryz123 authored Jan 29, 2025
2 parents 8fa6290 + 5e1d66f commit dac1f10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/scala/rocket/RocketCore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ class Rocket(tile: RocketTile)(implicit p: Parameters) extends CoreModule()(p)
val v_decode = rocketParams.vector.get.decoder(p)
v_decode.io.inst := id_inst(0)
v_decode.io.vconfig := csr.io.vector.get.vconfig
id_ctrl.vec := v_decode.io.vector
when (v_decode.io.legal) {
id_ctrl.legal := !csr.io.vector.get.vconfig.vtype.vill
id_ctrl.fp := v_decode.io.fp
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/rocket/VectorUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ abstract class RocketVectorDecoder(implicit p: Parameters) extends CoreModule()(
val io = IO(new Bundle {
val inst = Input(UInt(32.W))
val vconfig = Input(new VConfig)
val legal = Output(Bool())
val vector = Output(Bool()) // this is a vector instruction
val legal = Output(Bool()) // this is a legal vector instruction given vconfig
val fp = Output(Bool())
val read_rs1 = Output(Bool())
val read_rs2 = Output(Bool())
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/tile/FPU.scala
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ class FPU(cfg: FPUParams)(implicit p: Parameters) extends FPUModule()(p) {
val v_decode = v.decoder(p) // Only need to get ren1
v_decode.io.inst := io.inst
v_decode.io.vconfig := DontCare // core deals with this
v_decode.io.vconfig.vtype.vsew := io.v_sew
when (v_decode.io.legal && v_decode.io.read_frs1) {
id_ctrl.ren1 := true.B
id_ctrl.swap12 := false.B
Expand Down

0 comments on commit dac1f10

Please sign in to comment.