shared heter-subsystem | single example SUB_PROJECT
This commit is contained in:
@@ -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:
|
||||||
@@ -187,7 +187,7 @@ jobs:
|
|||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Building the boomrocketexample subproject using Verilator
|
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
|
no_output_timeout: 120m
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
@@ -351,7 +351,7 @@ 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:
|
boomrocketexample-run-benchmark-tests:
|
||||||
docker:
|
docker:
|
||||||
@@ -379,7 +379,7 @@ jobs:
|
|||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Run boomrocketexample benchmark tests
|
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:
|
boom-run-benchmark-tests:
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
@@ -41,72 +41,6 @@ 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
|
|
||||||
// ----------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
// BOOM + Rocket Top Level System Parameter Mixins
|
||||||
// -----------------------------------------------
|
// -----------------------------------------------
|
||||||
|
|||||||
@@ -16,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 WithNormalBoomAndRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class HwachaConfig extends Config(
|
class HwachaConfig extends Config(
|
||||||
@@ -28,26 +28,26 @@ class RoccRocketConfig extends Config(
|
|||||||
new DefaultRocketConfig)
|
new DefaultRocketConfig)
|
||||||
|
|
||||||
class PWMRocketConfig extends Config(
|
class PWMRocketConfig extends Config(
|
||||||
new WithPWMRocketTop ++
|
new WithPWMBoomAndRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class PWMAXI4RocketConfig extends Config(
|
class PWMAXI4RocketConfig extends Config(
|
||||||
new WithPWMAXI4RocketTop ++
|
new WithPWMAXI4BoomAndRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class SimBlockDeviceRocketConfig extends Config(
|
class SimBlockDeviceRocketConfig extends Config(
|
||||||
new WithBlockDevice ++
|
new WithBlockDevice ++
|
||||||
new WithSimBlockDeviceRocketTop ++
|
new WithSimBlockDeviceBoomAndRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class BlockDeviceModelRocketConfig extends Config(
|
class BlockDeviceModelRocketConfig extends Config(
|
||||||
new WithBlockDevice ++
|
new WithBlockDevice ++
|
||||||
new WithBlockDeviceModelRocketTop ++
|
new WithBlockDeviceModelBoomAndRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class GPIORocketConfig extends Config(
|
class GPIORocketConfig extends Config(
|
||||||
new WithGPIO ++
|
new WithGPIO ++
|
||||||
new WithGPIORocketTop ++
|
new WithGPIOBoomAndRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class DualCoreRocketConfig extends Config(
|
class DualCoreRocketConfig extends Config(
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -2,47 +2,13 @@ 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
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
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
|
// BOOM + Rocket Test Harness
|
||||||
// --------------------------
|
// --------------------------
|
||||||
|
|||||||
@@ -1,76 +1,17 @@
|
|||||||
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
|
|
||||||
// ------------------------
|
|
||||||
|
|
||||||
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
|
// BOOM + Rocket Top Level Systems
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
|
|||||||
26
variables.mk
26
variables.mk
@@ -29,37 +29,13 @@ SUB_PROJECT ?= example
|
|||||||
|
|
||||||
ifeq ($(SUB_PROJECT),example)
|
ifeq ($(SUB_PROJECT),example)
|
||||||
SBT_PROJECT ?= example
|
SBT_PROJECT ?= example
|
||||||
MODEL ?= RocketTestHarness
|
MODEL ?= BoomAndRocketTestHarness
|
||||||
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
|
|
||||||
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
|
TOP ?= BoomAndRocketTop
|
||||||
endif
|
endif
|
||||||
# for BOOM developers
|
# for BOOM developers
|
||||||
|
|||||||
Reference in New Issue
Block a user