Skip to content

Commit b1ccb4f

Browse files
authored
[scala3] Remove names from context parameters (#4639)
They are not needed and add unnecessary noise to public APIs.
1 parent 856ceb0 commit b1ccb4f

File tree

20 files changed

+173
-173
lines changed

20 files changed

+173
-173
lines changed

core/src/main/scala-3/chisel3/Aggregate.scala

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, length: Int)
5252

5353
override def toString: String = super[VecImpl].toString
5454

55-
def apply(p: UInt)(using sourceInfo: SourceInfo): T = _applyImpl(p)
55+
def apply(p: UInt)(using SourceInfo): T = _applyImpl(p)
5656

5757
/** A reduce operation in a tree like structure instead of sequentially
5858
* @example An adder tree
@@ -75,7 +75,7 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, length: Int)
7575
redOp: (T, T) => T,
7676
layerOp: (T) => T = (x: T) => x
7777
)(
78-
using sourceInfo: SourceInfo
78+
using SourceInfo
7979
): T = _reduceTreeImpl(redOp, layerOp)
8080
}
8181

@@ -92,7 +92,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
9292
* element
9393
* @note output elements are connected from the input elements
9494
*/
95-
def apply[T <: Data](elts: Seq[T])(using sourceInfo: SourceInfo): Vec[T] = _applyImpl(elts)
95+
def apply[T <: Data](elts: Seq[T])(using SourceInfo): Vec[T] = _applyImpl(elts)
9696

9797
/** Creates a new [[Vec]] composed of the input [[Data]] nodes.
9898
*
@@ -102,7 +102,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
102102
* element
103103
* @note output elements are connected from the input elements
104104
*/
105-
def apply[T <: Data](elt0: T, elts: T*)(using sourceInfo: SourceInfo): Vec[T] = _applyImpl(elt0, elts: _*)
105+
def apply[T <: Data](elt0: T, elts: T*)(using SourceInfo): Vec[T] = _applyImpl(elt0, elts: _*)
106106

107107
/** Creates a new [[Vec]] of length `n` composed of the results of the given
108108
* function applied over a range of integer values starting from 0.
@@ -115,7 +115,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
115115
def tabulate[T <: Data](
116116
n: Int
117117
)(gen: (Int) => T)(
118-
using sourceInfo: SourceInfo
118+
using SourceInfo
119119
): Vec[T] = _tabulateImpl(n)(gen)
120120

121121
/** Creates a new 2D [[Vec]] of length `n by m` composed of the results of the given
@@ -131,7 +131,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
131131
n: Int,
132132
m: Int
133133
)(gen: (Int, Int) => T)(
134-
using sourceInfo: SourceInfo
134+
using SourceInfo
135135
): Vec[Vec[T]] = _tabulateImpl(n, m)(gen)
136136

137137
/** Creates a new 3D [[Vec]] of length `n by m by p` composed of the results of the given
@@ -148,7 +148,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
148148
m: Int,
149149
p: Int
150150
)(gen: (Int, Int, Int) => T)(
151-
using sourceInfo: SourceInfo
151+
using SourceInfo
152152
): Vec[Vec[Vec[T]]] = _tabulateImpl(n, m, p)(gen)
153153

154154
/** Creates a new [[Vec]] of length `n` composed of the result of the given
@@ -158,7 +158,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
158158
* @param gen function that takes in an element T and returns an output
159159
* element of the same type
160160
*/
161-
def fill[T <: Data](n: Int)(gen: => T)(using sourceInfo: SourceInfo): Vec[T] = _fillImpl(n)(gen)
161+
def fill[T <: Data](n: Int)(gen: => T)(using SourceInfo): Vec[T] = _fillImpl(n)(gen)
162162

