Frontend.scala 788 字节
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 utils.XSInfo
8 9 10 11 12 13

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

14 15
  val ifu = Module(new IFU)
  val fakeicache = Module(new FakeCache)
16 17
  val ibuffer=  Module(new Ibuffer)

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

20 21 22
  ifu.io.redirectInfo <> io.backend.redirectInfo
  fakeicache.io.in <> ifu.io.icacheReq
  ifu.io.icacheResp <> fakeicache.io.out
23

24
  ibuffer.io.in <> ifu.io.fetchPacket
25
  ibuffer.io.flush := needFlush
26 27

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

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

35

36
}