tilelink2: add client-side FIFO parameterization
This commit is contained in:
parent
d4c9c13fb4
commit
fd521c56a6
@ -23,6 +23,7 @@ case class TLManagerParameters(
|
||||
supportsPutPartial: TransferSizes = TransferSizes.none,
|
||||
supportsHint: TransferSizes = TransferSizes.none,
|
||||
// If fifoId=Some, all accesses sent to the same fifoId are executed and ACK'd in FIFO order
|
||||
// Note: you can only rely on this FIFO behaviour if your TLClientParameters include requestFifo
|
||||
fifoId: Option[Int] = None)
|
||||
{
|
||||
require (!address.isEmpty)
|
||||
@ -76,6 +77,8 @@ case class TLManagerPortParameters(
|
||||
require (endSinkId > 0)
|
||||
require (minLatency >= 0)
|
||||
|
||||
def requireFifo() = managers.foreach { m =>require (m.fifoId == Some(0)) }
|
||||
|
||||
// Bounds on required sizes
|
||||
def maxAddress = managers.map(_.maxAddress).max
|
||||
def maxTransfer = managers.map(_.maxTransfer).max
|
||||
@ -157,6 +160,7 @@ case class TLManagerPortParameters(
|
||||
case class TLClientParameters(
|
||||
sourceId: IdRange = IdRange(0,1),
|
||||
nodePath: Seq[BaseNode] = Seq(),
|
||||
requestFifo: Boolean = false, // only a request, not a requirement
|
||||
// Supports both Probe+Grant of these sizes
|
||||
supportsProbe: TransferSizes = TransferSizes.none,
|
||||
supportsArithmetic: TransferSizes = TransferSizes.none,
|
||||
@ -174,6 +178,8 @@ case class TLClientParameters(
|
||||
require (supportsProbe.contains(supportsPutFull))
|
||||
require (supportsProbe.contains(supportsPutPartial))
|
||||
require (supportsProbe.contains(supportsHint))
|
||||
// If you need FIFO, you better not be TL-C (due to independent A vs. C order)
|
||||
require (!requestFifo || !supportsProbe)
|
||||
|
||||
val maxTransfer = List(
|
||||
supportsProbe.max,
|
||||
@ -228,6 +234,8 @@ case class TLClientPortParameters(
|
||||
def find(id: UInt) = Vec(clients.map(_.sourceId.contains(id)))
|
||||
def contains(id: UInt) = find(id).reduce(_ || _)
|
||||
|
||||
def requestFifo(id: UInt) = Mux1H(find(id), clients.map(c => Bool(c.requestFifo)))
|
||||
|
||||
private def safety_helper(member: TLClientParameters => TransferSizes)(id: UInt, lgSize: UInt) = {
|
||||
val allSame = clients.map(member(_) == member(clients(0))).reduce(_ && _)
|
||||
if (allSame) member(clients(0)).containsLg(lgSize) else {
|
||||
|
Loading…
Reference in New Issue
Block a user