Skip to content

Commit

Permalink
subsystem: pbus crossing type
Browse files Browse the repository at this point in the history
  • Loading branch information
hcook committed Feb 23, 2018
1 parent 5725e17 commit ad823ef
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/scala/subsystem/PeripheryBus.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ import freechips.rocketchip.util._
case class PeripheryBusParams(
beatBytes: Int,
blockBytes: Int,
arithmeticAtomics: Boolean = true,
sbusCrossingType: SubsystemClockCrossing = SynchronousCrossing(), // relative to sbus
frequency: BigInt = BigInt(100000000) // 100 MHz as default bus frequency
) extends HasTLBusParams

case object PeripheryBusKey extends Field[PeripheryBusParams]

class PeripheryBus(params: PeripheryBusParams, val crossing: SubsystemClockCrossing = SynchronousCrossing())
class PeripheryBus(params: PeripheryBusParams)
(implicit p: Parameters) extends TLBusWrapper(params, "periphery_bus")
with HasTLXbarPhy
with HasCrossing {
val crossing = params.sbusCrossingType

def toSlave[D,U,E,B <: Data]
(name: Option[String] = None, buffer: BufferParams = BufferParams.none)
Expand Down Expand Up @@ -86,13 +89,11 @@ class PeripheryBus(params: PeripheryBusParams, val crossing: SubsystemClockCross
}


def fromSystemBus
(arithmetic: Boolean = true, buffer: BufferParams = BufferParams.default)
(gen: => TLOutwardNode) {
def fromSystemBus(gen: => TLOutwardNode) {
from("sbus") {
(inwardNode
:*= TLBuffer(buffer)
:*= TLAtomicAutomata(arithmetic = arithmetic)
:*= TLBuffer(BufferParams.default)
:*= TLAtomicAutomata(arithmetic = params.arithmeticAtomics)
:*= gen)
}
}
Expand Down

0 comments on commit ad823ef

Please sign in to comment.