Skip to content

Commit bdb7388

Browse files
Merge pull request #67 from ucb-ucie/sideband_main
Sideband main
2 parents b6eb23f + 10e38f5 commit bdb7388

13 files changed

+2217
-15
lines changed

build.sbt

+61-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
// ThisBuild / organization := "edu.berkeley.cs"
2+
// ThisBuild / version := "0.0.1-SNAPSHOT"
3+
4+
// ThisBuild / scalaVersion := "2.13.10"
5+
// ThisBuild / scalacOptions := Seq(
6+
// "-deprecation",
7+
// "-feature",
8+
// "-language:reflectiveCalls",
9+
// "-Xcheckinit",
10+
// "-Xlint",
11+
// )
12+
13+
// Compile / doc / scalacOptions += "-groups"
14+
15+
// val chiselVersion = "3.6.0"
16+
17+
// lazy val root = (project in file("."))
18+
// .settings(
19+
// name := "uciedigital",
20+
// libraryDependencies ++= Seq(
21+
// "edu.berkeley.cs" %% "chisel3" % chiselVersion,
22+
// "edu.berkeley.cs" %% "chiseltest" % "0.6.2" % Test,
23+
// "org.scalatest" %% "scalatest" % "3.2.17" % Test,
24+
// "edu.berkeley.cs" %% "rocketchip" % "1.6.0",
25+
// "edu.berkeley.cs" %% "rocket-macros" % "1.6.0",
26+
// "edu.berkeley.cs" %% "cde" % "1.6.0",
27+
// ),
28+
// addCompilerPlugin(
29+
// "edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full,
30+
// ),
31+
// )
32+
33+
// // Plugins
34+
// Global / excludeLintKeys += idePackagePrefix
35+
// root / idePackagePrefix := Some("edu.berkeley.cs.ucie.digital")
36+
37+
name := "ucie_digital"
138
ThisBuild / organization := "edu.berkeley.cs"
239
ThisBuild / version := "0.0.1-SNAPSHOT"
340

@@ -14,19 +51,29 @@ Compile / doc / scalacOptions += "-groups"
1451

1552
val chiselVersion = "3.6.0"
1653

17-
lazy val root = (project in file("."))
18-
.settings(
19-
name := "uciedigital",
20-
libraryDependencies ++= Seq(
21-
"edu.berkeley.cs" %% "chisel3" % chiselVersion,
22-
"edu.berkeley.cs" %% "chiseltest" % "0.6.2" % Test,
23-
"org.scalatest" %% "scalatest" % "3.2.17" % Test,
24-
),
25-
addCompilerPlugin(
26-
"edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full,
27-
),
54+
// SNAPSHOT repositories
55+
libraryDependencies ++=
56+
Seq(
57+
"edu.berkeley.cs" %% "rocketchip-3.6.0" % "1.6-3.6.0-e3773366a-SNAPSHOT",
58+
"edu.berkeley.cs" %% "chisel3" % chiselVersion,
59+
"edu.berkeley.cs" %% "chiseltest" % "0.6.2" % "test",
60+
"org.scalatest" %% "scalatest" % "3.2.17" % "test",
2861
)
2962

30-
// Plugins
31-
Global / excludeLintKeys += idePackagePrefix
32-
root / idePackagePrefix := Some("edu.berkeley.cs.ucie.digital")
63+
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
64+
resolvers ++= Resolver.sonatypeOssRepos("releases")
65+
resolvers += Resolver.mavenLocal
66+
67+
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full)
68+
69+
import Tests._
70+
71+
Test / fork := true
72+
Test / testGrouping := (Test / testGrouping).value.flatMap { group =>
73+
group.tests.map { test =>
74+
Group(test.name, Seq(test), SubProcess(ForkOptions()))
75+
}
76+
}
77+
78+
concurrentRestrictions := Seq(Tags.limit(Tags.ForkedTestGroup, 72))
79+

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.9.8
1+
sbt.version=1.9.7

src/main/scala/sideband/sb-msg-encoding.scala

