summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/Counter.scala
diff options
context:
space:
mode:
authorJim Lawson2015-11-06 14:40:30 -0800
committerJim Lawson2015-11-06 14:40:30 -0800
commit85f3006d7eac44ff21111d0f7ece1015164c0fe0 (patch)
tree60775f61ca8a481631ba67554a995ef1822b2ec0 /src/test/scala/chiselTests/Counter.scala
parent730c951f4271120931062df674a9cd1303d226ad (diff)
parent7fe61318433a8ecaac80ef2b547a88ab9dc04aec (diff)
Merge pull request #59 from ucb-bar/testing-improvements
Further testing improvements
Diffstat (limited to 'src/test/scala/chiselTests/Counter.scala')
-rw-r--r--src/test/scala/chiselTests/Counter.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/scala/chiselTests/Counter.scala b/src/test/scala/chiselTests/Counter.scala
index 080130df..1aa2aaba 100644
--- a/src/test/scala/chiselTests/Counter.scala
+++ b/src/test/scala/chiselTests/Counter.scala
@@ -8,17 +8,18 @@ import Chisel.testers.BasicTester
class CountTester(max: Int) extends BasicTester {
val cnt = Counter(max)
- when(cnt.value === UInt(max)) { io.done := Bool(true) }
+ when(Bool(true)) { cnt.inc() }
+ when(cnt.value === UInt(max-1)) { io.done := Bool(true) }
}
class EnableTester(seed: Int) extends BasicTester {
val ens = Reg(init = UInt(seed))
ens := ens >> 1
val (cntEn, cntWrap) = Counter(ens(0), 32)
- val cnt = Counter(32)
- when(cnt.value === UInt(31)) {
+ val cnt = Counter(Bool(true), 32)._1
+ when(cnt === UInt(31)) {
io.done := Bool(true)
- io.error := cnt.value != UInt(popCount(seed))
+ io.error := cnt != UInt(popCount(seed))
}
}