Skip to content

Commit 9f416dd

Browse files
chickjackkoenig
andauthored
Get rid of warnings in / doc build (#3041)
* Get rid of warnings in / doc build Many `[[...]]` dont work so replace with back-ticks Printable docs are very problematic, use Warning suppression for those * Enable fatal warnings in CI for ScalaDoc generation Co-authored-by: Jack Koenig <koenig@sifive.com>
1 parent 5968fbb commit 9f416dd

40 files changed

+162
-179
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
uses: ./.github/workflows/install-circt
134134
#TODO: make the microsite building include building ScalaDoc
135135
- name: Build the docs
136-
run: sbt -DdisableFatalWarnings doc
136+
run: sbt doc
137137
- name: Build the microsite
138138
run: make -C website
139139
env:

build.sbt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ lazy val warningSuppression = Seq(
5656
"msg=Importing from firrtl:s",
5757
"msg=migration to the MLIR:s",
5858
"msg=method hasDefiniteSize in trait IterableOnceOps is deprecated:s", // replacement `knownSize` is not in 2.12
59-
"msg=object JavaConverters in package collection is deprecated:s"
59+
"msg=object JavaConverters in package collection is deprecated:s",
60+
"msg=undefined in comment for method cf in class PrintableHelper:s"
6061
).mkString(",")
6162
)
6263

@@ -110,6 +111,7 @@ lazy val chiselSettings = Seq(
110111
)
111112

112113
autoCompilerPlugins := true
114+
autoAPIMappings := true
113115

114116
// Plugin must be fully cross-versioned (published for Scala minor version)
115117
// The plugin only works in Scala 2.12+
@@ -318,7 +320,3 @@ lazy val docs = project // new documentation project
318320
)
319321
)
320322
.settings(fatalWarningsSettings: _*)
321-
322-
addCommandAlias("com", "all compile")
323-
addCommandAlias("lint", "; compile:scalafix --check ; test:scalafix --check")
324-
addCommandAlias("fix", "all compile:scalafix test:scalafix")

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

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

