From 75f54a3f873f168a7811da88ba1d3d59c9844659 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 29 Jul 2015 00:23:59 -0700 Subject: Use Seq, not Iterable, when traversal order matters --- src/main/scala/Chisel/Core.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/scala/Chisel/Core.scala') 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 -- cgit v1.2.3