Skip to content

Commit 8bbb885

Browse files
authored
Merge pull request #19 from ucb-ucie/scaladoc
Setup scaladoc + tweak doc-comments
2 parents a336d69 + 0e1886f commit 8bbb885

File tree

5 files changed

+221
-67
lines changed

5 files changed

+221
-67
lines changed

.github/workflows/docs.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: pages
10+
cancel-in-progress: false
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: coursier/cache-action@v6
18+
- uses: coursier/setup-action@v1
19+
with:
20+
jvm: 17
21+
apps: sbtn
22+
- name: Build docs
23+
run: |
24+
sbt -v 'doc'
25+
- name: Upload atifact
26+
uses: actions/upload-pages-artifact@v2
27+
with:
28+
path: ./target/scala-2.13/api
29+
30+
deploy:
31+
needs: build
32+
33+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
34+
permissions:
35+
pages: write # to deploy to Pages
36+
id-token: write # to verify the deployment originates from an appropriate source
37+
38+
# Deploy to the github-pages environment
39+
environment:
40+
name: github-pages
41+
url: ${{ steps.deployment.outputs.page_url }}
42+
43+
# Specify runner + deployment step
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v2

build.sbt

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ThisBuild / scalacOptions := Seq(
1010
"-Xlint",
1111
)
1212

13+
Compile / doc / scalacOptions += "-groups"
14+
1315
val chiselVersion = "3.6.0"
1416

1517
lazy val root = (project in file("."))

src/main/scala/Afe.scala

+119-40
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package edu.berkeley.cs.ucie.digital
33
import chisel3._
44
import chisel3.util._
55

