summaryrefslogtreecommitdiff
path: root/chiselFrontend
diff options
context:
space:
mode:
authorchick2016-06-06 15:57:28 -0700
committerchick2016-06-06 15:57:28 -0700
commitb7c6e0d1a2098b545938a5a8dfce2b1d9294532f (patch)
tree1261e9a9de8643fcd7f431255305357eab34bcf7 /chiselFrontend
parent43124af2f3eab9a3491dd2c83c1922b1b7e07c2a (diff)
moved do_asUInt implementation into aggregate, it has been to identical separate implementations in Vec and Bundle
Diffstat (limited to 'chiselFrontend')
-rw-r--r--chiselFrontend/src/main/scala/Chisel/Aggregate.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/chiselFrontend/src/main/scala/Chisel/Aggregate.scala b/chiselFrontend/src/main/scala/Chisel/Aggregate.scala
index f573592d..c0f8a354 100644
--- a/chiselFrontend/src/main/scala/Chisel/Aggregate.scala
+++ b/chiselFrontend/src/main/scala/Chisel/Aggregate.scala
@@ -17,6 +17,8 @@ import internal.sourceinfo.{SourceInfo, DeprecatedSourceInfo, VecTransform, Sour
sealed abstract class Aggregate(dirArg: Direction) extends Data(dirArg) {
private[Chisel] def cloneTypeWidth(width: Width): this.type = cloneType
def width: Width = flatten.map(_.width).reduce(_ + _)
+
+ def do_asUInt(implicit sourceInfo: SourceInfo): UInt = SeqUtils.do_asUInt(this.flatten)
}
object Vec {
@@ -167,8 +169,6 @@ sealed class Vec[T <: Data] private (gen: => T, val length: Int)
private[Chisel] lazy val flatten: IndexedSeq[Bits] =
(0 until length).flatMap(i => this.apply(i).flatten)
- def do_asUInt(implicit sourceInfo: SourceInfo): UInt = SeqUtils.do_asUInt(this.flatten).asUInt()
-
for ((elt, i) <- self zipWithIndex)
elt.setRef(this, i)
}
@@ -344,8 +344,6 @@ class Bundle extends Aggregate(NO_DIR) {
private[Chisel] def addElt(name: String, elt: Data): Unit =
namedElts += name -> elt
- def do_asUInt(implicit sourceInfo: SourceInfo): UInt = SeqUtils.do_asUInt(this.flatten).asUInt()
-
private[Chisel] override def _onModuleClose: Unit = // scalastyle:ignore method.name
for ((name, elt) <- namedElts) { elt.setRef(this, _namespace.name(name)) }