Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mdoc build failing (sbt) #3313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ lazy val docs = project
.dependsOn(rocketchip)
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.settings(chiselSettings)
.settings(
scalacOptions += "-language:reflectiveCalls",
mdocIn := file("docs/src"),
Expand Down
18 changes: 11 additions & 7 deletions docs/src/diplomacy/adder_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## What is Diplomacy?

From the [Diplomatic Design Patterns: A TileLink Case Study](https://carrv.github.io/2017/papers/cook-diplomacy-carrv2017.pdf):
> Diplomacy is a parameter negotiation framework for generating parameterized
> Diplomacy is a parameter negotiation framework for generating parameterized
protocol implementations.

The goal of this walkthrough is to demonstrate an extremely simple Diplomacy
Expand All @@ -36,7 +36,7 @@ smaller of the two widths from the drivers versus the monitor, which is the oppo
behavior of typical Chisel width inference.

```scala mdoc:invisible
import chipsalliance.rocketchip.config.{Config, Parameters}
import org.chipsalliance.cde.config.{Config, Parameters}
import chisel3._
import chisel3.internal.sourceinfo.SourceInfo
import chisel3.stage.ChiselStage
Expand Down Expand Up @@ -247,15 +247,18 @@ signals an error if the `Adder` returns an incorrect result. It has two
`AdderMonitorNode` to take in the sum from the `Adder`.

```scala mdoc

class ErrorIO extends Bundle {
val error = Output(Bool())
}
/** monitor (sink) */
class AdderMonitor(width: Int, numOperands: Int)(implicit p: Parameters) extends LazyModule {
val nodeSeq = Seq.fill(numOperands) { new AdderMonitorNode(UpwardParam(width)) }
val nodeSum = new AdderMonitorNode(UpwardParam(width))

lazy val module = new LazyModuleImp(this) {
val io = IO(new Bundle {
val error = Output(Bool())
})
lazy val module = new Impl
class Impl extends LazyModuleImp(this) {
val io = IO(new ErrorIO)

// print operation
printf(nodeSeq.map(node => p"${node.in.head._1}").reduce(_ + p" + " + _) + p" = ${nodeSum.in.head._1}")
Expand Down Expand Up @@ -294,7 +297,8 @@ class AdderTestHarness()(implicit p: Parameters) extends LazyModule {
drivers.zip(monitor.nodeSeq).foreach { case (driver, monitorNode) => monitorNode := driver.node }
monitor.nodeSum := adder.node

lazy val module = new LazyModuleImp(this) {
lazy val module = new Impl
class Impl extends LazyModuleImp(this) {
when(monitor.module.io.error) {
printf("something went wrong")
}
Expand Down
12 changes: 6 additions & 6 deletions docs/src/diplomacy/select_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We will use the following `LazyModule`s in the examples below.
```scala mdoc
import chisel3.Bool
import freechips.rocketchip.aop.Select
import freechips.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.diplomacy.{
BundleBridgeSink,
BundleBridgeSource,
Expand All @@ -27,16 +27,16 @@ class Top(implicit p: Parameters) extends LazyModule {
val aInput = BundleBridgeSource[Bool](() => Bool())
a.input := aInput

val aOutput = a.output.makeSink
val aOutput = a.output.makeSink()

val fooInput = BundleBridgeSource[Bool](() => Bool())
foo.input := fooInput

val fooOutput = foo.output.makeSink
val fooOutput = foo.output.makeSink()

lazy val module = new LazyModuleImp(this) {
aInput.makeIO
fooOutput.makeIO
aInput.makeIO()
fooOutput.makeIO()
fooInput.bundle := aOutput.bundle
}
}
Expand All @@ -55,7 +55,7 @@ class A(implicit p: Parameters) extends LazyModule {
val input = b.input
val output = c.output

val bOutput = b.output.makeSink
val bOutput = b.output.makeSink()
val cInput = BundleBridgeSource[Bool](() => Bool())
c.input := cInput
lazy val module = new LazyModuleImp(this) {
Expand Down