summaryrefslogtreecommitdiff
path: root/src/main/scala
diff options
context:
space:
mode:
authorSchuyler Eldridge2020-10-19 12:35:26 -0400
committerGitHub2020-10-19 16:35:26 +0000
commitac641fb183e3a8866e6bd72123801cfb04a0c893 (patch)
tree8a0839df9a42c47b7618ffcf944b989cd0dcc574 /src/main/scala
parentbaea2da820e9ebff5ba1b6ad9573a7cc33aaacbd (diff)
Enable Cat of Zero Element Vec (#1623)
* Return 0.U for asUInt of a zero-element Seq Add a condition to SeqUtils.asUInt to have it return an unspecified width 0.U when applied to an empty sequence. This enables the ability to do a Cat of a zero-element sequence. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> * Test elaboration of Cat on zero-element Seq Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Diffstat (limited to 'src/main/scala')
-rw-r--r--src/main/scala/chisel3/util/Cat.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/util/Cat.scala b/src/main/scala/chisel3/util/Cat.scala
index 793a5463..3369eb18 100644
--- a/src/main/scala/chisel3/util/Cat.scala
+++ b/src/main/scala/chisel3/util/Cat.scala
@@ -25,6 +25,7 @@ object Cat {
* in the sequence forms the least significant bits.
*
* Equivalent to r(0) ## r(1) ## ... ## r(n-1).
+ * @note This returns a `0.U` if applied to a zero-element `Vec`.
*/
def apply[T <: Bits](r: Seq[T]): UInt = SeqUtils.asUInt(r.reverse)
}