Skip to content

Commit

Permalink
[rocketv] Try to separate the floating point decode, 'fp' represents …
Browse files Browse the repository at this point in the history
…the instruction that will enter FPU.
  • Loading branch information
qinjun-li committed Sep 5, 2024
1 parent edb8deb commit dd5ca50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 3 additions & 2 deletions rocketv/src/Decoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,15 @@ case class DecoderParameter(
object fp extends BoolDecodeField[RocketDecodePattern] {
override def name: String = "fp"

override def genTable(op: RocketDecodePattern): BitPat = op.instruction.instructionSet.name match {
override def genTable(op: RocketDecodePattern): BitPat = (op.instruction.instructionSet.name, op) match {
// format: off
case s if Seq(
case (s, _) if Seq(
"rv_d", "rv64_d",
"rv_f", "rv64_f",
"rv_q", "rv64_q",
"rv_zfh", "rv64_zfh", "rv_d_zfh", "rv_q_zfh",
).contains(s) => y
case (_, p) if p.vectorReadFRegFile => y
case _ => n
// format: on
}
Expand Down
14 changes: 2 additions & 12 deletions rocketv/src/RocketCore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1409,13 +1409,7 @@ class Rocket(val parameter: RocketParameter)
csr.io.csrStall || csr.io.singleStep && (exRegValid || memRegValid || wbRegValid) ||
idCsrEn && csr.io.decode(0).fpCsr && !io.fpu.map(_.fcsr_rdy).getOrElse(false.B) || io.traceStall ||
!clockEnable ||
Option
.when(usingFPU)(
(idDecodeOutput(parameter.decoderParameter.fp) || idDecodeOutput(
parameter.decoderParameter.vectorReadFRs1
)) && idStallFpu
)
.getOrElse(false.B) ||
Option.when(usingFPU)(idDecodeOutput(parameter.decoderParameter.fp) && idStallFpu).getOrElse(false.B) ||
idDecodeOutput(parameter.decoderParameter.mem) && dcacheBlocked || // reduce activity during D$ misses
Option
.when(usingMulDiv)(
Expand Down Expand Up @@ -1509,11 +1503,7 @@ class Rocket(val parameter: RocketParameter)
io.fpu.foreach { fpu =>
fpuDecoder.get.io.instruction := idInstruction
fpu.dec := fpuDecoder.get.io.output
fpu.valid := !ctrlKilled && (
idDecodeOutput(parameter.decoderParameter.fp) ||
// vector read frs1
(fpu.dec.ren1 && idDecodeOutput(parameter.decoderParameter.vector))
)
fpu.valid := !ctrlKilled && idDecodeOutput(parameter.decoderParameter.fp)
fpu.killx := ctrlKillx
fpu.killm := killmCommon
fpu.inst := idInstruction
Expand Down

0 comments on commit dd5ca50

Please sign in to comment.