-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toString method to BitPat (#1819)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ac094a5
commit 2a56c65
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package chiselTests.util | ||
|
||
import chisel3.util.BitPat | ||
import org.scalatest.flatspec.AnyFlatSpec | ||
import org.scalatest.matchers.should.Matchers | ||
|
||
|
||
class BitPatSpec extends AnyFlatSpec with Matchers { | ||
behavior of classOf[BitPat].toString | ||
|
||
it should "convert a BitPat to readable form" in { | ||
val testPattern = "0" * 32 + "1" * 32 + "?" * 32 + "?01" * 32 | ||
BitPat("b" + testPattern).toString should be (s"BitPat($testPattern)") | ||
} | ||
} |