Protocol Support¶
Constellation supports an interface to automatically wrap a multi-channel communication protocol on top of the NoC. This section describes the abstract interface for layering any potential protocol onto the NoC, as well as the implementations which provide AXI-4 and TileLink compliant interconnects.
Abstract Protocol Interface¶
To layer a protocol on top of the NoC, an instance of a case class extending ProtocolParams
must be constructed.
trait ProtocolParams {
val minPayloadWidth: Int
val ingressNodes: Seq[Int]
val egressNodes: Seq[Int]
val nVirtualNetworks: Int
val vNetBlocking: (Int, Int) => Boolean
val flows: Seq[FlowParams]
def genIO()(implicit p: Parameters): Data
def interface(
terminals: NoCTerminalIO,
ingressOffset: Int,
egressOffset: Int,
protocol: Data)(implicit p: Parameters)
}
The required fields of ProtocolParams must be provided as follows:
minPayloadWidthis the required minimum payload width for flits to transport this protocol. It is the minimum payload width at the ingress and egress terminals.
ingressNodesis an ordered list of physical node destination for all ingress terminals
egressNodesis an ordered list of physical node sources for all egress terminals
nVirtualNetworksis the number of virtual subnets in this protocol, often this is the number of protocol channels.
vNetBlockingdescribes the blocking/nonblocking relationships between virtual subnetworks in this protocol
flowsis a list of possible flows for the protocol
genIOreturns the protocol-level IO for the entire interconnect
interfaceprovides the interface for the NoC throughterminals: NoCTerminalIOand the interface for the protocol throughprotocol: Data. This function should instantiate the user-defined protocol adapters to connect the two interfaces.
Standalone Protocol NoC¶
A NoC with protocol support can be elaborated in Chisel using the ProtocolNoC generator.
The ProtocolNoCParams case class parameterizes both the network (through nocParams), as well
as the protocol interface (though a list of ProtocolParams.
case class ProtocolNoCParams(
nocParams: NoCParams,
protocolParams: Seq[ProtocolParams],
widthDivision: Int = 1,
inlineNoC: Boolean = false
)
class ProtocolNoC(params: ProtocolNoCParams)(implicit p: Parameters) extends Module {
val io = IO(new Bundle {
val ctrl = if (params.nocParams.hasCtrl) Vec(params.nocParams.topology.nNodes, new RouterCtrlBundle) else Nil
val protocol = MixedVec(params.protocolParams.map { u => u.genIO() })
})
Note
Multiple protocols can be supported on a shared interconnect by passing multiple ProtocolParams to protocolParams
Note
Harnesses for testing standalone non-diplomatic protocol-capable NoCs are currently not provided. At the moment, Diplomatic integration is recommended.
TileLink Protocol Params¶
The TileLinkProtocolParams case class describes an instance of ProtocolParams for TileLink-C.
edgesIn and edgesOut are ordered list of inwards and outwards TileLink edges (from masters and slaves, respectively). edgeInNodes and edgeOutNodes map the masters and slaves to physical node indices.
The definition of the TLEdge parameter class can be found in Rocketchip.
case class TileLinkABCDEProtocolParams(
edgesIn: Seq[TLEdge],
edgesOut: Seq[TLEdge],
edgeInNodes: Seq[Int],
edgeOutNodes: Seq[Int]
) extends TileLinkProtocolParams {
Note
TL-C is a superset of TL-UL and TL-UH, so this implementation supports all potential TileLink implementations.
AXI-4 Protocol Params¶
The AXI4ProtocolParams case class describes an instance of ProtocolParams for AXI4.
edgesIn and edgesOut are ordered list of inwards and outwards AXI-4 edges (from masters and slaves, respectively). edgeInNodes and edgeOutNodes map the masters and slaves to physical node indices.
The definition of the AXI4EdgeParameters class can be found in Rocketchip.
case class AXI4ProtocolParams(
edgesIn: Seq[AXI4EdgeParameters],
edgesOut: Seq[AXI4EdgeParameters],
edgeInNodes: Seq[Int],
edgeOutNodes: Seq[Int],
awQueueDepth: Int
) extends ProtocolParams {
Diplomatic Protocol NoC¶
The common approach for generating interconnects within a Chipyard/Rocketchip-based SoC is to use the Diplomatic wrapper for a protocol-capable interconnet. Diplomacy’s parameter negotiation will automatically construct a ProtocolParams case class to construct the TileLinkProtocolParams or AXI4ProtocolParams case classes from the Diplomatic graph.
These modules can replace existing TLXbar() and AXI4Xbar() Diplomatic modules in any Chipyard/Rocketchip design.
nocParams: NoCParamsdescribes the physical topology and routing relation of the network
nodeMappings: DiplmaticNetworkNodeMappingcontains mappings fromStringto aIntto map Diplomatic edges to physical node identifiers
case class AXI4NoCParams(
nodeMappings: DiplomaticNetworkNodeMapping,
nocParams: NoCParams,
awQueueDepth: Int = 2
)
class AXI4NoC(params: AXI4NoCParams, name: String = "test")(implicit p: Parameters) extends LazyModule {
case class SimpleTLNoCParams(
nodeMappings: DiplomaticNetworkNodeMapping,
nocParams: NoCParams = NoCParams(),
) extends TLNoCParams
class TLNoC(params: SimpleTLNoCParams, name: String = "test", inlineNoC: Boolean = false)(implicit p: Parameters) extends TLNoCLike {
case class DiplomaticNetworkNodeMapping(
inNodeMapping: ListMap[String, Int] = ListMap[String, Int](),
outNodeMapping: ListMap[String, Int] = ListMap[String, Int]()
) {