228228
/** The "bulk connect operator", assigning elements in this Vec from elements in a Seq.
229229
*
230-
* For chisel3._, uses the [[BiConnect]] algorithm; sub-elements of `that` may end up driving sub-elements of `this`
230+
* For chisel3._, uses the `chisel3.internal.BiConnect` algorithm; sub-elements of `that` may end up driving sub-elements of `this`
231231
* - Complicated semantics, will likely be deprecated in the future
232232
*
233233
* For Chisel._, emits the FIRRTL.<- operator
@@ -249,7 +249,7 @@ sealed class Vec[T <: Data] private[chisel3] (gen: => T, val length: Int) extend
249249

250250
/** The "bulk connect operator", assigning elements in this Vec from elements in a Vec.
251251
*
252-
* For chisel3._, uses the [[BiConnect]] algorithm; sub-elements of `that` may end up driving sub-elements of `this`
252+
* For chisel3._, uses the `chisel3.internal.BiConnect` algorithm; sub-elements of `that` may end up driving sub-elements of `this`
253253
* - See docs/src/explanations/connection-operators.md for details
254254
*
255255
* For Chisel._, emits the FIRRTL.<- operator
@@ -1159,11 +1159,11 @@ abstract class Record(private[chisel3] implicit val compileOptions: CompileOptio
11591159
clone
11601160
}
11611161

1162-
/** The collection of [[Data]]
1162+
/** The collection of [[chisel3.Data]]
11631163
*
11641164
* This underlying datastructure is a ListMap because the elements must
11651165
* remain ordered for serialization/deserialization. Elements added later
1166-
* are higher order when serialized (this is similar to [[Vec]]). For example:
1166+
* are higher order when serialized (this is similar to `Vec`). For example:
11671167
* {{{
11681168
* // Assume we have some type MyRecord that creates a Record from the ListMap
11691169
* val record = MyRecord(ListMap("fizz" -> UInt(16.W), "buzz" -> UInt(16.W)))

core/src/main/scala/chisel3/Annotation.scala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ trait ChiselMultiAnnotation {
2828
def toFirrtl: Seq[Annotation]
2929
}
3030

31-
/** Mixin for [[ChiselAnnotation]] that instantiates an associated FIRRTL Transform when this Annotation is present
32-
* during a run of
33-
* [[Driver$.execute(args:Array[String],dut:()=>chisel3\.RawModule)* Driver.execute]].
34-
* Automatic Transform instantiation is *not* supported when the Circuit and Annotations are serialized before invoking
35-
* FIRRTL.
31+
/** Mixin for [[ChiselAnnotation]] that instantiates an associated Transform when this Annotation is present
3632
*/
3733
trait RunFirrtlTransform extends ChiselAnnotation {
3834
def transformClass: Class[_ <: Transform]
@@ -78,12 +74,7 @@ object annotate {
7874
* io.out(1) := fullAdder(io.a, io.b, "mod2")
7975
* }
8076
* }}}
81-
*
82-
* @note Calling this on [[Data]] creates an annotation that Chisel emits to a separate annotations
83-
* file. This file must be passed to FIRRTL independently of the `.fir` file. The execute methods
84-
* in [[chisel3.Driver]] will pass the annotations to FIRRTL automatically.
8577
*/
86-
8778
object doNotDedup {
8879

8980
/** Marks a module to be ignored in Dedup Transform in Firrtl

core/src/main/scala/chisel3/Bits.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ sealed abstract class Bits(private[chisel3] val width: Width) extends Element wi
374374
/** @group SourceInfoTransformMacro */
375375
def do_asSInt(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): SInt
376376

377-
/** Reinterpret this $coll as a [[FixedPoint]].
377+
/** Reinterpret this $coll as a `FixedPoint`.
378378
*
379379
* @note The value is not guaranteed to be preserved. For example, a [[UInt]] of width 3 and value 7 (0b111) would
380-
* become a [[FixedPoint]] with value -1. The interpretation of the number is also affected by the specified binary
380+
* become a `FixedPoint` with value -1. The interpretation of the number is also affected by the specified binary
381381
* point. '''Caution is advised!'''
382382
*/
383383
@deprecated(deprecatedMFCMessage, "Chisel 3.6")
@@ -1331,7 +1331,7 @@ package experimental {
13311331
@deprecated(deprecatedMFCMessage, "Chisel 3.6")
13321332
def binaryPoint: BinaryPoint
13331333

1334-
/** Return the [[Double]] value of this instance if it is a Literal
1334+
/** Return the `Double` value of this instance if it is a Literal
13351335
* @note this method may throw an exception if the literal value won't fit in a Double
13361336
*/
13371337
@deprecated(deprecatedMFCMessage, "Chisel 3.6")
@@ -1348,7 +1348,7 @@ package experimental {
13481348
@deprecated(deprecatedMFCMessage, "Chisel 3.6")
13491349
def litToDouble: Double = litToDoubleOption.get
13501350

1351-
/** Return the [[BigDecimal]] value of this instance if it is a Literal
1351+
/** Return the [[scala.math.BigDecimal]] value of this instance if it is a Literal
13521352
* @note this method may throw an exception if the literal value won't fit in a BigDecimal
13531353
*/
13541354
@deprecated(deprecatedMFCMessage, "Chisel 3.6")
@@ -1360,7 +1360,7 @@ package experimental {
13601360
}
13611361
}
13621362

1363-
/** Return the [[BigDecimal]] value of this instance assuming it is a literal (convenience method)
1363+
/** Return the [[scala.math.BigDecimal]] value of this instance assuming it is a literal (convenience method)
13641364
* @return
13651365
*/
13661366
@deprecated(deprecatedMFCMessage, "Chisel 3.6")
@@ -1860,7 +1860,7 @@ package experimental {
18601860
* val one = 1.I
18611861
* val six = Seq.fill(6)(one).reduce(_ + _)
18621862
* }}}
1863-
* A UInt computed in this way would require a [[Width]]
1863+
* A UInt computed in this way would require a `Width`
18641864
* binary point
18651865
* The width and binary point may be inferred.
18661866
*

