summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchick2019-12-18 16:38:07 -0800
committerchick2019-12-18 16:38:07 -0800
commitee71c54ffa48162b3d0a451e37016374bd9a7239 (patch)
tree4be9f65f5945d86447afe72501faecc344b56ad8 /src
parent954cc41e1349d0df6d2250d6270590340cd36e82 (diff)
Add method asBool to Clock.
Shortcut for .asUInt.asBool Added test to show it works
Diffstat (limited to 'src')
-rw-r--r--src/test/scala/chiselTests/Clock.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/scala/chiselTests/Clock.scala b/src/test/scala/chiselTests/Clock.scala
index 58a491ef..2ae1d3e9 100644
--- a/src/test/scala/chiselTests/Clock.scala
+++ b/src/test/scala/chiselTests/Clock.scala
@@ -7,6 +7,7 @@ import chisel3.testers.BasicTester
class ClockAsUIntTester extends BasicTester {
assert(true.B.asClock.asUInt === 1.U)
+ assert(true.B.asClock.asBool === true.B)
stop()
}
@@ -18,6 +19,8 @@ class WithClockAndNoReset extends RawModule {
val a = withClock(clock2) {
RegNext(in)
}
+
+ in.asUInt()
out := a
}