Merge pull request #1358 from ucb-bar/detcip

Remove TLHelper, directly use tilelink node constructors
This commit is contained in:
Jerry Zhao
2023-02-28 15:17:10 -08:00
committed by GitHub
9 changed files with 25 additions and 27 deletions

View File

@@ -173,7 +173,7 @@ lazy val tracegen = (project in file("generators/tracegen"))
.settings(commonSettings) .settings(commonSettings)
lazy val icenet = (project in file("generators/icenet")) lazy val icenet = (project in file("generators/icenet"))
.dependsOn(testchipip, rocketchip) .dependsOn(rocketchip)
.settings(libraryDependencies ++= rocketLibDeps.value) .settings(libraryDependencies ++= rocketLibDeps.value)
.settings(commonSettings) .settings(commonSettings)
@@ -209,7 +209,7 @@ lazy val sha3 = (project in file("generators/sha3"))
.settings(commonSettings) .settings(commonSettings)
lazy val gemmini = (project in file("generators/gemmini")) lazy val gemmini = (project in file("generators/gemmini"))
.dependsOn(testchipip, rocketchip) .dependsOn(rocketchip)
.settings(libraryDependencies ++= rocketLibDeps.value) .settings(libraryDependencies ++= rocketLibDeps.value)
.settings(chiselTestSettings) .settings(chiselTestSettings)
.settings(commonSettings) .settings(commonSettings)

View File

@@ -20,7 +20,7 @@ that writes zeros to the memory at a configured address.
:start-after: DOC include start: DigitalTop :start-after: DOC include start: DigitalTop
:end-before: DOC include end: DigitalTop :end-before: DOC include end: DigitalTop
We use ``TLHelper.makeClientNode`` to create a TileLink client node for us. We use ``TLClientNode`` to create a TileLink client node for us.
We then connect the client node to the memory system through the front bus (fbus). We then connect the client node to the memory system through the front bus (fbus).
For more info on creating TileLink client nodes, take a look at :ref:`TileLink-Diplomacy-Reference/NodeTypes:Client Node`. For more info on creating TileLink client nodes, take a look at :ref:`TileLink-Diplomacy-Reference/NodeTypes:Client Node`.

View File

@@ -16,8 +16,7 @@ on the C channel, and send grant acknowledgements on the E channel.
The L1 caches and DMA devices in RocketChip/Chipyard have client nodes. The L1 caches and DMA devices in RocketChip/Chipyard have client nodes.
You can add a TileLink client node to your LazyModule using the TLHelper You can add a TileLink client node to your LazyModule like so:
object from testchipip like so:
.. literalinclude:: ../../generators/chipyard/src/main/scala/example/NodeTypes.scala .. literalinclude:: ../../generators/chipyard/src/main/scala/example/NodeTypes.scala
:language: scala :language: scala
@@ -48,8 +47,7 @@ generators optimize the hardware by not arbitrating the client to managers with
address ranges that don't overlap with its visibility. address ranges that don't overlap with its visibility.
Inside your lazy module implementation, you can call ``node.out`` to get a Inside your lazy module implementation, you can call ``node.out`` to get a
list of bundle/edge pairs. If you used the TLHelper, you only specified a list of bundle/edge pairs.
single client edge, so this list will only have one pair.
The ``tl`` bundle is a Chisel hardware bundle that connects to the IO of this The ``tl`` bundle is a Chisel hardware bundle that connects to the IO of this
module. It contains two (in the case of TL-UL and TL-UH) or five (in the case module. It contains two (in the case of TL-UL and TL-UH) or five (in the case
@@ -65,8 +63,7 @@ Manager Node
------------ ------------
TileLink managers take requests from clients on the A channel and send TileLink managers take requests from clients on the A channel and send
responses back on the D channel. You can create a manager node using the responses back on the D channel. You can create a manager like so:
TLHelper like so:
.. literalinclude:: ../../generators/chipyard/src/main/scala/example/NodeTypes.scala .. literalinclude:: ../../generators/chipyard/src/main/scala/example/NodeTypes.scala
:language: scala :language: scala

View File

@@ -5,14 +5,14 @@ import chisel3.util._
import freechips.rocketchip.subsystem.{BaseSubsystem, CacheBlockBytes} import freechips.rocketchip.subsystem.{BaseSubsystem, CacheBlockBytes}
import freechips.rocketchip.config.{Parameters, Field, Config} import freechips.rocketchip.config.{Parameters, Field, Config}
import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp, IdRange} import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp, IdRange}
import testchipip.TLHelper import freechips.rocketchip.tilelink._
case class InitZeroConfig(base: BigInt, size: BigInt) case class InitZeroConfig(base: BigInt, size: BigInt)
case object InitZeroKey extends Field[Option[InitZeroConfig]](None) case object InitZeroKey extends Field[Option[InitZeroConfig]](None)
class InitZero(implicit p: Parameters) extends LazyModule { class InitZero(implicit p: Parameters) extends LazyModule {
val node = TLHelper.makeClientNode( val node = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLClientParameters(
name = "init-zero", sourceId = IdRange(0, 1)) name = "init-zero", sourceId = IdRange(0, 1))))))
lazy val module = new InitZeroModuleImp(this) lazy val module = new InitZeroModuleImp(this)
} }

View File

