Factor out some of HaveRocketTiles into HaveTiles
This commit is contained in:
parent
34e96c03b1
commit
70a4127cb8
@ -6,6 +6,9 @@ import Chisel._
|
|||||||
import freechips.rocketchip.config.Parameters
|
import freechips.rocketchip.config.Parameters
|
||||||
import freechips.rocketchip.diplomacy._
|
import freechips.rocketchip.diplomacy._
|
||||||
import freechips.rocketchip.tilelink._
|
import freechips.rocketchip.tilelink._
|
||||||
|
import freechips.rocketchip.devices.tilelink._
|
||||||
|
import freechips.rocketchip.tile.{BaseTile, TileParams}
|
||||||
|
import freechips.rocketchip.devices.debug.{HasPeripheryDebug, HasPeripheryDebugModuleImp}
|
||||||
import freechips.rocketchip.util._
|
import freechips.rocketchip.util._
|
||||||
|
|
||||||
/** Enumerates the three types of clock crossing between tiles and system bus */
|
/** Enumerates the three types of clock crossing between tiles and system bus */
|
||||||
@ -29,6 +32,21 @@ abstract class BareCoreplexModule[+L <: BareCoreplex](_outer: L) extends LazyMod
|
|||||||
println(outer.dts)
|
println(outer.dts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trait HasTiles extends HasSystemBus {
|
||||||
|
protected def tileParams: Seq[TileParams]
|
||||||
|
def nRocketTiles = tileParams.size
|
||||||
|
def hartIdList = tileParams.map(_.hartid)
|
||||||
|
|
||||||
|
// Handle interrupts to be routed directly into each tile
|
||||||
|
// TODO: figure out how to merge the localIntNodes and coreIntXbar
|
||||||
|
def localIntCounts = tileParams.map(_.core.nLocalInterrupts)
|
||||||
|
def localIntNodes = tileParams map { t =>
|
||||||
|
(t.core.nLocalInterrupts > 0).option(LazyModule(new IntXbar).intnode)
|
||||||
|
}
|
||||||
|
|
||||||
|
val rocket_tiles: Seq[BaseTile]
|
||||||
|
}
|
||||||
|
|
||||||
/** Base Coreplex class with no peripheral devices or ports added */
|
/** Base Coreplex class with no peripheral devices or ports added */
|
||||||
abstract class BaseCoreplex(implicit p: Parameters) extends BareCoreplex
|
abstract class BaseCoreplex(implicit p: Parameters) extends BareCoreplex
|
||||||
with HasInterruptBus
|
with HasInterruptBus
|
||||||
|
@ -14,7 +14,7 @@ import freechips.rocketchip.util._
|
|||||||
case object RocketTilesKey extends Field[Seq[RocketTileParams]](Nil)
|
case object RocketTilesKey extends Field[Seq[RocketTileParams]](Nil)
|
||||||
case object RocketCrossing extends Field[CoreplexClockCrossing](SynchronousCrossing())
|
case object RocketCrossing extends Field[CoreplexClockCrossing](SynchronousCrossing())
|
||||||
|
|
||||||
trait HasRocketTiles extends HasSystemBus
|
trait HasRocketTiles extends HasTiles
|
||||||
with HasPeripheryBus
|
with HasPeripheryBus
|
||||||
with HasPeripheryPLIC
|
with HasPeripheryPLIC
|
||||||
with HasPeripheryClint
|
with HasPeripheryClint
|
||||||
@ -22,21 +22,11 @@ trait HasRocketTiles extends HasSystemBus
|
|||||||
val module: HasRocketTilesModuleImp
|
val module: HasRocketTilesModuleImp
|
||||||
|
|
||||||
private val crossing = p(RocketCrossing)
|
private val crossing = p(RocketCrossing)
|
||||||
private val tileParams = p(RocketTilesKey)
|
protected val tileParams = p(RocketTilesKey)
|
||||||
val nRocketTiles = tileParams.size
|
|
||||||
val hartIdList = tileParams.map(_.hartid)
|
|
||||||
|
|
||||||
// Handle interrupts to be routed directly into each tile
|
|
||||||
// TODO: figure out how to merge the localIntNodes and coreIntXbar below
|
|
||||||
val localIntCounts = tileParams.map(_.core.nLocalInterrupts)
|
|
||||||
val localIntNodes = tileParams map { t =>
|
|
||||||
(t.core.nLocalInterrupts > 0).option(LazyModule(new IntXbar).intnode)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make a wrapper for each tile that will wire it to coreplex devices and crossbars,
|
// Make a wrapper for each tile that will wire it to coreplex devices and crossbars,
|
||||||
// according to the specified type of clock crossing.
|
// according to the specified type of clock crossing.
|
||||||
val wiringTuple = localIntNodes.zip(tileParams)
|
val rocket_tiles: Seq[BaseTile] = localIntNodes.zip(tileParams).map { case (lip, tp) =>
|
||||||
val rocket_tiles: Seq[BaseTile] = wiringTuple.map { case (lip, tp) =>
|
|
||||||
val pWithExtra = p.alterPartial {
|
val pWithExtra = p.alterPartial {
|
||||||
case TileKey => tp
|
case TileKey => tp
|
||||||
case BuildRoCC => tp.rocc
|
case BuildRoCC => tp.rocc
|
||||||
@ -107,7 +97,7 @@ trait HasRocketTilesModuleImp extends LazyModuleImp
|
|||||||
with HasRocketTilesBundle
|
with HasRocketTilesBundle
|
||||||
with HasResetVectorWire
|
with HasResetVectorWire
|
||||||
with HasPeripheryDebugModuleImp {
|
with HasPeripheryDebugModuleImp {
|
||||||
val outer: HasRocketTiles
|
val outer: HasTiles with HasPeripheryDebug
|
||||||
|
|
||||||
def resetVectorBits: Int = {
|
def resetVectorBits: Int = {
|
||||||
// Consider using the minimum over all widths, rather than enforcing homogeneity
|
// Consider using the minimum over all widths, rather than enforcing homogeneity
|
||||||
|
@ -65,6 +65,7 @@ case class TraceGenParams(
|
|||||||
memStart: BigInt, //p(ExtMem).base
|
memStart: BigInt, //p(ExtMem).base
|
||||||
numGens: Int) extends GroundTestTileParams {
|
numGens: Int) extends GroundTestTileParams {
|
||||||
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 trace = false
|
val trace = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ trait TileParams {
|
|||||||
val rocc: Seq[RoCCParams]
|
val rocc: Seq[RoCCParams]
|
||||||
val btb: Option[BTBParams]
|
val btb: Option[BTBParams]
|
||||||
val trace: Boolean
|
val trace: Boolean
|
||||||
|
val hartid: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
trait HasTileParameters {
|
trait HasTileParameters {
|
||||||
|
Loading…
Reference in New Issue
Block a user