diff options
| author | Schuyler Eldridge | 2018-09-07 16:54:05 -0400 |
|---|---|---|
| committer | GitHub | 2018-09-07 16:54:05 -0400 |
| commit | c6144dc8354965722b3edc5c2a34892a78c5afee (patch) | |
| tree | b553e0cfb4f9133dcf90fecc61cfe4a4f7836380 /chiselFrontend/src/main/scala/chisel3/core/Data.scala | |
| parent | 69d247becb5d66c566ba4face2852516dd28cde2 (diff) | |
| parent | a5de2b79a93e5acda2cf07bf37534e6782055960 (diff) | |
Merge pull request #873 from seldridge/issue-872
API Documentation Improvements
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Data.scala | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 171a2bff..cab6075e 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.SourceInfoDoc import chisel3.core.BiConnect.DontCareCantBeSink /** User-specified directions. @@ -197,8 +198,11 @@ 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 + * @define coll data */ -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] = { @@ -381,7 +385,22 @@ abstract class Data extends HasId with NamedComponent { 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 @@ -432,6 +451,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()) @@ -452,6 +472,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 */ |