core/src/main/scala/chisel3/Data.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ abstract class Data extends HasId with NamedComponent with SourceInfoDoc {
723723

724724
/** The "bulk connect operator", assigning elements in this Vec from elements in a Vec.
725725
*
726-
* For chisel3._, uses the [[BiConnect]] algorithm; sub-elements of `that` may end up driving sub-elements of `this`
726+
* For chisel3._, uses the `chisel3.internal.BiConnect` algorithm; sub-elements of that` may end up driving sub-elements of `this`
727727
* - Complicated semantics, hard to write quickly, will likely be deprecated in the future
728728
*
729729
* For Chisel._, emits the FIRRTL.<- operator

core/src/main/scala/chisel3/Module.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ package experimental {
401401

402402
/** The desired name of this module (which will be used in generated FIRRTL IR or Verilog).
403403
*
404-
* The name of a module approximates the behavior of the Java Reflection [[`getSimpleName` method
405-
* https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getSimpleName--]] with some modifications:
404+
* The name of a module approximates the behavior of the Java Reflection `getSimpleName` method
405+
* https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getSimpleName-- with some modifications:
406406
*
407407
* - Anonymous modules will get an `"_Anon"` tag
408408
* - Modules defined in functions will use their class name and not a numeric name

core/src/main/scala/chisel3/VerificationStatement.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object assert extends VerifPrintMacrosDoc {
6464
* @param cond condition, assertion fires (simulation fails) on a rising clock edge when false and reset is not asserted
6565
* @param message optional chisel Printable type message
6666
*
67-
* @note See [[printf.apply(fmt:Printable)]] for documentation on printf using Printables
67+
* @note See [[printf.apply(pable:chisel3\.Printable)*]] for documentation on printf using Printables
6868
* @note currently cannot be used in core Chisel / libraries because macro
6969
* defs need to be compiled first and the SBT project is not set up to do
7070
* that
@@ -239,7 +239,7 @@ object assume extends VerifPrintMacrosDoc {
239239
* @param cond condition, assertion fires (simulation fails) when false
240240
* @param message optional Printable type message when the assertion fires
241241
*
242-
* @note See [[printf.apply(fmt:Printable]] for documentation on printf using Printables
242+
* @note See [[printf.apply(pable:chisel3\.Printable)*]] for documentation on printf using Printables
243243
*/
244244
def apply(
245245
cond: Bool,

core/src/main/scala/chisel3/connectable/Connectable.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ object Connectable {
125125
* $chiselTypeRestrictions
126126
*
127127
* Additional notes:
128-
* - Connecting two [[util.DecoupledIO]]'s would connect `bits`, `valid`, AND `ready` from producer to consumer (despite `ready` being flipped)
128+
* - Connecting two `util.DecoupledIO`'s would connect `bits`, `valid`, AND `ready` from producer to consumer (despite `ready` being flipped)
129129
* - Functionally equivalent to chisel3.:=, but different than Chisel.:=
130130
*
131131
* @group connection
@@ -143,7 +143,7 @@ object Connectable {
143143
* $chiselTypeRestrictions
144144
*
145145
* Additional notes:
146-
* - Connecting two [[util.DecoupledIO]]'s would connect `bits` and `valid` from producer to consumer, but leave `ready` unconnected
146+
* - Connecting two `util.DecoupledIO`'s would connect `bits` and `valid` from producer to consumer, but leave `ready` unconnected
147147
*
148148
* @group connection
149149
*
@@ -160,7 +160,7 @@ object Connectable {
160160
* $chiselTypeRestrictions
161161
*
162162
* Additional notes:
163-
* - Connecting two [[util.DecoupledIO]]'s would connect `ready` from consumer to producer, but leave `bits` and `valid` unconnected
163+
* - Connecting two `util.DecoupledIO`'s would connect `ready` from consumer to producer, but leave `bits` and `valid` unconnected
164164
*
165165
* @group connection
166166
*
@@ -182,7 +182,7 @@ object Connectable {
182182
* - An additional type restriction is that all relative orientations of `consumer` and `producer` must match exactly.
183183
*
184184
* Additional notes:
185-
* - Connecting two wires of [[util.DecoupledIO]] chisel type would connect `bits` and `valid` from producer to consumer, and `ready` from consumer to producer.
185+
* - Connecting two wires of `util.DecoupledIO` chisel type would connect `bits` and `valid` from producer to consumer, and `ready` from consumer to producer.
186186
* - If the types of consumer and producer also have identical relative flips, then we can emit FIRRTL.<= as it is a stricter version of chisel3.:<>=
187187
* - "turk-duck-en" is a dish where a turkey is stuffed with a duck, which is stuffed with a chicken; `:<>=` is a `:=` stuffed with a `<>`
188188
*

core/src/main/scala/chisel3/dontTouch.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ import firrtl.transforms.DontTouchAnnotation
1919
* dontTouch(dead) // Marking it as such will preserve it
2020
* }
2121
* }}}
22-
* @note Calling this on [[Data]] creates an annotation that Chisel emits to a separate annotations
23-
* file. This file must be passed to FIRRTL independently of the `.fir` file. The execute methods
24-
* in [[chisel3.Driver]] will pass the annotations to FIRRTL automatically.
2522
* @note Because this is an optimization barrier, constants will not be propagated through a signal marked as
2623
* dontTouch.
2724
*/

core/src/main/scala/chisel3/experimental/Trace.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object Trace {
5959
def duplicate(n: T): Annotation = this.copy(target = n)
6060
}
6161

62-
/** Get [[CompleteTarget]] of the target `x` for `annos`.
62+
/** Get `CompleteTarget` of the target `x` for `annos`.
6363
* This API can be used to find the final reference to a signal or module which is marked by `traceName`
6464
*/
6565
def finalTarget(annos: AnnotationSeq)(x: HasId): Seq[CompleteTarget] = finalTargetMap(annos)

core/src/main/scala/chisel3/experimental/dataview/DataProduct.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ object DataProduct extends LowPriorityDataProduct {
9292
}
9393
}
9494

95-
/** [[DataProduct]] implementation for any [[Tuple2]] where each field has an implementation of `DataProduct`. */
95+
/** [[DataProduct]] implementation for any [[scala.Tuple2]] where each field has an implementation of `DataProduct`. */
9696
implicit def tuple2DataProduct[A: DataProduct, B: DataProduct]: DataProduct[(A, B)] = new DataProduct[(A, B)] {
9797
def dataIterator(tup: (A, B), path: String): Iterator[(Data, String)] = {
9898
val dpa = implicitly[DataProduct[A]]
@@ -102,7 +102,7 @@ object DataProduct extends LowPriorityDataProduct {
102102
}
103103
}
104104

105-
/** [[DataProduct]] implementation for any [[Tuple3]] where each field has an implementation of `DataProduct`. */
105+
/** [[DataProduct]] implementation for any [[scala.Tuple3]] where each field has an implementation of `DataProduct`. */
106106
implicit def tuple3DataProduct[A: DataProduct, B: DataProduct, C: DataProduct]: DataProduct[(A, B, C)] =
107107
new DataProduct[(A, B, C)] {
108108
def dataIterator(tup: (A, B, C), path: String): Iterator[(Data, String)] = {
@@ -114,7 +114,7 @@ object DataProduct extends LowPriorityDataProduct {
114114
}
115115
}
116116

117-
/** [[DataProduct]] implementation for any [[Tuple4]] where each field has an implementation of `DataProduct`. */
117+
/** [[DataProduct]] implementation for any [[scala.Tuple4]] where each field has an implementation of `DataProduct`. */
118118
implicit def tuple4DataProduct[
119119
A: DataProduct,
120120
B: DataProduct,
@@ -135,7 +135,7 @@ object DataProduct extends LowPriorityDataProduct {
135135
}
136136
}
137137

138-
/** [[DataProduct]] implementation for any [[Tuple5]] where each field has an implementation of `DataProduct`. */
138+
/** [[DataProduct]] implementation for any [[scala.Tuple5]] where each field has an implementation of `DataProduct`. */
139139
implicit def tuple5DataProduct[
140140
A: DataProduct,
141141
B: DataProduct,
@@ -159,7 +159,7 @@ object DataProduct extends LowPriorityDataProduct {
159159
}
160160
}
161161

162-
/** [[DataProduct]] implementation for any [[Tuple6]] where each field has an implementation of `DataProduct`. */
162+
/** [[DataProduct]] implementation for any [[scala.Tuple6]] where each field has an implementation of `DataProduct`. */
163163
implicit def tuple6DataProduct[
164164
A: DataProduct,
165165
B: DataProduct,
@@ -186,7 +186,7 @@ object DataProduct extends LowPriorityDataProduct {
186186
}
187187
}
188188

189-
/** [[DataProduct]] implementation for any [[Tuple7]] where each field has an implementation of `DataProduct`. */
189+
/** [[DataProduct]] implementation for any [[scala.Tuple7]] where each field has an implementation of `DataProduct`. */
190190
implicit def tuple7DataProduct[
191191
A: DataProduct,
192192
B: DataProduct,
@@ -216,7 +216,7 @@ object DataProduct extends LowPriorityDataProduct {
216216
}
217217
}
218218

219-
/** [[DataProduct]] implementation for any [[Tuple8]] where each field has an implementation of `DataProduct`. */
219+
/** [[DataProduct]] implementation for any [[scala.Tuple8]] where each field has an implementation of `DataProduct`. */
220220
implicit def tuple8DataProduct[
221221
A: DataProduct,
222222
B: DataProduct,
@@ -249,7 +249,7 @@ object DataProduct extends LowPriorityDataProduct {
249249
}
250250
}
251251

252-
/** [[DataProduct]] implementation for any [[Tuple9]] where each field has an implementation of `DataProduct`. */
252+
/** [[DataProduct]] implementation for any [[scala.Tuple9]] where each field has an implementation of `DataProduct`. */
253253
implicit def tuple9DataProduct[
254254
A: DataProduct,
255255
B: DataProduct,
@@ -285,7 +285,7 @@ object DataProduct extends LowPriorityDataProduct {
285285
}
286286
}
287287

288-
/** [[DataProduct]] implementation for any [[Tuple9]] where each field has an implementation of `DataProduct`. */
288+
/** [[DataProduct]] implementation for any [[scala.Tuple9]] where each field has an implementation of `DataProduct`. */
289289
implicit def tuple10DataProduct[
290290
A: DataProduct,
291291
B: DataProduct,

core/src/main/scala/chisel3/experimental/dataview/DataView.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ object DataView {
170170
)
171171
}
172172

173-
/** Provides implementations of [[DataView]] for [[Tuple2]] to [[HWTuple2]] */
173+
/** Provides implementations of [[DataView]] for [[scala.Tuple2]] to [[HWTuple2]] */
174174
implicit def tuple2DataView[T1: DataProduct, T2: DataProduct, V1 <: Data, V2 <: Data](
175175
implicit v1: DataView[T1, V1],
176176
v2: DataView[T2, V2],
@@ -184,7 +184,7 @@ object DataView {
184184
}
185185
)
186186

187-
/** Provides implementations of [[DataView]] for [[Tuple3]] to [[HWTuple3]] */
187+
/** Provides implementations of [[DataView]] for [[scala.Tuple3]] to [[HWTuple3]] */
188188
implicit def tuple3DataView[T1: DataProduct, T2: DataProduct, T3: DataProduct, V1 <: Data, V2 <: Data, V3 <: Data](
189189
implicit v1: DataView[T1, V1],
190190
v2: DataView[T2, V2],
@@ -199,7 +199,7 @@ object DataView {
199199
}
200200
)
201201

202-
/** Provides implementations of [[DataView]] for [[Tuple4]] to [[HWTuple4]] */
202+
/** Provides implementations of [[DataView]] for [[scala.Tuple4]] to [[HWTuple4]] */
203203
implicit def tuple4DataView[
204204
T1: DataProduct,
205205
T2: DataProduct,
@@ -227,7 +227,7 @@ object DataView {
227227
}
228228
)
229229

230-
/** Provides implementations of [[DataView]] for [[Tuple5]] to [[HWTuple5]] */
230+
/** Provides implementations of [[DataView]] for [[scala.Tuple5]] to [[HWTuple5]] */
231231
implicit def tuple5DataView[
232232
T1: DataProduct,
233233
T2: DataProduct,
@@ -272,7 +272,7 @@ object DataView {
272272
)
273273
}
274274

275-
/** Provides implementations of [[DataView]] for [[Tuple6]] to [[HWTuple6]] */
275+
/** Provides implementations of [[DataView]] for [[scala.Tuple6]] to [[HWTuple6]] */
276276
implicit def tuple6DataView[
277277
T1: DataProduct,
278278
T2: DataProduct,
@@ -320,7 +320,7 @@ object DataView {
320320
}
321321
)
322322

323-
/** Provides implementations of [[DataView]] for [[Tuple7]] to [[HWTuple7]] */
323+
/** Provides implementations of [[DataView]] for [[scala.Tuple7]] to [[HWTuple7]] */
324324
implicit def tuple7DataView[
325325
T1: DataProduct,
326326
T2: DataProduct,
@@ -373,7 +373,7 @@ object DataView {
373373
}
374374
)
375375

376-
/** Provides implementations of [[DataView]] for [[Tuple8]] to [[HWTuple8]] */
376+
/** Provides implementations of [[DataView]] for [[scala.Tuple8]] to [[HWTuple8]] */
377377
implicit def tuple8DataView[
378378
T1: DataProduct,
379379
T2: DataProduct,
@@ -431,7 +431,7 @@ object DataView {
431431
}
432432
)
433433

434-
/** Provides implementations of [[DataView]] for [[Tuple9]] to [[HWTuple9]] */
434+
/** Provides implementations of [[DataView]] for [[scala.Tuple9]] to [[HWTuple9]] */
435435
implicit def tuple9DataView[
436436
T1: DataProduct,
437437
T2: DataProduct,
@@ -494,7 +494,7 @@ object DataView {
494494
}
495495
)
496496

497-
/** Provides implementations of [[DataView]] for [[Tuple10]] to [[HWTuple10]] */
497+
/** Provides implementations of [[DataView]] for [[scala.Tuple10]] to [[HWTuple10]] */
498498
implicit def tuple10DataView[
499499
T1: DataProduct,
500500
T2: DataProduct,

0 commit comments

Comments
 (0)