summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt2015-12-06 22:14:16 -0800
committerPalmer Dabbelt2015-12-06 22:14:16 -0800
commitc26ca883aab6499216c673f867ee61651a9c11a2 (patch)
treecfca00c83ae2101afec3652ddd9ea006d0e0de01
parent85f3006d7eac44ff21111d0f7ece1015164c0fe0 (diff)
parente3e70ac9eb2446ad850ebddc1f42816b4537f7af (diff)
Merge pull request #55 from ucb-bar/vecdoc
More design rationale for Vec
-rw-r--r--src/main/scala/Chisel/Aggregate.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/Chisel/Aggregate.scala b/src/main/scala/Chisel/Aggregate.scala
index e6ac6b85..8a0f20af 100644
--- a/src/main/scala/Chisel/Aggregate.scala
+++ b/src/main/scala/Chisel/Aggregate.scala
@@ -88,10 +88,14 @@ object Vec {
* @tparam T type of elements
* @note when multiple conflicting assignments are performed on a Vec element,
* the last one takes effect (unlike Mem, where the result is undefined)
+ * @note Vecs, unlike classes in Scala's collection library, are propagated
+ * intact to FIRRTL as a vector type, which may make debugging easier
*/
sealed class Vec[T <: Data] private (gen: => T, val length: Int)
extends Aggregate(gen.dir) with VecLike[T] {
- // REVIEW TODO: should this take a Seq instead of a gen()?
+ // Note: the constructor takes a gen() function instead of a Seq to enforce
+ // that all elements must be the same and because it makes FIRRTL generation
+ // simpler.
private val self = IndexedSeq.fill(length)(gen)