From f856d44b1f7c00ecee0b13021b4723c89debd250 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 24 Jan 2016 17:09:12 -0800 Subject: Disallow weak connect for Vec --- src/main/scala/Chisel/Aggregate.scala | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') 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 -- cgit v1.2.3