summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Counter.scala
diff options
context:
space:
mode:
authorJim Lawson2016-12-02 12:51:03 -0800
committerGitHub2016-12-02 12:51:03 -0800
commitd3ec37edd39799e8cf039e5caed915c00dff7eeb (patch)
tree03329ddc11ca15b9d6c7f832354a9cba20c87843 /src/test/scala/chiselTests/Counter.scala
parent1b53d893816d349f5ea18fa0ed13325b9f1b6917 (diff)
parenteba224e524b249207b47a3b378458c61c9b66e2c (diff)
Merge branch 'master' into exceptionfix
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()
}
}