diff --git a/.circleci/config.yml b/.circleci/config.yml index 50577af7..d2354fde 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -187,7 +187,7 @@ jobs: - run: name: Building the boomrocketexample subproject using Verilator - command: .circleci/do-rtl-build.sh SUB_PROJECT=boomrocketexample CONFIG=SmallDefaultBoomAndRocketConfig + command: .circleci/do-rtl-build.sh SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig no_output_timeout: 120m - save_cache: @@ -351,7 +351,7 @@ 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: @@ -379,7 +379,7 @@ jobs: - run: name: Run boomrocketexample benchmark tests - command: make run-bmark-tests -C sims/verisim SUB_PROJECT=boomexample CONFIG=SmallDefaultBoomAndRocketConfig + command: make run-bmark-tests -C sims/verisim SUB_PROJECT=example CONFIG=SmallDefaultBoomAndRocketConfig boom-run-benchmark-tests: docker: diff --git a/generators/example/src/main/scala/ConfigMixins.scala b/generators/example/src/main/scala/ConfigMixins.scala index 8e8f017b..dbfc1c34 100644 --- a/generators/example/src/main/scala/ConfigMixins.scala +++ b/generators/example/src/main/scala/ConfigMixins.scala @@ -41,72 +41,6 @@ class WithGPIO extends Config((site, here, up) => { GPIOParams(address = 0x10012000, width = 4, includeIOF = false)) }) -// ---------------------------------------- -// Rocket Top Level System Parameter Mixins -// ---------------------------------------- - -/** - * Class to specify a "plain" top level rocket-chip system - */ -class WithNormalRocketTop extends Config((site, here, up) => { - case BuildRocketTop => (clock: Clock, reset: Bool, p: Parameters) => { - Module(LazyModule(new RocketTop()(p)).module) - } -}) - -/** - * Class to specify a top level rocket-chip 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 to specify a top level rocket-chip 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 to specify a top level rocket-chip 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) - top.connectBlockDeviceModel() - top - } -}) - -/** - * Class to specify a top level rocket-chip 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) - top.connectSimBlockDevice(clock, reset) - top - } -}) - -/** - * Class to specify a top level rocket-chip 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 + Rocket Top Level System Parameter Mixins // ----------------------------------------------- diff --git a/generators/example/src/main/scala/Configs.scala b/generators/example/src/main/scala/Configs.scala index ee17916f..98a37bc7 100644 --- a/generators/example/src/main/scala/Configs.scala +++ b/generators/example/src/main/scala/Configs.scala @@ -16,7 +16,7 @@ class BaseRocketConfig extends Config( new freechips.rocketchip.system.DefaultConfig) class DefaultRocketConfig extends Config( - new WithNormalRocketTop ++ + new WithNormalBoomAndRocketTop ++ new BaseRocketConfig) class HwachaConfig extends Config( @@ -28,26 +28,26 @@ class RoccRocketConfig extends Config( new DefaultRocketConfig) class PWMRocketConfig extends Config( - new WithPWMRocketTop ++ + new WithPWMBoomAndRocketTop ++ new BaseRocketConfig) class PWMAXI4RocketConfig extends Config( - new WithPWMAXI4RocketTop ++ + new WithPWMAXI4BoomAndRocketTop ++ new BaseRocketConfig) class SimBlockDeviceRocketConfig extends Config( new WithBlockDevice ++ - new WithSimBlockDeviceRocketTop ++ + new WithSimBlockDeviceBoomAndRocketTop ++ new BaseRocketConfig) class BlockDeviceModelRocketConfig extends Config( new WithBlockDevice ++ - new WithBlockDeviceModelRocketTop ++ + new WithBlockDeviceModelBoomAndRocketTop ++ new BaseRocketConfig) class GPIORocketConfig extends Config( new WithGPIO ++ - new WithGPIORocketTop ++ + new WithGPIOBoomAndRocketTop ++ new BaseRocketConfig) class DualCoreRocketConfig extends Config( diff --git a/generators/example/src/main/scala/Generator.scala b/generators/example/src/main/scala/Generator.scala index 3a1300b4..c5df8cb1 100644 --- a/generators/example/src/main/scala/Generator.scala +++ b/generators/example/src/main/scala/Generator.scala @@ -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 { diff --git a/generators/example/src/main/scala/TestHarness.scala b/generators/example/src/main/scala/TestHarness.scala index 3d488c1c..7bad5cbc 100644 --- a/generators/example/src/main/scala/TestHarness.scala +++ b/generators/example/src/main/scala/TestHarness.scala @@ -2,47 +2,13 @@ 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 -// ------------------- - -case object BuildRocketTop extends Field[(Clock, Bool, Parameters) => RocketTopModule[RocketTop]] - -class RocketTestHarness(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(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 + Rocket Test Harness // -------------------------- diff --git a/generators/example/src/main/scala/Top.scala b/generators/example/src/main/scala/Top.scala index 59493492..ddd4a20f 100644 --- a/generators/example/src/main/scala/Top.scala +++ b/generators/example/src/main/scala/Top.scala @@ -1,76 +1,17 @@ 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 -// ------------------------ - -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 + Rocket Top Level Systems // ------------------------------- diff --git a/variables.mk b/variables.mk index 16e69d02..f73d7f7a 100644 --- a/variables.mk +++ b/variables.mk @@ -29,37 +29,13 @@ SUB_PROJECT ?= example ifeq ($(SUB_PROJECT),example) SBT_PROJECT ?= example - MODEL ?= RocketTestHarness + MODEL ?= BoomAndRocketTestHarness 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 ?= BoomAndRocketTestHarness - VLOG_MODEL ?= TestHarness - MODEL_PACKAGE ?= $(SBT_PROJECT) - CONFIG ?= DefaultBoomConfig - CONFIG_PACKAGE ?= $(SBT_PROJECT) - GENERATOR_PACKAGE ?= $(SBT_PROJECT) - TB ?= TestDriver - TOP ?= BoomAndRocketTop -endif -# for a BOOM + Rocket based example system -ifeq ($(SUB_PROJECT),boomrocketexample) - SBT_PROJECT ?= example - MODEL ?= BoomAndRocketTestHarness - VLOG_MODEL ?= TestHarness - MODEL_PACKAGE ?= $(SBT_PROJECT) - CONFIG ?= DefaultBoomAndRocketConfig - CONFIG_PACKAGE ?= $(SBT_PROJECT) - GENERATOR_PACKAGE ?= $(SBT_PROJECT) - TB ?= TestDriver TOP ?= BoomAndRocketTop endif # for BOOM developers