move boom integration to chipyard
This commit is contained in:
Submodule generators/boom updated: 51bfc070e8...962e94674e
97
generators/example/src/main/scala/BoomConfigs.scala
Normal file
97
generators/example/src/main/scala/BoomConfigs.scala
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
//******************************************************************************
|
||||||
|
// Copyright (c) 2015 - 2019, The Regents of the University of California (Regents).
|
||||||
|
// All Rights Reserved. See LICENSE and LICENSE.SiFive for license details.
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Author: Christopher Celio, Abraham Gonzalez, Ben Korpan, Jerry Zhao
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package example
|
||||||
|
|
||||||
|
import chisel3._
|
||||||
|
|
||||||
|
import freechips.rocketchip.config.{Config}
|
||||||
|
import freechips.rocketchip.subsystem.{WithJtagDTM}
|
||||||
|
|
||||||
|
import boom.common._
|
||||||
|
|
||||||
|
// ---------------------
|
||||||
|
// BOOM Configs
|
||||||
|
// ---------------------
|
||||||
|
|
||||||
|
class SmallBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
|
class MediumBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.MediumBoomConfig)
|
||||||
|
|
||||||
|
class LargeBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.LargeBoomConfig)
|
||||||
|
|
||||||
|
class MegaBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.MegaBoomConfig)
|
||||||
|
|
||||||
|
class jtagSmallBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
|
class jtagMediumBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.MediumBoomConfig)
|
||||||
|
|
||||||
|
class jtagLargeBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.LargeBoomConfig)
|
||||||
|
|
||||||
|
class jtagMegaBoomConfig extends Config(
|
||||||
|
new WithDTMBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new WithJtagDTM ++
|
||||||
|
new boom.common.MegaBoomConfig)
|
||||||
|
|
||||||
|
class SmallDualBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallDualBoomConfig)
|
||||||
|
|
||||||
|
class TracedSmallBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.TracedSmallBoomConfig)
|
||||||
|
|
||||||
|
class SmallRV32UnifiedBoomConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallRV32UnifiedBoomConfig)
|
||||||
|
|
||||||
|
// --------------------------
|
||||||
|
// BOOM + Rocket Configs
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
class SmallBoomAndRocketConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.SmallBoomAndRocketConfig)
|
||||||
|
|
||||||
|
class MediumBoomAndRocketConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.MediumBoomAndRocketConfig)
|
||||||
|
|
||||||
|
class DualMediumBoomAndDualRocketConfig extends Config(
|
||||||
|
new WithNormalBoomRocketTop ++
|
||||||
|
new WithBootROM ++
|
||||||
|
new boom.common.DualMediumBoomAndDualRocketConfig)
|
||||||
@@ -58,6 +58,15 @@ class WithNormalBoomRocketTop extends Config((site, here, up) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to specify a top level BOOM and/or Rocket system with DTM
|
||||||
|
*/
|
||||||
|
class WithDTMBoomRocketTop extends Config((site, here, up) => {
|
||||||
|
case BuildBoomRocketTopWithDTM => (clock: Clock, reset: Bool, p: Parameters) => {
|
||||||
|
Module(LazyModule(new BoomRocketTopWithDTM()(p)).module)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to specify a top level BOOM and/or Rocket system with PWM
|
* Class to specify a top level BOOM and/or Rocket system with PWM
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ class HwachaL2Config extends Config(
|
|||||||
|
|
||||||
class BaseBoomConfig extends Config(
|
class BaseBoomConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.LargeBoomConfig)
|
new boom.common.LargeBoomConfig)
|
||||||
|
|
||||||
class SmallBaseBoomConfig extends Config(
|
class SmallBaseBoomConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.SmallBoomConfig)
|
new boom.common.SmallBoomConfig)
|
||||||
|
|
||||||
class DefaultBoomConfig extends Config(
|
class DefaultBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
@@ -132,7 +132,7 @@ class DualCoreBoomConfig extends Config(
|
|||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
@@ -142,14 +142,14 @@ class DualCoreSmallBoomConfig extends Config(
|
|||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithSmallBooms ++
|
new boom.common.WithSmallBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class RV32UnifiedBoomConfig extends Config(
|
class RV32UnifiedBoomConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
new boom.common.SmallRV32UnifiedBoomConfig)
|
||||||
|
|
||||||
class BoomL2Config extends Config(
|
class BoomL2Config extends Config(
|
||||||
new WithInclusiveCache ++
|
new WithInclusiveCache ++
|
||||||
@@ -161,22 +161,22 @@ class BoomL2Config extends Config(
|
|||||||
|
|
||||||
class BaseBoomAndRocketConfig extends Config(
|
class BaseBoomAndRocketConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.common.WithNBoomCores(1) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class SmallBaseBoomAndRocketConfig extends Config(
|
class SmallBaseBoomAndRocketConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithSmallBooms ++
|
new boom.common.WithSmallBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.common.WithNBoomCores(1) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -223,11 +223,11 @@ class GPIOBoomAndRocketConfig extends Config(
|
|||||||
class DualCoreBoomAndOneRocketConfig extends Config(
|
class DualCoreBoomAndOneRocketConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -237,12 +237,12 @@ class DualBoomAndOneHwachaRocketConfig extends Config(
|
|||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new WithMultiRoCC ++
|
new WithMultiRoCC ++
|
||||||
new WithMultiRoCCHwacha(0) ++ // put Hwacha just on hart0 which was renumbered to Rocket
|
new WithMultiRoCCHwacha(0) ++ // put Hwacha just on hart0 which was renumbered to Rocket
|
||||||
new boom.system.WithRenumberHarts(rocketFirst = true) ++
|
new boom.common.WithRenumberHarts(rocketFirst = true) ++
|
||||||
new hwacha.DefaultHwachaConfig ++
|
new hwacha.DefaultHwachaConfig ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(2) ++
|
new boom.common.WithNBoomCores(2) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
@@ -250,12 +250,12 @@ class DualBoomAndOneHwachaRocketConfig extends Config(
|
|||||||
class RV32BoomAndRocketConfig extends Config(
|
class RV32BoomAndRocketConfig extends Config(
|
||||||
new WithNormalBoomRocketTop ++
|
new WithNormalBoomRocketTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.WithRenumberHarts ++
|
new boom.common.WithRenumberHarts ++
|
||||||
new boom.common.WithBoomRV32 ++
|
new boom.common.WithBoomRV32 ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.WithLargeBooms ++
|
new boom.common.WithLargeBooms ++
|
||||||
new boom.common.BaseBoomConfig ++
|
new boom.common.BaseBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.common.WithNBoomCores(1) ++
|
||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.subsystem.WithRV32 ++
|
new freechips.rocketchip.subsystem.WithRV32 ++
|
||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
|
|||||||
@@ -8,14 +8,19 @@ 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
|
||||||
|
import freechips.rocketchip.devices.debug.{Debug}
|
||||||
|
|
||||||
// --------------------------
|
// -------------------------------
|
||||||
// BOOM and/or Rocket Test Harness
|
// BOOM and/or Rocket Test Harness
|
||||||
// --------------------------
|
// -------------------------------
|
||||||
|
|
||||||
case object BuildBoomRocketTop extends Field[(Clock, Bool, Parameters) => BoomRocketTopModule[BoomRocketTop]]
|
case object BuildBoomRocketTop extends Field[(Clock, Bool, Parameters) => BoomRocketTopModule[BoomRocketTop]]
|
||||||
|
case object BuildBoomRocketTopWithDTM extends Field[(Clock, Bool, Parameters) => BoomRocketTopWithDTMModule[BoomRocketTopWithDTM]]
|
||||||
|
|
||||||
class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
/**
|
||||||
|
* Test harness using TSI to bringup the system
|
||||||
|
*/
|
||||||
|
class TestHarness(implicit val p: Parameters) extends Module {
|
||||||
val io = IO(new Bundle {
|
val io = IO(new Bundle {
|
||||||
val success = Output(Bool())
|
val success = Output(Bool())
|
||||||
})
|
})
|
||||||
@@ -24,6 +29,7 @@ class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
|||||||
override def desiredName = "TestHarness"
|
override def desiredName = "TestHarness"
|
||||||
|
|
||||||
val dut = p(BuildBoomRocketTop)(clock, reset.toBool, p)
|
val dut = p(BuildBoomRocketTop)(clock, reset.toBool, p)
|
||||||
|
|
||||||
dut.debug := DontCare
|
dut.debug := DontCare
|
||||||
dut.connectSimAXIMem()
|
dut.connectSimAXIMem()
|
||||||
dut.connectSimAXIMMIO()
|
dut.connectSimAXIMMIO()
|
||||||
@@ -41,5 +47,41 @@ class BoomRocketTestHarness(implicit val p: Parameters) extends Module {
|
|||||||
axi.w.bits := DontCare
|
axi.w.bits := DontCare
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
io.success := dut.connectSimSerial()
|
io.success := dut.connectSimSerial()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test harness using the Debug Test Module (DTM) to bringup the system
|
||||||
|
*/
|
||||||
|
class TestHarnessWithDTM(implicit 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(BuildBoomRocketTopWithDTM)(clock, reset.toBool, p)
|
||||||
|
|
||||||
|
dut.reset := reset.asBool | dut.debug.ndreset
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Debug.connectDebug(dut.debug, clock, reset.asBool, io.success)
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import testchipip._
|
|||||||
|
|
||||||
import sifive.blocks.devices.gpio._
|
import sifive.blocks.devices.gpio._
|
||||||
|
|
||||||
// -------------------------------
|
// ------------------------------------
|
||||||
// BOOM and/or Rocket Top Level Systems
|
// BOOM and/or Rocket Top Level Systems
|
||||||
// -------------------------------
|
// ------------------------------------
|
||||||
|
|
||||||
class BoomRocketTop(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
class BoomRocketTop(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
||||||
with HasNoDebug
|
with HasNoDebug
|
||||||
@@ -67,3 +67,12 @@ class BoomRocketTopWithGPIO(implicit p: Parameters) extends BoomRocketTop
|
|||||||
class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
|
class BoomRocketTopWithGPIOModule(l: BoomRocketTopWithGPIO)
|
||||||
extends BoomRocketTopModule(l)
|
extends BoomRocketTopModule(l)
|
||||||
with HasPeripheryGPIOModuleImp
|
with HasPeripheryGPIOModuleImp
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class BoomRocketTopWithDTM(implicit p: Parameters) extends boom.system.BoomRocketSystem
|
||||||
|
{
|
||||||
|
override lazy val module = new BoomRocketTopWithDTMModule(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
class BoomRocketTopWithDTMModule[+L <: BoomRocketTopWithDTM](l: L) extends boom.system.BoomRocketSystemModule(l)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ SUB_PROJECT ?= example
|
|||||||
|
|
||||||
ifeq ($(SUB_PROJECT),example)
|
ifeq ($(SUB_PROJECT),example)
|
||||||
SBT_PROJECT ?= example
|
SBT_PROJECT ?= example
|
||||||
MODEL ?= BoomRocketTestHarness
|
MODEL ?= TestHarness
|
||||||
VLOG_MODEL ?= TestHarness
|
VLOG_MODEL ?= TestHarness
|
||||||
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
MODEL_PACKAGE ?= $(SBT_PROJECT)
|
||||||
CONFIG ?= DefaultRocketConfig
|
CONFIG ?= DefaultRocketConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user