summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/Bitwise.scala
diff options
context:
space:
mode:
authorJack Koenig2022-05-13 19:45:59 -0700
committerGitHub2022-05-14 02:45:59 +0000
commit99ae2eeb9decb3bc3a789053889f608bb1a103b9 (patch)
tree42cf9f5cc00b27108dfda74a37e0a928be4ce3bc /src/main/scala/chisel3/util/Bitwise.scala
parent73d3e3cf0722f712f3f950980253290481de5db7 (diff)
Deprecate named arguments for methods moving to macros in 3.6 (#2530)
These methods will start using def macros and since def macros do not supported named arguments this will be a source-incompatible change. This deprecation will warn users that they need to remove any uses of named arguments on these methods.
Diffstat (limited to 'src/main/scala/chisel3/util/Bitwise.scala')
-rw-r--r--src/main/scala/chisel3/util/Bitwise.scala15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/scala/chisel3/util/Bitwise.scala b/src/main/scala/chisel3/util/Bitwise.scala
index 8abe3645..92ebddb4 100644
--- a/src/main/scala/chisel3/util/Bitwise.scala
+++ b/src/main/scala/chisel3/util/Bitwise.scala
@@ -24,13 +24,16 @@ object FillInterleaved {
*
* Output data-equivalent to in(size(in)-1) (n times) ## ... ## in(1) (n times) ## in(0) (n times)
*/
- def apply(n: Int, in: UInt): UInt = apply(n, in.asBools)
+ def apply(@deprecatedName('n, "Chisel 3.5") n: Int, @deprecatedName('in, "Chisel 3.5") in: UInt): UInt =
+ apply(n, in.asBools)
/** Creates n repetitions of each bit of x in order.
*
* Output data-equivalent to in(size(in)-1) (n times) ## ... ## in(1) (n times) ## in(0) (n times)
*/
- def apply(n: Int, in: Seq[Bool]): UInt = Cat(in.map(Fill(n, _)).reverse)
+ def apply(@deprecatedName('n, "Chisel 3.5") n: Int, @deprecatedName('in, "Chisel 3.5") in: Seq[Bool]): UInt = Cat(
+ in.map(Fill(n, _)).reverse
+ )
}
/** Returns the number of bits set (value is 1 or true) in the input signal.
@@ -45,9 +48,9 @@ object FillInterleaved {
* }}}
*/
object PopCount {
- def apply(in: Iterable[Bool]): UInt = SeqUtils.count(in.toSeq)
+ def apply(@deprecatedName('in, "Chisel 3.5") in: Iterable[Bool]): UInt = SeqUtils.count(in.toSeq)
- def apply(in: Bits): UInt = apply((0 until in.getWidth).map(in(_)))
+ def apply(@deprecatedName('in, "Chisel 3.5") in: Bits): UInt = apply((0 until in.getWidth).map(in(_)))
}
/** Create repetitions of the input using a tree fanout topology.
@@ -65,7 +68,7 @@ object Fill {
* Output data-equivalent to x ## x ## ... ## x (n repetitions).
* @throws java.lang.IllegalArgumentException if `n` is less than zero
*/
- def apply(n: Int, x: UInt): UInt = {
+ def apply(@deprecatedName('n, "Chisel 3.5") n: Int, @deprecatedName('x, "Chisel 3.5") x: UInt): UInt = {
n match {
case _ if n < 0 => throw new IllegalArgumentException(s"n (=$n) must be nonnegative integer.")
case 0 => UInt(0.W)
@@ -111,5 +114,5 @@ object Reverse {
Cat(doit(in(half - 1, 0), half), doit(in(length - 1, half), length - half))
}
- def apply(in: UInt): UInt = doit(in, in.getWidth)
+ def apply(@deprecatedName('in, "Chisel 3.5") in: UInt): UInt = doit(in, in.getWidth)
}