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

feat(FTB, FTQ): split FTB meta SRAM and FTQ meta SRAM #4360

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
6 changes: 4 additions & 2 deletions src/main/scala/xiangshan/frontend/FTB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package xiangshan.frontend

import chisel3._
import chisel3.util._
import coupledL2.utils.SplittedSRAM
import org.chipsalliance.cde.config.Parameters
import scala.{Tuple2 => &}
import utility._
Expand Down Expand Up @@ -493,14 +494,15 @@ class FTB(implicit p: Parameters) extends BasePredictor with FTBParams with BPUU
})

// Extract holdRead logic to fix bug that update read override predict read result
val ftb = Module(new SRAMTemplate(
val ftb = Module(new SplittedSRAM(
new FTBEntryWithTag,
set = numSets,
way = numWays,
dataSplit = 8,
shouldReset = true,
holdRead = false,
singlePort = true,
withClockGate = true,
clockGated = true,
hasMbist = hasMbist
))
private val mbistPl = MbistPipeline.PlaceMbistPipeline(1, "MbistPipeFtb", hasMbist)
Expand Down
11 changes: 10 additions & 1 deletion src/main/scala/xiangshan/frontend/NewFtq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package xiangshan.frontend

import chisel3._
import chisel3.util._
import coupledL2.utils.SplittedSRAM
import org.chipsalliance.cde.config.Parameters
import utility._
import utility.ChiselDB
Expand Down Expand Up @@ -77,7 +78,15 @@ class FtqNRSRAM[T <: Data](gen: T, numRead: Int)(implicit p: Parameters) extends
})

for (i <- 0 until numRead) {
val sram = Module(new SRAMTemplate(gen, FtqSize, withClockGate = true, hasMbist = hasMbist))
val sram = Module(new SplittedSRAM(
gen,
set = FtqSize,
way = 1,
dataSplit = 2,
singlePort = false,
clockGated = true,
hasMbist = hasMbist
))
sram.io.r.req.valid := io.ren(i)
sram.io.r.req.bits.setIdx := io.raddr(i)
io.rdata(i) := sram.io.r.resp.data(0)
Expand Down
Loading