Skip to content

Commit

Permalink
Fix === for abstract Reset types (backport #3979) (#3980)
Browse files Browse the repository at this point in the history
* Fix === for abstract Reset types (#3979)

Previously, the function would infinitely recurse resulting in a stack
overflow.

(cherry picked from commit ea2d103)

# Conflicts:
#	core/src/main/scala/chisel3/Data.scala

* Resolve backport conflicts

---------

Co-authored-by: Jack Koenig <koenig@sifive.com>
  • Loading branch information
mergify[bot] and jackkoenig committed Apr 9, 2024
1 parent 60ebc65 commit 3926710
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 @@ -907,7 +907,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: Interval, that: Interval) => thiz === that
case (thiz: FixedPoint, that: FixedPoint) => thiz === that
case (thiz: EnumType, that: EnumType) => thiz === that
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 3926710

Please sign in to comment.