1
0

don't mux data_word_bypass between IOMSHR and cache

This commit is contained in:
Howard Mao 2015-09-10 17:57:03 -07:00
parent d89bcd3922
commit 16c748576a
2 changed files with 8 additions and 9 deletions

View File

@ -70,7 +70,7 @@ class HellaCacheResp extends HasCoreMemOp with HasCoreData {
val nack = Bool() // comes 2 cycles after req.fire val nack = Bool() // comes 2 cycles after req.fire
val replay = Bool() val replay = Bool()
val has_data = Bool() val has_data = Bool()
val data_subword = Bits(width = coreDataBits) val data_word_bypass = Bits(width = coreDataBits)
val store_data = Bits(width = coreDataBits) val store_data = Bits(width = coreDataBits)
} }
@ -185,8 +185,7 @@ class IOMSHR(id: Int) extends L1HellaCacheModule {
io.resp.valid := (state === s_resp) io.resp.valid := (state === s_resp)
io.resp.bits := req io.resp.bits := req
io.resp.bits.has_data := isRead(req.cmd) io.resp.bits.has_data := isRead(req.cmd)
io.resp.bits.data := loadgen.word io.resp.bits.data := loadgen.byte
io.resp.bits.data_subword := loadgen.byte
io.resp.bits.store_data := req.data io.resp.bits.store_data := req.data
io.resp.bits.nack := Bool(false) io.resp.bits.nack := Bool(false)
io.resp.bits.replay := io.resp.valid io.resp.bits.replay := io.resp.valid
@ -1019,8 +1018,7 @@ class HellaCache extends L1HellaCacheModule {
cache_resp.valid := (s2_replay || s2_valid_masked && s2_hit) && !s2_data_correctable cache_resp.valid := (s2_replay || s2_valid_masked && s2_hit) && !s2_data_correctable
cache_resp.bits := s2_req cache_resp.bits := s2_req
cache_resp.bits.has_data := isRead(s2_req.cmd) || s2_sc cache_resp.bits.has_data := isRead(s2_req.cmd) || s2_sc
cache_resp.bits.data := loadgen.word cache_resp.bits.data := loadgen.byte | s2_sc_fail
cache_resp.bits.data_subword := loadgen.byte | s2_sc_fail
cache_resp.bits.store_data := s2_req.data cache_resp.bits.store_data := s2_req.data
cache_resp.bits.nack := s2_valid && s2_nack cache_resp.bits.nack := s2_valid && s2_nack
cache_resp.bits.replay := s2_replay cache_resp.bits.replay := s2_replay
@ -1033,6 +1031,7 @@ class HellaCache extends L1HellaCacheModule {
mshrs.io.resp.ready := !cache_pass mshrs.io.resp.ready := !cache_pass
io.cpu.resp := Mux(cache_pass, cache_resp, uncache_resp) io.cpu.resp := Mux(cache_pass, cache_resp, uncache_resp)
io.cpu.resp.bits.data_word_bypass := loadgen.word
io.cpu.ordered := mshrs.io.fence_rdy && !s1_valid && !s2_valid io.cpu.ordered := mshrs.io.fence_rdy && !s1_valid && !s2_valid
io.cpu.replay_next.valid := s1_replay && (s1_read || s1_sc) io.cpu.replay_next.valid := s1_replay && (s1_read || s1_sc)
io.cpu.replay_next.bits := s1_req.tag io.cpu.replay_next.bits := s1_req.tag

View File

@ -167,8 +167,8 @@ class Rocket extends CoreModule
(id_illegal_insn, UInt(Causes.illegal_instruction)))) (id_illegal_insn, UInt(Causes.illegal_instruction))))
val dcache_bypass_data = val dcache_bypass_data =
if(params(FastLoadByte)) io.dmem.resp.bits.data_subword if(params(FastLoadByte)) io.dmem.resp.bits.data
else if(params(FastLoadWord)) io.dmem.resp.bits.data else if(params(FastLoadWord)) io.dmem.resp.bits.data_word_bypass
else wb_reg_wdata else wb_reg_wdata
// detect bypass opportunities // detect bypass opportunities
@ -364,7 +364,7 @@ class Rocket extends CoreModule
val wb_wen = wb_valid && wb_ctrl.wxd val wb_wen = wb_valid && wb_ctrl.wxd
val rf_wen = wb_wen || ll_wen val rf_wen = wb_wen || ll_wen
val rf_waddr = Mux(ll_wen, ll_waddr, wb_waddr) val rf_waddr = Mux(ll_wen, ll_waddr, wb_waddr)
val rf_wdata = Mux(dmem_resp_valid && dmem_resp_xpu, io.dmem.resp.bits.data_subword, val rf_wdata = Mux(dmem_resp_valid && dmem_resp_xpu, io.dmem.resp.bits.data,
Mux(ll_wen, ll_wdata, Mux(ll_wen, ll_wdata,
Mux(wb_ctrl.csr != CSR.N, csr.io.rw.rdata, Mux(wb_ctrl.csr != CSR.N, csr.io.rw.rdata,
wb_reg_wdata))) wb_reg_wdata)))
@ -474,7 +474,7 @@ class Rocket extends CoreModule
io.fpu.inst := id_inst io.fpu.inst := id_inst
io.fpu.fromint_data := ex_rs(0) io.fpu.fromint_data := ex_rs(0)
io.fpu.dmem_resp_val := dmem_resp_valid && dmem_resp_fpu io.fpu.dmem_resp_val := dmem_resp_valid && dmem_resp_fpu
io.fpu.dmem_resp_data := io.dmem.resp.bits.data io.fpu.dmem_resp_data := io.dmem.resp.bits.data_word_bypass
io.fpu.dmem_resp_type := io.dmem.resp.bits.typ io.fpu.dmem_resp_type := io.dmem.resp.bits.typ
io.fpu.dmem_resp_tag := dmem_resp_waddr io.fpu.dmem_resp_tag := dmem_resp_waddr