Skip to content

Commit

Permalink
power(IssueQueue): add clock gate for deqDelay reg (OpenXiangShan#3583)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofeibao-xjtu authored Sep 18, 2024
1 parent b7dc2d1 commit 52fc0c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/xiangshan/backend/issue/IssueBlockParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ case class IssueBlockParams(
MixedVec(exuBlockParams.filterNot(_.fakeUnit).map(x => DecoupledIO(new IssueQueueIssueBundle(this, x))))
}

def genIssueValidBundle(implicit p: Parameters): MixedVec[ValidIO[IssueQueueIssueBundle]] = {
MixedVec(exuBlockParams.filterNot(_.fakeUnit).map(x => ValidIO(new IssueQueueIssueBundle(this, x))))
}

def genWBWakeUpSinkValidBundle(implicit p: Parameters): MixedVec[ValidIO[IssueQueueWBWakeUpBundle]] = {
val intBundle: Seq[ValidIO[IssueQueueWBWakeUpBundle]] = schdType match {
case IntScheduler() | MemScheduler() => needWakeupFromIntWBPort.map(x => ValidIO(new IssueQueueWBWakeUpBundle(x._2.map(_.exuIdx), backendParam))).toSeq
Expand Down
15 changes: 12 additions & 3 deletions src/main/scala/xiangshan/backend/issue/IssueQueue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,21 @@ class IssueQueueImp(override val wrapper: IssueQueue)(implicit p: Parameters, va
deq.bits.common.perfDebugInfo.issueTime := GTimer() + 1.U
}

io.deqDelay.zip(deqBeforeDly).foreach { case (deqDly, deq) =>
deqDly.valid := RegNext(deq.valid)
deqDly.bits := RegNext(deq.bits)
val deqDelay = Reg(params.genIssueValidBundle)
deqDelay.zip(deqBeforeDly).foreach { case (deqDly, deq) =>
deqDly.valid := deq.valid
when(validVec.asUInt.orR) {
deqDly.bits := deq.bits
}
// deqBeforeDly.ready is always true
deq.ready := true.B
}
io.deqDelay.zip(deqDelay).foreach { case (sink, source) =>
sink.valid := source.valid
sink.bits := source.bits
}
if(backendParams.debugEn) {
dontTouch(deqDelay)
dontTouch(io.deqDelay)
dontTouch(deqBeforeDly)
}
Expand Down

0 comments on commit 52fc0c9

Please sign in to comment.