@@ -9,6 +9,7 @@ import pipeline.common.MultiQueue
99import pipeline .rob .bundles ._
1010import pipeline .rob .enums .{RegDataLocateSel , RobDistributeSel , RobInstState => State }
1111import spec ._
12+ import pipeline .common .DistributedQueuePlus
1213
1314// assert: commits cannot ready 1 but not 0
1415class Rob (
@@ -57,15 +58,28 @@ class Rob(
5758
5859 val matchTable = RegInit (VecInit (Seq .fill(spec.Count .reg)(RobMatchBundle .default)))
5960
61+ // val queue = Module(
62+ // new MultiQueue(
63+ // robLength,
64+ // issueNum,
65+ // commitNum,
66+ // new RobInstStoreBundle,
67+ // RobInstStoreBundle.default
68+ // )
69+ // )
70+
6071 val queue = Module (
61- new MultiQueue (
62- robLength,
72+ new DistributedQueuePlus (
6373 issueNum,
6474 commitNum,
75+ Param .Width .Rob ._channelNum,
76+ Param .Width .Rob ._channelLength,
6577 new RobInstStoreBundle ,
66- RobInstStoreBundle .default
78+ RobInstStoreBundle .default,
79+ useSyncReadMem = false
6780 )
6881 )
82+
6983 queue.io.enqueuePorts.foreach { port =>
7084 port.valid := false .B
7185 port.bits := DontCare
@@ -77,7 +91,7 @@ class Rob(
7791 }
7892 queue.io.dequeuePorts.foreach(_.ready := false .B )
7993 queue.io.isFlush := io.isFlush
80- io.emptyNum := queue.io.emptyNum
94+ io.emptyNum := VecInit ( queue.io.enqueuePorts.map(_.ready.asUInt)).reduceTree(_ +& _)
8195 io.instWbBroadCasts.zip(io.finishInsts).foreach {
8296 case (dst, src) =>
8397 dst.en := src.valid // && io.robInstValids(src.bits.instInfo.robId)
@@ -91,9 +105,9 @@ class Rob(
91105 io.finishInsts.foreach { finishInst =>
92106 finishInst.ready := true .B
93107 when(finishInst.valid && finishInst.bits.instInfo.isValid) {
94- queue.io.elemValids.lazyZip(queue.io. elems) .lazyZip(queue.io.setPorts).zipWithIndex.foreach {
95- case ((elemValid, elem, set), idx) =>
96- when(elemValid && elem.state === State .busy && idx.U === finishInst.bits.instInfo.robId) {
108+ queue.io.elems.lazyZip(queue.io.setPorts).zipWithIndex.foreach {
109+ case ((elem, set), idx) =>
110+ when(elem.state === State .busy && idx.U === finishInst.bits.instInfo.robId) {
97111 set.valid := true .B
98112 set.bits.isValid := elem.isValid
99113 set.bits.state := State .ready
@@ -138,8 +152,9 @@ class Rob(
138152 ! deqPort.bits.wbPort.instInfo.forbidParallelCommit &&
139153 queue.io.dequeuePorts(idx - 1 ).valid &&
140154 queue.io.dequeuePorts(idx - 1 ).ready && // promise commit in order
141- ! hasInterruptReg &&
142- ! io.hasInterrupt
155+ ! hasInterruptReg
156+ // &&
157+ // !io.hasInterrupt
143158 }
144159
145160 commit.valid := deqPort.ready
@@ -159,12 +174,12 @@ class Rob(
159174 }
160175
161176 when(io.hasInterrupt) {
162- when(io.commits(0 ).valid && io.commits(0 ).ready) {
163- io.commits(0 ).bits.instInfo.exceptionRecord := Csr .ExceptionIndex .int
164- io.commits(0 ).bits.instInfo.exceptionPos := ExceptionPos .backend
165- }.otherwise {
166- hasInterruptReg := true .B
167- }
177+ // when(io.commits(0).valid && io.commits(0).ready) {
178+ // io.commits(0).bits.instInfo.exceptionRecord := Csr.ExceptionIndex.int
179+ // io.commits(0).bits.instInfo.exceptionPos := ExceptionPos.backend
180+ // }.otherwise {
181+ hasInterruptReg := true .B
182+ // }
168183 }.elsewhen(hasInterruptReg && io.commits(0 ).valid && io.commits(0 ).ready) {
169184 hasInterruptReg := false .B
170185 io.commits(0 ).bits.instInfo.exceptionRecord := Csr .ExceptionIndex .int
@@ -241,8 +256,8 @@ class Rob(
241256 */
242257
243258 when(io.isFlush) {
244- queue.io.enqueuePorts.foreach(_.valid := false .B )
245- io.commits.foreach(_.valid := false .B )
259+ // queue.io.enqueuePorts.foreach(_.valid := false.B)
260+ // io.commits.foreach(_.valid := false.B)
246261 matchTable.foreach(_.locate := RegDataLocateSel .regfile)
247262 }
248263}
0 commit comments