Skip to content

Commit

Permalink
ICache <bug-fix>: fix meta error when reset (OpenXiangShan#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyue110 authored Feb 1, 2022
1 parent 6427650 commit e8e4462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/xiangshan/frontend/icache/ICacheMainPipe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ class ICacheMainPipe(implicit p: Parameters) extends ICacheModule
val s2_parity_error = VecInit((0 until PortNumber).map(i => RegNext(s2_parity_meta_error(i)) || s2_parity_data_error(i)))

for(i <- 0 until PortNumber){
io.errors(i).valid := RegNext(s2_parity_error(i))
io.errors(i).report_to_beu := RegNext(s2_parity_error(i))
io.errors(i).valid := RegNext(s2_parity_error(i) && RegNext(RegNext(s1_fire)))
io.errors(i).report_to_beu := RegNext(s2_parity_error(i) && RegNext(RegNext(s1_fire)))
io.errors(i).paddr := RegNext(RegNext(s2_req_paddr(i)))
io.errors(i).source := DontCare
io.errors(i).source.tag := RegNext(RegNext(s2_parity_meta_error(i)))
Expand All @@ -385,6 +385,7 @@ class ICacheMainPipe(implicit p: Parameters) extends ICacheModule
io.errors(i).opType := DontCare
io.errors(i).opType.fetch := true.B
}
XSError(s2_parity_error.reduce(_||_) && RegNext(RegNext(s1_fire)), "ICache has parity error in MainPaipe!")


/** exception and pmp logic **/
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/xiangshan/frontend/icache/ReplacePipe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class ICacheReplacePipe(implicit p: Parameters) extends ICacheModule{
val r2_parity_error = RegNext(r2_parity_meta_error) || r2_parity_data_error


io.error.valid := RegNext(r2_parity_error )
io.error.report_to_beu := RegNext(r2_parity_error )
io.error.valid := RegNext(r2_parity_error && RegNext(RegNext(r1_fire)))
io.error.report_to_beu := RegNext(r2_parity_error && RegNext(RegNext(r1_fire)))
io.error.paddr := RegNext(RegNext(r2_req.paddr))
io.error.source.tag := RegNext(RegNext(r2_parity_meta_error))
io.error.source.data := RegNext(r2_parity_data_error)
Expand All @@ -190,6 +190,7 @@ class ICacheReplacePipe(implicit p: Parameters) extends ICacheModule{
io.error.opType.release := RegNext(RegNext(r2_req.isRelease))
io.error.opType.probe := RegNext(RegNext(r2_req.isProbe))

XSError(r2_parity_error && RegNext(RegNext(r1_fire)), "ICache has parity error in ReplacePipe!")


/*** for Release mux ***/
Expand Down

0 comments on commit e8e4462

Please sign in to comment.