Skip to content

Commit 1c0b27d

Browse files
committed
[chisel5] Fix FIRRTL doc warnings, make fatal
Fix all FIRRTL Scaladoc warnings and re-enable fatal warnings when building the docs. Signed-off-by: Schuyler Eldridge <[email protected]>
1 parent 51d53bc commit 1c0b27d

File tree

16 files changed

+26
-48
lines changed

16 files changed

+26
-48
lines changed

build.sbt

+2
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ lazy val chisel = (project in file("."))
319319
.dependsOn(firrtl)
320320
.aggregate(macros, core, plugin, firrtl)
321321
.settings(warningSuppression: _*)
322+
.settings(fatalWarningsSettings: _*)
322323
.settings(
323324
mimaPreviousArtifacts := Set(),
324325
Test / scalacOptions ++= Seq("-language:reflectiveCalls"),
@@ -393,3 +394,4 @@ lazy val docs = project // new documentation project
393394
"BUILD_DIR" -> "docs-target" // build dir for mdoc programs to dump temp files
394395
)
395396
)
397+
.settings(fatalWarningsSettings: _*)

core/src/main/scala/chisel3/internal/plugin/package.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ package object plugin {
3838
* DO NOT USE in your normal Chisel code!!!
3939
*
4040
* @param names The names to use corresponding to interesting fields of the Product
41-
* @param nameMe The [[Product]] to be named
41+
* @param nameMe The [[scala.Product]] to be named
4242
* @tparam T The type of the thing to be named
4343
* @return The thing, but with each member named
4444
*/

firrtl/src/main/scala/firrtl/RenameMap.scala

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ object RenameMap {
2525

2626
/** Map old names to new names
2727
*
28-
* Transforms that modify names should return a [[RenameMap]] with the [[CircuitState]]
2928
* These are mutable datastructures for convenience
3029
* @define noteSelfRename @note Self renames *will* be recorded
3130
* @define noteDistinct @note Rename to/tos will be made distinct

firrtl/src/main/scala/firrtl/options/DependencyManager.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ trait DependencyManager[A, B <: TransformLike[A] with DependencyAPI[B]] extends
3535
private lazy val _targets: LinkedHashSet[Dependency[B]] = targets
3636
.foldLeft(new LinkedHashSet[Dependency[B]]()) { case (a, b) => a += b }
3737

38-
/** A sequence of [[firrtl.Transform]]s that have been run. Internally, this will be converted to an ordered set.
38+
/** A sequence of [[TransformLike]]s that have been run. Internally, this will be converted to an ordered set.
3939
*/
4040
def currentState: Seq[Dependency[B]]
4141
private lazy val _currentState: LinkedHashSet[Dependency[B]] = currentState

firrtl/src/main/scala/firrtl/options/phases/WriteOutputAnnotations.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ import scala.collection.mutable
2424
* 1) Annotations which extend [[CustomFileEmission]] are written seperately to their prescribed
2525
* destinations and replaced per [[[CustomFileEmission.replacements replacements]].
2626
* 2) All remaining annotations are written to destination specified by
27-
* [[StageOptions.annotationFileOut annotationFileOut]], iff the stage option is set, with the following exceptions:
27+
* [[StageOptions.annotationFileOut annotationFileOut]], iff the stage option is set, with the following exception:
2828
* a) Annotations extending [[Unserializable]] are not written
29-
* b) Deleted annotations are not written unless [[StageOptions.writeDeleted writeDeleted]] is set
29+
* b) Annotations extending [[CustomFileEmission]] are written to the file they specify using the serialization they
30+
* define. They show up in the output Annotation file using their "replacements", if one is specified.
3031
*/
3132
class WriteOutputAnnotations extends Phase {
3233

firrtl/src/main/scala/firrtl/stage/FirrtlAnnotations.scala

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ object OutputFileAnnotation extends HasShellOptions {
3535
/** Sets the info mode style
3636
* - set with `--info-mode`
3737
* @param mode info mode name
38-
* @note This cannote be directly converted to [[Parser.InfoMode]] as that depends on an optional [[FirrtlFileAnnotation]]
3938
*/
4039
case class InfoModeAnnotation(modeName: String = "use") extends NoTargetAnnotation with FirrtlOption {
4140
require(

firrtl/src/main/scala/firrtl/stage/package.scala

+3-9
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,11 @@ package firrtl
55
import firrtl.options.OptionsView
66
import logger.LazyLogging
77

8-
/** The [[stage]] package provides an implementation of the FIRRTL compiler using the [[firrtl.options]] package. This
9-
* primarily consists of:
10-
* - [[FirrtlStage]], the internal and external (command line) interface to the FIRRTL compiler
11-
* - A number of [[options.Phase Phase]]s that support and compartmentalize the individual operations of
12-
* [[FirrtlStage]]
13-
* - [[FirrtlOptions]], a class representing options that are necessary to drive the [[FirrtlStage]] and its
14-
* [[firrtl.options.Phase Phase]]s
8+
/** The [[stage]] package provides Stage/Phase infrastructure for FIRRTL compilers:
9+
* - A number of support [[options.Phase Phase]]s
10+
* - [[FirrtlOptions]], a class representing options common to FIRRTL compilers
1511
* - [[FirrtlOptionsView]], a utility that constructs an [[options.OptionsView OptionsView]] of [[FirrtlOptions]]
1612
* from an [[AnnotationSeq]]
17-
* - [[FirrtlCli]], the command line options that the [[FirrtlStage]] supports
18-
* - [[FirrtlStageUtils]] containing miscellaneous utilities for [[stage]]
1913
*/
2014
package object stage {
2115
implicit object FirrtlOptionsView extends OptionsView[FirrtlOptions] with LazyLogging {

firrtl/src/main/scala/firrtl/stage/phases/AddDefaults.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import firrtl.options.{Phase, TargetDirAnnotation}
77
import firrtl.transforms.BlackBoxTargetDirAnno
88
import firrtl.stage.{FirrtlOptions, InfoModeAnnotation}
99

10-
/** [[firrtl.options.Phase Phase]] that adds default [[FirrtlOption]] [[firrtl.annotations.Annotation Annotation]]s.
11-
* This is a part of the preprocessing done by [[FirrtlStage]].
12-
*/
10+
/** [[firrtl.options.Phase Phase]] that adds default [[FirrtlOption]] [[firrtl.annotations.Annotation Annotation]]s. */
1311
class AddDefaults extends Phase {
1412

1513
override def prerequisites = Seq.empty

firrtl/src/main/scala/firrtl/stage/phases/Checks.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import firrtl.options.{Dependency, OptionsException, Phase}
1313
* [[AddDefaults]]).
1414
*
1515
* The intent of this approach is that after running this [[firrtl.options.Phase Phase]], a user can be absolutely
16-
* certain that other [[firrtl.options.Phase Phase]]s or views will succeed. See [[FirrtlStage]] for a list of
17-
* [[firrtl.options.Phase Phase]] that commonly run before this.
16+
* certain that other [[firrtl.options.Phase Phase]]s or views will succeed.
1817
*/
1918
class Checks extends Phase {
2019

root-doc.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This is the documentation for Chisel.
33
== Package structure ==
44

55
The [[chisel3]] package presents the public API of Chisel.
6-
It contains the concrete core types [[chisel3.UInt `UInt`]], [[chisel3.SInt `SInt`]], [[chisel3.Bool `Bool`]], [[chisel3.experimental.FixedPoint `FixedPoint`]], [[chisel3.Clock `Clock`]], and [[chisel3.Reg `Reg`]],
6+
It contains the concrete core types [[chisel3.UInt `UInt`]], [[chisel3.SInt `SInt`]], [[chisel3.Bool `Bool`]], [[chisel3.Clock `Clock`]], and [[chisel3.Reg `Reg`]],
77
the abstract types [[chisel3.Bits `Bits`]], [[chisel3.Aggregate `Aggregate`]], and [[chisel3.Data `Data`]],
88
and the aggregate types [[chisel3.Bundle `Bundle`]] and [[chisel3.Vec `Vec`]].
99

src/main/scala/chisel3/stage/phases/Emitter.scala

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package chisel3.stage.phases
44

5-
import firrtl.{AnnotationSeq, EmittedFirrtlCircuit, EmittedFirrtlCircuitAnnotation}
5+
import firrtl.AnnotationSeq
66
import firrtl.options.{Dependency, Phase, StageOptions}
77
import firrtl.options.Viewer.view
88

@@ -12,14 +12,9 @@ import chisel3.stage.{ChiselCircuitAnnotation, ChiselOptions}
1212
import java.io.{File, FileWriter}
1313

1414
/** Emit a [[chisel3.stage.ChiselCircuitAnnotation]] to a file if a [[chisel3.stage.ChiselOutputFileAnnotation]] is
15-
* present. A deleted [[firrtl.EmittedFirrtlCircuitAnnotation]] is added.
15+
* present.
1616
*
17-
* @todo This should be switched to support correct emission of multiple circuits to multiple files. The API should
18-
* likely mirror how the [[firrtl.stage.phases.Compiler]] parses annotations into "global" annotations and
19-
* left-associative per-circuit annotations.
20-
* @todo The use of the deleted [[firrtl.EmittedFirrtlCircuitAnnotation]] is a kludge to provide some breadcrumbs such
21-
* that the emitted CHIRRTL can be provided back to the old Driver. This should be removed or a better solution
22-
* developed.
17+
* @todo This should be switched to support correct emission of multiple circuits to multiple files.
2318
*/
2419
class Emitter extends Phase {
2520

src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ private case class ChiselLoadMemoryAnnotation[T <: Data](
3535
/** [[loadMemoryFromFile]] is an annotation generator that helps with loading a memory from a text file as a bind module. This relies on
3636
* Verilator and Verilog's `\$readmemh` or `\$readmemb`.
3737
*
38-
* This annotation, when the FIRRTL compiler runs, triggers the [[LoadMemoryTransform]]. That will add Verilog
39-
* directives to enable the specified memories to be initialized from files.
38+
* This annotation, when a FIRRTL compiler runs will add Verilog directives to enable the specified memories to be
39+
* initialized from files.
4040
*
4141
* ==Example module==
4242
*

src/main/scala/circt/stage/Annotations.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import firrtl.options.{CustomFileEmission, HasShellOptions, OptionsException, Sh
88
import firrtl.options.Viewer.view
99
import firrtl.stage.FirrtlOptions
1010

11-
/** An option consumed by [[circt.stage.CIRCTStage CIRCTStage]] */
11+
/** An option used to construct a [[circt.stage.CIRCTOptions CIRCTOptions]] */
1212
sealed trait CIRCTOption extends Unserializable { this: Annotation => }
1313

1414
object PreserveAggregate extends HasShellOptions {

src/main/scala/circt/stage/ChiselStage.scala

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ trait CLI { this: Shell =>
3232
}
3333

3434
/** Entry point for running Chisel with the CIRCT compiler.
35-
*
36-
* This is intended to be a replacement for [[chisel3.stage.ChiselStage]].
3735
*
3836
* @note The companion object, [[ChiselStage$]], has a cleaner API for compiling and returning a string.
3937
*/

src/main/scala/circt/stage/phases/AddImplicitOutputFile.scala

+6-10
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,15 @@ import firrtl.AnnotationSeq
88
import firrtl.options.{Dependency, Phase, Viewer}
99
import firrtl.stage.{FirrtlOptions, OutputFileAnnotation}
1010

11-
/** [[firrtl.options.Phase Phase]] that adds an [[OutputFileAnnotation]] if one does not already exist.
11+
/** [[firrtl.options.Phase Phase]] that adds an [[firrtl.stage.OutputFileAnnotation OutputFileAnnotation]] if one does
12+
* not already exist.
1213
*
13-
* To determine the [[OutputFileAnnotation]], the following precedence is used. Whichever happens first succeeds:
14-
* - Do nothing if an [[OutputFileAnnotation]] or [[EmitAllModulesAnnotation]] exist
14+
* To determine the [[firrtl.stage.OutputFileAnnotation OutputFileAnnotation]], the following precedence is
15+
* used. Whichever happens first succeeds:
16+
* - Do nothing if an [[firrtl.stage.OutputFileAnnotation OutputFileAnnotation]] "--split-verilog" was specified
1517
* - Use the main in the first discovered [[firrtl.stage.FirrtlCircuitAnnotation FirrtlCircuitAnnotation]] (see note
1618
* below)
1719
* - Use "a"
18-
*
19-
* The file suffix may or may not be specified, but this may be arbitrarily changed by the [[Emitter]].
20-
*
21-
* @note This [[firrtl.options.Phase Phase]] has a dependency on [[AddCircuit]]. Only a
22-
* [[firrtl.stage.FirrtlCircuitAnnotation FirrtlCircuitAnnotation]] will be used to implicitly set the
23-
* [[OutputFileAnnotation]] (not other [[firrtl.stage.CircuitOption CircuitOption]] subclasses).
2420
*/
2521
class AddImplicitOutputFile extends Phase {
2622

@@ -30,7 +26,7 @@ class AddImplicitOutputFile extends Phase {
3026

3127
override def invalidates(a: Phase) = false
3228

33-
/** Add an [[OutputFileAnnotation]] to an [[AnnotationSeq]] */
29+
/** Add an [[firrtl.stage.OutputFileAnnotation OutputFileAnnotation]] to an [[firrtl.AnnotationSeq AnnotationSeq]] */
3430
def transform(annotations: AnnotationSeq): AnnotationSeq =
3531
annotations.collectFirst { case _: OutputFileAnnotation | SplitVerilog => annotations }.getOrElse {
3632
val topName = Viewer[FirrtlOptions]

src/main/scala/circt/stage/phases/CIRCT.scala

+1-4
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ private[this] object Exceptions {
115115

116116
}
117117

118-
/** A phase that calls and runs CIRCT, specifically `firtool`, while preserving an `AnnotationSeq` API.
119-
*
120-
* This is analogous to [[firrtl.stage.phases.Compiler]].
121-
*/
118+
/** A phase that calls and runs CIRCT, specifically `firtool`, while preserving an [[firrtl.AnnotationSeq AnnotationSeq]] API. */
122119
class CIRCT extends Phase {
123120

124121
import Helpers._

0 commit comments

Comments
 (0)