FloatBlock.scala 1.2 KB
Newer Older
1 2 3 4 5
package xiangshan.backend

import chisel3._
import chisel3.util._
import xiangshan._
6 7
import xiangshan.backend.regfile.Regfile
import xiangshan.backend.exu._
8 9 10 11 12 13 14 15 16 17 18 19 20


class FpBlockToCtrlIO extends XSBundle {
  // TODO: should not be FpExuCnt
  val wbIntRegs = Vec(exuParameters.FpExuCnt, Flipped(ValidIO(new ExuOutput)))
  val wbFpRegs = Vec(exuParameters.FpExuCnt, Flipped(ValidIO(new ExuOutput)))
  val numExist = Vec(exuParameters.FpExuCnt, Output(UInt(log2Ceil(IssQueSize).W)))
}

class FloatBlock extends XSModule {
  val io = IO(new Bundle {
    val fromCtrlBlock = Flipped(new CtrlToFpBlockIO)
    val toCtrlBlock = new FpBlockToCtrlIO
21
    // val writebackFromFpLs = 
22 23
  })

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
  // floating-point regfile
  val regfile = Module(new Regfile(
    numReadPorts = NRFpReadPorts,
    numWirtePorts = NRFpWritePorts,
    hasZero = false
  ))

  val fmacExeUnits = Array.tabulate(exuParameters.FmacCnt)(_ => Module(new FmacExeUnit))
  val fmiscExeUnits = Array.tabulate(exuParameters.FmiscCnt)(_ => Module(new FmiscExeUnit))
  val exeUnits = fmacExeUnits ++ fmiscExeUnits
  val exuConfigs = exeUnits.map(_.config)

  // generate reservation stations

  // connect writeback
  // val wbArbiter = 
40 41

}