Skip to content

Commit

Permalink
VsetModule: fix vlIsVlmax, checking tail should use max(VLMAX, VLEN/S…
Browse files Browse the repository at this point in the history
  • Loading branch information
sinsanction authored Jul 4, 2024
1 parent 42d529e commit 7994c93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/scala/xiangshan/backend/fu/Vsetu.scala
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ class VsetModule(implicit p: Parameters) extends XSModule {
outVConfig.vtype.vlmul := Mux(illegal, 0.U, vtype.vlmul)
outVConfig.vtype.vsew := Mux(illegal, 0.U, vtype.vsew)

io.out.vlmax := vlmax
private val log2VlenDivVsew = log2Vlen.U(3.W) - log2Vsew
private val vlenDivVsew = 1.U(vlWidth.W) << log2VlenDivVsew
io.out.vlmax := Mux(vlmax >= vlenDivVsew, vlmax, vlenDivVsew)

io.testOut.vlmax := vlmax
io.testOut.log2Vlmax := log2Vlmax
Expand Down

0 comments on commit 7994c93

Please sign in to comment.