diff options
| author | Jiuyang Liu | 2021-05-26 02:35:34 +0800 |
|---|---|---|
| committer | GitHub | 2021-05-25 18:35:34 +0000 |
| commit | 6ccff4848fcf55cb1e865738a67f2bec25988ac8 (patch) | |
| tree | 9d3d4a04bc7723834ffe60b515af5254b43e4524 /src/test/scala/chiselTests | |
| parent | 3e65fb78769c8e4f7b737b021c6bbb52d1d7b7af (diff) | |
throw exception if BitPat width is 0 (#1920)
* spot a bug when BitPat width is 0
* fix #1919
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Diffstat (limited to 'src/test/scala/chiselTests')
| -rw-r--r-- | src/test/scala/chiselTests/util/BitPatSpec.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/util/BitPatSpec.scala b/src/test/scala/chiselTests/util/BitPatSpec.scala index a6c0acf7..ca8dd85c 100644 --- a/src/test/scala/chiselTests/util/BitPatSpec.scala +++ b/src/test/scala/chiselTests/util/BitPatSpec.scala @@ -14,4 +14,8 @@ class BitPatSpec extends AnyFlatSpec with Matchers { val testPattern = "0" * 32 + "1" * 32 + "?" * 32 + "?01" * 32 BitPat("b" + testPattern).toString should be (s"BitPat($testPattern)") } + + it should "not fail if BitPat width is 0" in { + intercept[IllegalArgumentException]{BitPat("b")} + } } |
