From 121635ed26c8a9852c827d6c0729515337604d08 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Wed, 21 Nov 2018 14:08:32 -0800 Subject: Add asBools, deprecate toBools --- chiselFrontend/src/main/scala/chisel3/core/Bits.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'chiselFrontend') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala index ffde7c87..b7c303f0 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala @@ -364,7 +364,15 @@ sealed abstract class Bits(private[chisel3] val width: Width) extends Element wi final def toBools(): Seq[Bool] = macro SourceInfoTransform.noArg /** @group SourceInfoTransformMacro */ - def do_toBools(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Seq[Bool] = + @chiselRuntimeDeprecated + @deprecated("Use asBools instead", "3.2") + def do_toBools(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Seq[Bool] = do_asBools + + /** Returns the contents of this wire as a [[scala.collection.Seq]] of [[Bool]]. */ + final def asBools(): Seq[Bool] = macro SourceInfoTransform.noArg + + /** @group SourceInfoTransformMacro */ + def do_asBools(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Seq[Bool] = Seq.tabulate(this.getWidth)(i => this(i)) /** Reinterpret this $coll as a [[SInt]] -- cgit v1.2.3