summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/Clock.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 16:32:51 -0800
committerGitHub2022-01-10 16:32:51 -0800
commit2b48fd15a7711dcd44334fbbc538667a102a581a (patch)
tree4b4766347c3943d65c13e5de2d139b14821eec61 /core/src/main/scala/chisel3/Clock.scala
parent92e77a97af986629766ac9038f0ebc8ab9a48fa1 (diff)
parentbff8dc0738adafa1176f6959a33ad86f6373c558 (diff)
Merge pull request #2246 from chipsalliance/scalafmt
Add scalafmt configuration and apply it.
Diffstat (limited to 'core/src/main/scala/chisel3/Clock.scala')
-rw-r--r--core/src/main/scala/chisel3/Clock.scala26
1 files changed, 18 insertions, 8 deletions
diff --git a/core/src/main/scala/chisel3/Clock.scala b/core/src/main/scala/chisel3/Clock.scala
index e4be6558..68174d7c 100644
--- a/core/src/main/scala/chisel3/Clock.scala
+++ b/core/src/main/scala/chisel3/Clock.scala
@@ -21,10 +21,11 @@ sealed class Clock(private[chisel3] val width: Width = Width(1)) extends Element
private[chisel3] def typeEquivalent(that: Data): Boolean =
this.getClass == that.getClass
- override def connect(that: Data)(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): Unit = that match {
- case _: Clock => super.connect(that)(sourceInfo, connectCompileOptions)
- case _ => super.badConnect(that)(sourceInfo)
- }
+ override def connect(that: Data)(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): Unit =
+ that match {
+ case _: Clock => super.connect(that)(sourceInfo, connectCompileOptions)
+ case _ => super.badConnect(that)(sourceInfo)
+ }
override def litOption: Option[BigInt] = None
@@ -34,14 +35,23 @@ sealed class Clock(private[chisel3] val width: Width = Width(1)) extends Element
/** Returns the contents of the clock wire as a [[Bool]]. */
final def asBool: Bool = macro SourceInfoTransform.noArg
- @deprecated("Calling this function with an empty argument list is invalid in Scala 3. Use the form without parentheses instead", "Chisel 3.5")
+ @deprecated(
+ "Calling this function with an empty argument list is invalid in Scala 3. Use the form without parentheses instead",
+ "Chisel 3.5"
+ )
final def asBool(dummy: Int*): Bool = macro SourceInfoTransform.noArgDummy
def do_asBool(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = this.asUInt.asBool
- override def do_asUInt(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): UInt = pushOp(DefPrim(sourceInfo, UInt(this.width), AsUIntOp, ref))
- private[chisel3] override def connectFromBits(that: Bits)(implicit sourceInfo: SourceInfo,
- compileOptions: CompileOptions): Unit = {
+ override def do_asUInt(implicit sourceInfo: SourceInfo, connectCompileOptions: CompileOptions): UInt = pushOp(
+ DefPrim(sourceInfo, UInt(this.width), AsUIntOp, ref)
+ )
+ private[chisel3] override def connectFromBits(
+ that: Bits
+ )(
+ implicit sourceInfo: SourceInfo,
+ compileOptions: CompileOptions
+ ): Unit = {
this := that.asBool.asClock
}
}