working heterogenous cores
This commit is contained in:
parent
8b3fef85ce
commit
cae63ad13f
|
@ -1,14 +1,20 @@
|
|||
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.subsystem.{RocketTilesKey, WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32}
|
||||
import freechips.rocketchip.diplomacy.{LazyModule, ValName}
|
||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||
import freechips.rocketchip.tile.{XLen}
|
||||
import freechips.rocketchip.tile.{XLen, MaxHartIdBits}
|
||||
|
||||
import testchipip._
|
||||
|
||||
import sifive.blocks.devices.gpio._
|
||||
|
||||
import boom.system.{BoomTilesKey}
|
||||
|
||||
/**
|
||||
* TODO: Why do we need this?
|
||||
*/
|
||||
|
@ -234,3 +240,19 @@ class WithGPIOBoomAndRocketTop extends Config((site, here, up) => {
|
|||
top
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Class to renumber BOOM + Rocket harts so that there are no overlapped harts
|
||||
* This mixin assumes Rocket tiles are numbered before BOOM tiles
|
||||
* Also makes support for multiple harts depend on Rocket + BOOM
|
||||
* Note: Must come after all harts are assigned for it to apply
|
||||
*/
|
||||
class WithRenumberHarts extends Config((site, here, up) => {
|
||||
case RocketTilesKey => up(RocketTilesKey, site).zipWithIndex map { case (r, i) =>
|
||||
r.copy(hartId = i)
|
||||
}
|
||||
case BoomTilesKey => up(BoomTilesKey, site).zipWithIndex map { case (b, i) =>
|
||||
b.copy(hartId = i + up(RocketTilesKey, site).length)
|
||||
}
|
||||
case MaxHartIdBits => log2Up(up(BoomTilesKey, site).size + up(RocketTilesKey, site).size)
|
||||
})
|
||||
|
|
|
@ -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._
|
||||
|
||||
// --------------
|
||||
|
@ -43,6 +45,11 @@ class BlockDeviceModelRocketConfig extends Config(
|
|||
new WithBlockDeviceModelRocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class GPIORocketConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIORocketTop ++
|
||||
new BaseRocketConfig)
|
||||
|
||||
class DualCoreRocketConfig extends Config(
|
||||
new WithNBigCores(2) ++
|
||||
new DefaultRocketConfig)
|
||||
|
@ -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)
|
||||
|
@ -106,6 +108,11 @@ class BlockDeviceModelBoomConfig extends Config(
|
|||
new WithBlockDeviceModelBoomTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
class GPIOBoomConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIOBoomTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
/**
|
||||
* Slightly different looking configs since we need to override
|
||||
* the `WithNBoomCores` with the DefaultBoomConfig params
|
||||
|
@ -129,48 +136,18 @@ class DualCoreSmallBoomConfig extends Config(
|
|||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class RV32BoomConfig extends Config(
|
||||
class RV32UnifiedBoomConfig extends Config(
|
||||
new WithNormalBoomTop ++
|
||||
new WithBootROM ++
|
||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
||||
|
||||
class GPIOBoomConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIOBoomTop ++
|
||||
new BaseBoomConfig)
|
||||
|
||||
// ---------------------
|
||||
// BOOM + Rocket Configs
|
||||
// ---------------------
|
||||
|
||||
//class BaseRocketConfig extends Config(
|
||||
// new WithBootROM ++
|
||||
// new freechips.rocketchip.system.DefaultConfig)
|
||||
//
|
||||
//class DefaultRocketConfig extends Config(
|
||||
// new WithNormalRocketTop ++
|
||||
// new BaseRocketConfig)
|
||||
//
|
||||
//class BaseConfig extends Config(
|
||||
// new WithDefaultMemPort() ++
|
||||
// new WithDefaultMMIOPort() ++
|
||||
// new WithDefaultSlavePort() ++
|
||||
// new WithTimebase(BigInt(1000000)) ++ // 1 MHz
|
||||
// new WithDTS("freechips,rocketchip-unknown", Nil) ++
|
||||
// new WithNExtTopInterrupts(2) ++
|
||||
// new BaseSubsystemConfig()
|
||||
//)
|
||||
//
|
||||
//class DefaultConfig extends Config(new WithNBigCores(1) ++ new BaseConfig)
|
||||
//
|
||||
////boom
|
||||
// new WithRVC ++
|
||||
// new DefaultBoomConfig ++
|
||||
// new WithNBoomCores(1) ++
|
||||
// new WithoutTLMonitors ++
|
||||
// new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class BaseBoomAndRocketConfig extends Config(
|
||||
new WithBootROM ++
|
||||
new WithRenumberHarts ++
|
||||
new boom.common.WithRVC ++
|
||||
new boom.common.DefaultBoomConfig ++
|
||||
new boom.system.WithNBoomCores(1) ++
|
||||
|
@ -178,15 +155,16 @@ class BaseBoomAndRocketConfig extends Config(
|
|||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
//class BaseBoomAndRocketConfig extends Config(
|
||||
// new WithBootROM ++
|
||||
// new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
// new boom.system.BoomConfig)
|
||||
|
||||
class SmallBaseBoomAndRocketConfig extends Config(
|
||||
new WithBootROM ++
|
||||
new 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 boom.system.SmallBoomConfig)
|
||||
new freechips.rocketchip.system.BaseConfig)
|
||||
|
||||
class DefaultBoomAndRocketConfig extends Config(
|
||||
new WithNormalBoomAndRocketTop ++
|
||||
|
@ -222,16 +200,31 @@ class BlockDeviceModelBoomAndRocketConfig extends Config(
|
|||
new WithBlockDeviceModelBoomAndRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class DualCoreBoomAndOneRocketConfig extends Config(
|
||||
// Core gets tacked onto existing list
|
||||
new boom.system.WithNBoomCores(2) ++
|
||||
new DefaultBoomAndRocketConfig)
|
||||
|
||||
class RV32BoomAndNormalRocketConfig extends Config(
|
||||
new WithBootROM ++
|
||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
||||
|
||||
class GPIOBoomAndRocketConfig extends Config(
|
||||
new WithGPIO ++
|
||||
new WithGPIOBoomAndRocketTop ++
|
||||
new BaseBoomAndRocketConfig)
|
||||
|
||||
class DualCoreBoomAndOneRocketConfig extends Config(
|
||||
new WithNormalBoomAndRocketTop ++
|
||||
new WithBootROM ++
|
||||
new 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 WithNormalBoomAndRocketTop ++
|
||||
new WithBootROM ++
|
||||
new 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)
|
||||
|
|
Loading…
Reference in New Issue