-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: master
Are you sure you want to change the base?
Conversation
yulightenyu
commented
Jan 23, 2025
… 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
// val l2Flush = Option.when(cacheParams.enableL2Flush) (Input(Bool())) | ||
// val l2FlushDone = Option.when(cacheParams.enableL2Flush) (Output(Bool())) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
//L2 Flush Done | ||
//io.l2FlushDone.foreach(_ := VecInit(slices.zipWithIndex.map { case (s, i) => s.io.l2FlushDone.getOrElse(false.B)}).reduce(_&_) ) | ||
|
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment needed here.
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()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment needed here.
val cmoAllValid = (state === sCMOREQ) | ||
val cmoAllBlock = (state === sCMOREQ) || (state === sWAITLINE) | ||
io.cmoAll.foreach {cmoAll => cmoAll.l2FlushDone :=(state ===sDONE)} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is 13?
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 |
There was a problem hiding this comment.
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 | ||
|
||
There was a problem hiding this comment.
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.
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))} |
There was a problem hiding this comment.
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.