summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Cat.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/chisel3/util/Cat.scala')
-rw-r--r--src/main/scala/chisel3/util/Cat.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/util/Cat.scala b/src/main/scala/chisel3/util/Cat.scala
new file mode 100644
index 00000000..b47da706
--- /dev/null
+++ b/src/main/scala/chisel3/util/Cat.scala
@@ -0,0 +1,21 @@
+// See LICENSE for license details.
+
+package chisel.util
+
+import chisel._
+import chisel.core.SeqUtils
+
+object Cat {
+ /** Combine data elements together
+ * @param a Data to combine with
+ * @param r any number of other Data elements to be combined in order
+ * @return A UInt which is all of the bits combined together
+ */
+ def apply[T <: Bits](a: T, r: T*): UInt = apply(a :: r.toList)
+
+ /** Combine data elements together
+ * @param r any number of other Data elements to be combined in order
+ * @return A UInt which is all of the bits combined together
+ */
+ def apply[T <: Bits](r: Seq[T]): UInt = SeqUtils.asUInt(r.reverse)
+}