提交 7e2cef1d 编写于 作者: Y Yinan Xu

Merge remote-tracking branch 'origin/fix-l2tlb-hit' into debian-gogogo

...@@ -117,7 +117,7 @@ class TlbEntry extends TlbBundle { ...@@ -117,7 +117,7 @@ class TlbEntry extends TlbBundle {
class TlbEntires(num: Int, tagLen: Int) extends TlbBundle { class TlbEntires(num: Int, tagLen: Int) extends TlbBundle {
require(log2Up(num)==log2Down(num)) require(log2Up(num)==log2Down(num))
/* vpn can be divide into three part */ /* vpn can be divide into three part */
// vpn: tagPart + addrPart // vpn: tagPart(17bit) + addrPart(8bit) + cutLenPart(2bit)
val cutLen = log2Up(num) val cutLen = log2Up(num)
val tag = UInt(tagLen.W) // NOTE: high part of vpn val tag = UInt(tagLen.W) // NOTE: high part of vpn
...@@ -127,9 +127,10 @@ class TlbEntires(num: Int, tagLen: Int) extends TlbBundle { ...@@ -127,9 +127,10 @@ class TlbEntires(num: Int, tagLen: Int) extends TlbBundle {
val vs = Vec(num, Bool()) val vs = Vec(num, Bool())
def tagClip(vpn: UInt, level: UInt) = { // full vpn => tagLen def tagClip(vpn: UInt, level: UInt) = { // full vpn => tagLen
Mux(level===0.U, Cat(vpn(vpnLen-1, vpnnLen*2+cutLen), 0.U(vpnnLen*2+cutLen)), val tmp = Mux(level===0.U, Cat(vpn(vpnLen-1, vpnnLen*2+cutLen), 0.U(vpnnLen*2)),
Mux(level===1.U, Cat(vpn(vpnLen-1, vpnnLen*1+cutLen), 0.U(vpnnLen*1+cutLen)), Mux(level===1.U, Cat(vpn(vpnLen-1, vpnnLen*1+cutLen), 0.U(vpnnLen*1)),
Cat(vpn(vpnLen-1, vpnnLen*0+cutLen), 0.U(vpnnLen*0+cutLen))))(tagLen-1, 0) Cat(vpn(vpnLen-1, vpnnLen*0+cutLen), 0.U(vpnnLen*0))))
tmp(tmp.getWidth-1, tmp.getWidth-tagLen)
} }
// NOTE: get insize idx // NOTE: get insize idx
...@@ -527,4 +528,4 @@ object TLB { ...@@ -527,4 +528,4 @@ object TLB {
tlb.io.ptw tlb.io.ptw
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册