summaryrefslogtreecommitdiff
path: root/core/src/main/scala/chisel3/Clock.scala
diff options
context:
space:
mode:
authorJack2021-12-18 08:27:38 +0000
committerJack2021-12-18 08:27:38 +0000
commitdd9ad534771247ac16eaa47eb9794102736b5102 (patch)
treed4566d317cb8526b79017de1e438aea8217dd1d4 /core/src/main/scala/chisel3/Clock.scala
parent440edc4436fb3a8a4175ae425a0d31c4997ee60f (diff)
parentf50f74f583fba7b98e550c440df091e559ce32b8 (diff)
Merge branch 'master' into 3.5-release
Diffstat (limited to 'core/src/main/scala/chisel3/Clock.scala')
-rw-r--r--core/src/main/scala/chisel3/Clock.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/main/scala/chisel3/Clock.scala b/core/src/main/scala/chisel3/Clock.scala
index edb07908..e4be6558 100644
--- a/core/src/main/scala/chisel3/Clock.scala
+++ b/core/src/main/scala/chisel3/Clock.scala
@@ -14,7 +14,7 @@ object Clock {
// TODO: Document this.
sealed class Clock(private[chisel3] val width: Width = Width(1)) extends Element {
- override def toString: String = s"Clock$bindingToString"
+ override def toString: String = stringAccessor("Clock")
def cloneType: this.type = Clock().asInstanceOf[this.type]
@@ -32,8 +32,12 @@ sealed class Clock(private[chisel3] val width: Width = Width(1)) extends Element
def toPrintable: Printable = PString("CLOCK")
/** Returns the contents of the clock wire as a [[Bool]]. */
- final def asBool(): Bool = macro SourceInfoTransform.noArg
- def do_asBool(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Bool = this.asUInt().asBool()
+ 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")
+ 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,