tilelink2: Nodes should accept full PortParameters
We need this for terminal clients/managers that bridge multiple non-TL2 devices.
This commit is contained in:
parent
f2ca2178bf
commit
c85e42a303
@ -391,6 +391,7 @@ case class TLBundleParameters(
|
|||||||
require (isPow2(dataBits))
|
require (isPow2(dataBits))
|
||||||
|
|
||||||
val addrLoBits = log2Up(dataBits/8)
|
val addrLoBits = log2Up(dataBits/8)
|
||||||
|
val addressBits = addrHiBits + log2Ceil(dataBits/8)
|
||||||
|
|
||||||
def union(x: TLBundleParameters) =
|
def union(x: TLBundleParameters) =
|
||||||
TLBundleParameters(
|
TLBundleParameters(
|
||||||
|
@ -6,13 +6,15 @@ import Chisel._
|
|||||||
import scala.math.{min,max}
|
import scala.math.{min,max}
|
||||||
|
|
||||||
class TLRegisterNode(address: AddressSet, concurrency: Int = 0, beatBytes: Int = 4, undefZero: Boolean = true)
|
class TLRegisterNode(address: AddressSet, concurrency: Int = 0, beatBytes: Int = 4, undefZero: Boolean = true)
|
||||||
extends TLManagerNode(beatBytes, TLManagerParameters(
|
extends TLManagerNode(TLManagerPortParameters(
|
||||||
|
Seq(TLManagerParameters(
|
||||||
address = Seq(address),
|
address = Seq(address),
|
||||||
supportsGet = TransferSizes(1, beatBytes),
|
supportsGet = TransferSizes(1, beatBytes),
|
||||||
supportsPutPartial = TransferSizes(1, beatBytes),
|
supportsPutPartial = TransferSizes(1, beatBytes),
|
||||||
supportsPutFull = TransferSizes(1, beatBytes),
|
supportsPutFull = TransferSizes(1, beatBytes),
|
||||||
fifoId = Some(0)), // requests are handled in order
|
fifoId = Some(0))), // requests are handled in order
|
||||||
minLatency = min(concurrency, 1)) // the Queue adds at least one cycle
|
beatBytes = beatBytes,
|
||||||
|
minLatency = min(concurrency, 1))) // the Queue adds at least one cycle
|
||||||
{
|
{
|
||||||
require (address.contiguous)
|
require (address.contiguous)
|
||||||
|
|
||||||
|
@ -6,15 +6,17 @@ import Chisel._
|
|||||||
|
|
||||||
class TLRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4) extends LazyModule
|
class TLRAM(address: AddressSet, executable: Boolean = true, beatBytes: Int = 4) extends LazyModule
|
||||||
{
|
{
|
||||||
val node = TLManagerNode(beatBytes, TLManagerParameters(
|
val node = TLManagerNode(TLManagerPortParameters(
|
||||||
|
Seq(TLManagerParameters(
|
||||||
address = List(address),
|
address = List(address),
|
||||||
regionType = RegionType.UNCACHED,
|
regionType = RegionType.UNCACHED,
|
||||||
executable = executable,
|
executable = executable,
|
||||||
supportsGet = TransferSizes(1, beatBytes),
|
supportsGet = TransferSizes(1, beatBytes),
|
||||||
supportsPutPartial = TransferSizes(1, beatBytes),
|
supportsPutPartial = TransferSizes(1, beatBytes),
|
||||||
supportsPutFull = TransferSizes(1, beatBytes),
|
supportsPutFull = TransferSizes(1, beatBytes),
|
||||||
fifoId = Some(0)), // requests are handled in order
|
fifoId = Some(0))), // requests are handled in order
|
||||||
minLatency = 1) // no bypass needed for this device
|
beatBytes = beatBytes,
|
||||||
|
minLatency = 1)) // no bypass needed for this device
|
||||||
|
|
||||||
// We require the address range to include an entire beat (for the write mask)
|
// We require the address range to include an entire beat (for the write mask)
|
||||||
require ((address.mask & (beatBytes-1)) == beatBytes-1)
|
require ((address.mask & (beatBytes-1)) == beatBytes-1)
|
||||||
|
@ -38,11 +38,22 @@ case class TLIdentityNode() extends IdentityNode(TLImp)
|
|||||||
case class TLOutputNode() extends OutputNode(TLImp)
|
case class TLOutputNode() extends OutputNode(TLImp)
|
||||||
case class TLInputNode() extends InputNode(TLImp)
|
case class TLInputNode() extends InputNode(TLImp)
|
||||||
|
|
||||||
case class TLClientNode(params: TLClientParameters, numPorts: Range.Inclusive = 1 to 1)
|
case class TLClientNode(portParams: TLClientPortParameters, numPorts: Range.Inclusive = 1 to 1)
|
||||||
extends SourceNode(TLImp)(TLClientPortParameters(Seq(params)), numPorts)
|
extends SourceNode(TLImp)(portParams, numPorts)
|
||||||
|
case class TLManagerNode(portParams: TLManagerPortParameters, numPorts: Range.Inclusive = 1 to 1)
|
||||||
|
extends SinkNode(TLImp)(portParams, numPorts)
|
||||||
|
|
||||||
case class TLManagerNode(beatBytes: Int, params: TLManagerParameters, numPorts: Range.Inclusive = 1 to 1, minLatency: Int = 0)
|
object TLClientNode
|
||||||
extends SinkNode(TLImp)(TLManagerPortParameters(Seq(params), beatBytes, minLatency), numPorts)
|
{
|
||||||
|
def apply(params: TLClientParameters) =
|
||||||
|
new TLClientNode(TLClientPortParameters(Seq(params)), 1 to 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
object TLManagerNode
|
||||||
|
{
|
||||||
|
def apply(beatBytes: Int, params: TLManagerParameters) =
|
||||||
|
new TLManagerNode(TLManagerPortParameters(Seq(params), beatBytes, 0), 1 to 1)
|
||||||
|
}
|
||||||
|
|
||||||
case class TLAdapterNode(
|
case class TLAdapterNode(
|
||||||
clientFn: Seq[TLClientPortParameters] => TLClientPortParameters,
|
clientFn: Seq[TLClientPortParameters] => TLClientPortParameters,
|
||||||
|
Loading…
Reference in New Issue
Block a user