IntegerBlock.scala 1.3 KB
Newer Older
1 2 3 4 5
package xiangshan.backend

import chisel3._
import chisel3.util._
import xiangshan._
6 7 8
import xiangshan.backend.regfile.Regfile
import xiangshan.backend.exu._

9 10 11 12 13 14 15 16 17 18 19 20 21

// wbIntRegs,wbFpRegs are used for updating busytables
class IntBlockToCtrlIO extends XSBundle {
  // TODO: should not be IntExuCnt
  val wbIntRegs = Vec(exuParameters.IntExuCnt, Flipped(ValidIO(new ExuOutput)))
  val wbFpRegs = Vec(exuParameters.IntExuCnt, Flipped(ValidIO(new ExuOutput)))
  val numExist = Vec(exuParameters.IntExuCnt, Output(UInt(log2Ceil(IssQueSize).W)))
}

class IntegerBlock extends XSModule {
  val io = IO(new Bundle {
    val fromCtrlBlock = Flipped(new CtrlToIntBlockIO)
    val toCtrlBlock = new IntBlockToCtrlIO
22
    // val writebackFromFpLs = 
23 24
  })

25 26 27 28 29 30 31 32 33 34 35 36 37 38
  // integer regfile
  val regfile = Module(new Regfile(
    numReadPorts = NRIntReadPorts,
    numWirtePorts = NRIntWritePorts,
    hasZero = true
  ))

  val jmpExeUnit = Module(new JumpExeUnit)
  val mduExeUnits = Array.tabulate(exuParameters.MduCnt)(_ => Module(new MulDivExeUnit))
  val aluExeUnits = Array.tabulate(exuParameters.AluCnt)(_ => Module(new AluExeUnit))
  val exeUnits = jmpExeUnit +: (mduExeUnits ++ aluExeUnits)
  val exuConfigs = exeUnits.map(_.config)

  // generate reservation stations
39

40 41
  // connect writeback
  // val wbArbiter = 
42
}