From 66a59036eae0c9d75055f09df6696bd8431d9c59 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Tue, 14 Aug 2018 11:42:16 -0400 Subject: Add Connect ScalaDoc group to Data This adds the ScalaDoc group "Connect" to the Data class. Signed-off-by: Schuyler Eldridge --- chiselFrontend/src/main/scala/chisel3/core/Data.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 171a2bff..151bc13f 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -7,7 +7,8 @@ import scala.language.experimental.macros import chisel3.internal._ import chisel3.internal.Builder.{pushCommand, pushOp} import chisel3.internal.firrtl._ -import chisel3.internal.sourceinfo._ +import chisel3.internal.sourceinfo.{SourceInfo, SourceInfoTransform, UnlocatableSourceInfo, DeprecatedSourceInfo} +import chisel3.util.SourceInfoDoc import chisel3.core.BiConnect.DontCareCantBeSink /** User-specified directions. @@ -197,6 +198,8 @@ object Flipped { * must be representable as some number (need not be known at Chisel compile * time) of bits, and must have methods to pack / unpack structured data to / * from bits. + * + * @groupdesc Connect Utilities for connecting hardware components */ abstract class Data extends HasId with NamedComponent { // This is a bad API that punches through object boundaries. -- cgit v1.2.3 From 57e8774c34fc28dd34cdec5e8a1bf82f3cd4e0cd Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Tue, 14 Aug 2018 11:39:28 -0400 Subject: Put do_* methods in SourceInfoTransformMacro group This places all do_* methods (and two unary methods in SInt and FixedPoint that act like do_* methods) inside the ScalaDoc group "SourceInfoTransformMacro". Classes/objects which need information about this group have an additional bare trait mixed in, `SourceInfoDoc`, that provides information about the group and its priority. Signed-off-by: Schuyler Eldridge --- chiselFrontend/src/main/scala/chisel3/core/Data.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 151bc13f..04209cef 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -8,7 +8,7 @@ import chisel3.internal._ import chisel3.internal.Builder.{pushCommand, pushOp} import chisel3.internal.firrtl._ import chisel3.internal.sourceinfo.{SourceInfo, SourceInfoTransform, UnlocatableSourceInfo, DeprecatedSourceInfo} -import chisel3.util.SourceInfoDoc +import chisel3.SourceInfoDoc import chisel3.core.BiConnect.DontCareCantBeSink /** User-specified directions. @@ -201,7 +201,7 @@ object Flipped { * * @groupdesc Connect Utilities for connecting hardware components */ -abstract class Data extends HasId with NamedComponent { +abstract class Data extends HasId with NamedComponent with SourceInfoDoc { // This is a bad API that punches through object boundaries. @deprecated("pending removal once all instances replaced", "chisel3") private[chisel3] def flatten: IndexedSeq[Element] = { @@ -435,6 +435,7 @@ abstract class Data extends HasId with NamedComponent { */ def asTypeOf[T <: Data](that: T): T = macro SourceInfoTransform.thatArg + /** @group SourceInfoTransformMacro */ def do_asTypeOf[T <: Data](that: T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = { val thatCloned = Wire(that.cloneTypeFull) thatCloned.connectFromBits(this.asUInt()) @@ -455,6 +456,7 @@ abstract class Data extends HasId with NamedComponent { */ final def asUInt(): UInt = macro SourceInfoTransform.noArg + /** @group SourceInfoTransformMacro */ def do_asUInt(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): UInt /** Default pretty printing */ -- cgit v1.2.3 From fefdc9441d248bf3d72e7e7e200a0caa63607049 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Tue, 14 Aug 2018 11:43:37 -0400 Subject: Put := and <> methods in Connect ScalaDoc group This puts Data's connection methods, `:=` and `<>`, in the ScalaDoc `Connect` group. These groups will propagate through to all children of Data, e.g., UInt, and cause those methods to be grouped in the ScalaDoc of these children. Signed-off-by: Schuyler Eldridge --- chiselFrontend/src/main/scala/chisel3/core/Data.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 04209cef..cab6075e 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -200,6 +200,7 @@ object Flipped { * from bits. * * @groupdesc Connect Utilities for connecting hardware components + * @define coll data */ abstract class Data extends HasId with NamedComponent with SourceInfoDoc { // This is a bad API that punches through object boundaries. @@ -384,7 +385,22 @@ abstract class Data extends HasId with NamedComponent with SourceInfoDoc { clone } + /** Connect this $coll to that $coll mono-directionally and element-wise. + * + * This uses the [[MonoConnect]] algorithm. + * + * @param that the $coll to connect to + * @group Connect + */ final def := (that: Data)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Unit = this.connect(that)(sourceInfo, connectionCompileOptions) + + /** Connect this $coll to that $coll bi-directionally and element-wise. + * + * This uses the [[BiConnect]] algorithm. + * + * @param that the $coll to connect to + * @group Connect + */ final def <> (that: Data)(implicit sourceInfo: SourceInfo, connectionCompileOptions: CompileOptions): Unit = this.bulkConnect(that)(sourceInfo, connectionCompileOptions) @chiselRuntimeDeprecated -- cgit v1.2.3