summaryrefslogtreecommitdiff
path: root/chiselFrontend
diff options
context:
space:
mode:
authorJim Lawson2016-10-06 10:40:10 -0700
committerJim Lawson2016-10-06 10:40:10 -0700
commita5aba40349e290c30280df25bc5b0ba848183469 (patch)
treed80a106bb741a59042b1367b7ad2bad08d1b5673 /chiselFrontend
parentf1507aa7cec86ca8f5de13ddc96fd046370dfe1d (diff)
Add comments; correct Complex definition (use cloneType).
Diffstat (limited to 'chiselFrontend')
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Data.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala
index 867c5a16..e95b4352 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala
@@ -155,7 +155,19 @@ abstract class Data extends HasId {
private[chisel3] def toType: String
private[core] def width: Width
+ /** cloneType must be defined for any Chisel object extending Data.
+ * It is responsible for constructing a basic copy of the object being cloned.
+ * If cloneType needs to recursively clone elements of an object, it should call
+ * the cloneType methods on those elements.
+ * @return a copy of the object.
+ */
def cloneType: this.type
+
+ /** chiselCloneType is called at the top-level of a clone chain.
+ * It calls the client's cloneType() method to construct a basic copy of the object being cloned,
+ * then performs any fixups required to reconstruct the appropriate core state of the cloned object.
+ * @return a copy of the object with appropriate core state.
+ */
def chiselCloneType: this.type = {
// Call the user-supplied cloneType method
val clone = this.cloneType