+401
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package edu.berkeley.cs.ucie.digital
2+
package sideband
3+
4+
import chisel3._
5+
6+
import interfaces._
7+
8+
class D2DSidebandChannel(
9+
val myID: BigInt = BigInt(1),
10+
val sbParams: SidebandParams,
11+
val fdiParams: FdiParams,
12+
) extends Module {
13+
val io = IO(new D2DSidebandChannelIO(sbParams, fdiParams))
14+
15+
// Instantiate submodule
16+
val upper_node = Module(new SidebandNode(sbParams, fdiParams))
17+
val switcher = Module(new sidebandSwitcher(myID, sbParams))
18+
val lower_node = Module(new SidebandNode(sbParams, fdiParams))
19+
20+
// Connect outer signals
21+
io.to_upper_layer <> upper_node.io.outer
22+
io.to_lower_layer <> lower_node.io.outer
23+
24+
// Connect two sidebandNodes and switcher
25+
upper_node.io.inner.layer_to_node <> switcher.io.outer.layer_to_node_above
26+
upper_node.io.inner.node_to_layer <> switcher.io.outer.node_to_layer_above
27+
lower_node.io.inner.layer_to_node <> switcher.io.outer.layer_to_node_below
28+
lower_node.io.inner.node_to_layer <> switcher.io.outer.node_to_layer_below
29+
30+
// Connect inner signals
31+
io.inner <> switcher.io.inner
32+
}
33+
34+
class PHYSidebandChannel(
35+
val myID: BigInt = BigInt(2),
36+
val sbParams: SidebandParams,
37+
val fdiParams: FdiParams,
38+
) extends Module {
39+
val io = IO(new PHYSidebandChannelIO(sbParams, fdiParams))
40+
41+
// Instantiate submodule
42+
val upper_node = Module(new SidebandNode(sbParams, fdiParams))
43+
val switcher = Module(new sidebandSwitcher(myID, sbParams))
44+
val lower_node = Module(new SidebandLinkNode(sbParams, fdiParams))
45+
46+
// Connect outer signals
47+
io.to_upper_layer <> upper_node.io.outer
48+
io.to_lower_layer <> lower_node.io.outer
49+
50+
// Connect two sidebandNodes and switcher
51+
upper_node.io.inner.layer_to_node <> switcher.io.outer.layer_to_node_above
52+
upper_node.io.inner.node_to_layer <> switcher.io.outer.node_to_layer_above
53+
lower_node.io.inner.layer_to_node <> switcher.io.outer.layer_to_node_below
54+
lower_node.io.inner.node_to_layer <> switcher.io.outer.node_to_layer_below
55+
56+
// Connect inner signals
57+
io.inner <> switcher.io.inner
58+
}
+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
package edu.berkeley.cs.ucie.digital
2+
package sideband
3+
4+
import chisel3._
5+
import chisel3.util._
6+
7+
import interfaces._
8+
9+
class D2DSidebandChannelIO(
10+
val sbParams: SidebandParams,
11+
val fdiParams: FdiParams,
12+
) extends Bundle {
13+
// connect to another sideband node in the layer above (protocol layer)
14+
val to_upper_layer = new Bundle {
15+
val tx = new Bundle {
16+
val bits = Output(UInt(fdiParams.sbWidth.W))
17+
val valid = Output(Bool())
18+
val credit = Input(Bool())
19+
}
20+
val rx = new Bundle {
21+
val bits = Input(UInt(fdiParams.sbWidth.W))
22+
val valid = Input(Bool())
23+
val credit = Output(Bool())
24+
}
25+
}
26+
// connect to another sideband node in the layer below (physical layer)
27+
val to_lower_layer = new Bundle {
28+
val tx = new Bundle {
29+
val bits = Output(UInt(fdiParams.sbWidth.W))
30+
val valid = Output(Bool())
31+
val credit = Input(Bool())
32+
}
33+
val rx = new Bundle {
34+
val bits = Input(UInt(fdiParams.sbWidth.W))
35+
val valid = Input(Bool())
36+
val credit = Output(Bool())
37+
}
38+
}
39+
// d2d layer drive these
40+
val inner = Flipped(new SidebandSwitcherbundle(sbParams))
41+
}
42+
43+
class PHYSidebandChannelIO(
44+
val sbParams: SidebandParams,
45+
val fdiParams: FdiParams,
46+
) extends Bundle {
47+
// connect to another sideband node in the layer above (d2d layer)
48+
val to_upper_layer = new Bundle {
49+
val tx = new Bundle {
50+
val bits = Output(UInt(fdiParams.sbWidth.W))
51+
val valid = Output(Bool())
52+
val credit = Input(Bool())
53+
}
54+
val rx = new Bundle {
55+
val bits = Input(UInt(fdiParams.sbWidth.W))
56+
val valid = Input(Bool())
57+
val credit = Output(Bool())
58+
}
59+
}
60+
// connect to another sideband node in the layer below (link layer)
61+
val to_lower_layer = new Bundle {
62+
val tx = new Bundle {
63+
val bits = Output(UInt(fdiParams.sbWidth.W))
64+
val clock = Output(Bool())
65+
}
66+
val rx = new Bundle {
67+
val bits = Input(UInt(fdiParams.sbWidth.W))
68+
val clock = Input(Bool())
69+
}
70+
}
71+
// phy layer drive these
72+
val inner = Flipped(new SidebandSwitcherbundle(sbParams))
73+
}
74+
75+
// IO for the RDI and FDI sideband
76+
class SidebandNodeIO(val sbParams: SidebandParams, val fdiParams: FdiParams)
77+
extends Bundle {
78+
// layers drive these
79+
val inner = new Bundle {
80+
val layer_to_node = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W)))
81+
/* This signal overrides the tx.ready and takes up the priority reserved
82+
* queue slot */
83+
// Should only be asserted high for access completion packets
84+
val node_to_layer = Decoupled(UInt(sbParams.sbNodeMsgWidth.W))
85+
}
86+
// connect these to another sideband node
87+
val outer = new Bundle {
88+
val tx = new Bundle {
89+
val bits = Output(UInt(fdiParams.sbWidth.W))
90+
val valid = Output(Bool())
91+
val credit = Input(Bool())
92+
}
93+
val rx = new Bundle {
94+
val bits = Input(UInt(fdiParams.sbWidth.W))
95+
val valid = Input(Bool())
96+
val credit = Output(Bool())
97+
}
98+
}
99+
}
100+
101+
class SidebandNodeOuterIO(
102+
val sbParams: SidebandParams,
103+
val fdiParams: FdiParams,
104+
) extends Bundle {
105+
val tx = new Bundle {
106+
val bits = Output(UInt(fdiParams.sbWidth.W))
107+
val valid = Output(Bool())
108+
val credit = Input(Bool())
109+
}
110+
val rx = new Bundle {
111+
val bits = Input(UInt(fdiParams.sbWidth.W))
112+
val valid = Input(Bool())
113+
val credit = Output(Bool())
114+
}
115+
}
116+
117+
class SidebandLinkNodeOuterIO(
118+
val sbParams: SidebandParams,
119+
val fdiParams: FdiParams,
120+
) extends Bundle {
121+
val tx = new Bundle {
122+
val bits = Output(UInt(fdiParams.sbWidth.W))
123+
val clock = Output(Bool())
124+
}
125+
val rx = new Bundle {
126+
val bits = Input(UInt(fdiParams.sbWidth.W))
127+
val clock = Input(Bool())
128+
}
129+
}
130+
131+
// IO for the remote sideband
132+
class SidebandLinkIO(val sbParams: SidebandParams, val fdiParams: FdiParams)
133+
extends Bundle {
134+
// layers drive these
135+
val inner = new Bundle {
136+
val layer_to_node = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W)))
137+
/* This signal overrides the tx.ready and takes up the priority reserved
138+
* queue slot */
139+
// Should only be asserted high for access completion packets
140+
val node_to_layer = Decoupled(UInt(sbParams.sbNodeMsgWidth.W))
141+
}
142+
// connect these to another sideband node
143+
val outer = new Bundle {
144+
val tx = new Bundle {
145+
val bits = Output(UInt(fdiParams.sbWidth.W))
146+
val clock = Output(Bool())
147+
}
148+
val rx = new Bundle {
149+
val bits = Input(UInt(fdiParams.sbWidth.W))
150+
val clock = Input(Bool())
151+
}
152+
}
153+
}
154+
155+
class SidebandSwitcherIO(val sbParams: SidebandParams) extends Bundle {
156+
// layer drive these
157+
val inner = Flipped(new SidebandSwitcherbundle(sbParams))
158+
// Sideband node drive these
159+
val outer = new SidebandSwitcherbundle(sbParams)
160+
}
161+
162+
class SidebandSwitcherbundle(val sbParams: SidebandParams) extends Bundle {
163+
val node_to_layer_above = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W)))
164+
val layer_to_node_above = Decoupled(UInt(sbParams.sbNodeMsgWidth.W))
165+
val node_to_layer_below = Flipped(Decoupled(UInt(sbParams.sbNodeMsgWidth.W)))
166+
val layer_to_node_below = Decoupled(UInt(sbParams.sbNodeMsgWidth.W))
167+
}

0 commit comments

Comments
 (0)