Add documentation on HarnessBinders
This commit is contained in:
@@ -66,12 +66,14 @@ class WithGPIOTiedOff extends OverrideHarnessBinder({
|
||||
}
|
||||
})
|
||||
|
||||
// DOC include start: WithUARTAdapter
|
||||
class WithUARTAdapter extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryUARTModuleImp, th: HasHarnessSignalReferences, ports: Seq[Data]) => {
|
||||
UARTAdapter.connect(ports.map(_.asInstanceOf[UARTPortIO]))(system.p)
|
||||
Nil
|
||||
}
|
||||
})
|
||||
// DOC include end: WithUARTAdapter
|
||||
|
||||
class WithSimSPIFlashModel(rdOnly: Boolean = true) extends OverrideHarnessBinder({
|
||||
(system: HasPeripherySPIFlashModuleImp, th: HasHarnessSignalReferences, ports: Seq[Data]) => {
|
||||
|
||||
@@ -40,13 +40,6 @@ import scala.reflect.{ClassTag}
|
||||
|
||||
// You can add your own binder by adding a new (key, fn) pair, typically by using
|
||||
// the OverrideIOBinder or ComposeIOBinder macros
|
||||
|
||||
|
||||
// DOC include start: IOBinders
|
||||
// This type describes a function callable on the TestHarness instance. Its return type is unused.
|
||||
|
||||
|
||||
|
||||
case object IOBinders extends Field[Map[String, (Any) => (Seq[Data], Seq[IOCell])]](
|
||||
Map[String, (Any) => (Seq[Data], Seq[IOCell])]().withDefaultValue((Any) => (Nil, Nil))
|
||||
)
|
||||
@@ -59,7 +52,6 @@ object ApplyIOBinders {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Note: The parameters instance is accessible only through LazyModule
|
||||
// or LazyModuleImpLike. The self-type requirement in traits like
|
||||
// CanHaveMasterAXI4MemPort is insufficient to make it accessible to the IOBinder
|
||||
@@ -116,8 +108,6 @@ object BoreHelper {
|
||||
}
|
||||
}
|
||||
|
||||
// DOC include end: IOBinders
|
||||
|
||||
|
||||
case object IOCellKey extends Field[IOCellTypeParams](GenericIOCellParams())
|
||||
|
||||
@@ -140,7 +130,7 @@ class WithGPIOCells extends OverrideIOBinder({
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// DOC include start: WithUARTIOCells
|
||||
class WithUARTIOCells extends OverrideIOBinder({
|
||||
(system: HasPeripheryUARTModuleImp) => {
|
||||
val (ports, cells2d) = system.uart.zipWithIndex.map({ case (u, i) =>
|
||||
@@ -151,6 +141,7 @@ class WithUARTIOCells extends OverrideIOBinder({
|
||||
(ports, cells2d.flatten)
|
||||
}
|
||||
})
|
||||
// DOC include end: WithUARTIOCells
|
||||
|
||||
class WithSPIIOCells extends OverrideIOBinder({
|
||||
(system: HasPeripherySPIFlashModuleImp) => {
|
||||
|
||||
Reference in New Issue
Block a user