2020-11-24 17:09:22 +08:00
|
|
|
|
2020-06-21 11:20:06 +08:00
|
|
|
package xiangshan.backend.exu
|
|
|
|
|
|
|
|
import chisel3._
|
|
|
|
import chisel3.util._
|
2020-07-14 19:38:20 +08:00
|
|
|
import utils._
|
2020-11-16 12:54:50 +08:00
|
|
|
import xiangshan.backend.exu.Exu.aluExeUnitCfg
|
|
|
|
import xiangshan.backend.fu.Alu
|
2020-06-21 11:20:06 +08:00
|
|
|
|
2020-11-16 12:54:50 +08:00
|
|
|
class AluExeUnit extends Exu(aluExeUnitCfg)
|
2020-11-08 09:25:42 +08:00
|
|
|
{
|
|
|
|
val alu = supportedFunctionUnits.collectFirst{
|
|
|
|
case a: Alu => a
|
|
|
|
}.get
|
|
|
|
|
2020-11-15 20:35:03 +08:00
|
|
|
io.toInt.bits.redirectValid := alu.redirectOutValid
|
|
|
|
io.toInt.bits.redirect := alu.redirectOut
|
2020-11-16 15:26:34 +08:00
|
|
|
|
2020-11-24 17:09:22 +08:00
|
|
|
XSDebug(io.fromInt.valid || io.redirect.valid,
|
|
|
|
p"fromInt(${io.fromInt.valid} ${io.fromInt.ready}) toInt(${io.toInt.valid} ${io.toInt.ready})" +
|
2020-12-21 19:42:34 +08:00
|
|
|
p"Redirect:(${io.redirect.valid}) roqIdx:${io.redirect.bits.roqIdx}\n",
|
2020-11-16 15:26:34 +08:00
|
|
|
)
|
2020-11-24 17:09:22 +08:00
|
|
|
XSDebug(io.fromInt.valid,
|
|
|
|
p"src1:${Hexadecimal(io.fromInt.bits.src1)} src2:${Hexadecimal(io.fromInt.bits.src2)} " +
|
|
|
|
p"src3:${Hexadecimal(io.fromInt.bits.src3)} func:${Binary(io.fromInt.bits.uop.ctrl.fuOpType)} " +
|
|
|
|
p"pc:${Hexadecimal(io.fromInt.bits.uop.cf.pc)} roqIdx:${io.fromInt.bits.uop.roqIdx}\n"
|
2020-11-16 15:26:34 +08:00
|
|
|
)
|
2020-11-24 17:09:22 +08:00
|
|
|
XSDebug(io.toInt.valid,
|
|
|
|
p"res:${Hexadecimal(io.toInt.bits.data)}\n"
|
2020-11-16 15:26:34 +08:00
|
|
|
)
|
2020-06-21 11:20:06 +08:00
|
|
|
}
|