Merge pull request #92 from ucb-bar/rebar-dev-heter-multicore
Add support for heterogenous SoCs (BOOM + Hwacha)
This commit is contained in:
commit
45cacd526f
|
@ -153,7 +153,7 @@ jobs:
|
|||
|
||||
- run:
|
||||
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
|
||||
|
||||
- save_cache:
|
||||
|
@ -161,6 +161,40 @@ jobs:
|
|||
paths:
|
||||
- "/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:
|
||||
docker:
|
||||
- image: riscvboom/riscvboom-images:0.0.5
|
||||
|
@ -317,7 +351,35 @@ jobs:
|
|||
|
||||
- run:
|
||||
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:
|
||||
docker:
|
||||
|
@ -427,6 +489,11 @@ workflows:
|
|||
- install-riscv-toolchain
|
||||
- install-verilator
|
||||
|
||||
- prepare-boomrocketexample:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- install-verilator
|
||||
|
||||
- prepare-boom:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
|
@ -456,6 +523,11 @@ workflows:
|
|||
- install-riscv-toolchain
|
||||
- prepare-boomexample
|
||||
|
||||
- boomrocketexample-run-benchmark-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
- prepare-boomrocketexample
|
||||
|
||||
- boom-run-benchmark-tests:
|
||||
requires:
|
||||
- install-riscv-toolchain
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8d3162cbbe6f0db19a39a2f22226ab9eb6edea31
|
||||
Subproject commit 92313af2a0ed4d8a93591a08f42ede1a0ffd808a
|
|
@ -1,12 +1,16 @@
|
|||
package example
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util.{log2Up}
|
||||
|
||||
import freechips.rocketchip.config.{Parameters, Config}
|
||||
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32}
|
||||
import freechips.rocketchip.diplomacy.{LazyModule, ValName}
|
||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||
import freechips.rocketchip.tile.{XLen}
|
||||
|
||||
import testchipip._
|
||||
|
||||
import sifive.blocks.devices.gpio._
|
||||
|
||||
/**
|
||||
|
@ -37,129 +41,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)
|
||||
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)
|
||||
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
|
||||
|
|
|
@ -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,140 @@ 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 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
|
||||
|
|
18
variables.mk
18
variables.mk
|
@ -29,26 +29,14 @@ SUB_PROJECT ?= example
|
|||
|
||||
ifeq ($(SUB_PROJECT),example)
|
||||
SBT_PROJECT ?= example
|
||||
MODEL ?= RocketTestHarness
|
||||
MODEL ?= BoomRocketTestHarness
|
||||
VLOG_MODEL ?= TestHarness
|
||||
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
||||
CONFIG ?= DefaultRocketConfig
|
||||
CONFIG_PACKAGE ?= $(SBT_PROJECT)
|
||||
GENERATOR_PACKAGE ?= $(SBT_PROJECT)
|
||||
TB ?= TestDriver
|
||||
TOP ?= RocketTop
|
||||
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
|
||||
TOP ?= BoomRocketTop
|
||||
endif
|
||||
# for BOOM developers
|
||||
ifeq ($(SUB_PROJECT),boom)
|
||||
|
@ -60,7 +48,7 @@ ifeq ($(SUB_PROJECT),boom)
|
|||
CONFIG_PACKAGE ?= boom.system
|
||||
GENERATOR_PACKAGE ?= boom.system
|
||||
TB ?= TestDriver
|
||||
TOP ?= ExampleBoomSystem
|
||||
TOP ?= ExampleBoomAndRocketSystem
|
||||
endif
|
||||
# for Rocket-chip developers
|
||||
ifeq ($(SUB_PROJECT),rocketchip)
|
||||
|
|
Loading…
Reference in New Issue