FPUSubModule.scala 508 字节
Newer Older
1
package xiangshan.backend.fu.fpu
L
FPUv0.1  
LinJiawei 已提交
2 3 4

import chisel3._
import chisel3.util._
5
import xiangshan.backend.fu.{FuConfig, FunctionUnit, HasPipelineReg}
L
FPUv0.1  
LinJiawei 已提交
6 7 8 9 10 11 12

trait HasUIntToSIntHelper {
  implicit class UIntToSIntHelper(x: UInt){
    def toSInt: SInt = Cat(0.U(1.W), x).asSInt()
  }
}

13
abstract class FPUSubModule extends FunctionUnit(len = 65)
L
LinJiawei 已提交
14 15 16
  with HasUIntToSIntHelper
{
  val rm = IO(Input(UInt(3.W)))
17
  val fflags = IO(Output(UInt(5.W)))
L
LinJiawei 已提交
18
}
19

20 21
abstract class FPUPipelineModule
  extends FPUSubModule
L
LinJiawei 已提交
22
  with HasPipelineReg