diff options
| author | Andrew Waterman | 2015-07-29 00:23:59 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2015-07-29 00:23:59 -0700 |
| commit | 75f54a3f873f168a7811da88ba1d3d59c9844659 (patch) | |
| tree | 9f6d0aa9c3e61871d821a048289013764bb045fe /src/main/scala/Chisel/Core.scala | |
| parent | d034f40b02e40d8a919596c7554bc0662db62001 (diff) | |
Use Seq, not Iterable, when traversal order matters
Diffstat (limited to 'src/main/scala/Chisel/Core.scala')
| -rw-r--r-- | src/main/scala/Chisel/Core.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/Chisel/Core.scala b/src/main/scala/Chisel/Core.scala index f2857f7c..64c0e0f6 100644 --- a/src/main/scala/Chisel/Core.scala +++ b/src/main/scala/Chisel/Core.scala @@ -439,7 +439,7 @@ class SeqMem[T <: Data](t: T, n: Int) { object Vec { def apply[T <: Data](gen: T, n: Int): Vec[T] = new Vec((0 until n).map(i => gen.cloneType)) - def apply[T <: Data](elts: Iterable[T]): Vec[T] = { + def apply[T <: Data](elts: Seq[T]): Vec[T] = { val vec = new Vec[T](elts.map(e => elts.head.cloneType)) if (vec.isReg) throw new Exception("Vec of Reg Deprecated.") @@ -461,7 +461,7 @@ abstract class Aggregate(dirArg: Direction) extends Data(dirArg) { def cloneTypeWidth(width: Int): this.type = cloneType } -class Vec[T <: Data](elts: Iterable[T], dirArg: Direction = NO_DIR) extends Aggregate(dirArg) with VecLike[T] { +class Vec[T <: Data](elts: Seq[T], dirArg: Direction = NO_DIR) extends Aggregate(dirArg) with VecLike[T] { private val self = elts.toIndexedSeq private lazy val elt0 = elts.head @@ -469,11 +469,11 @@ class Vec[T <: Data](elts: Iterable[T], dirArg: Direction = NO_DIR) extends Aggr for ((e, i) <- self zipWithIndex) setIndexForId(cid, e.cid, i) - def <> (that: Iterable[T]): Unit = + def <> (that: Seq[T]): Unit = for ((a, b) <- this zip that) a <> b - def := (that: Iterable[T]): Unit = + def := (that: Seq[T]): Unit = for ((a, b) <- this zip that) a := b |
