From ee71c54ffa48162b3d0a451e37016374bd9a7239 Mon Sep 17 00:00:00 2001 From: chick Date: Wed, 18 Dec 2019 16:38:07 -0800 Subject: Add method asBool to Clock. Shortcut for .asUInt.asBool Added test to show it works --- src/test/scala/chiselTests/Clock.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 } -- cgit v1.2.3 From 18cca9c376ccd53d1c8a308519427bb0d74bc9c5 Mon Sep 17 00:00:00 2001 From: Chick Markley Date: Tue, 21 Jan 2020 15:46:20 -0800 Subject: Removed unnecessary cast Non-functional, must have been a typo--- src/test/scala/chiselTests/Clock.scala | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/test/scala/chiselTests/Clock.scala b/src/test/scala/chiselTests/Clock.scala index 2ae1d3e9..5dea66dc 100644 --- a/src/test/scala/chiselTests/Clock.scala +++ b/src/test/scala/chiselTests/Clock.scala @@ -20,7 +20,6 @@ class WithClockAndNoReset extends RawModule { RegNext(in) } - in.asUInt() out := a } -- cgit v1.2.3