6-
// The mainband pins exposed by a standard package UCIe module in one direction.
6+
/** The mainband pins exposed by a standard package UCIe module in one
7+
* direction.
8+
*/
79
class MainbandIo(lanes: Int = 16) extends Bundle {
810
val data = Bits(lanes.W)
911
val valid = Bool()
@@ -12,60 +14,100 @@ class MainbandIo(lanes: Int = 16) extends Bundle {
1214
val clkn = Clock()
1315
}
1416

15-
// The sideband pins exposed by a standard package UCIe module in one direction.
17+
/** The sideband pins exposed by a standard package UCIe module in one
18+
* direction.
19+
*/
1620
class SidebandIo extends Bundle {
1721
val data = Bool()
1822
val clk = Clock()
1923
}
2024

21-
// The pins (mainband and sideband) exposed by a standard package UCIe module in one direction.
25+
/** The pins (mainband and sideband) exposed by a standard package UCIe module
26+
* in one direction.
27+
*/
2228
class UnidirectionalIo(lanes: Int = 16) extends Bundle {
2329
val mainband = new MainbandIo(lanes)
2430
val sideband = new SidebandIo()
2531
}
2632

27-
// The pins (mainband and sideband) exposed by a standard package UCIe module in both directions.
33+
/** The pins (mainband and sideband) exposed by a standard package UCIe module
34+
* in both directions.
35+
*/
2836
class StandardPackageIo(lanes: Int = 16) extends Bundle {
2937
val tx = Output(new UnidirectionalIo(lanes))
3038
val rx = Input(new UnidirectionalIo(lanes))
3139
}
3240

33-
// The sideband analog front-end (AFE) interface, from the perspective of the logical PHY layer.
34-
//
35-
// All signals in this interface are synchronous to the sideband clock (fixed at 800 MHz).
36-
// As a result, the sideband's `serializerRatio` likely will be different from the mainband's `serializerRatio`.
41+
/** The sideband analog front-end (AFE) interface, from the perspective of the
42+
* logical PHY layer.
43+
*
44+
* All signals in this interface are synchronous to the sideband clock (fixed
45+
* at 800 MHz). As a result, the sideband's `serializerRatio` likely will be
46+
* different from the mainband's `serializerRatio`.
47+
*/
3748
class SidebandAfeIo(
3849
serializerRatio: Int = 1,
3950
) extends Bundle {
40-
// Data to transmit on the sideband.
41-
// Output from the async FIFO.
51+
52+
/** Data to transmit on the sideband.
53+
*
54+
* Output from the async FIFO.
55+
*/
4256
val txData = Decoupled(Bits(serializerRatio.W))
43-
// Data received on the sideband.
44-
// Input to the async FIFO.
57+
58+
/** Data received on the sideband.
59+
*
60+
* Input to the async FIFO.
61+
*/
4562
val rxData = Flipped(Decoupled(Bits(serializerRatio.W)))
46-
// Enable sideband receivers.
63+
64+
/** Enable sideband receivers. */
4765
val rxEn = Output(Bool())
4866
}
4967

50-
// The mainband analog front-end (AFE) interface, from the perspective of the logical PHY layer.
51-
//
52-
// All signals in this interface are synchronous to the mainband AFE's digital clock,
53-
// which is produced by taking a high speed clock from a PLL
54-
// and dividing its frequency by `serializerRatio`.
55-
//
56-
// With half-rate clocking (1 data bit transmitted per UI; 1 UI = 0.5 clock cycles), the PLL clock
57-
// may be 2, 4, 6, 8, 12, or 16 GHz. With a serializer ratio of 16, this results in a 0.125-1 GHz
58-
// AFE digital clock.
68+
/** The mainband analog front-end (AFE) interface, from the perspective of the
69+
* logical PHY layer.
70+
*
71+
* All signals in this interface are synchronous to the mainband AFE's digital
72+
* clock, which is produced by taking a high speed clock from a PLL and
73+
* dividing its frequency by `serializerRatio`.
74+
*
75+
* With half-rate clocking (1 data bit transmitted per UI; 1 UI = 0.5 clock
76+
* cycles), the PLL clock may be 2, 4, 6, 8, 12, or 16 GHz. With a serializer
77+
* ratio of 16, this results in a 0.125-1 GHz AFE digital clock.
78+
*
79+
* @groupname data Data signals
80+
* @groupprio data 50
81+
* @groupname impedance Impedance control signals
82+
* @groupprio impedance 100
83+
* @groupname phase Phase control signals
84+
* @groupprio phase 101
85+
* @groupname receiver Receiver control signals
86+
* @groupprio receiver 102
87+
* @groupname freq Frequency control signals
88+
* @groupprio freq 103
89+
* @groupname clock Clock control signals
90+
* @groupprio clock 104
91+
*/
5992
class MainbandAfeIo(
6093
lanes: Int = 16,
6194
serializerRatio: Int = 16,
6295
) extends Bundle {
63-
// Data to transmit on the mainband.
64-
// Output from the async FIFO.
96+
97+
/** Data to transmit on the mainband.
98+
*
99+
* Output from the async FIFO.
100+
*
101+
* @group data
102+
*/
65103
val txData = Decoupled(Vec(lanes, Bits(serializerRatio.W)))
66104

67-
// Data received on the mainband.
68-
// Input to the async FIFO.
105+
/** Data received on the mainband.
106+
*
107+
* Input to the async FIFO.
108+
*
109+
* @group data
110+
*/
69111
val rxData = Flipped(Decoupled(Vec(lanes, Bits(serializerRatio.W))))
70112

71113
/////////////////////
@@ -74,46 +116,83 @@ class MainbandAfeIo(
74116
// Setting txZpu = txZpd = 0 sets drivers to hi-z.
75117
/////////////////////
76118

77-
// TX pull up impedance control.
119+
/** TX pull up impedance control.
120+
*
121+
* @group impedance
122+
*/
78123
val txZpu = Output(Vec(lanes, UInt(4.W)))
79-
// TX pull down impedance control.
124+
125+
/** TX pull down impedance control.
126+
*
127+
* @group impedance
128+
*/
80129
val txZpd = Output(Vec(lanes, UInt(4.W)))
81-
// RX impedance control.
130+
131+
/** RX impedance control.
132+
*
133+
* @group impedance
134+
*/
82135
val rxZ = Output(Vec(lanes, UInt(4.W)))
83136

84137
/////////////////////
85138
// phase control
86139
/////////////////////
87140

88-
// Global (per-module) phase control.
141+
/** Global (per-module) phase control.
142+
*
143+
* @group phase
144+
*/
89145
val txGlobalPhaseSel = Output(UInt(4.W))
90-
// Per-lane phase control.
146+
147+
/** Per-lane phase control.
148+
*
149+
* @group phase
150+
*/
91151
val txLaneDeskew = Output(Vec(lanes, UInt(4.W)))
92-
// Per-lane phase control.
152+
153+
/** Per-lane phase control.
154+
*
155+
* @group phase
156+
*/
93157
val rxLaneDeskew = Output(Vec(lanes, UInt(4.W)))
94158

95159
/////////////////////
96160
// frequency control
97161
/////////////////////
162+
/** @group freq */
98163
val txFreqSel = Output(UInt(4.W))
99164

100165
/////////////////////
101166
// receiver control
102167
/////////////////////
103-
// Mainband receiver enable.
168+
/** Mainband receiver enable.
169+
*
170+
* @group receiver
171+
*/
104172
val rxEn = Output(Bool())
105-
// Per-lane vref/offset cancellation control.
173+
174+
/** Per-lane vref/offset cancellation control.
175+
*
176+
* @group receiver
177+
*/
106178
val rxVref = Output(Vec(lanes, UInt(4.W)))
107179

108180
/////////////////////
109181
// clock control
110182
/////////////////////
111-
// Clock gating control.
183+
/** Clock gating control.
184+
*
185+
* @group clock
186+
*/
112187
val txClockEn = Output(Bool())
113-
// Clock parking level.
114-
//
115-
// Per the UCIe spec, must alternate between high and low
116-
// on subsequent clock gating events. If the link is using
117-
// free running clock mode, this signal has no effect.
188+
189+
/** Clock parking level.
190+
*
191+
* Per the UCIe spec, must alternate between high and low on subsequent clock
192+
* gating events. If the link is using free running clock mode, this signal
193+
* has no effect.
194+
*
195+
* @group clock
196+
*/
118197
val txClockPark = Output(Bool())
119198
}

src/main/scala/Decoupled3.scala

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ package edu.berkeley.cs.ucie.digital
22

33
import chisel3._
44

5+
/** An I/O Bundle containing `valid`, `ready`, and `irdy` signals that handshake
6+
* the transfer of data stored in the 'bits' subfield.
7+
*
8+
* The base protocol implied by the directionality is that the producer uses
9+
* the interface as-is (outputs bits) while the consumer uses the flipped
10+
* interface (inputs bits). The actual semantics of ready/valid are enforced
11+
* via the use of concrete subclasses.
12+
* @param gen
13+
* the type of data to be wrapped in Ready/Valid
14+
* @groupdesc Signals
15+
* The actual hardware fields of the Bundle
16+
*/
517
abstract class ReadyValid3IO[+T <: Data](gen: T) extends Bundle {
618

719
/** Indicates that the consumer is ready to accept the data this cycle

src/main/scala/Rdi.scala

+40-27
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,59 @@ package edu.berkeley.cs.ucie.digital
33
import chisel3._
44
import chisel3.util._
55

6-
// The raw D2D interface (RDI), from the perspective of the D2D Adapter.
6+
/** The raw D2D interface (RDI), from the perspective of the D2D Adapter. */
77
class Rdi(width: Int, sbWidth: Int) extends Bundle {
8-
// Adapter to Physical Layer data.
9-
// Encompasses lp_irdy, lp_valid, and pl_trdy from the UCIe specification.
8+
9+
/** Adapter to Physical Layer data.
10+
*
11+
* Encompasses lp_irdy, lp_valid, and pl_trdy from the UCIe specification.
12+
*/
1013
val lpData = Decoupled3(Vec(width, UInt(8.W)))
1114

12-
// Physical Layer to Adapter data.
13-
// Encompasses pl_valid and pl_data from the UCIe specification.
14-
// Note that backpressure is not possible.
15-
// Data should be sampled whenever valid is asserted at a clock edge.
15+
/** Physical Layer to Adapter data.
16+
*
17+
* Encompasses `pl_valid` and `pl_data` from the UCIe specification. Note
18+
* that backpressure is not possible. Data should be sampled whenever valid
19+
* is asserted at a clock edge.
20+
*/
1621
val plData = Flipped(Valid(Vec(width, UInt(8.W))))
1722

18-
// When asserted at a rising clock edge, it indicates a single credit return from the
19-
// Adapter to the Physical Layer for the Retimer Receiver buffers. Each credit corresponds
20-
// to 256B of mainband data. This signal must NOT assert for dies that are not UCIe
21-
// Retimers.
23+
/** When asserted at a rising clock edge, it indicates a single credit return
24+
* from the Adapter to the Physical Layer for the Retimer Receiver buffers.
25+
* Each credit corresponds to 256B of mainband data. This signal must NOT
26+
* assert for dies that are not UCIe Retimers.
27+
*/
2228
val lpRetimerCrd = Output(Bool())
2329

24-
// When asserted at a rising clock edge, it indicates a single credit return from the
25-
// Retimer to the Adapter. Each credit corresponds to 256B of mainband data. This signal
26-
// must NOT assert if the remote Link partner is not a Retimer.
30+
/** When asserted at a rising clock edge, it indicates a single credit return
31+
* from the Retimer to the Adapter. Each credit corresponds to 256B of
32+
* mainband data. This signal must NOT assert if the remote Link partner is
33+
* not a Retimer.
34+
*/
2735
val plRetimerCrd = Input(Bool())
2836

29-
// Adapter request to Physical Layer to request state change.
37+
/** Adapter request to Physical Layer to request state change. */
3038
val lpStateReq = Output(PhyStateReq())
3139

32-
// Adapter to Physical Layer indication that an error has occurred which requires the Link
33-
// to go down. Physical Layer must move to LinkError state and stay there as long as
34-
// lp_linkerror=1. The reason for having this be an indication decoupled from regular
35-
// state transitions is to allow immediate action on part of the Adapter and Physical Layer
36-
// in order to provide the quickest path for error containment when applicable (for
37-
// example, a viral error escalation must map to the LinkError state).
38-
// The Adapter must OR internal error conditions with lp_linkerror received from
39-
// Protocol Layer on FDI.
40+
/** Adapter to Physical Layer indication that an error has occurred which
41+
* requires the Link to go down. Physical Layer must move to LinkError state
42+
* and stay there as long as lp_linkerror=1. The reason for having this be an
43+
* indication decoupled from regular state transitions is to allow immediate
44+
* action on part of the Adapter and Physical Layer in order to provide the
45+
* quickest path for error containment when applicable (for example, a viral
46+
* error escalation must map to the LinkError state). The Adapter must OR
47+
* internal error conditions with lp_linkerror received from Protocol Layer
48+
* on FDI.
49+
*/
4050
val lpLinkError = Output(PhyStateReq())
4151

42-
// Physical Layer to Adapter Status indication of the Interface.
43-
// The status signal is permitted to transition from Physical Layer autonomously when
44-
// applicable. For example the Physical Layer asserts the Retrain status when it decides to
45-
// enter retraining either autonomously or when requested by remote agent.
52+
/** Physical Layer to Adapter Status indication of the Interface.
53+
*
54+
* The status signal is permitted to transition from Physical Layer
55+
* autonomously when applicable. For example the Physical Layer asserts the
56+
* Retrain status when it decides to enter retraining either autonomously or
57+
* when requested by remote agent.
58+
*/
4659
val plStateStatus = Input(PhyState())
4760

4861
val plInbandPres = Input(Bool())

0 commit comments

Comments
 (0)