tilelink2: create DTS for devices automagically
This commit is contained in:
parent
2587234838
commit
a357c1d42e
@ -127,7 +127,8 @@ case class TLManagerParameters(
|
|||||||
supportsPutPartial: TransferSizes = TransferSizes.none,
|
supportsPutPartial: TransferSizes = TransferSizes.none,
|
||||||
supportsHint: 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
|
// If fifoId=Some, all accesses sent to the same fifoId are executed and ACK'd in FIFO order
|
||||||
fifoId: Option[Int] = None)
|
fifoId: Option[Int] = None,
|
||||||
|
customDTS: Option[String]= None)
|
||||||
{
|
{
|
||||||
address.combinations(2).foreach({ case Seq(x,y) =>
|
address.combinations(2).foreach({ case Seq(x,y) =>
|
||||||
require (!x.overlaps(y))
|
require (!x.overlaps(y))
|
||||||
@ -143,6 +144,18 @@ case class TLManagerParameters(
|
|||||||
supportsPutFull.max,
|
supportsPutFull.max,
|
||||||
supportsPutPartial.max).max
|
supportsPutPartial.max).max
|
||||||
|
|
||||||
|
// Generate the config string (in future device tree)
|
||||||
|
lazy val name = nodePath.lastOption.map(_.lazyModule.name).getOrElse("disconnected")
|
||||||
|
lazy val dts = customDTS.getOrElse {
|
||||||
|
val header = s"${name} {\n"
|
||||||
|
val middle = address.map { a =>
|
||||||
|
require (!a.strided) // Config String does not support this
|
||||||
|
" addr 0x%x;\n size 0x%x;\n".format(a.base, a.mask+1)
|
||||||
|
}
|
||||||
|
val footer = "}\n"
|
||||||
|
header + middle.reduce(_ + _) + footer
|
||||||
|
}
|
||||||
|
|
||||||
// The device had better not support a transfer larger than it's alignment
|
// The device had better not support a transfer larger than it's alignment
|
||||||
address.foreach({ case a =>
|
address.foreach({ case a =>
|
||||||
require (a.alignment1 >= maxTransfer-1)
|
require (a.alignment1 >= maxTransfer-1)
|
||||||
|
Loading…
Reference in New Issue
Block a user