未验证 提交 9930e66f 编写于 作者: L Lemover 提交者: GitHub

l1tlb: for non-block tlb port, resp should always be ready (#1673)

* l1tlb: for non-block tlb port, resp should always be ready

* l1tlb: add tlb refill duplicate assert
上级 6ef4f6f6
......@@ -184,6 +184,7 @@ class TLB(Width: Int, Block: Seq[Boolean], q: TLBParameters)(implicit p: Paramet
def handle_nonblock(idx: Int): Unit = {
io.requestor(idx).resp.valid := req_out_v(idx)
io.requestor(idx).req.ready := io.requestor(idx).resp.ready // should always be true
XSError(!io.requestor(idx).resp.ready, s"${q.name} port ${idx} is non-block, resp.ready must be true.B")
val ptw_just_back = ptw.resp.fire && ptw.resp.bits.entry.hit(get_pn(req_out(idx).vaddr), asid = io.csr.satp.asid, allType = true)
io.ptw.req(idx).valid := RegNext(req_out_v(idx) && missVec(idx) && !ptw_just_back, false.B) // TODO: remove the regnext, timing
......
......@@ -83,6 +83,9 @@ class TLBFA(
v(io.w.bits.wayIdx) := true.B
entries(io.w.bits.wayIdx).apply(io.w.bits.data, io.csr.satp.asid, io.w.bits.data_replenish)
}
// write assert, shoulg not duplicate with the existing entries
val w_hit_vec = VecInit(entries.zip(v).map{case (e, vi) => e.hit(io.w.bits.data.entry.tag, io.csr.satp.asid) && vi })
XSError(io.w.valid && Cat(w_hit_vec).orR, s"${parentName} refill, duplicate with existing entries")
val refill_vpn_reg = RegNext(io.w.bits.data.entry.tag)
val refill_wayIdx_reg = RegNext(io.w.bits.wayIdx)
......@@ -302,7 +305,7 @@ class TlbStorageWrapper(ports: Int, q: TLBParameters)(implicit p: Parameters) ex
// TODO: wrap Normal page and super page together, wrap the declare & refill dirty codes
val normalPage = TlbStorage(
parentName = q.name + "_storage",
parentName = q.name + "_np_storage",
associative = q.normalAssociative,
ports = ports,
nSets = q.normalNSets,
......@@ -312,7 +315,7 @@ class TlbStorageWrapper(ports: Int, q: TLBParameters)(implicit p: Parameters) ex
superPage = false
)
val superPage = TlbStorage(
parentName = q.name + "_storage",
parentName = q.name + "_sp_storage",
associative = q.superAssociative,
ports = ports,
nSets = q.superNSets,
......
......@@ -86,7 +86,7 @@ class AtomicsUnit(implicit p: Parameters) extends XSModule with MemoryOpConstant
io.dtlb.req.valid := false.B
io.dtlb.req.bits := DontCare
io.dtlb.resp.ready := false.B
io.dtlb.resp.ready := true.B
io.flush_sbuffer.valid := false.B
......@@ -125,7 +125,6 @@ class AtomicsUnit(implicit p: Parameters) extends XSModule with MemoryOpConstant
// keep firing until tlb hit
io.dtlb.req.valid := true.B
io.dtlb.req.bits.vaddr := in.src(0)
io.dtlb.resp.ready := true.B
val is_lr = in.uop.ctrl.fuOpType === LSUOpType.lr_w || in.uop.ctrl.fuOpType === LSUOpType.lr_d
io.dtlb.req.bits.cmd := Mux(is_lr, TlbCmd.atom_read, TlbCmd.atom_write)
io.dtlb.req.bits.debug.robIdx := in.uop.robIdx
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册