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(CoupledL2): add flush L2 all operation #348

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yulightenyu
Copy link
Contributor

  * Core initiate flush L2$ all operation by core and L2 interface <io.l2Flush>
  * The Barrier is added to wait all mshrs done before l2 flush begin
  * The FSM in SinkA is added to insert 'CBO_FLUSH' with set/way task to main pipe
  * The set/way are generated by the set loop(0~numSets) and way loop(0~numWays)
  * If cache-line is VALID, after CBO flush, main pipe sends back resp to SinkA
  * if cache-line is INVALID, main pipe drop it and send back resp to SinkA
  * During the process, SinkA/C is blocked by ready until l2 flush done
  * Snoop operations from SinkB is allowed to enter into main pipe
  * After all slices done, inform Core and exit coherency
  * fix tl2tl version with invalid <io.l2Flush>

… cacheline to release to memory

  * Core initiate flush L2$ all operation by core and L2 interface <io.l2Flush>
  * The Barrior is added to wait all mshrs done before l2 flush begin
  * The FSM in SinkA is added to insert 'CBO_FLUSH' with set/way task to main pipe
  * The set/way are generated by the set loop(0~numSets) and way loop(0~numWays)
  * If cacheline is VALID, after cbo flush, main pipe send back resp to sinkA
  * if cacheline is INVALID, main pipe drop it and send back resp to sinkA
  * During the process, sinkA/C is blocked by ready until l2 flush done
  * Snoop operations from sinkB is allowed to enter into mainpipe
  * After all slices done, inform Core and exit coherency
… cacheline to release to memory

  * Core initiate flush L2$ all operation by core and L2 interface <io.l2Flush>
  * The Barrior is added to wait all mshrs done before l2 flush begin
  * The FSM in SinkA is added to insert 'CBO_FLUSH' with set/way task to main pipe
  * The set/way are generated by the set loop(0~numSets) and way loop(0~numWays)
  * If cacheline is VALID, after cbo flush, main pipe send back resp to sinkA
  * if cacheline is INVALID, main pipe drop it and send back resp to sinkA
  * During the process, sinkA/C is blocked by ready until l2 flush done
  * Snoop operations from sinkB is allowed to enter into mainpipe
  * After all slices done, inform Core and exit coherency
  * fix tl2tl version with invalid io.l2Flush
… cacheline to release to memory

  * Core initiate flush L2$ all operation by core and L2 interface <io.l2Flush>
  * The Barrior is added to wait all mshrs done before l2 flush begin
  * The FSM in SinkA is added to insert 'CBO_FLUSH' with set/way task to main pipe
  * The set/way are generated by the set loop(0~numSets) and way loop(0~numWays)
  * If cacheline is VALID, after cbo flush, main pipe send back resp to sinkA
  * if cacheline is INVALID, main pipe drop it and send back resp to sinkA
  * During the process, sinkA/C is blocked by ready until l2 flush done
  * Snoop operations from sinkB is allowed to enter into mainpipe
  * After all slices done, inform Core and exit coherency
  * fix tl2tl version with invalid io.l2Flush
… cacheline to release to memory

  * Core initiate flush L2$ all operation by core and L2 interface <io.l2Flush>
  * The Barrior is added to wait all mshrs done before l2 flush begin
  * The FSM in SinkA is added to insert 'CBO_FLUSH' with set/way task to main pipe
  * The set/way are generated by the set loop(0~numSets) and way loop(0~numWays)
  * If cacheline is VALID, after cbo flush, main pipe send back resp to sinkA
  * if cacheline is INVALID, main pipe drop it and send back resp to sinkA
  * During the process, sinkA/C is blocked by ready until l2 flush done
  * Snoop operations from sinkB is allowed to enter into mainpipe
  * After all slices done, inform Core and exit coherency
  * fix tl2tl version with invalid io.l2Flush
