@@ -191,14 +191,12 @@ class ITTageTable
191
191
def inc_ctr (ctr : UInt , taken : Bool ): UInt = satUpdate(ctr, ITTageCtrBits , taken)
192
192
193
193
class ITTageEntry () extends ITTageBundle {
194
- // val valid = Bool()
194
+ val valid = Bool ()
195
195
val tag = UInt (tagLen.W )
196
196
val ctr = UInt (ITTageCtrBits .W )
197
197
val target = UInt (VAddrBits .W )
198
198
}
199
199
200
- val validArray = RegInit (0 .U (nRows.W ))
201
-
202
200
// Why need add instOffsetBits?
203
201
val ittageEntrySz = 1 + tagLen + ITTageCtrBits + VAddrBits
204
202
@@ -229,7 +227,7 @@ class ITTageTable
229
227
val table_banks_r = table_banks.map(_.io.r.resp.data(0 ))
230
228
231
229
val resp_selected = Mux1H (s1_bank_req_1h, table_banks_r)
232
- val s1_req_rhit = validArray(s1_idx) && resp_selected.tag === s1_tag
230
+ val s1_req_rhit = resp_selected.valid && resp_selected.tag === s1_tag
233
231
val resp_invalid_by_write = Wire (Bool ())
234
232
235
233
io.resp.valid := (if (tagLen != 0 ) s1_req_rhit && ! resp_invalid_by_write else true .B ) // && s1_mask(b)
@@ -275,15 +273,12 @@ class ITTageTable
275
273
wrbypass.io.write_data.map(_ := update_wdata.ctr)
276
274
277
275
val old_ctr = Mux (wrbypass.io.hit, wrbypass.io.hit_data(0 ).bits, io.update.oldCtr)
276
+ update_wdata.valid := true .B
278
277
update_wdata.ctr := Mux (io.update.alloc, 2 .U , inc_ctr(old_ctr, io.update.correct))
279
278
update_wdata.tag := update_tag
280
279
// only when ctr is null
281
280
update_wdata.target := Mux (io.update.alloc || ctr_null(old_ctr), update_target, io.update.old_target)
282
281
283
- when (io.update.valid) {
284
- validArray := UIntToOH (update_idx) | validArray
285
- }
286
-
287
282
// reset all us in 32 cycles
288
283
us.io.resetEn.map(_ := io.update.reset_u)
289
284
0 commit comments