Merge remote-tracking branch 'origin/master' into firesim-integration
This commit is contained in:
Submodule generators/boom updated: 8d3162cbbe...2f8c419ff8
@@ -1,12 +1,20 @@
|
||||
package example
|
||||
|
||||
import chisel3._
|
||||
import freechips.rocketchip.config.{Parameters, Config}
|
||||
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32}
|
||||
import chisel3.util.{log2Up}
|
||||
|
||||
import freechips.rocketchip.config.{Field, Parameters, Config}
|
||||
import freechips.rocketchip.subsystem.{RocketTilesKey, WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32}
|
||||
import freechips.rocketchip.diplomacy.{LazyModule, ValName}
|
||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||
import freechips.rocketchip.tile.{XLen}
|
||||
import freechips.rocketchip.tile.{XLen, BuildRoCC, TileKey, LazyRoCC}
|
||||
|
||||
import boom.system.{BoomTilesKey}
|
||||
|
||||
import testchipip._
|
||||
|
||||
import hwacha.{Hwacha}
|
||||
|
||||
import sifive.blocks.devices.gpio._
|
||||
|
||||
/**
|
||||
@@ -37,63 +45,63 @@ class WithGPIO extends Config((site, here, up) => {
|
||||
GPIOParams(address = 0x10012000, width = 4, includeIOF = false))
|
||||
})
|
||||
|
||||
// ----------------------------------------
|
||||
// Rocket Top Level System Parameter Mixins
|
||||
// ----------------------------------------
|
||||
// -----------------------------------------------
|
||||
// BOOM and/or Rocket Top Level System Parameter Mixins
|
||||
// -----------------------------------------------
|
||||
|
||||
/**
|
||||
* Class to specify a "plain" top level rocket-chip system
|
||||
* Class to specify a "plain" top level BOOM and/or Rocket system
|
||||
*/
|
||||
class WithNormalRocketTop extends Config((site, here, up) => {
|
||||
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
Module(LazyModule(new RocketTop()(p)).module)
|
||||
class WithNormalBoomRocketTop extends Config((site, here, up) => {
|
||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
Module(LazyModule(new BoomRocketTop()(p)).module)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level rocket-chip system with PWM
|
||||
* Class to specify a top level BOOM and/or Rocket system with PWM
|
||||
*/
|
||||
class WithPWMRocketTop extends Config((site, here, up) => {
|
||||
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||
Module(LazyModule(new RocketTopWithPWMTL()(p)).module)
|
||||
class WithPWMBoomRocketTop extends Config((site, here, up) => {
|
||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||
Module(LazyModule(new BoomRocketTopWithPWMTL()(p)).module)
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level rocket-chip system with a PWM AXI4
|
||||
* Class to specify a top level BOOM and/or Rocket system with a PWM AXI4
|
||||
*/
|
||||
class WithPWMAXI4RocketTop extends Config((site, here, up) => {
|
||||
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||
Module(LazyModule(new RocketTopWithPWMAXI4()(p)).module)
|
||||
class WithPWMAXI4BoomRocketTop extends Config((site, here, up) => {
|
||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||
Module(LazyModule(new BoomRocketTopWithPWMAXI4()(p)).module)
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level rocket-chip system with a block device
|
||||
* Class to specify a top level BOOM and/or Rocket system with a block device
|
||||
*/
|
||||
class WithBlockDeviceModelRocketTop extends Config((site, here, up) => {
|
||||
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new RocketTopWithBlockDevice()(p)).module)
|
||||
class WithBlockDeviceModelBoomRocketTop extends Config((site, here, up) => {
|
||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new BoomRocketTopWithBlockDevice()(p)).module)
|
||||
top.connectBlockDeviceModel()
|
||||
top
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level rocket-chip system with a simulator block device
|
||||
* Class to specify a top level BOOM and/or Rocket system with a simulator block device
|
||||
*/
|
||||
class WithSimBlockDeviceRocketTop extends Config((site, here, up) => {
|
||||
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new RocketTopWithBlockDevice()(p)).module)
|
||||
class WithSimBlockDeviceBoomRocketTop extends Config((site, here, up) => {
|
||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new BoomRocketTopWithBlockDevice()(p)).module)
|
||||
top.connectSimBlockDevice(clock, reset)
|
||||
top
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level rocket-chip system with GPIO
|
||||
* Class to specify a top level BOOM and/or Rocket system with GPIO
|
||||
*/
|
||||
class WithGPIORocketTop extends Config((site, here, up) => {
|
||||
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new RocketTopWithGPIO()(p)).module)
|
||||
class WithGPIOBoomRocketTop extends Config((site, here, up) => {
|
||||
case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new BoomRocketTopWithGPIO()(p)).module)
|
||||
for (gpio <- top.gpio) {
|
||||
for (pin <- gpio.pins) {
|
||||
pin.i.ival := false.B
|
||||
@@ -103,68 +111,40 @@ class WithGPIORocketTop extends Config((site, here, up) => {
|
||||
}
|
||||
})
|
||||
|
||||
// --------------------------------------
|
||||
// BOOM Top Level System Parameter Mixins
|
||||
// --------------------------------------
|
||||
// ------------------
|
||||
// Multi-RoCC Support
|
||||
// ------------------
|
||||
|
||||
/**
|
||||
* Class to specify a "plain" top level BOOM system
|
||||
* Map from a hartId to a particular RoCC accelerator
|
||||
*/
|
||||
class WithNormalBoomTop extends Config((site, here, up) => {
|
||||
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
Module(LazyModule(new BoomTop()(p)).module)
|
||||
}
|
||||
case object MultiRoCCKey extends Field[Map[Int, Seq[Parameters => LazyRoCC]]](Map.empty[Int, Seq[Parameters => LazyRoCC]])
|
||||
|
||||
/**
|
||||
* Mixin to enable different RoCCs based on the hartId
|
||||
*/
|
||||
class WithMultiRoCC extends Config((site, here, up) => {
|
||||
case BuildRoCC => site(MultiRoCCKey).getOrElse(site(TileKey).hartId, Nil)
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level BOOM system with PWM
|
||||
* Mixin to add Hwachas to cores based on hart
|
||||
*
|
||||
* For ex:
|
||||
* Core 0, 1, 2, 3 have been defined earlier
|
||||
* with hartIds of 0, 1, 2, 3 respectively
|
||||
* And you call WithMultiRoCCHwacha(0,1)
|
||||
* Then Core 0 and 1 will get a Hwacha
|
||||
*
|
||||
* @param harts harts to specify which will get a Hwacha
|
||||
*/
|
||||
class WithPWMBoomTop extends Config((site, here, up) => {
|
||||
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||
Module(LazyModule(new BoomTopWithPWMTL()(p)).module)
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level BOOM system with a PWM AXI4
|
||||
*/
|
||||
class WithPWMAXI4BoomTop extends Config((site, here, up) => {
|
||||
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) =>
|
||||
Module(LazyModule(new BoomTopWithPWMAXI4()(p)).module)
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level BOOM system with a block device
|
||||
*/
|
||||
class WithBlockDeviceModelBoomTop extends Config((site, here, up) => {
|
||||
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new BoomTopWithBlockDevice()(p)).module)
|
||||
top.connectBlockDeviceModel()
|
||||
top
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level BOOM system with a simulator block device
|
||||
*/
|
||||
class WithSimBlockDeviceBoomTop extends Config((site, here, up) => {
|
||||
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new BoomTopWithBlockDevice()(p)).module)
|
||||
top.connectSimBlockDevice(clock, reset)
|
||||
top
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to specify a top level BOOM system with GPIO
|
||||
*/
|
||||
class WithGPIOBoomTop extends Config((site, here, up) => {
|
||||
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||
val top = Module(LazyModule(new BoomTopWithGPIO()(p)).module)
|
||||
for (gpio <- top.gpio) {
|
||||
for (pin <- gpio.pins) {
|
||||
pin.i.ival := false.B
|
||||
}
|
||||
class WithMultiRoCCHwacha(harts: Int*) extends Config((site, here, up) => {
|
||||
case MultiRoCCKey => {
|
||||
require(harts.max <= ((up(RocketTilesKey, site).length + up(BoomTilesKey, site).length) - 1))
|
||||
up(MultiRoCCKey, site) ++ harts.distinct.map{ i =>
|
||||
(i -> Seq((p: Parameters) => {
|
||||
LazyModule(new Hwacha()(p)).suggestName("hwacha")
|
||||
}))
|
||||
}
|
||||
top
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package example
|
||||
|
||||
import chisel3._
|
||||
|
||||
import freechips.rocketchip.config.{Config}
|
||||
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32, WithExtMemSize, WithNBanks}
|
||||
|
||||
import testchipip._
|
||||
|
||||
// --------------
|
||||
@@ -14,7 +16,7 @@ class BaseRocketConfig extends Config(
|
||||
new freechips.rocketchip.system.DefaultConfig)
|
||||
|
||||
class DefaultRocketConfig extends Config(
|
||||
new WithNormalRocketTop ++
|
||||
new WithNormalBoomRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class HwachaConfig extends Config(
|
||||
@@ -26,21 +28,26 @@ class RoccRocketConfig extends Config(
|
||||
new DefaultRocketConfig)
|
||||
|
||||
class PWMRocketConfig extends Config(
|
||||
new WithPWMRocketTop ++
|
||||
new WithPWMBoomRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class PWMAXI4RocketConfig extends Config(
|
||||
new WithPWMAXI4RocketTop ++
|
||||
new WithPWMAXI4BoomRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class SimBlockDeviceRocketConfig extends Config(
|
||||
new WithBlockDevice ++
|
||||
new WithSimBlockDeviceRocketTop ++
|
||||
new WithSimBlockDeviceBoomRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class BlockDeviceModelRocketConfig extends Config(
|
||||
new WithBlockDevice ++
|
||||
new WithBlockDeviceModelRocketTop ++
|
||||
new WithBlockDeviceModelBoomRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class GPIORocketConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIOBoomRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class DualCoreRocketConfig extends Config(
|
||||
@@ -51,11 +58,6 @@ class RV32RocketConfig extends Config(
|
||||
new WithRV32 ++
|
||||
new DefaultRocketConfig)
|
||||
|
||||
class GPIORocketConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIORocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class GB1MemoryConfig extends Config(
|
||||
new WithExtMemSize((1<<30) * 1L) ++
|
||||
new DefaultRocketConfig)
|
||||
@@ -73,11 +75,11 @@ class SmallBaseBoomConfig extends Config(
|
||||
new boom.system.SmallBoomConfig)
|
||||
|
||||
class DefaultBoomConfig extends Config(
|
||||
new WithNormalBoomTop ++
|
||||
new WithNormalBoomRocketTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
class SmallDefaultBoomConfig extends Config(
|
||||
new WithNormalBoomTop ++
|
||||
new WithNormalBoomRocketTop ++
|
||||
new SmallBaseBoomConfig)
|
||||
|
||||
class HwachaBoomConfig extends Config(
|
||||
@@ -89,33 +91,154 @@ class RoccBoomConfig extends Config(
|
||||
new DefaultBoomConfig)
|
||||
|
||||
class PWMBoomConfig extends Config(
|
||||
new WithPWMBoomTop ++
|
||||
new WithPWMBoomRocketTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
class PWMAXI4BoomConfig extends Config(
|
||||
new WithPWMAXI4BoomTop ++
|
||||
new WithPWMAXI4BoomRocketTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
class SimBlockDeviceBoomConfig extends Config(
|
||||
new WithBlockDevice ++
|
||||
new WithSimBlockDeviceBoomTop ++
|
||||
new WithSimBlockDeviceBoomRocketTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
class BlockDeviceModelBoomConfig extends Config(
|
||||
new WithBlockDevice ++
|
||||
new WithBlockDeviceModelBoomTop ++
|
||||
new WithBlockDeviceModelBoomRocketTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
class DualCoreBoomConfig extends Config(
|
||||
// Core gets tacked onto existing list
|
||||
new boom.system.WithNBoomCores(2) ++
|
||||
new DefaultBoomConfig)
|
||||
|
||||
class RV32BoomConfig extends Config(
|
||||
new WithBootROM ++
|
||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
||||
|
||||
class GPIOBoomConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIOBoomTop ++
|
||||
new WithGPIOBoomRocketTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
/**
|
||||
* Slightly different looking configs since we need to override
|
||||
* the `WithNBoomCores` with the DefaultBoomConfig params
|
||||
*/
|
||||
class DualCoreBoomConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new WithBootROM ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(2) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class DualCoreSmallBoomConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new WithBootROM ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.WithSmallBooms ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(2) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class RV32UnifiedBoomConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new WithBootROM ++
|
||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
||||
|
||||
// ---------------------
|
||||
// BOOM and Rocket Configs
|
||||
// ---------------------
|
||||
|
||||
class BaseBoomAndRocketConfig extends Config(
|
||||
new WithBootROM ++
|
||||
new boom.system.WithRenumberHarts ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(1) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class SmallBaseBoomAndRocketConfig extends Config(
|
||||
new WithBootROM ++
|
||||
new boom.system.WithRenumberHarts ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.WithSmallBooms ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(1) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class DefaultBoomAndRocketConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class SmallDefaultBoomAndRocketConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new SmallBaseBoomAndRocketConfig)
|
||||
|
||||
class HwachaBoomAndRocketConfig extends Config(
|
||||
new hwacha.DefaultHwachaConfig ++
|
||||
new DefaultBoomAndRocketConfig)
|
||||
|
||||
class RoccBoomAndRocketConfig extends Config(
|
||||
new WithRoccExample ++
|
||||
new DefaultBoomAndRocketConfig)
|
||||
|
||||
class PWMBoomAndRocketConfig extends Config(
|
||||
new WithPWMBoomRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class PWMAXI4BoomAndRocketConfig extends Config(
|
||||
new WithPWMAXI4BoomRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class SimBlockDeviceBoomAndRocketConfig extends Config(
|
||||
new WithBlockDevice ++
|
||||
new WithSimBlockDeviceBoomRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class BlockDeviceModelBoomAndRocketConfig extends Config(
|
||||
new WithBlockDevice ++
|
||||
new WithBlockDeviceModelBoomRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class GPIOBoomAndRocketConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIOBoomRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class DualCoreBoomAndOneRocketConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new WithBootROM ++
|
||||
new boom.system.WithRenumberHarts ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(2) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class DualCoreBoomAndOneHwachaRocketConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new WithBootROM ++
|
||||
new WithMultiRoCC ++
|
||||
new WithMultiRoCCHwacha(0) ++ // put Hwacha just on hart0 which was renumbered to Rocket
|
||||
new boom.system.WithRenumberHarts ++
|
||||
new hwacha.DefaultHwachaConfig ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(2) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class RV32BoomAndRocketConfig extends Config(
|
||||
new WithNormalBoomRocketTop ++
|
||||
new WithBootROM ++
|
||||
new boom.system.WithRenumberHarts ++
|
||||
new boom.common.WithBoomRV32 ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(1) ++
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new WithRV32 ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package example
|
||||
|
||||
import scala.collection.mutable.LinkedHashSet
|
||||
|
||||
import chisel3._
|
||||
import chisel3.experimental._
|
||||
|
||||
import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper}
|
||||
|
||||
import freechips.rocketchip.subsystem.{RocketTilesKey}
|
||||
import freechips.rocketchip.diplomacy.{LazyModule}
|
||||
import freechips.rocketchip.config.{Field, Parameters}
|
||||
import freechips.rocketchip.util.{GeneratorApp}
|
||||
import freechips.rocketchip.tile.{XLen}
|
||||
import freechips.rocketchip.system.{TestGeneration, RegressionTestSuite}
|
||||
|
||||
import boom.system.{BoomTilesKey, BoomTestSuites}
|
||||
|
||||
object Generator extends GeneratorApp {
|
||||
|
||||
@@ -2,18 +2,20 @@ package example
|
||||
|
||||
import chisel3._
|
||||
import chisel3.experimental._
|
||||
|
||||
import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper}
|
||||
|
||||
import freechips.rocketchip.diplomacy.LazyModule
|
||||
import freechips.rocketchip.config.{Field, Parameters}
|
||||
import freechips.rocketchip.util.GeneratorApp
|
||||
|
||||
// -------------------
|
||||
// Rocket Test Harness
|
||||
// -------------------
|
||||
// --------------------------
|
||||
// BOOM and/or Rocket Test Harness
|
||||
// --------------------------
|
||||
|
||||
case object BuildRocketTop extends Field[(Clock, Bool, Parameters) => RocketTopModule[RocketTop]]
|
||||
case object BuildBoomRocketTop extends Field[(Clock, Bool, Parameters) => BoomRocketTopModule[BoomRocketTop]]
|
||||
|
||||
class RocketTestHarness(implicit val p: Parameters) extends Module {
|
||||
class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
||||
val io = IO(new Bundle {
|
||||
val success = Output(Bool())
|
||||
})
|
||||
@@ -21,43 +23,7 @@ class RocketTestHarness(implicit val p: Parameters) extends Module {
|
||||
// force Chisel to rename module
|
||||
override def desiredName = "TestHarness"
|
||||
|
||||
val dut = p(BuildRocketTop)(clock, reset.toBool, p)
|
||||
dut.debug := DontCare
|
||||
dut.connectSimAXIMem()
|
||||
dut.connectSimAXIMMIO()
|
||||
dut.dontTouchPorts()
|
||||
dut.tieOffInterrupts()
|
||||
dut.l2_frontend_bus_axi4.foreach(axi => {
|
||||
axi.tieoff()
|
||||
experimental.DataMirror.directionOf(axi.ar.ready) match {
|
||||
case core.ActualDirection.Input =>
|
||||
axi.r.bits := DontCare
|
||||
axi.b.bits := DontCare
|
||||
case core.ActualDirection.Output =>
|
||||
axi.aw.bits := DontCare
|
||||
axi.ar.bits := DontCare
|
||||
axi.w.bits := DontCare
|
||||
}
|
||||
})
|
||||
|
||||
io.success := dut.connectSimSerial()
|
||||
}
|
||||
|
||||
// -----------------
|
||||
// BOOM Test Harness
|
||||
// -----------------
|
||||
|
||||
case object BuildBoomTop extends Field[(Clock, Bool, Parameters) => BoomTopModule[BoomTop]]
|
||||
|
||||
class BoomTestHarness(implicit val p: Parameters) extends Module {
|
||||
val io = IO(new Bundle {
|
||||
val success = Output(Bool())
|
||||
})
|
||||
|
||||
// force Chisel to rename module
|
||||
override def desiredName = "TestHarness"
|
||||
|
||||
val dut = p(BuildBoomTop)(clock, reset.toBool, p)
|
||||
val dut = p(BuildBoomRocketTop)(clock, reset.toBool, p)
|
||||
dut.debug := DontCare
|
||||
dut.connectSimAXIMem()
|
||||
dut.connectSimAXIMMIO()
|
||||
|
||||
@@ -1,129 +1,69 @@
|
||||
package example
|
||||
|
||||
import chisel3._
|
||||
|
||||
import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.system._
|
||||
import freechips.rocketchip.config.Parameters
|
||||
import freechips.rocketchip.devices.tilelink._
|
||||
import freechips.rocketchip.util.DontTouch
|
||||
|
||||
import testchipip._
|
||||
|
||||
import sifive.blocks.devices.gpio._
|
||||
|
||||
// ------------------------
|
||||
// Rocket Top Level Systems
|
||||
// ------------------------
|
||||
// -------------------------------
|
||||
// BOOM and/or Rocket Top Level Systems
|
||||
// -------------------------------
|
||||
|
||||
class RocketTop(implicit p: Parameters) extends ExampleRocketSystem
|
||||
with CanHaveMasterAXI4MemPort
|
||||
with HasPeripheryBootROM
|
||||
with HasNoDebug
|
||||
with HasPeripherySerial {
|
||||
override lazy val module = new RocketTopModule(this)
|
||||
}
|
||||
|
||||
class RocketTopModule[+L <: RocketTop](l: L) extends ExampleRocketSystemModuleImp(l)
|
||||
with HasRTCModuleImp
|
||||
with CanHaveMasterAXI4MemPortModuleImp
|
||||
with HasPeripheryBootROMModuleImp
|
||||
with HasNoDebugModuleImp
|
||||
with HasPeripherySerialModuleImp
|
||||
with DontTouch
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class RocketTopWithPWMTL(implicit p: Parameters) extends RocketTop
|
||||
with HasPeripheryPWMTL {
|
||||
override lazy val module = new RocketTopWithPWMTLModule(this)
|
||||
}
|
||||
|
||||
class RocketTopWithPWMTLModule(l: RocketTopWithPWMTL)
|
||||
extends RocketTopModule(l) with HasPeripheryPWMTLModuleImp
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class RocketTopWithPWMAXI4(implicit p: Parameters) extends RocketTop
|
||||
with HasPeripheryPWMAXI4 {
|
||||
override lazy val module = new RocketTopWithPWMAXI4Module(this)
|
||||
}
|
||||
|
||||
class RocketTopWithPWMAXI4Module(l: RocketTopWithPWMAXI4)
|
||||
extends RocketTopModule(l) with HasPeripheryPWMAXI4ModuleImp
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class RocketTopWithBlockDevice(implicit p: Parameters) extends RocketTop
|
||||
with HasPeripheryBlockDevice {
|
||||
override lazy val module = new RocketTopWithBlockDeviceModule(this)
|
||||
}
|
||||
|
||||
class RocketTopWithBlockDeviceModule(l: RocketTopWithBlockDevice)
|
||||
extends RocketTopModule(l)
|
||||
with HasPeripheryBlockDeviceModuleImp
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class RocketTopWithGPIO(implicit p: Parameters) extends RocketTop
|
||||
with HasPeripheryGPIO {
|
||||
override lazy val module = new RocketTopWithGPIOModule(this)
|
||||
}
|
||||
|
||||
class RocketTopWithGPIOModule(l: RocketTopWithGPIO)
|
||||
extends RocketTopModule(l)
|
||||
with HasPeripheryGPIOModuleImp
|
||||
|
||||
// ----------------------
|
||||
// BOOM Top Level Systems
|
||||
// ----------------------
|
||||
|
||||
class BoomTop(implicit p: Parameters) extends boom.system.ExampleBoomSystem
|
||||
class BoomRocketTop(implicit p: Parameters) extends boom.system.ExampleBoomAndRocketSystem
|
||||
with HasNoDebug
|
||||
with HasPeripherySerial {
|
||||
override lazy val module = new BoomTopModule(this)
|
||||
override lazy val module = new BoomRocketTopModule(this)
|
||||
}
|
||||
|
||||
class BoomTopModule[+L <: BoomTop](l: L) extends boom.system.ExampleBoomSystemModule(l)
|
||||
with HasRTCModuleImp
|
||||
class BoomRocketTopModule[+L <: BoomRocketTop](l: L) extends boom.system.ExampleBoomAndRocketSystemModule(l)
|
||||
with HasNoDebugModuleImp
|
||||
with HasPeripherySerialModuleImp
|
||||
with DontTouch
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class BoomTopWithPWMTL(implicit p: Parameters) extends BoomTop
|
||||
class BoomRocketTopWithPWMTL(implicit p: Parameters) extends BoomRocketTop
|
||||
with HasPeripheryPWMTL {
|
||||
override lazy val module = new BoomTopWithPWMTLModule(this)
|
||||
override lazy val module = new BoomRocketTopWithPWMTLModule(this)
|
||||
}
|
||||
|
||||
class BoomTopWithPWMTLModule(l: BoomTopWithPWMTL) extends BoomTopModule(l)
|
||||
class BoomRocketTopWithPWMTLModule(l: BoomRocketTopWithPWMTL) extends BoomRocketTopModule(l)
|
||||
with HasPeripheryPWMTLModuleImp
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class BoomTopWithPWMAXI4(implicit p: Parameters) extends BoomTop
|
||||
class BoomRocketTopWithPWMAXI4(implicit p: Parameters) extends BoomRocketTop
|
||||
with HasPeripheryPWMAXI4 {
|
||||
override lazy val module = new BoomTopWithPWMAXI4Module(this)
|
||||
override lazy val module = new BoomRocketTopWithPWMAXI4Module(this)
|
||||
}
|
||||
|
||||
class BoomTopWithPWMAXI4Module(l: BoomTopWithPWMAXI4) extends BoomTopModule(l)
|
||||
class BoomRocketTopWithPWMAXI4Module(l: BoomRocketTopWithPWMAXI4) extends BoomRocketTopModule(l)
|
||||
with HasPeripheryPWMAXI4ModuleImp
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class BoomTopWithBlockDevice(implicit p: Parameters) extends BoomTop
|
||||
class BoomRocketTopWithBlockDevice(implicit p: Parameters) extends BoomRocketTop
|
||||
with HasPeripheryBlockDevice {
|
||||
override lazy val module = new BoomTopWithBlockDeviceModule(this)
|
||||
override lazy val module = new BoomRocketTopWithBlockDeviceModule(this)
|
||||
}
|
||||
|
||||
class BoomTopWithBlockDeviceModule(l: BoomTopWithBlockDevice) extends BoomTopModule(l)
|
||||
class BoomRocketTopWithBlockDeviceModule(l: BoomRocketTopWithBlockDevice) extends BoomRocketTopModule(l)
|
||||
with HasPeripheryBlockDeviceModuleImp
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
class BoomTopWithGPIO(implicit p: Parameters) extends BoomTop
|
||||
class BoomRocketTopWithGPIO(implicit p: Parameters) extends BoomRocketTop
|
||||
with HasPeripheryGPIO {
|
||||
override lazy val module = new BoomTopWithGPIOModule(this)
|
||||
override lazy val module = new BoomRocketTopWithGPIOModule(this)
|
||||
}
|
||||
|
||||
class BoomTopWithGPIOModule(l: BoomTopWithGPIO)
|
||||
extends BoomTopModule(l)
|
||||
class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
|
||||
extends BoomRocketTopModule(l)
|
||||
with HasPeripheryGPIOModuleImp
|
||||
|
||||
Reference in New Issue
Block a user