tilelink2 Parameters: include a minLatency parameter for optimization
This commit is contained in:
parent
cf39c32b0e
commit
44277c1db3
@ -173,10 +173,14 @@ case class TLManagerParameters(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
case class TLManagerPortParameters(managers: Seq[TLManagerParameters], beatBytes: Int)
|
case class TLManagerPortParameters(
|
||||||
|
managers: Seq[TLManagerParameters],
|
||||||
|
beatBytes: Int,
|
||||||
|
minLatency: Int = 0)
|
||||||
{
|
{
|
||||||
require (!managers.isEmpty)
|
require (!managers.isEmpty)
|
||||||
require (isPow2(beatBytes))
|
require (isPow2(beatBytes))
|
||||||
|
require (minLatency >= 0)
|
||||||
|
|
||||||
// Require disjoint ranges for Ids and addresses
|
// Require disjoint ranges for Ids and addresses
|
||||||
managers.combinations(2).foreach({ case Seq(x,y) =>
|
managers.combinations(2).foreach({ case Seq(x,y) =>
|
||||||
@ -291,9 +295,11 @@ case class TLClientParameters(
|
|||||||
|
|
||||||
case class TLClientPortParameters(
|
case class TLClientPortParameters(
|
||||||
clients: Seq[TLClientParameters],
|
clients: Seq[TLClientParameters],
|
||||||
unsafeAtomics: Boolean = false) // Atomics are executed as get+put
|
unsafeAtomics: Boolean = false,
|
||||||
|
minLatency: Int = 0) // Atomics are executed as get+put
|
||||||
{
|
{
|
||||||
require (!clients.isEmpty)
|
require (!clients.isEmpty)
|
||||||
|
require (minLatency >= 0)
|
||||||
|
|
||||||
// Require disjoint ranges for Ids
|
// Require disjoint ranges for Ids
|
||||||
clients.combinations(2).foreach({ case Seq(x,y) =>
|
clients.combinations(2).foreach({ case Seq(x,y) =>
|
||||||
|
@ -41,8 +41,8 @@ case class TLInputNode() extends InputNode(TLImp)
|
|||||||
case class TLClientNode(params: TLClientParameters, numPorts: Range.Inclusive = 1 to 1)
|
case class TLClientNode(params: TLClientParameters, numPorts: Range.Inclusive = 1 to 1)
|
||||||
extends SourceNode(TLImp)(TLClientPortParameters(Seq(params)), numPorts)
|
extends SourceNode(TLImp)(TLClientPortParameters(Seq(params)), numPorts)
|
||||||
|
|
||||||
case class TLManagerNode(beatBytes: Int, params: TLManagerParameters, numPorts: Range.Inclusive = 1 to 1)
|
case class TLManagerNode(beatBytes: Int, params: TLManagerParameters, numPorts: Range.Inclusive = 1 to 1, minLatency: Int = 0)
|
||||||
extends SinkNode(TLImp)(TLManagerPortParameters(Seq(params), beatBytes), numPorts)
|
extends SinkNode(TLImp)(TLManagerPortParameters(Seq(params), beatBytes, minLatency), numPorts)
|
||||||
|
|
||||||
case class TLAdapterNode(
|
case class TLAdapterNode(
|
||||||
clientFn: Seq[TLClientPortParameters] => TLClientPortParameters,
|
clientFn: Seq[TLClientPortParameters] => TLClientPortParameters,
|
||||||
|
@ -47,22 +47,28 @@ class TLXbar(policy: (Vec[Bool], Bool) => Seq[Bool] = TLXbar.lowestIndex) extend
|
|||||||
clientFn = { seq =>
|
clientFn = { seq =>
|
||||||
// An unsafe atomic port can not be combined with any other!
|
// An unsafe atomic port can not be combined with any other!
|
||||||
require (!seq.exists(_.unsafeAtomics) || seq.size == 1)
|
require (!seq.exists(_.unsafeAtomics) || seq.size == 1)
|
||||||
seq(0).copy(clients = (mapInputIds(seq) zip seq) flatMap { case (range, port) =>
|
seq(0).copy(
|
||||||
|
minLatency = seq.map(_.minLatency).min,
|
||||||
|
clients = (mapInputIds(seq) zip seq) flatMap { case (range, port) =>
|
||||||
port.clients map { client => client.copy(
|
port.clients map { client => client.copy(
|
||||||
sourceId = client.sourceId.shift(range.start)
|
sourceId = client.sourceId.shift(range.start)
|
||||||
)}
|
)}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
},
|
},
|
||||||
managerFn = { seq =>
|
managerFn = { seq =>
|
||||||
val fifoIdFactory = relabeler()
|
val fifoIdFactory = relabeler()
|
||||||
seq(0).copy(managers = (mapOutputIds(seq) zip seq) flatMap { case (range, port) =>
|
seq(0).copy(
|
||||||
|
minLatency = seq.map(_.minLatency).min,
|
||||||
|
managers = (mapOutputIds(seq) zip seq) flatMap { case (range, port) =>
|
||||||
require (port.beatBytes == seq(0).beatBytes)
|
require (port.beatBytes == seq(0).beatBytes)
|
||||||
val fifoIdMapper = fifoIdFactory()
|
val fifoIdMapper = fifoIdFactory()
|
||||||
port.managers map { manager => manager.copy(
|
port.managers map { manager => manager.copy(
|
||||||
sinkId = manager.sinkId.shift(range.start),
|
sinkId = manager.sinkId.shift(range.start),
|
||||||
fifoId = manager.fifoId.map(fifoIdMapper(_))
|
fifoId = manager.fifoId.map(fifoIdMapper(_))
|
||||||
)}
|
)}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
lazy val module = new LazyModuleImp(this) {
|
lazy val module = new LazyModuleImp(this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user