summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Counter.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/chiselTests/Counter.scala')
-rw-r--r--src/test/scala/chiselTests/Counter.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/scala/chiselTests/Counter.scala b/src/test/scala/chiselTests/Counter.scala
index 69d8a44a..55c07772 100644
--- a/src/test/scala/chiselTests/Counter.scala
+++ b/src/test/scala/chiselTests/Counter.scala
@@ -11,29 +11,29 @@ import chisel3.util._
class CountTester(max: Int) extends BasicTester {
val cnt = Counter(max)
- when(Bool(true)) { cnt.inc() }
- when(cnt.value === UInt(max-1)) {
+ when(true.B) { cnt.inc() }
+ when(cnt.value === (max-1).asUInt) {
stop()
}
}
class EnableTester(seed: Int) extends BasicTester {
- val ens = Reg(init = UInt(seed))
+ val ens = Reg(init = seed.asUInt)
ens := ens >> 1
val (cntEnVal, _) = Counter(ens(0), 32)
- val (_, done) = Counter(Bool(true), 33)
+ val (_, done) = Counter(true.B, 33)
when(done) {
- assert(cntEnVal === UInt(popCount(seed)))
+ assert(cntEnVal === popCount(seed).asUInt)
stop()
}
}
class WrapTester(max: Int) extends BasicTester {
- val (cnt, wrap) = Counter(Bool(true), max)
+ val (cnt, wrap) = Counter(true.B, max)
when(wrap) {
- assert(cnt === UInt(max - 1))
+ assert(cnt === (max - 1).asUInt)
stop()
}
}