diff options
| author | Jim Lawson | 2016-07-20 13:28:15 -0700 |
|---|---|---|
| committer | Jim Lawson | 2016-07-20 13:28:15 -0700 |
| commit | 28e80311f172ae4d1d477e8bb47ca3719c9a8fc5 (patch) | |
| tree | 5d7a077498317c5f2412604380acc43c6b1fc371 /chiselFrontend/src/main/scala/chisel3/core/Data.scala | |
| parent | f81202b896d30d90075be487895befa009b11733 (diff) | |
Compile ok.
Need to convert UInt(x) into UInt.Lit(x) or UInt.width(x)
Diffstat (limited to 'chiselFrontend/src/main/scala/chisel3/core/Data.scala')
| -rw-r--r-- | chiselFrontend/src/main/scala/chisel3/core/Data.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Data.scala b/chiselFrontend/src/main/scala/chisel3/core/Data.scala index 4cc66cb5..79119114 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/Data.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/Data.scala @@ -174,6 +174,13 @@ abstract class Data extends HasId { */ @deprecated("Use asBits, which makes the reinterpret cast more explicit and actually returns Bits", "chisel3") def toBits(): UInt = SeqUtils.do_asUInt(this.flatten)(DeprecatedSourceInfo) + + protected def unBind(): Unit = { + //TODO(twigg): Do recursively for better error messages + for(elem <- this.allElements) { + elem.binding = UnboundBinding(elem.binding.direction) + } + } } object Wire { @@ -210,7 +217,11 @@ object Clock { // TODO: Document this. sealed class Clock extends Element(Width(1)) { - def cloneType: this.type = Clock().asInstanceOf[this.type] + def cloneType: this.type = { + val clone = Clock().asInstanceOf[this.type] + clone.unBind() + clone + } private[chisel3] override def flatten: IndexedSeq[Bits] = IndexedSeq() private[chisel3] def cloneTypeWidth(width: Width): this.type = cloneType private[chisel3] def toType = "Clock" |
