增加tlbl1的d位检查
This commit is contained in:
parent
e37a05f5db
commit
3490a3005a
|
@ -262,7 +262,7 @@ class Tlb extends Module with HasTlbConst with HasCSRConst {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
// ----------------- 指令虚实地址转换 -----------------
|
// ----------------- 数据虚实地址转换 -----------------
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
switch(dmmu_state) {
|
switch(dmmu_state) {
|
||||||
is(search_l1) {
|
is(search_l1) {
|
||||||
|
@ -299,6 +299,10 @@ class Tlb extends Module with HasTlbConst with HasCSRConst {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is(AccessType.store) {
|
is(AccessType.store) {
|
||||||
|
when(!dtlb.flag.d) {
|
||||||
|
dpage_fault := true.B
|
||||||
|
dmmu_state := search_fault
|
||||||
|
}.otherwise {
|
||||||
when(!dtlb.flag.w) {
|
when(!dtlb.flag.w) {
|
||||||
dpage_fault := true.B
|
dpage_fault := true.B
|
||||||
dmmu_state := search_fault
|
dmmu_state := search_fault
|
||||||
|
@ -307,15 +311,16 @@ class Tlb extends Module with HasTlbConst with HasCSRConst {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}.otherwise {
|
}.otherwise {
|
||||||
dmmu_state := search_l2
|
dmmu_state := search_l2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is(search_l2) {
|
is(search_l2) {
|
||||||
when(il2_hit_vec.asUInt.orR) {
|
when(dl2_hit_vec.asUInt.orR) {
|
||||||
dmmu_state := search_l1
|
dmmu_state := search_l1
|
||||||
dtlb := tlbl2(PriorityEncoder(il2_hit_vec))
|
dtlb := tlbl2(PriorityEncoder(dl2_hit_vec))
|
||||||
}.otherwise {
|
}.otherwise {
|
||||||
req_ptw(1) := true.B
|
req_ptw(1) := true.B
|
||||||
when(!ar_sel && io.dcache.ptw.vpn.ready) {
|
when(!ar_sel && io.dcache.ptw.vpn.ready) {
|
||||||
|
@ -336,7 +341,7 @@ class Tlb extends Module with HasTlbConst with HasCSRConst {
|
||||||
}.otherwise {
|
}.otherwise {
|
||||||
// 在内存中找寻到了页表,将其写入TLB
|
// 在内存中找寻到了页表,将其写入TLB
|
||||||
val replace_entry = Wire(tlbBundle)
|
val replace_entry = Wire(tlbBundle)
|
||||||
replace_entry.vpn := ivpn
|
replace_entry.vpn := dvpn
|
||||||
replace_entry.asid := satp.asid
|
replace_entry.asid := satp.asid
|
||||||
replace_entry.flag := io.dcache.ptw.pte.bits.entry.flag
|
replace_entry.flag := io.dcache.ptw.pte.bits.entry.flag
|
||||||
replace_entry.ppn := io.dcache.ptw.pte.bits.entry.ppn
|
replace_entry.ppn := io.dcache.ptw.pte.bits.entry.ppn
|
||||||
|
|
Loading…
Reference in New Issue