163163
/** Creates a new 2D [[Vec]] of length `n by m` composed of the result of the given
164164
* function applied to an element of data type T.
@@ -172,7 +172,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
172172
n: Int,
173173
m: Int
174174
)(gen: => T)(
175-
using sourceInfo: SourceInfo
175+
using SourceInfo
176176
): Vec[Vec[T]] = _fillImpl(n, m)(gen)
177177

178178
/** Creates a new 3D [[Vec]] of length `n by m by p` composed of the result of the given
@@ -189,7 +189,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
189189
m: Int,
190190
p: Int
191191
)(gen: => T)(
192-
using sourceInfo: SourceInfo
192+
using SourceInfo
193193
): Vec[Vec[Vec[T]]] = _fillImpl(n, m, p)(gen)
194194

195195
/** Creates a new [[Vec]] of length `n` composed of the result of the given
@@ -204,7 +204,7 @@ object VecInit extends VecInitImpl with SourceInfoDoc {
204204
start: T,
205205
len: Int
206206
)(f: (T) => T)(
207-
using sourceInfo: SourceInfo
207+
using SourceInfo
208208
): Vec[T] = _iterateImpl(start, len)(f)
209209
}
210210

@@ -215,32 +215,32 @@ trait VecLike[T <: Data] extends VecLikeImpl[T] with SourceInfoDoc {
215215

216216
/** Creates a dynamically indexed read or write accessor into the array.
217217
*/
218-
def apply(p: UInt)(using sourceInfo: SourceInfo): T
218+
def apply(p: UInt)(using SourceInfo): T
219219

220220
/** Outputs true if p outputs true for every element.
221221
*/
222-
def forall(p: T => Bool)(using sourceInfo: SourceInfo): Bool = _forallImpl(p)
222+
def forall(p: T => Bool)(using SourceInfo): Bool = _forallImpl(p)
223223

224224
/** Outputs true if p outputs true for at least one element.
225225
*/
226-
def exists(p: T => Bool)(using sourceInfo: SourceInfo): Bool = _existsImpl(p)
226+
def exists(p: T => Bool)(using SourceInfo): Bool = _existsImpl(p)
227227

228228
/** Outputs true if the vector contains at least one element equal to x (using
229229
* the === operator).
230230
*/
231-
def contains(x: T)(using sourceInfo: SourceInfo, ev: T <:< UInt): Bool = _containsImpl(x)
231+
def contains(x: T)(using SourceInfo, T <:< UInt): Bool = _containsImpl(x)
232232

233233
/** Outputs the number of elements for which p is true.
234234
*/
235-
def count(p: T => Bool)(using sourceInfo: SourceInfo): UInt = _countImpl(p)
235+
def count(p: T => Bool)(using SourceInfo): UInt = _countImpl(p)
236236

237237
/** Outputs the index of the first element for which p outputs true.
238238
*/
239-
def indexWhere(p: T => Bool)(using sourceInfo: SourceInfo): UInt = _indexWhereImpl(p)
239+
def indexWhere(p: T => Bool)(using SourceInfo): UInt = _indexWhereImpl(p)
240240

241241
/** Outputs the index of the last element for which p outputs true.
242242
*/
243-
def lastIndexWhere(p: T => Bool)(using sourceInfo: SourceInfo): UInt = _lastIndexWhereImpl(p)
243+
def lastIndexWhere(p: T => Bool)(using SourceInfo): UInt = _lastIndexWhereImpl(p)
244244

245245
/** Outputs the index of the element for which p outputs true, assuming that
246246
* the there is exactly one such element.
@@ -252,7 +252,7 @@ trait VecLike[T <: Data] extends VecLikeImpl[T] with SourceInfoDoc {
252252
* true is NOT checked (useful in cases where the condition doesn't always
253253
* hold, but the results are not used in those cases)
254254
*/
255-
def onlyIndexWhere(p: T => Bool)(using sourceInfo: SourceInfo): UInt = _onlyIndexWhereImpl(p)
255+
def onlyIndexWhere(p: T => Bool)(using SourceInfo): UInt = _onlyIndexWhereImpl(p)
256256
}
257257

258258
/** Base class for Aggregates based on key values pairs of String and Data

0 commit comments

Comments
 (0)