summaryrefslogtreecommitdiff
path: root/src/test/scala/cookbook/UInt2VecOfBool.scala
diff options
context:
space:
mode:
authorRichard Lin2016-11-21 13:44:26 -0800
committerGitHub2016-11-21 13:44:26 -0800
commit3b4755716a74d4711efa3ce6799742479e17e80b (patch)
tree56652eaa478d5dfd8cddfbe2795c0123d39d230d /src/test/scala/cookbook/UInt2VecOfBool.scala
parentcd6eb41275381a4399a8a88c886110d276bb805c (diff)
parent81e5d00d18a5ba9ae33c10219a270148002fc672 (diff)
Merge pull request #372 from ucb-bar/onetrueliteral
Standardize the One True Way of specifying literals
Diffstat (limited to 'src/test/scala/cookbook/UInt2VecOfBool.scala')
-rw-r--r--src/test/scala/cookbook/UInt2VecOfBool.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/scala/cookbook/UInt2VecOfBool.scala b/src/test/scala/cookbook/UInt2VecOfBool.scala
index ad4a0334..09d538f9 100644
--- a/src/test/scala/cookbook/UInt2VecOfBool.scala
+++ b/src/test/scala/cookbook/UInt2VecOfBool.scala
@@ -11,15 +11,15 @@ import chisel3._
*/
class UInt2VecOfBool extends CookbookTester(0) {
// Example
- val uint = UInt(0xc)
+ val uint = 0xc.U
val vec = Vec(uint.toBools)
printf(p"$vec") // Vec(0, 0, 1, 1)
// Test
- assert(vec(0) === Bool(false))
- assert(vec(1) === Bool(false))
- assert(vec(2) === Bool(true))
- assert(vec(3) === Bool(true))
+ assert(vec(0) === false.B)
+ assert(vec(1) === false.B)
+ assert(vec(2) === true.B)
+ assert(vec(3) === true.B)
}
class UInt2VecOfBoolSpec extends CookbookSpec {