@@ -35,7 +35,7 @@ class BusyTableReadIO(implicit p: Parameters) extends XSBundle {
35
35
36
36
37
37
class VlBusyTableReadIO (implicit p : Parameters ) extends XSBundle {
38
- val is_zero = Output (Bool ())
38
+ val is_nonzero = Output (Bool ())
39
39
val is_vlmax = Output (Bool ())
40
40
}
41
41
@@ -207,31 +207,33 @@ class VlBusyTable(numReadPorts: Int, numWritePorts: Int, numPhyPregs: Int, pregW
207
207
var intSchdVlWbPort = p(XSCoreParamsKey ).intSchdVlWbPort
208
208
var vfSchdVlWbPort = p(XSCoreParamsKey ).vfSchdVlWbPort
209
209
210
- val zeroTableUpdate = Wire (Vec (numPhyPregs, Bool ()))
210
+ val nonzeroTableUpdate = Wire (Vec (numPhyPregs, Bool ()))
211
211
val vlmaxTableUpdate = Wire (Vec (numPhyPregs, Bool ()))
212
212
213
213
val intVlWb = Mux (io.wbPregs(intSchdVlWbPort).valid, UIntToOH (io.wbPregs(intSchdVlWbPort).bits), 0 .U )
214
214
val vfVlWb = Mux (io.wbPregs(vfSchdVlWbPort).valid, UIntToOH (io.wbPregs(vfSchdVlWbPort).bits), 0 .U )
215
+ // when other ports write back, we cannot know the vl value, so we should set the vl table to busy
216
+ val otherPortsWb = io.wbPregs.zipWithIndex.filter(x => x._2 != intSchdVlWbPort && x._2 != vfSchdVlWbPort).map(x => Mux (x._1.valid, UIntToOH (x._1.bits), 0 .U )).reduce(_ | _)
215
217
216
- val zeroTable = VecInit ((0 until numPhyPregs).zip(zeroTableUpdate ).map{ case (idx, update) =>
218
+ val nonzeroTable = VecInit ((0 until numPhyPregs).zip(nonzeroTableUpdate ).map{ case (idx, update) =>
217
219
RegEnable (update, 0 .U (1 .W ), allocMask(idx) || ldCancelMask(idx) || intVlWb(idx) || vfVlWb(idx))
218
220
}).asUInt
219
221
val vlmaxTable = VecInit ((0 until numPhyPregs).zip(vlmaxTableUpdate).map{ case (idx, update) =>
220
222
RegEnable (update, 0 .U (1 .W ), allocMask(idx) || ldCancelMask(idx) || intVlWb(idx) || vfVlWb(idx))
221
223
}).asUInt
222
224
223
225
224
- zeroTableUpdate .zipWithIndex.foreach{ case (update, idx) =>
226
+ nonzeroTableUpdate .zipWithIndex.foreach{ case (update, idx) =>
225
227
when(intVlWb(idx)) {
226
228
// int schd vl write back, check whether the vl is zero
227
- update := ! io_vl_Wb.vlWriteBackInfo.vlFromIntIsZero
229
+ update := io_vl_Wb.vlWriteBackInfo.vlFromIntIsZero
228
230
}.elsewhen(vfVlWb(idx)) {
229
231
// vf schd vl write back, check whether the vl is zero
230
- update := ! io_vl_Wb.vlWriteBackInfo.vlFromVfIsZero
231
- }.elsewhen(allocMask(idx) || ldCancelMask(idx)) {
232
+ update := io_vl_Wb.vlWriteBackInfo.vlFromVfIsZero
233
+ }.elsewhen(otherPortsWb(idx) || allocMask(idx) || ldCancelMask(idx)) {
232
234
update := true .B
233
235
}.otherwise {
234
- update := zeroTable (idx)
236
+ update := nonzeroTable (idx)
235
237
}
236
238
}
237
239
@@ -242,15 +244,15 @@ class VlBusyTable(numReadPorts: Int, numWritePorts: Int, numPhyPregs: Int, pregW
242
244
}.elsewhen(vfVlWb(idx)) {
243
245
// vf schd vl write back, check whether the vl is vlmax
244
246
update := ! io_vl_Wb.vlWriteBackInfo.vlFromVfIsVlmax
245
- }.elsewhen(allocMask(idx) || ldCancelMask(idx)) {
247
+ }.elsewhen(otherPortsWb(idx) || allocMask(idx) || ldCancelMask(idx)) {
246
248
update := true .B
247
249
}.otherwise {
248
250
update := vlmaxTable(idx)
249
251
}
250
252
}
251
253
252
254
io_vl_read.vlReadInfo.zip(io.read).foreach{ case (vlRes, res) =>
253
- vlRes.is_zero := ! zeroTable (res.req)
255
+ vlRes.is_nonzero := ! nonzeroTable (res.req)
254
256
vlRes.is_vlmax := ! vlmaxTable(res.req)
255
257
}
256
258
}
0 commit comments