Skip to content

Commit

Permalink
Support configurable ifpu and fpmu latency in FPU
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed May 17, 2024
1 parent d92922a commit 2371ef6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/scala/tile/FPU.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ case class FPUParams(
fLen: Int = 64,
divSqrt: Boolean = true,
sfmaLatency: Int = 3,
dfmaLatency: Int = 4
dfmaLatency: Int = 4,
fpmuLatency: Int = 2,
ifpuLatency: Int = 2
)

object FPConstants
Expand Down Expand Up @@ -879,12 +881,12 @@ class FPU(cfg: FPUParams)(implicit p: Parameters) extends FPUModule()(p) {
io.cp_resp.valid := true.B
}

val ifpu = Module(new IntToFP(2))
val ifpu = Module(new IntToFP(cfg.ifpuLatency))
ifpu.io.in.valid := req_valid && ex_ctrl.fromint
ifpu.io.in.bits := fpiu.io.in.bits
ifpu.io.in.bits.in1 := Mux(ex_cp_valid, io.cp_req.bits.in1, io.fromint_data)

val fpmu = Module(new FPToFP(2))
val fpmu = Module(new FPToFP(cfg.fpmuLatency))
fpmu.io.in.valid := req_valid && ex_ctrl.fastpipe
fpmu.io.in.bits := fpiu.io.in.bits
fpmu.io.lt := fpiu.io.out.bits.lt
Expand Down

0 comments on commit 2371ef6

Please sign in to comment.