working heterogenous cores
This commit is contained in:
@@ -1,14 +1,20 @@
|
|||||||
package example
|
package example
|
||||||
|
|
||||||
import chisel3._
|
import chisel3._
|
||||||
|
import chisel3.util.{log2Up}
|
||||||
|
|
||||||
import freechips.rocketchip.config.{Parameters, Config}
|
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.diplomacy.{LazyModule, ValName}
|
||||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||||
import freechips.rocketchip.tile.{XLen}
|
import freechips.rocketchip.tile.{XLen, MaxHartIdBits}
|
||||||
|
|
||||||
import testchipip._
|
import testchipip._
|
||||||
|
|
||||||
import sifive.blocks.devices.gpio._
|
import sifive.blocks.devices.gpio._
|
||||||
|
|
||||||
|
import boom.system.{BoomTilesKey}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Why do we need this?
|
* TODO: Why do we need this?
|
||||||
*/
|
*/
|
||||||
@@ -234,3 +240,19 @@ class WithGPIOBoomAndRocketTop extends Config((site, here, up) => {
|
|||||||
top
|
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
|
package example
|
||||||
|
|
||||||
import chisel3._
|
import chisel3._
|
||||||
|
|
||||||
import freechips.rocketchip.config.{Config}
|
import freechips.rocketchip.config.{Config}
|
||||||
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32, WithExtMemSize, WithNBanks}
|
import freechips.rocketchip.subsystem.{WithRoccExample, WithNMemoryChannels, WithNBigCores, WithRV32, WithExtMemSize, WithNBanks}
|
||||||
|
|
||||||
import testchipip._
|
import testchipip._
|
||||||
|
|
||||||
// --------------
|
// --------------
|
||||||
@@ -43,6 +45,11 @@ class BlockDeviceModelRocketConfig extends Config(
|
|||||||
new WithBlockDeviceModelRocketTop ++
|
new WithBlockDeviceModelRocketTop ++
|
||||||
new BaseRocketConfig)
|
new BaseRocketConfig)
|
||||||
|
|
||||||
|
class GPIORocketConfig extends Config(
|
||||||
|
new WithGPIO ++
|
||||||
|
new WithGPIORocketTop ++
|
||||||
|
new BaseRocketConfig)
|
||||||
|
|
||||||
class DualCoreRocketConfig extends Config(
|
class DualCoreRocketConfig extends Config(
|
||||||
new WithNBigCores(2) ++
|
new WithNBigCores(2) ++
|
||||||
new DefaultRocketConfig)
|
new DefaultRocketConfig)
|
||||||
@@ -51,11 +58,6 @@ class RV32RocketConfig extends Config(
|
|||||||
new WithRV32 ++
|
new WithRV32 ++
|
||||||
new DefaultRocketConfig)
|
new DefaultRocketConfig)
|
||||||
|
|
||||||
class GPIORocketConfig extends Config(
|
|
||||||
new WithGPIO ++
|
|
||||||
new WithGPIORocketTop ++
|
|
||||||
new BaseRocketConfig)
|
|
||||||
|
|
||||||
class GB1MemoryConfig extends Config(
|
class GB1MemoryConfig extends Config(
|
||||||
new WithExtMemSize((1<<30) * 1L) ++
|
new WithExtMemSize((1<<30) * 1L) ++
|
||||||
new DefaultRocketConfig)
|
new DefaultRocketConfig)
|
||||||
@@ -106,6 +108,11 @@ class BlockDeviceModelBoomConfig extends Config(
|
|||||||
new WithBlockDeviceModelBoomTop ++
|
new WithBlockDeviceModelBoomTop ++
|
||||||
new BaseBoomConfig)
|
new BaseBoomConfig)
|
||||||
|
|
||||||
|
class GPIOBoomConfig extends Config(
|
||||||
|
new WithGPIO ++
|
||||||
|
new WithGPIOBoomTop ++
|
||||||
|
new BaseBoomConfig)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Slightly different looking configs since we need to override
|
* Slightly different looking configs since we need to override
|
||||||
* the `WithNBoomCores` with the DefaultBoomConfig params
|
* the `WithNBoomCores` with the DefaultBoomConfig params
|
||||||
@@ -129,48 +136,18 @@ class DualCoreSmallBoomConfig extends Config(
|
|||||||
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
new freechips.rocketchip.subsystem.WithoutTLMonitors ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class RV32BoomConfig extends Config(
|
class RV32UnifiedBoomConfig extends Config(
|
||||||
|
new WithNormalBoomTop ++
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
new boom.system.SmallRV32UnifiedBoomConfig)
|
new boom.system.SmallRV32UnifiedBoomConfig)
|
||||||
|
|
||||||
class GPIOBoomConfig extends Config(
|
|
||||||
new WithGPIO ++
|
|
||||||
new WithGPIOBoomTop ++
|
|
||||||
new BaseBoomConfig)
|
|
||||||
|
|
||||||
// ---------------------
|
// ---------------------
|
||||||
// BOOM + Rocket Configs
|
// 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(
|
class BaseBoomAndRocketConfig extends Config(
|
||||||
new WithBootROM ++
|
new WithBootROM ++
|
||||||
|
new WithRenumberHarts ++
|
||||||
new boom.common.WithRVC ++
|
new boom.common.WithRVC ++
|
||||||
new boom.common.DefaultBoomConfig ++
|
new boom.common.DefaultBoomConfig ++
|
||||||
new boom.system.WithNBoomCores(1) ++
|
new boom.system.WithNBoomCores(1) ++
|
||||||
@@ -178,15 +155,16 @@ class BaseBoomAndRocketConfig extends Config(
|
|||||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new freechips.rocketchip.system.BaseConfig)
|
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(
|
class SmallBaseBoomAndRocketConfig extends Config(
|
||||||
new WithBootROM ++
|
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 freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||||
new boom.system.SmallBoomConfig)
|
new freechips.rocketchip.system.BaseConfig)
|
||||||
|
|
||||||
class DefaultBoomAndRocketConfig extends Config(
|
class DefaultBoomAndRocketConfig extends Config(
|
||||||
new WithNormalBoomAndRocketTop ++
|
new WithNormalBoomAndRocketTop ++
|
||||||
@@ -222,16 +200,31 @@ class BlockDeviceModelBoomAndRocketConfig extends Config(
|
|||||||
new WithBlockDeviceModelBoomAndRocketTop ++
|
new WithBlockDeviceModelBoomAndRocketTop ++
|
||||||
new BaseBoomAndRocketConfig)
|
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(
|
class GPIOBoomAndRocketConfig extends Config(
|
||||||
new WithGPIO ++
|
new WithGPIO ++
|
||||||
new WithGPIOBoomAndRocketTop ++
|
new WithGPIOBoomAndRocketTop ++
|
||||||
new BaseBoomAndRocketConfig)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user