… cacheline to release to memory

  * Core initiate flush L2$ all operation by core and L2 interface <io.l2Flush>
  * The Barrior is added to wait all mshrs done before l2 flush begin
  * The FSM in SinkA is added to insert 'CBO_FLUSH' with set/way task to main pipe
  * The set/way are generated by the set loop(0~numSets) and way loop(0~numWays)
  * If cacheline is VALID, after cbo flush, main pipe send back resp to sinkA
  * if cacheline is INVALID, main pipe drop it and send back resp to sinkA
  * During the process, sinkA/C is blocked by ready until l2 flush done
  * Snoop operations from sinkB is allowed to enter into mainpipe
  * After all slices done, inform Core and exit coherency
Comment on lines +319 to +320
// val l2Flush = Option.when(cacheParams.enableL2Flush) (Input(Bool()))
// val l2FlushDone = Option.when(cacheParams.enableL2Flush) (Output(Bool()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comments should be removed.

@@ -435,6 +438,9 @@ abstract class CoupledL2Base(implicit p: Parameters) extends LazyModule with Has

slice.io.error.ready := enableECC.asBool // TODO: fix the datapath as optional

// slice.io.l2Flush.foreach(_ := io.l2Flush.getOrElse(false.B))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comments should be removed.

Comment on lines +502 to +504
//L2 Flush Done
//io.l2FlushDone.foreach(_ := VecInit(slices.zipWithIndex.map { case (s, i) => s.io.l2FlushDone.getOrElse(false.B)}).reduce(_&_) )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comments should be removed.

@@ -108,6 +108,7 @@ class TaskBundle(implicit p: Parameters) extends L2Bundle

// for CMO
val cmoTask = Bool()
val cmoAll = Bool()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment needed here.

Comment on lines +459 to +466
class IOCMOAll(implicit p: Parameters) extends Bundle {
val l2Flush = Input(Bool())
val l2FlushDone = Output(Bool())

val cmoLineDone = Input(Bool())
val mshrValid = Input(Bool())
val cmoAllBlock = Output(Bool())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment needed here.

Comment on lines +48 to +50
val cmoAllValid = (state === sCMOREQ)
val cmoAllBlock = (state === sCMOREQ) || (state === sWAITLINE)
io.cmoAll.foreach {cmoAll => cmoAll.l2FlushDone :=(state ===sDONE)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant brackets.

task.off := parseAddress(a.address)._3
task.alias.foreach(_ := a.user.lift(AliasKey).getOrElse(0.U))
task.opcode := a.opcode
task.opcode := Mux(cmoAllValid, 13.U, a.opcode)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is 13?

Comment on lines +164 to +188
when (state === sIDLE && l2Flush && !mshrValid) {
state := sCMOREQ
}
when ((state === sCMOREQ) && io.task.fire) {
state := sWAITLINE
}
when (state === sWAITLINE && cmoLineDone) {
when (set===(numSets-1).U && way===(numWays-1).U) {
state := sDONE
}.otherwise {
when(way ===(numWays -1).U) {
way:=0.U
set:=set+1.U
}.otherwise {
way:=way+1.U
}
when (mshrValid) {
state := sCMOREQ
}.otherwise {
state := sWAITMSHR
}
}
}
when ((state === sWAITMSHR) && !mshrValid) {
state := sCMOREQ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read the coding standards carefully.


val mshr_req_s3 = req_s3.mshrTask
val sink_req_s3 = !mshr_req_s3
val sinkA_req_s3 = !mshr_req_s3 && req_s3.fromA
val sinkB_req_s3 = !mshr_req_s3 && req_s3.fromB
val sinkC_req_s3 = !mshr_req_s3 && req_s3.fromC

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank lines should not contain spaces.

Comment on lines +939 to +941
val cmoLineDrop = io.cmoAllBlock.getOrElse(false.B) && task_s3.valid && sinkA_req_s3 && (req_s3.opcode === CBOFlush) && (meta_s3.state === INVALID)
val cmoLineDone = io.cmoAllBlock.getOrElse(false.B) && task_s3.valid && mshr_cmoresp_s3
io.cmoLineDone.foreach{_ := RegNextN( ( cmoLineDone || cmoLineDrop) , 2, Some(false.B))}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read the coding standards carefully.

@linjuanZ linjuanZ changed the title feat(TL2CIHCoupledL2): add flush L2 all operation to search all VALID cache-line to release to memory feat(CoupledL2): add flush L2 all operation Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants