tile: put a BasicBusBlocker inside RocketTile (#1115)
...instead of on the master side of the system bus. People inheriting from HasTileMasterPort might need to add `masterNode := tileBus.node` to their Tile child class.
This commit is contained in:
		| @@ -16,23 +16,16 @@ import freechips.rocketchip.util._ | |||||||
| // TODO: how specific are these to RocketTiles? | // TODO: how specific are these to RocketTiles? | ||||||
| case class TileMasterPortParams( | case class TileMasterPortParams( | ||||||
|     addBuffers: Int = 0, |     addBuffers: Int = 0, | ||||||
|     blockerCtrlAddr: Option[BigInt] = None, |  | ||||||
|     cork: Option[Boolean] = None) { |     cork: Option[Boolean] = None) { | ||||||
|  |  | ||||||
|   def adapt(coreplex: HasPeripheryBus) |   def adapt(coreplex: HasPeripheryBus) | ||||||
|            (masterNode: TLOutwardNode) |            (masterNode: TLOutwardNode) | ||||||
|            (implicit p: Parameters, sourceInfo: SourceInfo): TLOutwardNode = { |            (implicit p: Parameters, sourceInfo: SourceInfo): TLOutwardNode = { | ||||||
|     val tile_master_cork = cork.map(u => (LazyModule(new TLCacheCork(unsafe = u)))) |     val tile_master_cork = cork.map(u => (LazyModule(new TLCacheCork(unsafe = u)))) | ||||||
|     val tile_master_blocker = |  | ||||||
|       blockerCtrlAddr |  | ||||||
|         .map(BasicBusBlockerParams(_, coreplex.pbus.beatBytes, coreplex.sbus.beatBytes, deadlock = true)) |  | ||||||
|         .map(bp => LazyModule(new BasicBusBlocker(bp))) |  | ||||||
|     val tile_master_fixer = LazyModule(new TLFIFOFixer(TLFIFOFixer.allUncacheable)) |     val tile_master_fixer = LazyModule(new TLFIFOFixer(TLFIFOFixer.allUncacheable)) | ||||||
|  |  | ||||||
|     tile_master_blocker.foreach { _.controlNode := coreplex.pbus.toVariableWidthSlaves } |     (Seq(tile_master_fixer.node) ++ TLBuffer.chain(addBuffers) ++ tile_master_cork.map(_.node)) | ||||||
|     (Seq(tile_master_fixer.node) ++ TLBuffer.chain(addBuffers) |       .foldRight(masterNode)(_ :=* _) | ||||||
|      ++ tile_master_blocker.map(_.node) ++ tile_master_cork.map(_.node)) |  | ||||||
|      .foldRight(masterNode)(_ :=* _) |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -45,7 +38,7 @@ case class TileSlavePortParams( | |||||||
|            (implicit p: Parameters, sourceInfo: SourceInfo): TLInwardNode = { |            (implicit p: Parameters, sourceInfo: SourceInfo): TLInwardNode = { | ||||||
|     val tile_slave_blocker = |     val tile_slave_blocker = | ||||||
|       blockerCtrlAddr |       blockerCtrlAddr | ||||||
|         .map(BasicBusBlockerParams(_, coreplex.pbus.beatBytes, coreplex.sbus.beatBytes)) |         .map(BasicBusBlockerParams(_, coreplex.pbus.beatBytes)) | ||||||
|         .map(bp => LazyModule(new BasicBusBlocker(bp))) |         .map(bp => LazyModule(new BasicBusBlocker(bp))) | ||||||
|  |  | ||||||
|     tile_slave_blocker.foreach { _.controlNode := coreplex.pbus.toVariableWidthSlaves } |     tile_slave_blocker.foreach { _.controlNode := coreplex.pbus.toVariableWidthSlaves } | ||||||
|   | |||||||
| @@ -62,8 +62,8 @@ object DevicePMP | |||||||
| case class BusBlockerParams( | case class BusBlockerParams( | ||||||
|   controlAddress:   BigInt, |   controlAddress:   BigInt, | ||||||
|   controlBeatBytes: Int, |   controlBeatBytes: Int, | ||||||
|   deviceBeatBytes:  Int, |   deviceBeatBytes:  Int = 1, // TODO: This is ignored by the BusBypassBar | ||||||
|   pmpRegisters:     Int) |   pmpRegisters:     Int = 1) | ||||||
| { | { | ||||||
|   val page = 4096 |   val page = 4096 | ||||||
|   val pageBits = log2Ceil(page) |   val pageBits = log2Ceil(page) | ||||||
| @@ -115,7 +115,7 @@ class BusBlocker(params: BusBlockerParams)(implicit p: Parameters) extends TLBus | |||||||
| case class BasicBusBlockerParams( | case class BasicBusBlockerParams( | ||||||
|   controlAddress:   BigInt, |   controlAddress:   BigInt, | ||||||
|   controlBeatBytes: Int, |   controlBeatBytes: Int, | ||||||
|   deviceBeatBytes:  Int, |   deviceBeatBytes:  Int = 1, // TODO: this is ignored by the BusBypassBar | ||||||
|   deadlock: Boolean = false) |   deadlock: Boolean = false) | ||||||
|  |  | ||||||
| class BasicBusBlocker(params: BasicBusBlockerParams)(implicit p: Parameters) | class BasicBusBlocker(params: BasicBusBlockerParams)(implicit p: Parameters) | ||||||
|   | |||||||
| @@ -67,6 +67,7 @@ case class TraceGenParams( | |||||||
|   def build(i: Int, p: Parameters): GroundTestTile = new TraceGenTile(i, this)(p) |   def build(i: Int, p: Parameters): GroundTestTile = new TraceGenTile(i, this)(p) | ||||||
|   val hartid = 0 |   val hartid = 0 | ||||||
|   val trace = false |   val trace = false | ||||||
|  |   val blockerCtrlAddr = None | ||||||
| } | } | ||||||
|  |  | ||||||
| trait HasTraceGenParams { | trait HasTraceGenParams { | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ import Chisel.ImplicitConversions._ | |||||||
|  |  | ||||||
| import freechips.rocketchip.config.Parameters | import freechips.rocketchip.config.Parameters | ||||||
| import freechips.rocketchip.coreplex.CacheBlockBytes | import freechips.rocketchip.coreplex.CacheBlockBytes | ||||||
|  | import freechips.rocketchip.devices.tilelink._ | ||||||
| import freechips.rocketchip.diplomacy._ | import freechips.rocketchip.diplomacy._ | ||||||
| import freechips.rocketchip.tile._ | import freechips.rocketchip.tile._ | ||||||
| import freechips.rocketchip.tilelink._ | import freechips.rocketchip.tilelink._ | ||||||
| @@ -110,13 +111,21 @@ trait CanHaveScratchpad extends HasHellaCache with HasICacheFrontend { | |||||||
|     beu |     beu | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   val tile_master_blocker = | ||||||
|  |     tileParams.blockerCtrlAddr | ||||||
|  |       .map(BasicBusBlockerParams(_, xBytes, deadlock = true)) | ||||||
|  |       .map(bp => LazyModule(new BasicBusBlocker(bp))) | ||||||
|  |  | ||||||
|  |   masterNode := tile_master_blocker.map { _.node := tileBus.node } getOrElse { tileBus.node } | ||||||
|  |  | ||||||
|   // connect any combination of ITIM, DTIM, and BusErrorUnit |   // connect any combination of ITIM, DTIM, and BusErrorUnit | ||||||
|   val slaveNode = TLIdentityNode() |   val slaveNode = TLIdentityNode() | ||||||
|   DisableMonitors { implicit p => |   DisableMonitors { implicit p => | ||||||
|     val xbarPorts = |     val xbarPorts = | ||||||
|       scratch.map(lm => (lm.node, xBytes)) ++ |       scratch.map(lm => (lm.node, xBytes)) ++ | ||||||
|       busErrorUnit.map(lm => (lm.node, xBytes)) ++ |       busErrorUnit.map(lm => (lm.node, xBytes)) ++ | ||||||
|       tileParams.icache.flatMap(icache => icache.itimAddr.map(a => (frontend.slaveNode, tileParams.core.fetchBytes))) |       tileParams.icache.flatMap(icache => icache.itimAddr.map(a => (frontend.slaveNode, tileParams.core.fetchBytes))) ++ | ||||||
|  |       tile_master_blocker.map( lm => (lm.controlNode, xBytes)) | ||||||
|  |  | ||||||
|     if (xbarPorts.nonEmpty) { |     if (xbarPorts.nonEmpty) { | ||||||
|       val xbar = LazyModule(new TLXbar) |       val xbar = LazyModule(new TLXbar) | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ trait TileParams { | |||||||
|   val btb: Option[BTBParams] |   val btb: Option[BTBParams] | ||||||
|   val trace: Boolean |   val trace: Boolean | ||||||
|   val hartid: Int |   val hartid: Int | ||||||
|  |   val blockerCtrlAddr: Option[BigInt] | ||||||
| } | } | ||||||
|  |  | ||||||
| trait HasTileParameters { | trait HasTileParameters { | ||||||
| @@ -85,7 +86,6 @@ trait HasTileLinkMasterPort { | |||||||
|   val module: HasTileLinkMasterPortModule |   val module: HasTileLinkMasterPortModule | ||||||
|   val masterNode = TLIdentityNode() |   val masterNode = TLIdentityNode() | ||||||
|   val tileBus = LazyModule(new TLXbar) // TileBus xbar for cache backends to connect to |   val tileBus = LazyModule(new TLXbar) // TileBus xbar for cache backends to connect to | ||||||
|   masterNode := tileBus.node |  | ||||||
| } | } | ||||||
|  |  | ||||||
| trait HasTileLinkMasterPortBundle { | trait HasTileLinkMasterPortBundle { | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ case class RocketTileParams( | |||||||
|     hcfOnUncorrectable: Boolean = false, |     hcfOnUncorrectable: Boolean = false, | ||||||
|     name: Option[String] = Some("tile"), |     name: Option[String] = Some("tile"), | ||||||
|     hartid: Int = 0, |     hartid: Int = 0, | ||||||
|  |     blockerCtrlAddr: Option[BigInt] = None, | ||||||
|     boundaryBuffers: Boolean = false // if synthesized with hierarchical PnR, cut feed-throughs? |     boundaryBuffers: Boolean = false // if synthesized with hierarchical PnR, cut feed-throughs? | ||||||
|     ) extends TileParams { |     ) extends TileParams { | ||||||
|   require(icache.isDefined) |   require(icache.isDefined) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user