Skip to content

Commit

Permalink
Fix === for abstract Reset types (#3979) (#3982)
Browse files Browse the repository at this point in the history
Previously, the function would infinitely recurse resulting in a stack
overflow.

(cherry picked from commit ea2d103)

Co-authored-by: Jack Koenig <koenig@sifive.com>
  • Loading branch information
mergify[bot] and jackkoenig committed Apr 9, 2024
1 parent 822a949 commit 5587c50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/chisel3/Data.scala
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ object Data {
case (thiz: UInt, that: UInt) => thiz === that
case (thiz: SInt, that: SInt) => thiz === that
case (thiz: AsyncReset, that: AsyncReset) => thiz.asBool === that.asBool
case (thiz: Reset, that: Reset) => thiz === that
case (thiz: Reset, that: Reset) => thiz.asBool === that.asBool
case (thiz: EnumType, that: EnumType) => thiz === that
case (thiz: Clock, that: Clock) => thiz.asUInt === that.asUInt
case (thiz: Vec[_], that: Vec[_]) =>
Expand Down
5 changes: 5 additions & 0 deletions src/test/scala/chiselTests/DataEqualitySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ class DataEqualitySpec extends ChiselFlatSpec with Utils {
new EqualityTester(true.B, false.B)
}
}
it should "support abstract reset wires" in {
assertTesterPasses {
new EqualityTester(WireDefault(Reset(), true.B), WireDefault(Reset(), true.B))
}
}

behavior.of("AsyncReset === AsyncReset")
it should "pass with equal values" in {
Expand Down

0 comments on commit 5587c50

Please sign in to comment.