Frontend.scala 743 字节
Newer Older
1 2 3 4 5 6
package xiangshan.frontend

import chisel3._
import chisel3.util._
import utils.PipelineConnect
import xiangshan._
L
LinJiawei 已提交
7
import xiangshan.utils.XSInfo
8 9 10 11 12 13 14 15 16

class Frontend extends XSModule {
  val io = IO(new Bundle() {
    val backend = new FrontendToBackendIO
  })

  val fakeIFU = Module(new FakeIFU)
  val ibuffer=  Module(new Ibuffer)

17 18 19 20
  val needFlush = io.backend.redirectInfo.flush()

  fakeIFU.io.redirect.valid := needFlush
  fakeIFU.io.redirect.bits := io.backend.redirectInfo.redirect
21 22

  ibuffer.io.in <> fakeIFU.io.fetchPacket
23
  ibuffer.io.flush := needFlush
24 25

  io.backend.cfVec <> ibuffer.io.out
L
LinJiawei 已提交
26 27 28 29 30 31 32

  for(out <- ibuffer.io.out){
    XSInfo(out.fire(),
      p"inst:${Hexadecimal(out.bits.instr)} pc:${Hexadecimal(out.bits.pc)}\n"
    )
  }

33
}