1package xiangshan.frontend 2 3import chisel3._ 4import chisel3.util._ 5import utils.PipelineConnect 6import xiangshan._ 7import utils.XSInfo 8 9class Frontend extends XSModule { 10 val io = IO(new Bundle() { 11 val backend = new FrontendToBackendIO 12 }) 13 14 val fakeIFU = Module(new FakeIFU) 15 val ibuffer= Module(new Ibuffer) 16 17 val needFlush = io.backend.redirectInfo.flush() 18 19 fakeIFU.io.redirect.valid := needFlush 20 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 26 27 for(out <- ibuffer.io.out){ 28 XSInfo(out.fire(), 29 p"inst:${Hexadecimal(out.bits.instr)} pc:${Hexadecimal(out.bits.pc)}\n" 30 ) 31 } 32 33} 34