@@ -3,7 +3,6 @@ package chipyard.example
import freechips.rocketchip.config.Parameters import freechips.rocketchip.config.Parameters
import freechips.rocketchip.diplomacy._ import freechips.rocketchip.diplomacy._
import freechips.rocketchip.tilelink._ import freechips.rocketchip.tilelink._
import testchipip.TLHelper
// These modules are not meant to be synthesized. // These modules are not meant to be synthesized.
// They are used as examples in the documentation and are only here // They are used as examples in the documentation and are only here
@@ -11,11 +10,11 @@ import testchipip.TLHelper
// DOC include start: MyClient // DOC include start: MyClient
class MyClient(implicit p: Parameters) extends LazyModule { class MyClient(implicit p: Parameters) extends LazyModule {
val node = TLHelper.makeClientNode(TLMasterParameters.v1( val node = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLClientParameters(
name = "my-client", name = "my-client",
sourceId = IdRange(0, 4), sourceId = IdRange(0, 4),
requestFifo = true, requestFifo = true,
visibility = Seq(AddressSet(0x10000, 0xffff)))) visibility = Seq(AddressSet(0x10000, 0xffff)))))))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
val (tl, edge) = node.out(0) val (tl, edge) = node.out(0)
@@ -29,7 +28,7 @@ class MyClient(implicit p: Parameters) extends LazyModule {
class MyManager(implicit p: Parameters) extends LazyModule { class MyManager(implicit p: Parameters) extends LazyModule {
val device = new SimpleDevice("my-device", Seq("tutorial,my-device0")) val device = new SimpleDevice("my-device", Seq("tutorial,my-device0"))
val beatBytes = 8 val beatBytes = 8
val node = TLHelper.makeManagerNode(beatBytes, TLSlaveParameters.v1( val node = TLManagerNode(Seq(TLSlavePortParameters.v1(Seq(TLManagerParameters(
address = Seq(AddressSet(0x20000, 0xfff)), address = Seq(AddressSet(0x20000, 0xfff)),
resources = device.reg, resources = device.reg,
regionType = RegionType.UNCACHED, regionType = RegionType.UNCACHED,
@@ -40,7 +39,7 @@ class MyManager(implicit p: Parameters) extends LazyModule {
supportsPutFull = TransferSizes(1, beatBytes), supportsPutFull = TransferSizes(1, beatBytes),
supportsPutPartial = TransferSizes(1, beatBytes), supportsPutPartial = TransferSizes(1, beatBytes),
supportsHint = TransferSizes(1, beatBytes), supportsHint = TransferSizes(1, beatBytes),
fifoId = Some(0))) fifoId = Some(0))), beatBytes)))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
val (tl, edge) = node.in(0) val (tl, edge) = node.in(0)
@@ -50,7 +49,8 @@ class MyManager(implicit p: Parameters) extends LazyModule {
// DOC include start: MyClient1+MyClient2 // DOC include start: MyClient1+MyClient2
class MyClient1(implicit p: Parameters) extends LazyModule { class MyClient1(implicit p: Parameters) extends LazyModule {
val node = TLHelper.makeClientNode("my-client1", IdRange(0, 1)) val node = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLClientParameters(
"my-client1", IdRange(0, 1))))))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
// ... // ...
@@ -58,7 +58,8 @@ class MyClient1(implicit p: Parameters) extends LazyModule {
} }
class MyClient2(implicit p: Parameters) extends LazyModule { class MyClient2(implicit p: Parameters) extends LazyModule {
val node = TLHelper.makeClientNode("my-client2", IdRange(0, 1)) val node = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLClientParameters(
"my-client2", IdRange(0, 1))))))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
// ... // ...
@@ -83,8 +84,8 @@ class MyClientGroup(implicit p: Parameters) extends LazyModule {
// DOC include start: MyManagerGroup // DOC include start: MyManagerGroup
class MyManager1(beatBytes: Int)(implicit p: Parameters) extends LazyModule { class MyManager1(beatBytes: Int)(implicit p: Parameters) extends LazyModule {
val node = TLHelper.makeManagerNode(beatBytes, TLSlaveParameters.v1( val node = TLManagerNode(Seq(TLSlavePortParameters.v1(Seq(TLManagerParameters(
address = Seq(AddressSet(0x0, 0xfff)))) address = Seq(AddressSet(0x0, 0xfff)))), beatBytes)))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
// ... // ...
@@ -92,8 +93,8 @@ class MyManager1(beatBytes: Int)(implicit p: Parameters) extends LazyModule {
} }
class MyManager2(beatBytes: Int)(implicit p: Parameters) extends LazyModule { class MyManager2(beatBytes: Int)(implicit p: Parameters) extends LazyModule {
val node = TLHelper.makeManagerNode(beatBytes, TLSlaveParameters.v1( val node = TLManagerNode(Seq(TLSlavePortParameters.v1(Seq(TLManagerParameters(
address = Seq(AddressSet(0x1000, 0xfff)))) address = Seq(AddressSet(0x1000, 0xfff)))), beatBytes)))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
// ... // ...

View File

@@ -27,4 +27,4 @@ index ec36a85f..c0c2849a 100644
+// .settings(commonSettings) +// .settings(commonSettings)
lazy val gemmini = (project in file("generators/gemmini")) lazy val gemmini = (project in file("generators/gemmini"))
.dependsOn(testchipip, rocketchip) .dependsOn(rocketchip)