xref: /XiangShan/src/main/scala/xiangshan/frontend/Frontend.scala (revision 66314a3840e5ebe6cc81ca4725bde95942f67489)
1package xiangshan.frontend
2import utils.XSInfo
3import chisel3._
4import chisel3.util._
5import utils.PipelineConnect
6import xiangshan._
7
8
9class Frontend extends XSModule {
10  val io = IO(new Bundle() {
11    val backend = new FrontendToBackendIO
12  })
13
14  val ifu = Module(new IFU)
15  val fakeicache = Module(new FakeCache)
16  val ibuffer=  Module(new Ibuffer)
17
18  val needFlush = io.backend.redirectInfo.flush()
19
20  ifu.io.redirectInfo <> io.backend.redirectInfo
21  fakeicache.io.in <> ifu.io.icacheReq
22  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
28
29  for(out <- ibuffer.io.out){
30    XSInfo(out.fire(),
31      p"inst:${Hexadecimal(out.bits.instr)} pc:${Hexadecimal(out.bits.pc)}\n"
32    )
33  }
34
35
36}
37