diplomacy: move rendering properties to edges
FlipRendering { implicit p => ... } now changes the render direction of edges. diplomatic NodeImps can specify a default render flip using the new 'render' method.
This commit is contained in:
parent
76c2aa1661
commit
a27e853101
@ -9,11 +9,9 @@ import freechips.rocketchip.diplomacy._
|
|||||||
|
|
||||||
object AHBImp extends SimpleNodeImp[AHBMasterPortParameters, AHBSlavePortParameters, AHBEdgeParameters, AHBBundle]
|
object AHBImp extends SimpleNodeImp[AHBMasterPortParameters, AHBSlavePortParameters, AHBEdgeParameters, AHBBundle]
|
||||||
{
|
{
|
||||||
def edge(pd: AHBMasterPortParameters, pu: AHBSlavePortParameters, p: Parameters, sourceInfo: SourceInfo): AHBEdgeParameters = AHBEdgeParameters(pd, pu, p, sourceInfo)
|
def edge(pd: AHBMasterPortParameters, pu: AHBSlavePortParameters, p: Parameters, sourceInfo: SourceInfo) = AHBEdgeParameters(pd, pu, p, sourceInfo)
|
||||||
def bundle(e: AHBEdgeParameters): AHBBundle = AHBBundle(e.bundle)
|
def bundle(e: AHBEdgeParameters) = AHBBundle(e.bundle)
|
||||||
|
def render(e: AHBEdgeParameters) = RenderedEdge(colour = "#00ccff" /* bluish */, label = (e.slave.beatBytes * 8).toString)
|
||||||
def colour = "#00ccff" // bluish
|
|
||||||
override def label(e: AHBEdgeParameters) = (e.slave.beatBytes * 8).toString
|
|
||||||
|
|
||||||
override def mixO(pd: AHBMasterPortParameters, node: OutwardNode[AHBMasterPortParameters, AHBSlavePortParameters, AHBBundle]): AHBMasterPortParameters =
|
override def mixO(pd: AHBMasterPortParameters, node: OutwardNode[AHBMasterPortParameters, AHBSlavePortParameters, AHBBundle]): AHBMasterPortParameters =
|
||||||
pd.copy(masters = pd.masters.map { c => c.copy (nodePath = node +: c.nodePath) })
|
pd.copy(masters = pd.masters.map { c => c.copy (nodePath = node +: c.nodePath) })
|
||||||
|
@ -9,11 +9,9 @@ import freechips.rocketchip.diplomacy._
|
|||||||
|
|
||||||
object APBImp extends SimpleNodeImp[APBMasterPortParameters, APBSlavePortParameters, APBEdgeParameters, APBBundle]
|
object APBImp extends SimpleNodeImp[APBMasterPortParameters, APBSlavePortParameters, APBEdgeParameters, APBBundle]
|
||||||
{
|
{
|
||||||
def edge(pd: APBMasterPortParameters, pu: APBSlavePortParameters, p: Parameters, sourceInfo: SourceInfo): APBEdgeParameters = APBEdgeParameters(pd, pu, p, sourceInfo)
|
def edge(pd: APBMasterPortParameters, pu: APBSlavePortParameters, p: Parameters, sourceInfo: SourceInfo) = APBEdgeParameters(pd, pu, p, sourceInfo)
|
||||||
def bundle(e: APBEdgeParameters): APBBundle = APBBundle(e.bundle)
|
def bundle(e: APBEdgeParameters) = APBBundle(e.bundle)
|
||||||
|
def render(e: APBEdgeParameters) = RenderedEdge(colour = "#00ccff" /* bluish */, (e.slave.beatBytes * 8).toString)
|
||||||
def colour = "#00ccff" // bluish
|
|
||||||
override def label(e: APBEdgeParameters) = (e.slave.beatBytes * 8).toString
|
|
||||||
|
|
||||||
override def mixO(pd: APBMasterPortParameters, node: OutwardNode[APBMasterPortParameters, APBSlavePortParameters, APBBundle]): APBMasterPortParameters =
|
override def mixO(pd: APBMasterPortParameters, node: OutwardNode[APBMasterPortParameters, APBSlavePortParameters, APBBundle]): APBMasterPortParameters =
|
||||||
pd.copy(masters = pd.masters.map { c => c.copy (nodePath = node +: c.nodePath) })
|
pd.copy(masters = pd.masters.map { c => c.copy (nodePath = node +: c.nodePath) })
|
||||||
|
@ -9,11 +9,9 @@ import freechips.rocketchip.diplomacy._
|
|||||||
|
|
||||||
object AXI4Imp extends SimpleNodeImp[AXI4MasterPortParameters, AXI4SlavePortParameters, AXI4EdgeParameters, AXI4Bundle]
|
object AXI4Imp extends SimpleNodeImp[AXI4MasterPortParameters, AXI4SlavePortParameters, AXI4EdgeParameters, AXI4Bundle]
|
||||||
{
|
{
|
||||||
def edge(pd: AXI4MasterPortParameters, pu: AXI4SlavePortParameters, p: Parameters, sourceInfo: SourceInfo): AXI4EdgeParameters = AXI4EdgeParameters(pd, pu, p, sourceInfo)
|
def edge(pd: AXI4MasterPortParameters, pu: AXI4SlavePortParameters, p: Parameters, sourceInfo: SourceInfo) = AXI4EdgeParameters(pd, pu, p, sourceInfo)
|
||||||
def bundle(e: AXI4EdgeParameters): AXI4Bundle = AXI4Bundle(e.bundle)
|
def bundle(e: AXI4EdgeParameters) = AXI4Bundle(e.bundle)
|
||||||
|
def render(e: AXI4EdgeParameters) = RenderedEdge(colour = "#00ccff" /* bluish */, label = (e.slave.beatBytes * 8).toString)
|
||||||
def colour = "#00ccff" // bluish
|
|
||||||
override def label(e: AXI4EdgeParameters) = (e.slave.beatBytes * 8).toString
|
|
||||||
|
|
||||||
override def mixO(pd: AXI4MasterPortParameters, node: OutwardNode[AXI4MasterPortParameters, AXI4SlavePortParameters, AXI4Bundle]): AXI4MasterPortParameters =
|
override def mixO(pd: AXI4MasterPortParameters, node: OutwardNode[AXI4MasterPortParameters, AXI4SlavePortParameters, AXI4Bundle]): AXI4MasterPortParameters =
|
||||||
pd.copy(masters = pd.masters.map { c => c.copy (nodePath = node +: c.nodePath) })
|
pd.copy(masters = pd.masters.map { c => c.copy (nodePath = node +: c.nodePath) })
|
||||||
|
@ -46,19 +46,19 @@ trait HasRocketTiles extends HasSystemBus
|
|||||||
case SynchronousCrossing(params) => {
|
case SynchronousCrossing(params) => {
|
||||||
val wrapper = LazyModule(new SyncRocketTile(tp, i)(pWithExtra))
|
val wrapper = LazyModule(new SyncRocketTile(tp, i)(pWithExtra))
|
||||||
sbus.fromSyncTiles(params, tp.externalMasterBuffers, tp.name) :=* wrapper.masterNode
|
sbus.fromSyncTiles(params, tp.externalMasterBuffers, tp.name) :=* wrapper.masterNode
|
||||||
wrapper.slaveNode :*= pbus.toSyncSlaves(tp.name, tp.externalSlaveBuffers)
|
FlipRendering { implicit p => wrapper.slaveNode :*= pbus.toSyncSlaves(tp.name, tp.externalSlaveBuffers) }
|
||||||
wrapper
|
wrapper
|
||||||
}
|
}
|
||||||
case AsynchronousCrossing(depth, sync) => {
|
case AsynchronousCrossing(depth, sync) => {
|
||||||
val wrapper = LazyModule(new AsyncRocketTile(tp, i)(pWithExtra))
|
val wrapper = LazyModule(new AsyncRocketTile(tp, i)(pWithExtra))
|
||||||
sbus.fromAsyncTiles(depth, sync, tp.externalMasterBuffers, tp.name) :=* wrapper.masterNode
|
sbus.fromAsyncTiles(depth, sync, tp.externalMasterBuffers, tp.name) :=* wrapper.masterNode
|
||||||
wrapper.slaveNode :*= pbus.toAsyncSlaves(sync, tp.name, tp.externalSlaveBuffers)
|
FlipRendering { implicit p => wrapper.slaveNode :*= pbus.toAsyncSlaves(sync, tp.name, tp.externalSlaveBuffers) }
|
||||||
wrapper
|
wrapper
|
||||||
}
|
}
|
||||||
case RationalCrossing(direction) => {
|
case RationalCrossing(direction) => {
|
||||||
val wrapper = LazyModule(new RationalRocketTile(tp, i)(pWithExtra))
|
val wrapper = LazyModule(new RationalRocketTile(tp, i)(pWithExtra))
|
||||||
sbus.fromRationalTiles(direction, tp.externalMasterBuffers, tp.name) :=* wrapper.masterNode
|
sbus.fromRationalTiles(direction, tp.externalMasterBuffers, tp.name) :=* wrapper.masterNode
|
||||||
wrapper.slaveNode :*= pbus.toRationalSlaves(tp.name, tp.externalSlaveBuffers)
|
FlipRendering { implicit p => wrapper.slaveNode :*= pbus.toRationalSlaves(tp.name, tp.externalSlaveBuffers) }
|
||||||
wrapper
|
wrapper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,10 +88,11 @@ abstract class LazyModule()(implicit val p: Parameters)
|
|||||||
buf ++= s"""${pad}</node>\n"""
|
buf ++= s"""${pad}</node>\n"""
|
||||||
}
|
}
|
||||||
private def edgesGraphML(buf: StringBuilder, pad: String) {
|
private def edgesGraphML(buf: StringBuilder, pad: String) {
|
||||||
nodes.filter(!_.omitGraphML) foreach { n => n.outputs.filter(!_._1.omitGraphML).foreach { case (o, l) =>
|
nodes.filter(!_.omitGraphML) foreach { n => n.outputs.filter(!_._1.omitGraphML).foreach { case (o, edge) =>
|
||||||
|
val RenderedEdge(colour, label, flipped) = edge
|
||||||
buf ++= pad
|
buf ++= pad
|
||||||
buf ++= "<edge"
|
buf ++= "<edge"
|
||||||
if (o.reverse) {
|
if (flipped) {
|
||||||
buf ++= s""" target=\"${index}::${n.index}\""""
|
buf ++= s""" target=\"${index}::${n.index}\""""
|
||||||
buf ++= s""" source=\"${o.lazyModule.index}::${o.index}\">"""
|
buf ++= s""" source=\"${o.lazyModule.index}::${o.index}\">"""
|
||||||
} else {
|
} else {
|
||||||
@ -99,13 +100,13 @@ abstract class LazyModule()(implicit val p: Parameters)
|
|||||||
buf ++= s""" target=\"${o.lazyModule.index}::${o.index}\">"""
|
buf ++= s""" target=\"${o.lazyModule.index}::${o.index}\">"""
|
||||||
}
|
}
|
||||||
buf ++= s"""<data key=\"e\"><y:PolyLineEdge>"""
|
buf ++= s"""<data key=\"e\"><y:PolyLineEdge>"""
|
||||||
if (o.reverse) {
|
if (flipped) {
|
||||||
buf ++= s"""<y:Arrows source=\"standard\" target=\"none\"/>"""
|
buf ++= s"""<y:Arrows source=\"standard\" target=\"none\"/>"""
|
||||||
} else {
|
} else {
|
||||||
buf ++= s"""<y:Arrows source=\"none\" target=\"standard\"/>"""
|
buf ++= s"""<y:Arrows source=\"none\" target=\"standard\"/>"""
|
||||||
}
|
}
|
||||||
buf ++= s"""<y:LineStyle color=\"${o.colour}\" type=\"line\" width=\"1.0\"/>"""
|
buf ++= s"""<y:LineStyle color=\"${colour}\" type=\"line\" width=\"1.0\"/>"""
|
||||||
buf ++= s"""<y:EdgeLabel modelName=\"centered\" rotationAngle=\"270.0\">${l}</y:EdgeLabel>"""
|
buf ++= s"""<y:EdgeLabel modelName=\"centered\" rotationAngle=\"270.0\">${label}</y:EdgeLabel>"""
|
||||||
buf ++= s"""</y:PolyLineEdge></data></edge>\n"""
|
buf ++= s"""</y:PolyLineEdge></data></edge>\n"""
|
||||||
} }
|
} }
|
||||||
children.filter(!_.omitGraphML).foreach { c => c.edgesGraphML(buf, pad) }
|
children.filter(!_.omitGraphML).foreach { c => c.edgesGraphML(buf, pad) }
|
||||||
|
@ -28,6 +28,12 @@ private case object CardinalityInferenceDirectionKey extends
|
|||||||
Field[CardinalityInferenceDirection.T](CardinalityInferenceDirection.NO_INFERENCE)
|
Field[CardinalityInferenceDirection.T](CardinalityInferenceDirection.NO_INFERENCE)
|
||||||
|
|
||||||
private case object MonitorsEnabled extends Field[Boolean](true)
|
private case object MonitorsEnabled extends Field[Boolean](true)
|
||||||
|
private case object RenderFlipped extends Field[Boolean](false)
|
||||||
|
|
||||||
|
case class RenderedEdge(
|
||||||
|
colour: String,
|
||||||
|
label: String = "",
|
||||||
|
flipped: Boolean = false) // prefer to draw the arrow pointing the opposite direction of other edges
|
||||||
|
|
||||||
// DI = Downwards flowing Parameters received on the inner side of the node
|
// DI = Downwards flowing Parameters received on the inner side of the node
|
||||||
// UI = Upwards flowing Parameters generated by the inner side of the node
|
// UI = Upwards flowing Parameters generated by the inner side of the node
|
||||||
@ -37,14 +43,14 @@ trait InwardNodeImp[DI, UI, EI, BI <: Data]
|
|||||||
{
|
{
|
||||||
def edgeI(pd: DI, pu: UI, p: Parameters, sourceInfo: SourceInfo): EI
|
def edgeI(pd: DI, pu: UI, p: Parameters, sourceInfo: SourceInfo): EI
|
||||||
def bundleI(ei: EI): BI
|
def bundleI(ei: EI): BI
|
||||||
|
|
||||||
|
// Edge functions
|
||||||
def monitor(bundle: BI, edge: EI) {}
|
def monitor(bundle: BI, edge: EI) {}
|
||||||
def colour: String
|
def render(e: EI): RenderedEdge
|
||||||
def reverse: Boolean = false
|
|
||||||
|
|
||||||
// optional methods to track node graph
|
// optional methods to track node graph
|
||||||
def mixI(pu: UI, node: InwardNode[DI, UI, BI]): UI = pu // insert node into parameters
|
def mixI(pu: UI, node: InwardNode[DI, UI, BI]): UI = pu // insert node into parameters
|
||||||
def getO(pu: UI): Option[BaseNode] = None // most-outward common node
|
def getO(pu: UI): Option[BaseNode] = None // most-outward common node
|
||||||
def labelI(ei: EI) = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DO = Downwards flowing Parameters generated by the outer side of the node
|
// DO = Downwards flowing Parameters generated by the outer side of the node
|
||||||
@ -59,7 +65,6 @@ trait OutwardNodeImp[DO, UO, EO, BO <: Data]
|
|||||||
// optional methods to track node graph
|
// optional methods to track node graph
|
||||||
def mixO(pd: DO, node: OutwardNode[DO, UO, BO]): DO = pd // insert node into parameters
|
def mixO(pd: DO, node: OutwardNode[DO, UO, BO]): DO = pd // insert node into parameters
|
||||||
def getI(pd: DO): Option[BaseNode] = None // most-inward common node
|
def getI(pd: DO): Option[BaseNode] = None // most-inward common node
|
||||||
def labelO(eo: EO) = ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class NodeImp[D, U, EO, EI, B <: Data]
|
abstract class NodeImp[D, U, EO, EI, B <: Data]
|
||||||
@ -75,9 +80,6 @@ abstract class SimpleNodeImp[D, U, E, B <: Data]
|
|||||||
def bundle(e: E): B
|
def bundle(e: E): B
|
||||||
def bundleO(e: E) = bundle(e)
|
def bundleO(e: E) = bundle(e)
|
||||||
def bundleI(e: E) = bundle(e)
|
def bundleI(e: E) = bundle(e)
|
||||||
def label(e: E): String = ""
|
|
||||||
override def labelO(e: E) = label(e)
|
|
||||||
override def labelI(e: E) = label(e)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class BaseNode(implicit val valName: ValName)
|
abstract class BaseNode(implicit val valName: ValName)
|
||||||
@ -106,10 +108,8 @@ abstract class BaseNode(implicit val valName: ValName)
|
|||||||
|
|
||||||
protected[diplomacy] def gci: Option[BaseNode] // greatest common inner
|
protected[diplomacy] def gci: Option[BaseNode] // greatest common inner
|
||||||
protected[diplomacy] def gco: Option[BaseNode] // greatest common outer
|
protected[diplomacy] def gco: Option[BaseNode] // greatest common outer
|
||||||
protected[diplomacy] def outputs: Seq[(BaseNode, String)]
|
protected[diplomacy] def inputs: Seq[(BaseNode, RenderedEdge)]
|
||||||
protected[diplomacy] def inputs: Seq[(BaseNode, String)]
|
protected[diplomacy] def outputs: Seq[(BaseNode, RenderedEdge)]
|
||||||
protected[diplomacy] def colour: String
|
|
||||||
protected[diplomacy] def reverse: Boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object BaseNode
|
object BaseNode
|
||||||
@ -333,10 +333,11 @@ sealed abstract class MixedNode[DI, UI, EI, BI <: Data, DO, UO, EO, BO <: Data](
|
|||||||
}
|
}
|
||||||
|
|
||||||
// meta-data for printing the node graph
|
// meta-data for printing the node graph
|
||||||
protected[diplomacy] def colour = inner.colour
|
protected[diplomacy] def inputs = (iPorts zip edgesIn) map { case ((_, n, p, _), e) =>
|
||||||
protected[diplomacy] def reverse = inner.reverse
|
val re = inner.render(e)
|
||||||
protected[diplomacy] def outputs = oPorts.map(_._2) zip edgesOut.map(e => outer.labelO(e))
|
(n, re.copy(flipped = re.flipped != p(RenderFlipped)))
|
||||||
protected[diplomacy] def inputs = iPorts.map(_._2) zip edgesIn .map(e => inner.labelI(e))
|
}
|
||||||
|
protected[diplomacy] def outputs = oPorts map { case (i, n, _, _) => (n, n.inputs(i)._2) }
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class MixedCustomNode[DI, UI, EI, BI <: Data, DO, UO, EO, BO <: Data](
|
abstract class MixedCustomNode[DI, UI, EI, BI <: Data, DO, UO, EO, BO <: Data](
|
||||||
|
@ -47,4 +47,7 @@ package object diplomacy
|
|||||||
def DisableMonitors[T](body: Parameters => T)(implicit p: Parameters) = body(p.alterPartial {
|
def DisableMonitors[T](body: Parameters => T)(implicit p: Parameters) = body(p.alterPartial {
|
||||||
case MonitorsEnabled => false
|
case MonitorsEnabled => false
|
||||||
})
|
})
|
||||||
|
def FlipRendering[T](body: Parameters => T)(implicit p: Parameters) = body(p.alterPartial {
|
||||||
|
case RenderFlipped => !p(RenderFlipped)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
@ -199,13 +199,13 @@ abstract class RocketTileWrapper(rtp: RocketTileParams, hartid: Int)(implicit p:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def optionalSlaveBuffer(in: TLOutwardNode): TLOutwardNode = {
|
def optionalSlaveBuffer(out: TLInwardNode): TLInwardNode = {
|
||||||
if (rtp.boundaryBuffers) {
|
if (rtp.boundaryBuffers) {
|
||||||
val sbuf = LazyModule(new TLBuffer(BufferParams.flow, BufferParams.none, BufferParams.none, BufferParams.none, BufferParams.none))
|
val sbuf = LazyModule(new TLBuffer(BufferParams.flow, BufferParams.none, BufferParams.none, BufferParams.none, BufferParams.none))
|
||||||
DisableMonitors { implicit p => sbuf.node :*= in }
|
DisableMonitors { implicit p => out :*= sbuf.node }
|
||||||
sbuf.node
|
sbuf.node
|
||||||
} else {
|
} else {
|
||||||
in
|
out
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,9 +234,7 @@ abstract class RocketTileWrapper(rtp: RocketTileParams, hartid: Int)(implicit p:
|
|||||||
|
|
||||||
class SyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) {
|
class SyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) {
|
||||||
val masterNode = optionalMasterBuffer(rocket.masterNode)
|
val masterNode = optionalMasterBuffer(rocket.masterNode)
|
||||||
|
val slaveNode = optionalSlaveBuffer(rocket.slaveNode)
|
||||||
val slaveNode = new TLIdentityNode() { override def reverse = true }
|
|
||||||
DisableMonitors { implicit p => rocket.slaveNode :*= optionalSlaveBuffer(slaveNode) }
|
|
||||||
|
|
||||||
// Fully async interrupts need synchronizers.
|
// Fully async interrupts need synchronizers.
|
||||||
// Others need no synchronization.
|
// Others need no synchronization.
|
||||||
@ -259,13 +257,9 @@ class AsyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters
|
|||||||
source.node :=* rocket.masterNode
|
source.node :=* rocket.masterNode
|
||||||
val masterNode = source.node
|
val masterNode = source.node
|
||||||
|
|
||||||
val slaveNode = new TLAsyncIdentityNode() { override def reverse = true }
|
|
||||||
val sink = LazyModule(new TLAsyncCrossingSink)
|
val sink = LazyModule(new TLAsyncCrossingSink)
|
||||||
|
DisableMonitors { implicit p => rocket.slaveNode :*= sink.node }
|
||||||
DisableMonitors { implicit p =>
|
val slaveNode = sink.node
|
||||||
rocket.slaveNode :*= sink.node
|
|
||||||
sink.node :*= slaveNode
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fully async interrupts need synchronizers,
|
// Fully async interrupts need synchronizers,
|
||||||
// as do those coming from the periphery clock.
|
// as do those coming from the periphery clock.
|
||||||
@ -289,13 +283,9 @@ class RationalRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Paramet
|
|||||||
source.node :=* optionalMasterBuffer(rocket.masterNode)
|
source.node :=* optionalMasterBuffer(rocket.masterNode)
|
||||||
val masterNode = source.node
|
val masterNode = source.node
|
||||||
|
|
||||||
val slaveNode = new TLRationalIdentityNode() { override def reverse = true }
|
|
||||||
val sink = LazyModule(new TLRationalCrossingSink(SlowToFast))
|
val sink = LazyModule(new TLRationalCrossingSink(SlowToFast))
|
||||||
|
DisableMonitors { implicit p => optionalSlaveBuffer(rocket.slaveNode) :*= sink.node }
|
||||||
DisableMonitors { implicit p =>
|
val slaveNode = sink.node
|
||||||
sink.node :*= slaveNode
|
|
||||||
rocket.slaveNode :*= optionalSlaveBuffer(sink.node)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fully async interrupts need synchronizers.
|
// Fully async interrupts need synchronizers.
|
||||||
// Those coming from periphery clock need a
|
// Those coming from periphery clock need a
|
||||||
|
@ -65,12 +65,9 @@ case class IntEdge(source: IntSourcePortParameters, sink: IntSinkPortParameters,
|
|||||||
|
|
||||||
object IntImp extends SimpleNodeImp[IntSourcePortParameters, IntSinkPortParameters, IntEdge, Vec[Bool]]
|
object IntImp extends SimpleNodeImp[IntSourcePortParameters, IntSinkPortParameters, IntEdge, Vec[Bool]]
|
||||||
{
|
{
|
||||||
def edge(pd: IntSourcePortParameters, pu: IntSinkPortParameters, p: Parameters, sourceInfo: SourceInfo): IntEdge = IntEdge(pd, pu, p, sourceInfo)
|
def edge(pd: IntSourcePortParameters, pu: IntSinkPortParameters, p: Parameters, sourceInfo: SourceInfo) = IntEdge(pd, pu, p, sourceInfo)
|
||||||
def bundle(e: IntEdge): Vec[Bool] = Vec(e.source.num, Bool())
|
def bundle(e: IntEdge) = Vec(e.source.num, Bool())
|
||||||
|
def render(e: IntEdge) = RenderedEdge(colour = "#0000ff" /* blue */, label = e.source.sources.map(_.range.size).sum.toString, flipped = true)
|
||||||
def colour = "#0000ff" // blue
|
|
||||||
override def reverse = true
|
|
||||||
override def label(e: IntEdge) = e.source.sources.map(_.range.size).sum.toString
|
|
||||||
|
|
||||||
override def mixO(pd: IntSourcePortParameters, node: OutwardNode[IntSourcePortParameters, IntSinkPortParameters, Vec[Bool]]): IntSourcePortParameters =
|
override def mixO(pd: IntSourcePortParameters, node: OutwardNode[IntSourcePortParameters, IntSinkPortParameters, Vec[Bool]]): IntSourcePortParameters =
|
||||||
pd.copy(sources = pd.sources.map { s => s.copy (nodePath = node +: s.nodePath) })
|
pd.copy(sources = pd.sources.map { s => s.copy (nodePath = node +: s.nodePath) })
|
||||||
|
@ -13,15 +13,13 @@ case object TLMonitorBuilder extends Field[TLMonitorArgs => TLMonitorBase](args
|
|||||||
|
|
||||||
object TLImp extends NodeImp[TLClientPortParameters, TLManagerPortParameters, TLEdgeOut, TLEdgeIn, TLBundle]
|
object TLImp extends NodeImp[TLClientPortParameters, TLManagerPortParameters, TLEdgeOut, TLEdgeIn, TLBundle]
|
||||||
{
|
{
|
||||||
def edgeO(pd: TLClientPortParameters, pu: TLManagerPortParameters, p: Parameters, sourceInfo: SourceInfo): TLEdgeOut = new TLEdgeOut(pd, pu, p, sourceInfo)
|
def edgeO(pd: TLClientPortParameters, pu: TLManagerPortParameters, p: Parameters, sourceInfo: SourceInfo) = new TLEdgeOut(pd, pu, p, sourceInfo)
|
||||||
def edgeI(pd: TLClientPortParameters, pu: TLManagerPortParameters, p: Parameters, sourceInfo: SourceInfo): TLEdgeIn = new TLEdgeIn (pd, pu, p, sourceInfo)
|
def edgeI(pd: TLClientPortParameters, pu: TLManagerPortParameters, p: Parameters, sourceInfo: SourceInfo) = new TLEdgeIn (pd, pu, p, sourceInfo)
|
||||||
|
|
||||||
def bundleO(eo: TLEdgeOut): TLBundle = TLBundle(eo.bundle)
|
def bundleO(eo: TLEdgeOut) = TLBundle(eo.bundle)
|
||||||
def bundleI(ei: TLEdgeIn): TLBundle = TLBundle(ei.bundle)
|
def bundleI(ei: TLEdgeIn) = TLBundle(ei.bundle)
|
||||||
|
|
||||||
def colour = "#000000" // black
|
def render(ei: TLEdgeIn) = RenderedEdge(colour = "#000000" /* black */, label = (ei.manager.beatBytes * 8).toString)
|
||||||
override def labelI(ei: TLEdgeIn) = (ei.manager.beatBytes * 8).toString
|
|
||||||
override def labelO(eo: TLEdgeOut) = (eo.manager.beatBytes * 8).toString
|
|
||||||
|
|
||||||
override def monitor(bundle: TLBundle, edge: TLEdgeIn) {
|
override def monitor(bundle: TLBundle, edge: TLEdgeIn) {
|
||||||
val monitor = Module(edge.params(TLMonitorBuilder)(TLMonitorArgs(edge)))
|
val monitor = Module(edge.params(TLMonitorBuilder)(TLMonitorArgs(edge)))
|
||||||
@ -76,11 +74,9 @@ abstract class TLCustomNode(
|
|||||||
|
|
||||||
object TLAsyncImp extends SimpleNodeImp[TLAsyncClientPortParameters, TLAsyncManagerPortParameters, TLAsyncEdgeParameters, TLAsyncBundle]
|
object TLAsyncImp extends SimpleNodeImp[TLAsyncClientPortParameters, TLAsyncManagerPortParameters, TLAsyncEdgeParameters, TLAsyncBundle]
|
||||||
{
|
{
|
||||||
def edge(pd: TLAsyncClientPortParameters, pu: TLAsyncManagerPortParameters, p: Parameters, sourceInfo: SourceInfo): TLAsyncEdgeParameters = TLAsyncEdgeParameters(pd, pu, p, sourceInfo)
|
def edge(pd: TLAsyncClientPortParameters, pu: TLAsyncManagerPortParameters, p: Parameters, sourceInfo: SourceInfo) = TLAsyncEdgeParameters(pd, pu, p, sourceInfo)
|
||||||
def bundle(e: TLAsyncEdgeParameters): TLAsyncBundle = new TLAsyncBundle(e.bundle)
|
def bundle(e: TLAsyncEdgeParameters) = new TLAsyncBundle(e.bundle)
|
||||||
|
def render(e: TLAsyncEdgeParameters) = RenderedEdge(colour = "#ff0000" /* red */, label = e.manager.depth.toString)
|
||||||
def colour = "#ff0000" // red
|
|
||||||
override def label(e: TLAsyncEdgeParameters) = e.manager.depth.toString
|
|
||||||
|
|
||||||
override def mixO(pd: TLAsyncClientPortParameters, node: OutwardNode[TLAsyncClientPortParameters, TLAsyncManagerPortParameters, TLAsyncBundle]): TLAsyncClientPortParameters =
|
override def mixO(pd: TLAsyncClientPortParameters, node: OutwardNode[TLAsyncClientPortParameters, TLAsyncManagerPortParameters, TLAsyncBundle]): TLAsyncClientPortParameters =
|
||||||
pd.copy(base = pd.base.copy(clients = pd.base.clients.map { c => c.copy (nodePath = node +: c.nodePath) }))
|
pd.copy(base = pd.base.copy(clients = pd.base.clients.map { c => c.copy (nodePath = node +: c.nodePath) }))
|
||||||
@ -111,10 +107,9 @@ case class TLAsyncSinkNode(depth: Int, sync: Int)(implicit valName: ValName)
|
|||||||
|
|
||||||
object TLRationalImp extends SimpleNodeImp[TLRationalClientPortParameters, TLRationalManagerPortParameters, TLRationalEdgeParameters, TLRationalBundle]
|
object TLRationalImp extends SimpleNodeImp[TLRationalClientPortParameters, TLRationalManagerPortParameters, TLRationalEdgeParameters, TLRationalBundle]
|
||||||
{
|
{
|
||||||
def edge(pd: TLRationalClientPortParameters, pu: TLRationalManagerPortParameters, p: Parameters, sourceInfo: SourceInfo): TLRationalEdgeParameters = TLRationalEdgeParameters(pd, pu, p, sourceInfo)
|
def edge(pd: TLRationalClientPortParameters, pu: TLRationalManagerPortParameters, p: Parameters, sourceInfo: SourceInfo) = TLRationalEdgeParameters(pd, pu, p, sourceInfo)
|
||||||
def bundle(e: TLRationalEdgeParameters): TLRationalBundle = new TLRationalBundle(e.bundle)
|
def bundle(e: TLRationalEdgeParameters) = new TLRationalBundle(e.bundle)
|
||||||
|
def render(e: TLRationalEdgeParameters) = RenderedEdge(colour = "#00ff00" /* green */)
|
||||||
def colour = "#00ff00" // green
|
|
||||||
|
|
||||||
override def mixO(pd: TLRationalClientPortParameters, node: OutwardNode[TLRationalClientPortParameters, TLRationalManagerPortParameters, TLRationalBundle]): TLRationalClientPortParameters =
|
override def mixO(pd: TLRationalClientPortParameters, node: OutwardNode[TLRationalClientPortParameters, TLRationalManagerPortParameters, TLRationalBundle]): TLRationalClientPortParameters =
|
||||||
pd.copy(base = pd.base.copy(clients = pd.base.clients.map { c => c.copy (nodePath = node +: c.nodePath) }))
|
pd.copy(base = pd.base.copy(clients = pd.base.clients.map { c => c.copy (nodePath = node +: c.nodePath) }))
|
||||||
|
Loading…
Reference in New Issue
Block a user