From 802cfc4405c28ae212a955a92c7a6ad2d2b6f0c2 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 17 Aug 2017 11:26:29 -0700 Subject: Make Reset a trait (#672) Bool implements Reset. Compatibility package includes an implicit conversion from Reset to Bool.--- chiselFrontend/src/main/scala/chisel3/core/MultiClock.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/MultiClock.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/MultiClock.scala b/chiselFrontend/src/main/scala/chisel3/core/MultiClock.scala index 62163318..6af4da41 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/MultiClock.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/MultiClock.scala @@ -9,7 +9,7 @@ import chisel3.internal.Builder.pushCommand import chisel3.internal.firrtl._ import chisel3.internal.sourceinfo.{SourceInfo} -private[chisel3] final case class ClockAndReset(clock: Clock, reset: Bool) +private[chisel3] final case class ClockAndReset(clock: Clock, reset: Reset) object withClockAndReset { // scalastyle:ignore object.name /** Creates a new Clock and Reset scope @@ -19,7 +19,7 @@ object withClockAndReset { // scalastyle:ignore object.name * @param block the block of code to run with new implicit Clock and Reset * @return the result of the block */ - def apply[T](clock: Clock, reset: Bool)(block: => T): T = { + def apply[T](clock: Clock, reset: Reset)(block: => T): T = { // Save parentScope val parentScope = Builder.currentClockAndReset Builder.currentClockAndReset = Some(ClockAndReset(clock, reset)) @@ -48,7 +48,7 @@ object withReset { // scalastyle:ignore object.name * @param block the block of code to run with new implicit Reset * @return the result of the block */ - def apply[T](reset: Bool)(block: => T): T = + def apply[T](reset: Reset)(block: => T): T = withClockAndReset(Module.clock, reset)(block) } -- cgit v1.2.3