Merge pull request #92 from ucb-bar/rebar-dev-heter-multicore

Add support for heterogenous SoCs (BOOM + Hwacha)
This commit is contained in:
Abraham Gonzalez
2019-05-28 11:24:35 -07:00
committed by GitHub
8 changed files with 278 additions and 261 deletions

View File

@@ -153,7 +153,7 @@ jobs:
- run: - run:
name: Building the boomexample subproject using Verilator name: Building the boomexample subproject using Verilator
command: .circleci/do-rtl-build.sh SUB_PROJECT=boomexample CONFIG=SmallDefaultBoomConfig command: .circleci/do-rtl-build.sh SUB_PROJECT=example CONFIG=SmallDefaultBoomConfig
no_output_timeout: 120m no_output_timeout: 120m
- save_cache: - save_cache:
@@ -161,6 +161,40 @@ jobs:
paths: paths:
- "/home/riscvuser/project" - "/home/riscvuser/project"
prepare-boomrocketexample:
docker:
- image: riscvboom/riscvboom-images:0.0.5
environment:
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
TERM: dumb
steps:
# Checkout the code
- checkout
- run:
name: Create hash of toolchains
command: |
.circleci/create-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- verilator-installed-v1-{{ checksum "sims/verisim/verilator.mk" }}
- run:
name: Building the boomrocketexample subproject using Verilator
command: .circleci/do-rtl-build.sh SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig
no_output_timeout: 120m
- save_cache:
key: boomrocketexample-{{ .Branch }}-{{ .Revision }}
paths:
- "/home/riscvuser/project"
prepare-boom: prepare-boom:
docker: docker:
- image: riscvboom/riscvboom-images:0.0.5 - image: riscvboom/riscvboom-images:0.0.5
@@ -317,7 +351,35 @@ jobs:
- run: - run:
name: Run boomexample benchmark tests name: Run boomexample benchmark tests
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=boomexample CONFIG=SmallDefaultBoomConfig command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomConfig
boomrocketexample-run-benchmark-tests:
docker:
- image: riscvboom/riscvboom-images:0.0.5
environment:
JVM_OPTS: -Xmx3200m # Customize the JVM maximum heap limit
TERM: dumb
steps:
# Checkout the code
- checkout
- run:
name: Create hash of toolchains
command: |
.circleci/create-hash.sh
- restore_cache:
keys:
- riscv-tools-installed-v1-{{ checksum "../riscv-tools.hash" }}
- restore_cache:
keys:
- boomrocketexample-{{ .Branch }}-{{ .Revision }}
- run:
name: Run boomrocketexample benchmark tests
command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig
boom-run-benchmark-tests: boom-run-benchmark-tests:
docker: docker:
@@ -427,6 +489,11 @@ workflows:
- install-riscv-toolchain - install-riscv-toolchain
- install-verilator - install-verilator
- prepare-boomrocketexample:
requires:
- install-riscv-toolchain
- install-verilator
- prepare-boom: - prepare-boom:
requires: requires:
- install-riscv-toolchain - install-riscv-toolchain
@@ -456,6 +523,11 @@ workflows:
- install-riscv-toolchain - install-riscv-toolchain
- prepare-boomexample - prepare-boomexample
- boomrocketexample-run-benchmark-tests:
requires:
- install-riscv-toolchain
- prepare-boomrocketexample
- boom-run-benchmark-tests: - boom-run-benchmark-tests:
requires: requires:
- install-riscv-toolchain - install-riscv-toolchain

View File

