add option for 2-cycle load-use delay
This commit is contained in:
parent
b514c7b725
commit
c036cdc1ea
@ -676,9 +676,10 @@ class Control(implicit conf: RocketConfiguration) extends Component
|
|||||||
fp_data_hazard_ex && (ex_reg_mem_val || ex_reg_fp_val)
|
fp_data_hazard_ex && (ex_reg_mem_val || ex_reg_fp_val)
|
||||||
|
|
||||||
// stall for RAW/WAW hazards on LB/LH and mul/div in memory stage.
|
// stall for RAW/WAW hazards on LB/LH and mul/div in memory stage.
|
||||||
val mem_mem_cmd_bh = if (conf.fastLoadByte) Bool(false) else
|
val mem_mem_cmd_bh =
|
||||||
(mem_reg_mem_type === MT_B) || (mem_reg_mem_type === MT_BU) ||
|
if (!conf.fastLoadWord) Bool(true)
|
||||||
(mem_reg_mem_type === MT_H) || (mem_reg_mem_type === MT_HU)
|
else if (conf.fastLoadByte) Bool(false)
|
||||||
|
else AVec(MT_B, MT_BU, MT_H, MT_HU) contains mem_reg_mem_type
|
||||||
val data_hazard_mem = mem_reg_wen &&
|
val data_hazard_mem = mem_reg_wen &&
|
||||||
(id_raddr1 != UFix(0) && id_renx1 && id_raddr1 === io.dpath.mem_waddr ||
|
(id_raddr1 != UFix(0) && id_renx1 && id_raddr1 === io.dpath.mem_waddr ||
|
||||||
id_raddr2 != UFix(0) && id_renx2 && id_raddr2 === io.dpath.mem_waddr ||
|
id_raddr2 != UFix(0) && id_renx2 && id_raddr2 === io.dpath.mem_waddr ||
|
||||||
|
@ -135,13 +135,13 @@ class Datapath(implicit conf: RocketConfiguration) extends Component
|
|||||||
|
|
||||||
val dmem_resp_data = if (conf.fastLoadByte) io.dmem.resp.bits.data_subword else io.dmem.resp.bits.data
|
val dmem_resp_data = if (conf.fastLoadByte) io.dmem.resp.bits.data_subword else io.dmem.resp.bits.data
|
||||||
val ex_rs1 =
|
val ex_rs1 =
|
||||||
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(3), dmem_resp_data,
|
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(3) && Bool(conf.fastLoadWord), dmem_resp_data,
|
||||||
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(2), wb_reg_wdata,
|
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(2), wb_reg_wdata,
|
||||||
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(1), mem_reg_wdata,
|
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(1), mem_reg_wdata,
|
||||||
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(0), Bits(0),
|
Mux(ex_reg_rs1_bypass && ex_reg_rs1_lsb === UFix(0), Bits(0),
|
||||||
Cat(ex_reg_rs1_msb, ex_reg_rs1_lsb)))))
|
Cat(ex_reg_rs1_msb, ex_reg_rs1_lsb)))))
|
||||||
val ex_rs2 =
|
val ex_rs2 =
|
||||||
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(3), dmem_resp_data,
|
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(3) && Bool(conf.fastLoadWord), dmem_resp_data,
|
||||||
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(2), wb_reg_wdata,
|
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(2), wb_reg_wdata,
|
||||||
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(1), mem_reg_wdata,
|
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(1), mem_reg_wdata,
|
||||||
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(0), Bits(0),
|
Mux(ex_reg_rs2_bypass && ex_reg_rs2_lsb === UFix(0), Bits(0),
|
||||||
|
@ -728,7 +728,7 @@ class HellaCache(implicit conf: DCacheConfig) extends Component {
|
|||||||
|
|
||||||
val s1_read = isRead(s1_req.cmd)
|
val s1_read = isRead(s1_req.cmd)
|
||||||
val s1_write = isWrite(s1_req.cmd)
|
val s1_write = isWrite(s1_req.cmd)
|
||||||
val s1_readwrite = s1_read || s1_write
|
val s1_readwrite = s1_read || s1_write || isPrefetch(s1_req.cmd)
|
||||||
|
|
||||||
val dtlb = new TLB(8)
|
val dtlb = new TLB(8)
|
||||||
dtlb.io.ptw <> io.cpu.ptw
|
dtlb.io.ptw <> io.cpu.ptw
|
||||||
|
@ -9,6 +9,7 @@ import Util._
|
|||||||
case class RocketConfiguration(ntiles: Int, co: CoherencePolicyWithUncached,
|
case class RocketConfiguration(ntiles: Int, co: CoherencePolicyWithUncached,
|
||||||
icache: ICacheConfig, dcache: DCacheConfig,
|
icache: ICacheConfig, dcache: DCacheConfig,
|
||||||
fpu: Boolean, vec: Boolean,
|
fpu: Boolean, vec: Boolean,
|
||||||
|
fastLoadWord: Boolean = true,
|
||||||
fastLoadByte: Boolean = false)
|
fastLoadByte: Boolean = false)
|
||||||
{
|
{
|
||||||
val dcacheReqTagBits = 9 // enforce compliance with require()
|
val dcacheReqTagBits = 9 // enforce compliance with require()
|
||||||
@ -16,6 +17,7 @@ case class RocketConfiguration(ntiles: Int, co: CoherencePolicyWithUncached,
|
|||||||
val nxpr = 32
|
val nxpr = 32
|
||||||
val nxprbits = log2Up(nxpr)
|
val nxprbits = log2Up(nxpr)
|
||||||
val rvc = false
|
val rvc = false
|
||||||
|
if (fastLoadByte) require(fastLoadWord)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Tile(resetSignal: Bool = null)(confIn: RocketConfiguration) extends Component(resetSignal)
|
class Tile(resetSignal: Bool = null)(confIn: RocketConfiguration) extends Component(resetSignal)
|
||||||
|
Loading…
Reference in New Issue
Block a user