diff --git a/src/main/scala/rocket/CSR.scala b/src/main/scala/rocket/CSR.scala index 79b56e17..0bf870df 100644 --- a/src/main/scala/rocket/CSR.scala +++ b/src/main/scala/rocket/CSR.scala @@ -333,8 +333,8 @@ class CSRFile(perfEventSets: EventSets = new EventSets(Seq()))(implicit p: Param val isaMaskString = (if (usingMulDiv) "M" else "") + (if (usingAtomics) "A" else "") + - (if (usingFPU) "F" else "") + - (if (usingFPU && xLen > 32) "D" else "") + + (if (fLen >= 32) "F" else "") + + (if (fLen >= 64) "D" else "") + (if (usingCompressed) "C" else "") + (if (usingRoCC) "X" else "") val isaString = "I" + isaMaskString + diff --git a/src/main/scala/rocket/RocketCore.scala b/src/main/scala/rocket/RocketCore.scala index 02385d42..0f3101c0 100644 --- a/src/main/scala/rocket/RocketCore.scala +++ b/src/main/scala/rocket/RocketCore.scala @@ -108,8 +108,8 @@ class Rocket(implicit p: Parameters) extends CoreModule()(p) val decode_table = { (if (usingMulDiv) new MDecode +: (xLen > 32).option(new M64Decode).toSeq else Nil) ++: (if (usingAtomics) new ADecode +: (xLen > 32).option(new A64Decode).toSeq else Nil) ++: - (if (usingFPU) new FDecode +: (xLen > 32).option(new F64Decode).toSeq else Nil) ++: - (if (usingFPU && xLen > 32) Seq(new DDecode, new D64Decode) else Nil) ++: + (if (fLen >= 32) new FDecode +: (xLen > 32).option(new F64Decode).toSeq else Nil) ++: + (if (fLen >= 64) new DDecode +: (xLen > 32).option(new D64Decode).toSeq else Nil) ++: (usingRoCC.option(new RoCCDecode)) ++: ((xLen > 32).option(new I64Decode)) ++: (usingVM.option(new SDecode)) ++: diff --git a/src/main/scala/tile/Core.scala b/src/main/scala/tile/Core.scala index 12d2a83f..888916a5 100644 --- a/src/main/scala/tile/Core.scala +++ b/src/main/scala/tile/Core.scala @@ -44,7 +44,7 @@ trait CoreParams { trait HasCoreParameters extends HasTileParameters { val coreParams: CoreParams = tileParams.core - val fLen = xLen // TODO relax this + val fLen = coreParams.fpu.map(_.fLen).getOrElse(0) val usingMulDiv = coreParams.mulDiv.nonEmpty val usingFPU = coreParams.fpu.nonEmpty diff --git a/src/main/scala/tile/FPU.scala b/src/main/scala/tile/FPU.scala index ce236919..3584c9ac 100644 --- a/src/main/scala/tile/FPU.scala +++ b/src/main/scala/tile/FPU.scala @@ -14,6 +14,7 @@ import freechips.rocketchip.util.property._ import chisel3.internal.sourceinfo.SourceInfo case class FPUParams( + fLen: Int = 64, divSqrt: Boolean = true, sfmaLatency: Int = 3, dfmaLatency: Int = 4