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

fix(Uncache): handle flush #4230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions src/main/scala/xiangshan/cache/dcache/Uncache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,20 @@ class UncacheImp(outer: Uncache)extends LazyModuleImp(outer)

val entries = Reg(Vec(UncacheBufferSize, new UncacheEntry))
val states = RegInit(VecInit(Seq.fill(UncacheBufferSize)(0.U.asTypeOf(new UncacheEntryState))))
val fence = RegInit(Bool(), false.B)
val s_idle :: s_inflight :: s_wait_return :: Nil = Enum(3)
val uState = RegInit(s_idle)

// drain buffer
val empty = Wire(Bool())
val f1_needDrain = Wire(Bool())
val do_uarch_drain = RegNext(f1_needDrain)
val do_uarch_drain = RegInit(false.B)
when((f1_needDrain || io.flush.valid) && !empty){
do_uarch_drain := true.B
}.elsewhen(empty){
do_uarch_drain := false.B
}.otherwise{
do_uarch_drain := false.B
}

val q0_entry = Wire(new UncacheEntry)
val q0_canSentIdx = Wire(UInt(INDEX_WIDTH.W))
Expand Down
Loading