Skip to content

Commit 1321d27

Browse files
committed
faet: add storeReady in RS
1 parent 7a38f38 commit 1321d27

7 files changed

Lines changed: 13 additions & 2 deletions

File tree

rtl/src/backend/Backend.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ class Backend(val parameter: BackendParameter)
188188
issue.io.intrInfo <> execute.io.intrInfo
189189
issue.io.storeOut := execute.io.storeOut
190190
issue.io.uncachedOut := execute.io.uncachedOut
191+
issue.io.storeReady := execute.io.storeReady
191192
// [Pipeline 3] Regfile and ROB Read (in Issue Module)
192193
//
193194
// [Pipeline 4] Execute

rtl/src/backend/execute/Execute.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class ExecuteInterface(parameter: ExecuteParameter) extends Bundle {
130130
val difftestStableCounter =
131131
if (parameter.aluBlockParameter.enableDifftest) Some(Output(UInt(64.W)))
132132
else None
133+
val storeReady = Output(Bool())
133134
}
134135

135136
/** Hardware Implementation of Execute */
@@ -179,6 +180,7 @@ class Execute(val parameter: ExecuteParameter)
179180
lsuBlock.io.uncachedCommit := io.uncachedCommit
180181
io.icacopOut := lsuBlock.io.icacopOut
181182
io.cacheInfo <> lsuBlock.io.cacheInfo
183+
io.storeReady := lsuBlock.io.storeReady
182184

183185
// difftest
184186
if (parameter.mduBlockParameter.enableDifftest) {

rtl/src/backend/execute/fu/LsuBlock.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ class RawLsuBlockIO(parameter: LsuBlockParameter) extends Bundle {
206206
val memWrResp = Vec(2, Flipped(Decoupled(new MemWrResp())))
207207

208208
val icacopOut = Valid(new ICacheOp(parameter.addressWidth))
209+
val storeReady = Output(Bool())
209210
}
210211

211212
class LsuBlockIO(parameter: LsuBlockParameter) extends Bundle {

rtl/src/backend/issue/Issue.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class IssueInterface(parameter: IssueParameter) extends Bundle {
115115
parameter.pRegNum,
116116
parameter.robSize,
117117
parameter.enableDifftest)))
118+
val storeReady = Input(Bool())
118119
val uncachedOut = Flipped(
119120
Output(
120121
Vec(
@@ -232,6 +233,7 @@ class Issue(val parameter: IssueParameter) extends Module with SerializableModul
232233
scheduler.io.normalWakeupBusIn := dataPath.io.normalWakeupBusOut
233234
scheduler.io.lsuWakeupBusIn := dataPath.io.lsuWakeupBusOut
234235
scheduler.io.redirect := io.redirect
236+
scheduler.io.storeReady := io.storeReady
235237
dataPath.io.cacheInfo := cacheInfo
236238
dataPath.io.writeBack <> io.writeBack
237239
dataPath.io.writeBackData := writeBackData

rtl/src/backend/issue/ReservationStation.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ class ReservationStation(parameter: ReservationStationParameter, issueParameter:
163163
val redirect = Input(Valid(new RedirectIO(issueParameter.robSize, issueParameter.brSize)))
164164
// [Fence]
165165
val canRunFence = Input(Bool())
166+
// [store Ready]
167+
val storeReady = if (parameter.name == "LSU") Some(Input(Bool())) else None
166168
// [Debug]
167169
val debug =
168170
if (issueParameter.debug)
@@ -265,7 +267,7 @@ class ReservationStation(parameter: ReservationStationParameter, issueParameter:
265267
// lsu group issue
266268
val firstStore = PriorityEncoder(
267269
rsData.map(e => e.valid && (!e.rfWen || e.func === LsuOp.SCW.asUInt)))
268-
baseReady && srcReady && (idx.U <= firstStore) // || !entry.rfWen 其实可以同一个周期选出多条store,但是前提是第一条store被选出来,但是现在的条件肯定不行,但是再多一点条件路径会很长
270+
baseReady && srcReady && (Mux(io.storeReady.get, idx.U <= firstStore, idx.U < firstStore)) // || !entry.rfWen 其实可以同一个周期选出多条store,但是前提是第一条store被选出来,但是现在的条件肯定不行,但是再多一点条件路径会很长
269271
} else {
270272
baseReady && srcReady
271273
}

rtl/src/backend/issue/Scheduler.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class Scheduler(parameter: IssueParameter) extends Module {
9999
val redirect = Input(Valid(new RedirectIO(parameter.robSize, parameter.brSize))) // replay
100100
val robDeqPtr = if (parameter.debug) Some(Input(new RobPtr(parameter.robSize))) else None
101101
val robEnqPtr = if (parameter.debug) Some(Input(new RobPtr(parameter.robSize))) else None
102+
103+
val storeReady = Input(Bool())
102104
})
103105
// prepare dispatch data [Dispatch] -----------------
104106
val dispatchData = WireDefault(io.dispatchData)
@@ -134,6 +136,7 @@ class Scheduler(parameter: IssueParameter) extends Module {
134136
}
135137
// lsu should be treated as group issue due to order requirement
136138
lsuRs.io.canDeqUpdate.foreach { _ := io.deqData.lsu.map(_.ready).reduce(_ && _) }
139+
lsuRs.io.storeReady.get := io.storeReady
137140

138141
// wakeup bus [Wakeup] -----------------
139142
val wbWakeupBus = Wire(Vec(parameter.lsuRSParameter.fuNum, ValidIO(new WakeupBus(parameter))))

rtl/src/backend/rob/ROB.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ class ROB(val parameter: ROBParameter) extends Module with SerializableModule[RO
801801
exceptionHandler.bits.robIdx := Mux(shouldCommitException(deqPtr.value), deqPtr, deqPtr - 1.U)
802802
exceptionHandler.bits.brIdx := robInstInfoRdDeqWire(0).brIdx
803803
exceptionHandler.bits.ecode := exceptionInfo(deqPtr.value).ecodes
804-
canSampleIntr := true.B // unlock
804+
canSampleIntr := RegNext(true.B) // unlock
805805
}
806806
// [IcacheOp]
807807
io.icacheOpBranchInfo.valid := false.B

0 commit comments

Comments
 (0)