summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/When.scala
diff options
context:
space:
mode:
authorJim Lawson2016-07-20 14:49:35 -0700
committerJim Lawson2016-07-20 14:49:35 -0700
commit2dce378deda1cc33833eb378c89a1c5415817bae (patch)
treee3bc5361030d63e017d065491e9e7e4cf788fe3c /src/test/scala/chiselTests/When.scala
parent28e80311f172ae4d1d477e8bb47ca3719c9a8fc5 (diff)
Distinguish between ?Int.Lit and ?Int.width
Diffstat (limited to 'src/test/scala/chiselTests/When.scala')
-rw-r--r--src/test/scala/chiselTests/When.scala36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/test/scala/chiselTests/When.scala b/src/test/scala/chiselTests/When.scala
index 5f3d3e61..58aa43e7 100644
--- a/src/test/scala/chiselTests/When.scala
+++ b/src/test/scala/chiselTests/When.scala
@@ -13,19 +13,19 @@ class WhenTester() extends BasicTester {
when(Bool(true)) { cnt.inc() }
val out = Wire(UInt(width=3))
- when(cnt.value === UInt(0)) {
- out := UInt(1)
- } .elsewhen (cnt.value === UInt(1)) {
- out := UInt(2)
- } .elsewhen (cnt.value === UInt(2)) {
- out := UInt(3)
+ when(cnt.value === UInt.Lit(0)) {
+ out := UInt.Lit(1)
+ } .elsewhen (cnt.value === UInt.Lit(1)) {
+ out := UInt.Lit(2)
+ } .elsewhen (cnt.value === UInt.Lit(2)) {
+ out := UInt.Lit(3)
} .otherwise {
- out := UInt(0)
+ out := UInt.Lit(0)
}
- assert(out === cnt.value + UInt(1))
+ assert(out === cnt.value + UInt.Lit(1))
- when(cnt.value === UInt(3)) {
+ when(cnt.value === UInt.Lit(3)) {
stop()
}
}
@@ -35,19 +35,19 @@ class OverlappedWhenTester() extends BasicTester {
when(Bool(true)) { cnt.inc() }
val out = Wire(UInt(width=3))
- when(cnt.value <= UInt(0)) {
- out := UInt(1)
- } .elsewhen (cnt.value <= UInt(1)) {
- out := UInt(2)
- } .elsewhen (cnt.value <= UInt(2)) {
- out := UInt(3)
+ when(cnt.value <= UInt.Lit(0)) {
+ out := UInt.Lit(1)
+ } .elsewhen (cnt.value <= UInt.Lit(1)) {
+ out := UInt.Lit(2)
+ } .elsewhen (cnt.value <= UInt.Lit(2)) {
+ out := UInt.Lit(3)
} .otherwise {
- out := UInt(0)
+ out := UInt.Lit(0)
}
- assert(out === cnt.value + UInt(1))
+ assert(out === cnt.value + UInt.Lit(1))
- when(cnt.value === UInt(3)) {
+ when(cnt.value === UInt.Lit(3)) {
stop()
}
}