diff options
| author | Albert Magyar | 2020-04-15 16:41:52 -0700 |
|---|---|---|
| committer | Albert Magyar | 2020-04-20 15:23:35 -0700 |
| commit | 8653fd628f83c1bcb329dd37844ddfdb8f4cf206 (patch) | |
| tree | e614936e50ba05d2262150a07d201ebd33ac517b /src | |
| parent | 04f4bc177f8d38993a191bdba4398840a2a63155 (diff) | |
Add test cases for illegal casts to AsyncReset / Clock
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/scala/firrtlTests/WidthSpec.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/scala/firrtlTests/WidthSpec.scala b/src/test/scala/firrtlTests/WidthSpec.scala index 4d04ed66..4b0bc5e5 100644 --- a/src/test/scala/firrtlTests/WidthSpec.scala +++ b/src/test/scala/firrtlTests/WidthSpec.scala @@ -68,6 +68,28 @@ class WidthSpec extends FirrtlFlatSpec { } } + "Casting a multi-bit signal to Clock" should "result in error" in { + val input = + s"""circuit Unit : + | module Unit : + | input i: UInt<2> + | node x = asClock(i)""".stripMargin + intercept[CheckWidths.MultiBitAsClock] { + executeTest(input, Nil, inferAndCheckPasses) + } + } + + "Casting a multi-bit signal to AsyncReset" should "result in error" in { + val input = + s"""circuit Unit : + | module Unit : + | input i: UInt<2> + | node x = asAsyncReset(i)""".stripMargin + intercept[CheckWidths.MultiBitAsAsyncReset] { + executeTest(input, Nil, inferAndCheckPasses) + } + } + "Width >= MaxWidth" should "result in an error" in { val input = s"""circuit Unit : |
