diff options
| author | Jack Koenig | 2018-12-04 13:53:36 -0800 |
|---|---|---|
| committer | GitHub | 2018-12-04 13:53:36 -0800 |
| commit | 83f2a65a3ab1d21258883c0b113406ef9900a57f (patch) | |
| tree | c21edf9bc9c5f2f42ec5716a829145024bb82862 /src/test/scala/chiselTests/UIntOps.scala | |
| parent | ab951049c2c60402e2318ba863520d4a16c8288d (diff) | |
| parent | 3db21bd8e5a32c29efa55494d180dac4d22589e5 (diff) | |
Merge pull request #950 from freechipsproject/as-bools
asBools, asBool, and chained apply on asBools
Diffstat (limited to 'src/test/scala/chiselTests/UIntOps.scala')
| -rw-r--r-- | src/test/scala/chiselTests/UIntOps.scala | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/test/scala/chiselTests/UIntOps.scala b/src/test/scala/chiselTests/UIntOps.scala index d583c0bb..e5ab706f 100644 --- a/src/test/scala/chiselTests/UIntOps.scala +++ b/src/test/scala/chiselTests/UIntOps.scala @@ -80,7 +80,7 @@ class GoodBoolConversion extends Module { val u = Input(UInt(1.W)) val b = Output(Bool()) }) - io.b := io.u.toBool + io.b := io.u.asBool } class BadBoolConversion extends Module { @@ -88,7 +88,7 @@ class BadBoolConversion extends Module { val u = Input(UInt(5.W)) val b = Output(Bool()) }) - io.b := io.u.toBool + io.b := io.u.asBool } class NegativeShift(t: => Bits) extends Module { @@ -139,5 +139,15 @@ class UIntOpsSpec extends ChiselPropSpec with Matchers { property("Bit extraction on literals should work for all non-negative indices") { assertTesterPasses(new UIntLitExtractTester) } + + property("asBools should support chained apply") { + elaborate(new Module { + val io = IO(new Bundle { + val in = Input(UInt(8.W)) + val out = Output(Bool()) + }) + io.out := io.in.asBools()(2) + }) + } } |
