Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

area(CacheOpDecoder): remove CacheOpDecoder #4050

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/scala/xiangshan/backend/MemBlock.scala
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ class MemBlockInlinedImp(outer: MemBlockInlined) extends LazyModuleImp(outer)
//val delayedDcacheRefill = RegNext(dcache.io.lsu.lsq)

val csrCtrl = DelayN(io.ooo_to_mem.csrCtrl, 2)
dcache.io.csr.distribute_csr <> csrCtrl.distribute_csr
dcache.io.l2_pf_store_only := RegNext(io.ooo_to_mem.csrCtrl.l2_pf_store_only, false.B)
io.error <> DelayNWithValid(dcache.io.error, 2)
when(!csrCtrl.cache_error_enable){
Expand Down
27 changes: 0 additions & 27 deletions src/main/scala/xiangshan/cache/dcache/DCacheWrapper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ class DCacheIO(implicit p: Parameters) extends DCacheBundle {
val hartId = Input(UInt(hartIdLen.W))
val l2_pf_store_only = Input(Bool())
val lsu = new DCacheToLsuIO
val csr = new L1CacheToCsrIO
val error = ValidIO(new L1CacheErrorInfo)
val mshrFull = Output(Bool())
val memSetPattenDetected = Output(Bool())
Expand Down Expand Up @@ -1671,32 +1670,6 @@ class DCacheImp(outer: DCache) extends LazyModuleImp(outer) with HasDCacheParame
sink.bits := source.bits
}


//----------------------------------------
// Customized csr cache op support
val cacheOpDecoder = Module(new CSRCacheOpDecoder("dcache", CacheInstrucion.COP_ID_DCACHE))
cacheOpDecoder.io.csr <> io.csr
bankedDataArray.io.cacheOp.req := cacheOpDecoder.io.cache.req
// dup cacheOp_req_valid
bankedDataArray.io.cacheOp_req_dup.zipWithIndex.map{ case(dup, i) => dup := cacheOpDecoder.io.cache_req_dup(i) }
// dup cacheOp_req_bits_opCode
bankedDataArray.io.cacheOp_req_bits_opCode_dup.zipWithIndex.map{ case (dup, i) => dup := cacheOpDecoder.io.cacheOp_req_bits_opCode_dup(i) }

tagArray.io.cacheOp.req := cacheOpDecoder.io.cache.req
// dup cacheOp_req_valid
tagArray.io.cacheOp_req_dup.zipWithIndex.map{ case(dup, i) => dup := cacheOpDecoder.io.cache_req_dup(i) }
// dup cacheOp_req_bits_opCode
tagArray.io.cacheOp_req_bits_opCode_dup.zipWithIndex.map{ case (dup, i) => dup := cacheOpDecoder.io.cacheOp_req_bits_opCode_dup(i) }

cacheOpDecoder.io.cache.resp.valid := bankedDataArray.io.cacheOp.resp.valid ||
tagArray.io.cacheOp.resp.valid
cacheOpDecoder.io.cache.resp.bits := Mux1H(List(
bankedDataArray.io.cacheOp.resp.valid -> bankedDataArray.io.cacheOp.resp.bits,
tagArray.io.cacheOp.resp.valid -> tagArray.io.cacheOp.resp.bits,
))
cacheOpDecoder.io.error := io.error
assert(!((bankedDataArray.io.cacheOp.resp.valid +& tagArray.io.cacheOp.resp.valid) > 1.U))

//----------------------------------------
// performance counters
val num_loads = PopCount(ldu.map(e => e.io.lsu.req.fire))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ abstract class AbstractBankedDataArray(implicit p: Parameters) extends DCacheMod
// when bank_conflict, read (1) port should be ignored
val bank_conflict_slow = Output(Vec(LoadPipelineWidth, Bool()))
val disable_ld_fast_wakeup = Output(Vec(LoadPipelineWidth, Bool()))
// customized cache op port
val cacheOp = Flipped(new L1CacheInnerOpIO)
val cacheOp_req_dup = Vec(DCacheDupNum, Flipped(Valid(new CacheCtrlReqInfo)))
val cacheOp_req_bits_opCode_dup = Input(Vec(DCacheDupNum, UInt(XLEN.W)))
val pseudo_error = Flipped(DecoupledIO(Vec(DCacheBanks, new CtrlUnitSignalingBundle)))
})

Expand Down Expand Up @@ -603,9 +599,6 @@ class SramedDataArray(implicit p: Parameters) extends AbstractBankedDataArray {
}
}

io.cacheOp.resp.valid := false.B
io.cacheOp.resp.bits := DontCare

val tableName = "BankConflict" + p(XSCoreParamsKey).HartId.toString
val siteName = "BankedDataArray" + p(XSCoreParamsKey).HartId.toString
val bankConflictTable = ChiselDB.createTable(tableName, new BankConflictDB)
Expand Down Expand Up @@ -893,9 +886,6 @@ class BankedDataArray(implicit p: Parameters) extends AbstractBankedDataArray {
}
}

io.cacheOp.resp.valid := false.B
io.cacheOp.resp.bits := DontCare

val tableName = "BankConflict" + p(XSCoreParamsKey).HartId.toString
val siteName = "BankedDataArray" + p(XSCoreParamsKey).HartId.toString
val bankConflictTable = ChiselDB.createTable(tableName, new BankConflictDB)
Expand Down
6 changes: 0 additions & 6 deletions src/main/scala/xiangshan/cache/dcache/meta/TagArray.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ class DuplicatedTagArray(readPorts: Int)(implicit p: Parameters) extends Abstrac
val read = Vec(readPorts, Flipped(DecoupledIO(new TagReadReq)))
val resp = Output(Vec(readPorts, Vec(nWays, UInt(encTagBits.W))))
val write = Flipped(DecoupledIO(new TagWriteReq))
// customized cache op port
val cacheOp = Flipped(new L1CacheInnerOpIO)
val cacheOp_req_dup = Vec(DCacheDupNum, Flipped(Valid(new CacheCtrlReqInfo)))
val cacheOp_req_bits_opCode_dup = Input(Vec(DCacheDupNum, UInt(XLEN.W)))
})

val array = Seq.fill(readPorts) { Module(new TagArray) }
Expand Down Expand Up @@ -130,8 +126,6 @@ class DuplicatedTagArray(readPorts: Int)(implicit p: Parameters) extends Abstrac
io.resp(i) := array(i).io.resp
tag_read_oh(i) := PopCount(array(i).io.read.fire)
}
io.cacheOp.resp.valid := false.B
io.cacheOp.resp.bits := DontCare

XSPerfAccumulate("tag_read_counter", tag_read_oh.reduce(_ + _))
}
Loading