1
0

Merge pull request #899 from freechipsproject/wrapper-dedup

Stabilize tile wrappers for downstream tools
This commit is contained in:
Henry Cook 2017-07-28 10:52:59 -07:00 committed by GitHub
commit 7eeb9dfd88
3 changed files with 16 additions and 12 deletions

View File

@ -13,7 +13,7 @@ import freechips.rocketchip.util._
sealed trait CoreplexClockCrossing sealed trait CoreplexClockCrossing
case class SynchronousCrossing(params: BufferParams = BufferParams.default) extends CoreplexClockCrossing case class SynchronousCrossing(params: BufferParams = BufferParams.default) extends CoreplexClockCrossing
case class RationalCrossing(direction: RationalDirection = FastToSlow) extends CoreplexClockCrossing case class RationalCrossing(direction: RationalDirection = FastToSlow) extends CoreplexClockCrossing
case class AsynchronousCrossing(depth: Int, sync: Int = 2) extends CoreplexClockCrossing case class AsynchronousCrossing(depth: Int, sync: Int = 3) extends CoreplexClockCrossing
/** BareCoreplex is the root class for creating a coreplex sub-system */ /** BareCoreplex is the root class for creating a coreplex sub-system */
abstract class BareCoreplex(implicit p: Parameters) extends LazyModule with BindingScope { abstract class BareCoreplex(implicit p: Parameters) extends LazyModule with BindingScope {

View File

@ -57,13 +57,12 @@ trait HasRocketTiles extends HasSystemBus
} }
case RationalCrossing(direction) => { case RationalCrossing(direction) => {
val wrapper = LazyModule(new RationalRocketTile(c, i)(pWithExtra)) val wrapper = LazyModule(new RationalRocketTile(c, i)(pWithExtra))
val sink = LazyModule(new TLRationalCrossingSink(direction))
val source = LazyModule(new TLRationalCrossingSource)
sbus.fromRationalTiles(direction) :=* wrapper.masterNode sbus.fromRationalTiles(direction) :=* wrapper.masterNode
wrapper.slaveNode :*= pbus.toRationalSlaves wrapper.slaveNode :*= pbus.toRationalSlaves
wrapper wrapper
} }
} }
wrapper.suggestName("tile") // Try to stabilize this name for downstream tools
// Local Interrupts must be synchronized to the core clock // Local Interrupts must be synchronized to the core clock
// before being passed into this module. // before being passed into this module.

View File

@ -17,7 +17,8 @@ case class RocketTileParams(
dcache: Option[DCacheParams] = Some(DCacheParams()), dcache: Option[DCacheParams] = Some(DCacheParams()),
rocc: Seq[RoCCParams] = Nil, rocc: Seq[RoCCParams] = Nil,
btb: Option[BTBParams] = Some(BTBParams()), btb: Option[BTBParams] = Some(BTBParams()),
dataScratchpadBytes: Int = 0) extends TileParams { dataScratchpadBytes: Int = 0,
boundaryBufferParams: BufferParams = BufferParams.flow) extends TileParams {
require(icache.isDefined) require(icache.isDefined)
require(dcache.isDefined) require(dcache.isDefined)
} }
@ -171,7 +172,11 @@ abstract class RocketTileWrapper(rtp: RocketTileParams, hartid: Int)(implicit p:
val periphIntNode = IntInputNode() val periphIntNode = IntInputNode()
val coreIntNode = IntInputNode() val coreIntNode = IntInputNode()
val intXbar = LazyModule(new IntXbar) val intXbar = LazyModule(new IntXbar)
val masterBuffer = LazyModule(new TLBuffer(rtp.boundaryBufferParams))
val slaveBuffer = LazyModule(new TLBuffer(rtp.boundaryBufferParams))
masterBuffer.node :=* rocket.masterNode
rocket.slaveNode connectButDontMonitorSlaves slaveBuffer.node
rocket.intNode := intXbar.intnode rocket.intNode := intXbar.intnode
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
@ -190,10 +195,10 @@ abstract class RocketTileWrapper(rtp: RocketTileParams, hartid: Int)(implicit p:
class SyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) { class SyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) {
val masterNode = TLOutputNode() val masterNode = TLOutputNode()
masterNode :=* rocket.masterNode masterNode :=* masterBuffer.node
val slaveNode = new TLInputNode() { override def reverse = true } val slaveNode = new TLInputNode() { override def reverse = true }
rocket.slaveNode :*= slaveNode slaveBuffer.node connectButDontMonitorSlaves slaveNode
// Fully async interrupts need synchronizers. // Fully async interrupts need synchronizers.
// Others need no synchronization. // Others need no synchronization.
@ -208,13 +213,13 @@ class SyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters)
class AsyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) { class AsyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) {
val masterNode = TLAsyncOutputNode() val masterNode = TLAsyncOutputNode()
val source = LazyModule(new TLAsyncCrossingSource) val source = LazyModule(new TLAsyncCrossingSource)
source.node :=* rocket.masterNode source.node :=* masterBuffer.node
masterNode :=* source.node masterNode :=* source.node
val slaveNode = new TLAsyncInputNode() { override def reverse = true } val slaveNode = new TLAsyncInputNode() { override def reverse = true }
val sink = LazyModule(new TLAsyncCrossingSink) val sink = LazyModule(new TLAsyncCrossingSink)
rocket.slaveNode :*= sink.node slaveBuffer.node connectButDontMonitorSlaves sink.node
sink.node :*= slaveNode sink.node connectButDontMonitorSlaves slaveNode
// Fully async interrupts need synchronizers, // Fully async interrupts need synchronizers,
// as do those coming from the periphery clock. // as do those coming from the periphery clock.
@ -232,13 +237,13 @@ class AsyncRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters
class RationalRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) { class RationalRocketTile(rtp: RocketTileParams, hartid: Int)(implicit p: Parameters) extends RocketTileWrapper(rtp, hartid) {
val masterNode = TLRationalOutputNode() val masterNode = TLRationalOutputNode()
val source = LazyModule(new TLRationalCrossingSource) val source = LazyModule(new TLRationalCrossingSource)
source.node :=* rocket.masterNode source.node :=* masterBuffer.node
masterNode :=* source.node masterNode :=* source.node
val slaveNode = new TLRationalInputNode() { override def reverse = true } val slaveNode = new TLRationalInputNode() { override def reverse = true }
val sink = LazyModule(new TLRationalCrossingSink(SlowToFast)) val sink = LazyModule(new TLRationalCrossingSink(SlowToFast))
rocket.slaveNode :*= sink.node slaveBuffer.node connectButDontMonitorSlaves sink.node
sink.node :*= slaveNode sink.node connectButDontMonitorSlaves slaveNode
// Fully async interrupts need synchronizers. // Fully async interrupts need synchronizers.
// Those coming from periphery clock need a // Those coming from periphery clock need a