summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Waterman2016-01-24 17:09:12 -0800
committerAndrew Waterman2016-01-24 17:09:12 -0800
commitf856d44b1f7c00ecee0b13021b4723c89debd250 (patch)
treedd25f56ff81a1b1290e6af721184ada27b7a8875 /src
parent34a1abcd81bd3b2d7d264468345572009edfad27 (diff)
Disallow weak connect for Vec
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/Chisel/Aggregate.scala15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/main/scala/Chisel/Aggregate.scala b/src/main/scala/Chisel/Aggregate.scala
index f510a913..3df48052 100644
--- a/src/main/scala/Chisel/Aggregate.scala
+++ b/src/main/scala/Chisel/Aggregate.scala
@@ -103,21 +103,16 @@ sealed class Vec[T <: Data] private (gen: => T, val length: Int)
private val self = IndexedSeq.fill(length)(gen)
- override def <> (that: Data): Unit = that match {
- case _: Vec[_] => this bulkConnect that
- case _ => this badConnect that
- }
+ override def <> (that: Data): Unit = this := that
- /** Weak bulk connect, assigning elements in this Vec from elements in a Seq.
+ /** Strong bulk connect, assigning elements in this Vec from elements in a Seq.
*
- * @note length mismatches silently ignored
+ * @note the length of this Vec must match the length of the input Seq
*/
- def <> (that: Seq[T]): Unit =
- for ((a, b) <- this zip that)
- a <> b
+ def <> (that: Seq[T]): Unit = this := that
// TODO: eliminate once assign(Seq) isn't ambiguous with assign(Data) since Vec extends Seq and Data
- def <> (that: Vec[T]): Unit = this bulkConnect that
+ def <> (that: Vec[T]): Unit = this := that.asInstanceOf[Data]
override def := (that: Data): Unit = that match {
case _: Vec[_] => this connect that