LSU, Loadunit: Set all data to 0 when exception (#2888)

When an exception occurs, as s3_out is true, backend will still consider
the data valid at this time (which is actually in X state) valid and
bypass it. Although in real chips, this situation will be handled after
2 cycles of exception processing (flushing the pipeline and
redirecting), when using vcs simulation, the simulation cannot continue
due to the problem of X-state propagation. Therefore, when an exception
occurs in load_s3, the output data will be forcibly set to 0.
This commit is contained in:
Haoyuan Feng 2024-04-17 02:47:43 +08:00 committed by GitHub
parent 0c00289943
commit 23761fd6ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -1346,8 +1346,9 @@ class LoadUnit(implicit p: Parameters) extends XSModule
// FIXME: add 1 cycle delay ?
// io.lsq.uncache.ready := !s3_valid
val s3_outexception = ExceptionNO.selectByFu(s3_out.bits.uop.exceptionVec, LduCfg).asUInt.orR && s3_vecActive
io.ldout.bits := s3_ld_wb_meta
io.ldout.bits.data := Mux(s3_valid, s3_ld_data_frm_cache, s3_ld_data_frm_uncache)
io.ldout.bits.data := Mux(s3_valid, Mux(!s3_outexception, s3_ld_data_frm_cache, 0.U), s3_ld_data_frm_uncache)
io.ldout.valid := (s3_out.valid || (s3_mmio.valid && !s3_valid)) && !s3_vecout.isvec
// TODO: check this --hx