xref: /XiangShan/src/main/scala/xiangshan/cache/mmu/L2TLBMissQueue.scala (revision 6967f5d579a359bb6f66c3cb4cb11bcefde4fb9c)
1/***************************************************************************************
2* Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
3* Copyright (c) 2020-2021 Peng Cheng Laboratory
4*
5* XiangShan is licensed under Mulan PSL v2.
6* You can use this software according to the terms and conditions of the Mulan PSL v2.
7* You may obtain a copy of Mulan PSL v2 at:
8*          http://license.coscl.org.cn/MulanPSL2
9*
10* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
11* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
12* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
13*
14* See the Mulan PSL v2 for more details.
15***************************************************************************************/
16
17package xiangshan.cache.mmu
18
19import org.chipsalliance.cde.config.Parameters
20import chisel3._
21import chisel3.util._
22import xiangshan._
23import xiangshan.cache.{HasDCacheParameters, MemoryOpConstants}
24import utils._
25import utility._
26import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp}
27import freechips.rocketchip.tilelink._
28
29/** L2TLB Miss Queue
30  * delay slot for reqs that pde miss in page cache
31  * if pde hit in page cache, go to LLPTW instead.
32  */
33class L2TlbMQBundle(implicit p: Parameters) extends L2TlbWithHptwIdBundle
34
35class L2TlbMQIO(implicit p: Parameters) extends MMUIOBaseBundle with HasPtwConst {
36  val in = Flipped(Decoupled(new L2TlbMQBundle()))
37  val out = Decoupled(new L2TlbMQBundle())
38}
39
40class L2TlbMissQueue(implicit p: Parameters) extends XSModule with HasPtwConst {
41  require(MissQueueSize >= (l2tlbParams.ifilterSize + l2tlbParams.dfilterSize))
42  val io = IO(new L2TlbMQIO())
43
44  io.out <> Queue(io.in, MissQueueSize, flush = Some(io.sfence.valid || io.csr.satp.changed || io.csr.vsatp.changed || io.csr.hgatp.changed))
45}
46