@@ -1,12 +1,16 @@
package example package example
import chisel3._ import chisel3._
import chisel3.util.{log2Up}
import freechips.rocketchip.config.{Parameters, Config} import freechips.rocketchip.config.{Parameters, Config}
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32} import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32}
import freechips.rocketchip.diplomacy.{LazyModule, ValName} import freechips.rocketchip.diplomacy.{LazyModule, ValName}
import freechips.rocketchip.devices.tilelink.BootROMParams import freechips.rocketchip.devices.tilelink.BootROMParams
import freechips.rocketchip.tile.{XLen} import freechips.rocketchip.tile.{XLen}
import testchipip._ import testchipip._
import sifive.blocks.devices.gpio._ import sifive.blocks.devices.gpio._
/** /**
@@ -37,129 +41,63 @@ class WithGPIO extends Config((site, here, up) => {
GPIOParams(address = 0x10012000, width = 4, includeIOF = false)) 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) => { class WithNormalBoomRocketTop extends Config((site, here, up) => {
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => { case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
Module(LazyModule(new RocketTop()(p)).module) 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) => { class WithPWMBoomRocketTop extends Config((site, here, up) => {
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
Module(LazyModule(new RocketTopWithPWMTL()(p)).module) 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) => { class WithPWMAXI4BoomRocketTop extends Config((site, here, up) => {
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) =>
Module(LazyModule(new RocketTopWithPWMAXI4()(p)).module) 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) => { class WithBlockDeviceModelBoomRocketTop extends Config((site, here, up) => {
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => { case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
val top = Module(LazyModule(new RocketTopWithBlockDevice()(p)).module) val top = Module(LazyModule(new BoomRocketTopWithBlockDevice()(p)).module)
top.connectBlockDeviceModel() top.connectBlockDeviceModel()
top 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) => { class WithSimBlockDeviceBoomRocketTop extends Config((site, here, up) => {
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => { case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
val top = Module(LazyModule(new RocketTopWithBlockDevice()(p)).module) val top = Module(LazyModule(new BoomRocketTopWithBlockDevice()(p)).module)
top.connectSimBlockDevice(clock, reset) top.connectSimBlockDevice(clock, reset)
top 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) => { class WithGPIOBoomRocketTop extends Config((site, here, up) => {
case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => { case BuildBoomRocketTop => (clock: Clock, reset: Bool, p: Parameters) => {
val top = Module(LazyModule(new RocketTopWithGPIO()(p)).module) val top = Module(LazyModule(new BoomRocketTopWithGPIO()(p)).module)
for (gpio <- top.gpio) {
for (pin <- gpio.pins) {
pin.i.ival := false.B
}
}
top
}
})
// --------------------------------------
// BOOM Top Level System Parameter Mixins
// --------------------------------------
/**
* Class to specify a "plain" top level BOOM system
*/
class WithNormalBoomTop extends Config((site, here, up) => {
case BuildBoomTop => (clock: Clock, reset: Bool, p: Parameters) => {
Module(LazyModule(new BoomTop()(p)).module)
}
})
/**
* Class to specify a top level BOOM system with PWM
*/
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 (gpio <- top.gpio) {
for (pin <- gpio.pins) { for (pin <- gpio.pins) {
pin.i.ival := false.B pin.i.ival := false.B

View File

@@ -1,8 +1,10 @@
package example package example
import chisel3._ import chisel3._
import freechips.rocketchip.config.{Config} import freechips.rocketchip.config.{Config}
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32, WithExtMemSize, WithNBanks} import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32, WithExtMemSize, WithNBanks}
import testchipip._ import testchipip._
// -------------- // --------------
@@ -14,7 +16,7 @@ class BaseRocketConfig extends Config(
new freechips.rocketchip.system.DefaultConfig) new freechips.rocketchip.system.DefaultConfig)
class DefaultRocketConfig extends Config( class DefaultRocketConfig extends Config(
new WithNormalRocketTop ++ new WithNormalBoomRocketTop ++
new BaseRocketConfig) new BaseRocketConfig)
class HwachaConfig extends Config( class HwachaConfig extends Config(
@@ -26,21 +28,26 @@ class RoccRocketConfig extends Config(
new DefaultRocketConfig) new DefaultRocketConfig)
class PWMRocketConfig extends Config( class PWMRocketConfig extends Config(
new WithPWMRocketTop ++ new WithPWMBoomRocketTop ++
new BaseRocketConfig) new BaseRocketConfig)
class PWMAXI4RocketConfig extends Config( class PWMAXI4RocketConfig extends Config(
new WithPWMAXI4RocketTop ++ new WithPWMAXI4BoomRocketTop ++
new BaseRocketConfig) new BaseRocketConfig)
class SimBlockDeviceRocketConfig extends Config( class SimBlockDeviceRocketConfig extends Config(
new WithBlockDevice ++ new WithBlockDevice ++
new WithSimBlockDeviceRocketTop ++ new WithSimBlockDeviceBoomRocketTop ++
new BaseRocketConfig) new BaseRocketConfig)
class BlockDeviceModelRocketConfig extends Config( class BlockDeviceModelRocketConfig extends Config(
new WithBlockDevice ++ new WithBlockDevice ++
new WithBlockDeviceModelRocketTop ++ new WithBlockDeviceModelBoomRocketTop ++
new BaseRocketConfig)
class GPIORocketConfig extends Config(
new WithGPIO ++
new WithGPIOBoomRocketTop ++
new BaseRocketConfig) new BaseRocketConfig)
class DualCoreRocketConfig extends Config( class DualCoreRocketConfig extends Config(
@@ -51,11 +58,6 @@ class RV32RocketConfig extends Config(
new WithRV32 ++ new WithRV32 ++
new DefaultRocketConfig) new DefaultRocketConfig)
class GPIORocketConfig extends Config(
new WithGPIO ++
new WithGPIORocketTop ++
new BaseRocketConfig)
class GB1MemoryConfig extends Config( class GB1MemoryConfig extends Config(
new WithExtMemSize((1<<30) * 1L) ++ new WithExtMemSize((1<<30) * 1L) ++
new DefaultRocketConfig) new DefaultRocketConfig)
@@ -73,11 +75,11 @@ class SmallBaseBoomConfig extends Config(
new boom.system.SmallBoomConfig) new boom.system.SmallBoomConfig)
class DefaultBoomConfig extends Config( class DefaultBoomConfig extends Config(
new WithNormalBoomTop ++ new WithNormalBoomRocketTop ++
new BaseBoomConfig) new BaseBoomConfig)
class SmallDefaultBoomConfig extends Config( class SmallDefaultBoomConfig extends Config(
new WithNormalBoomTop ++ new WithNormalBoomRocketTop ++
new SmallBaseBoomConfig) new SmallBaseBoomConfig)
class HwachaBoomConfig extends Config( class HwachaBoomConfig extends Config(
@@ -89,33 +91,140 @@ class RoccBoomConfig extends Config(
new DefaultBoomConfig) new DefaultBoomConfig)
class PWMBoomConfig extends Config( class PWMBoomConfig extends Config(
new WithPWMBoomTop ++ new WithPWMBoomRocketTop ++
new BaseBoomConfig) new BaseBoomConfig)
class PWMAXI4BoomConfig extends Config( class PWMAXI4BoomConfig extends Config(
new WithPWMAXI4BoomTop ++ new WithPWMAXI4BoomRocketTop ++
new BaseBoomConfig) new BaseBoomConfig)
class SimBlockDeviceBoomConfig extends Config( class SimBlockDeviceBoomConfig extends Config(
new WithBlockDevice ++ new WithBlockDevice ++
new WithSimBlockDeviceBoomTop ++ new WithSimBlockDeviceBoomRocketTop ++
new BaseBoomConfig) new BaseBoomConfig)
class BlockDeviceModelBoomConfig extends Config( class BlockDeviceModelBoomConfig extends Config(
new WithBlockDevice ++ new WithBlockDevice ++
new WithBlockDeviceModelBoomTop ++ new WithBlockDeviceModelBoomRocketTop ++
new BaseBoomConfig) 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( class GPIOBoomConfig extends Config(
new WithGPIO ++ new WithGPIO ++
new WithGPIOBoomTop ++ new WithGPIOBoomRocketTop ++
new BaseBoomConfig) 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 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)

View File

@@ -1,15 +1,19 @@
package example package example
import scala.collection.mutable.LinkedHashSet import scala.collection.mutable.LinkedHashSet
import chisel3._ import chisel3._
import chisel3.experimental._ import chisel3.experimental._
import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper} import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper}
import freechips.rocketchip.subsystem.{RocketTilesKey} import freechips.rocketchip.subsystem.{RocketTilesKey}
import freechips.rocketchip.diplomacy.{LazyModule} import freechips.rocketchip.diplomacy.{LazyModule}
import freechips.rocketchip.config.{Field, Parameters} import freechips.rocketchip.config.{Field, Parameters}
import freechips.rocketchip.util.{GeneratorApp} import freechips.rocketchip.util.{GeneratorApp}
import freechips.rocketchip.tile.{XLen} import freechips.rocketchip.tile.{XLen}
import freechips.rocketchip.system.{TestGeneration, RegressionTestSuite} import freechips.rocketchip.system.{TestGeneration, RegressionTestSuite}
import boom.system.{BoomTilesKey, BoomTestSuites} import boom.system.{BoomTilesKey, BoomTestSuites}
object Generator extends GeneratorApp { object Generator extends GeneratorApp {

View File

@@ -2,18 +2,20 @@ package example
import chisel3._ import chisel3._
import chisel3.experimental._ import chisel3.experimental._
import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper} import firrtl.transforms.{BlackBoxResourceAnno, BlackBoxSourceHelper}
import freechips.rocketchip.diplomacy.LazyModule import freechips.rocketchip.diplomacy.LazyModule
import freechips.rocketchip.config.{Field, Parameters} import freechips.rocketchip.config.{Field, Parameters}
import freechips.rocketchip.util.GeneratorApp 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 io = IO(new Bundle {
val success = Output(Bool()) val success = Output(Bool())
}) })
@@ -21,43 +23,7 @@ class RocketTestHarness(implicit val p: Parameters) extends Module {
// force Chisel to rename module // force Chisel to rename module
override def desiredName = "TestHarness" override def desiredName = "TestHarness"
val dut = p(BuildRocketTop)(clock, reset.toBool, p) val dut = p(BuildBoomRocketTop)(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)
dut.debug := DontCare dut.debug := DontCare
dut.connectSimAXIMem() dut.connectSimAXIMem()
dut.connectSimAXIMMIO() dut.connectSimAXIMMIO()

View File

@@ -1,129 +1,69 @@
package example package example
import chisel3._ import chisel3._
import freechips.rocketchip.subsystem._ import freechips.rocketchip.subsystem._
import freechips.rocketchip.system._ import freechips.rocketchip.system._
import freechips.rocketchip.config.Parameters import freechips.rocketchip.config.Parameters
import freechips.rocketchip.devices.tilelink._ import freechips.rocketchip.devices.tilelink._
import freechips.rocketchip.util.DontTouch import freechips.rocketchip.util.DontTouch
import testchipip._ import testchipip._
import sifive.blocks.devices.gpio._ import sifive.blocks.devices.gpio._
// ------------------------ // -------------------------------
// Rocket Top Level Systems // BOOM and/or Rocket Top Level Systems
// ------------------------ // -------------------------------
class RocketTop(implicit p: Parameters) extends ExampleRocketSystem class BoomRocketTop(implicit p: Parameters) extends boom.system.ExampleBoomAndRocketSystem
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
with HasNoDebug with HasNoDebug
with HasPeripherySerial { 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) class BoomRocketTopModule[+L <: BoomRocketTop](l: L) extends boom.system.ExampleBoomAndRocketSystemModule(l)
with HasRTCModuleImp
with HasNoDebugModuleImp with HasNoDebugModuleImp
with HasPeripherySerialModuleImp with HasPeripherySerialModuleImp
with DontTouch with DontTouch
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
class BoomTopWithPWMTL(implicit p: Parameters) extends BoomTop class BoomRocketTopWithPWMTL(implicit p: Parameters) extends BoomRocketTop
with HasPeripheryPWMTL { 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 with HasPeripheryPWMTLModuleImp
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
class BoomTopWithPWMAXI4(implicit p: Parameters) extends BoomTop class BoomRocketTopWithPWMAXI4(implicit p: Parameters) extends BoomRocketTop
with HasPeripheryPWMAXI4 { 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 with HasPeripheryPWMAXI4ModuleImp
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
class BoomTopWithBlockDevice(implicit p: Parameters) extends BoomTop class BoomRocketTopWithBlockDevice(implicit p: Parameters) extends BoomRocketTop
with HasPeripheryBlockDevice { 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 with HasPeripheryBlockDeviceModuleImp
//--------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------
class BoomTopWithGPIO(implicit p: Parameters) extends BoomTop class BoomRocketTopWithGPIO(implicit p: Parameters) extends BoomRocketTop
with HasPeripheryGPIO { with HasPeripheryGPIO {
override lazy val module = new BoomTopWithGPIOModule(this) override lazy val module = new BoomRocketTopWithGPIOModule(this)
} }
class BoomTopWithGPIOModule(l: BoomTopWithGPIO) class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
extends BoomTopModule(l) extends BoomRocketTopModule(l)
with HasPeripheryGPIOModuleImp with HasPeripheryGPIOModuleImp

View File

@@ -29,26 +29,14 @@ SUB_PROJECT ?= example
ifeq ($(SUB_PROJECT),example) ifeq ($(SUB_PROJECT),example)
SBT_PROJECT ?= example SBT_PROJECT ?= example
MODEL ?= RocketTestHarness MODEL ?= BoomRocketTestHarness
VLOG_MODEL ?= TestHarness VLOG_MODEL ?= TestHarness
MODEL_PACKAGE ?= $(SBT_PROJECT) MODEL_PACKAGE ?= $(SBT_PROJECT)
CONFIG ?= DefaultRocketConfig CONFIG ?= DefaultRocketConfig
CONFIG_PACKAGE ?= $(SBT_PROJECT) CONFIG_PACKAGE ?= $(SBT_PROJECT)
GENERATOR_PACKAGE ?= $(SBT_PROJECT) GENERATOR_PACKAGE ?= $(SBT_PROJECT)
TB ?= TestDriver TB ?= TestDriver
TOP ?= RocketTop TOP ?= BoomRocketTop
endif
# for a BOOM based example system
ifeq ($(SUB_PROJECT),boomexample)
SBT_PROJECT ?= example
MODEL ?= BoomTestHarness
VLOG_MODEL ?= TestHarness
MODEL_PACKAGE ?= $(SBT_PROJECT)
CONFIG ?= DefaultBoomConfig
CONFIG_PACKAGE ?= $(SBT_PROJECT)
GENERATOR_PACKAGE ?= $(SBT_PROJECT)
TB ?= TestDriver
TOP ?= BoomTop
endif endif
# for BOOM developers # for BOOM developers
ifeq ($(SUB_PROJECT),boom) ifeq ($(SUB_PROJECT),boom)
@@ -60,7 +48,7 @@ ifeq ($(SUB_PROJECT),boom)
CONFIG_PACKAGE ?= boom.system CONFIG_PACKAGE ?= boom.system
GENERATOR_PACKAGE ?= boom.system GENERATOR_PACKAGE ?= boom.system
TB ?= TestDriver TB ?= TestDriver
TOP ?= ExampleBoomSystem TOP ?= ExampleBoomAndRocketSystem
endif endif
# for Rocket-chip developers # for Rocket-chip developers
ifeq ($(SUB_PROJECT),rocketchip) ifeq ($(SUB_PROJECT),rocketchip)