summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Cat.scala
diff options
context:
space:
mode:
authorJim Lawson2016-06-20 11:08:46 -0700
committerJim Lawson2016-06-20 11:08:46 -0700
commitd408d73a171535bd7c2ba9d0037c194022b8a62f (patch)
tree81885a99ec56e89532bc3fa338f22b163dcc4d1f /src/main/scala/chisel3/util/Cat.scala
parentb5a534914795d9d17f4dfe623525f1b804e4c60f (diff)
Rename chisel3 package.
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)
+}