summaryrefslogtreecommitdiff
path: root/src/test/scala/cookbook/UInt2Bundle.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/UInt2Bundle.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/UInt2Bundle.scala')
-rw-r--r--src/test/scala/cookbook/UInt2Bundle.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/scala/cookbook/UInt2Bundle.scala b/src/test/scala/cookbook/UInt2Bundle.scala
index fbf7fe8a..3ce4eebf 100644
--- a/src/test/scala/cookbook/UInt2Bundle.scala
+++ b/src/test/scala/cookbook/UInt2Bundle.scala
@@ -11,16 +11,16 @@ import chisel3._
class UInt2Bundle extends CookbookTester(0) {
// Example
class MyBundle extends Bundle {
- val foo = UInt(width = 4)
- val bar = UInt(width = 4)
+ val foo = UInt(4.W)
+ val bar = UInt(4.W)
}
- val uint = UInt(0xb4)
+ val uint = 0xb4.U
val bundle = (new MyBundle).fromBits(uint)
printf(p"$bundle") // Bundle(foo -> 11, bar -> 4)
// Test
- assert(bundle.foo === UInt(0xb))
- assert(bundle.bar === UInt(0x4))
+ assert(bundle.foo === 0xb.U)
+ assert(bundle.bar === 0x4.U)
}
class UInt2BundleSpec extends CookbookSpec {