2017-08-26 03:12:25 +02:00
|
|
|
// See LICENSE.SiFive for license details.
|
|
|
|
|
|
|
|
package freechips.rocketchip.coreplex
|
|
|
|
|
|
|
|
import Chisel._
|
|
|
|
import freechips.rocketchip.config.{Field, Parameters}
|
|
|
|
import freechips.rocketchip.diplomacy._
|
|
|
|
import freechips.rocketchip.tilelink._
|
|
|
|
import freechips.rocketchip.util._
|
|
|
|
|
|
|
|
case class FrontBusParams(
|
|
|
|
beatBytes: Int,
|
|
|
|
blockBytes: Int,
|
|
|
|
masterBuffering: BufferParams = BufferParams.default,
|
|
|
|
slaveBuffering: BufferParams = BufferParams.none // TODO should be BufferParams.none on BCE
|
|
|
|
) extends TLBusParams
|
|
|
|
|
|
|
|
case object FrontBusParams extends Field[FrontBusParams]
|
|
|
|
|
2017-08-31 01:21:08 +02:00
|
|
|
class FrontBus(params: FrontBusParams)(implicit p: Parameters) extends TLBusWrapper(params, "FrontBus") {
|
2017-08-26 03:12:25 +02:00
|
|
|
|
2017-08-31 00:27:56 +02:00
|
|
|
def fromSyncMasters(params: BufferParams = BufferParams.default, buffers: Int = 1, name: Option[String] = None): TLInwardNode =
|
|
|
|
fromSyncPorts(params, buffers, name)
|
2017-08-26 03:12:25 +02:00
|
|
|
|
2017-08-31 00:27:56 +02:00
|
|
|
def fromSyncPorts(params: BufferParams = BufferParams.default, buffers: Int = 1, name: Option[String] = None): TLInwardNode = {
|
2017-08-31 22:00:37 +02:00
|
|
|
require(params == BufferParams.default, "Only BufferParams.default supported for FrontBus at this time.")
|
|
|
|
val (in, out) = bufferChain(buffers, name)
|
2017-08-31 02:57:52 +02:00
|
|
|
inwardNode :=* out
|
|
|
|
in
|
2017-08-26 03:12:25 +02:00
|
|
|
}
|
|
|
|
|
2017-08-31 00:27:56 +02:00
|
|
|
def fromSyncFIFOMaster(params: BufferParams = BufferParams.default, buffers: Int = 1, name: Option[String] = None): TLInwardNode =
|
|
|
|
fromSyncPorts(params, buffers, name)
|
2017-08-26 03:12:25 +02:00
|
|
|
|
|
|
|
def toSystemBus : TLOutwardNode = outwardBufNode
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Provides buses that serve as attachment points,
|
|
|
|
* for use in traits that connect individual devices or external ports.
|
|
|
|
*/
|
|
|
|
trait HasFrontBus extends HasSystemBus {
|
|
|
|
private val frontbusParams = p(FrontBusParams)
|
|
|
|
val frontbusBeatBytes = frontbusParams.beatBytes
|
|
|
|
|
|
|
|
val frontbus = new FrontBus(frontbusParams)
|
|
|
|
|
2017-08-31 02:51:30 +02:00
|
|
|
sbus.fromSyncPorts(name = Some("FrontBus")) := frontbus.toSystemBus
|
2017-08-26 03:12:25 +02:00
|
|
|
|
|
|
|
}
|