mirror of
https://github.com/SpinalHDL/VexRiscv.git
synced 2025-01-03 03:43:39 -05:00
Litex cluster can now set cache layout
This commit is contained in:
parent
9f62f37538
commit
15bda15bc9
2 changed files with 23 additions and 6 deletions
|
@ -126,8 +126,13 @@ object VexRiscvSmpClusterGen {
|
|||
resetVector : Long = 0x80000000l,
|
||||
iBusWidth : Int = 128,
|
||||
dBusWidth : Int = 64,
|
||||
coherency : Boolean = true) = {
|
||||
|
||||
coherency : Boolean = true,
|
||||
iCacheSize : Int = 8192,
|
||||
dCacheSize : Int = 8192,
|
||||
iCacheWays : Int = 2,
|
||||
dCacheWays : Int = 2) = {
|
||||
assert(iCacheSize/iCacheWays <= 4096, "Instruction cache ways can't be bigger than 4096 bytes")
|
||||
assert(dCacheSize/dCacheWays <= 4096, "Data cache ways can't be bigger than 4096 bytes")
|
||||
val config = VexRiscvConfig(
|
||||
plugins = List(
|
||||
new MmuPlugin(
|
||||
|
@ -143,9 +148,9 @@ object VexRiscvSmpClusterGen {
|
|||
injectorStage = false,
|
||||
relaxedPcCalculation = false,
|
||||
config = InstructionCacheConfig(
|
||||
cacheSize = 4096*2,
|
||||
cacheSize = iCacheSize,
|
||||
bytePerLine = 64,
|
||||
wayCount = 2,
|
||||
wayCount = iCacheWays,
|
||||
addressWidth = 32,
|
||||
cpuDataWidth = 32,
|
||||
memDataWidth = iBusWidth,
|
||||
|
@ -169,9 +174,9 @@ object VexRiscvSmpClusterGen {
|
|||
dBusRspSlavePipe = true,
|
||||
relaxedMemoryTranslationRegister = true,
|
||||
config = new DataCacheConfig(
|
||||
cacheSize = 4096*2,
|
||||
cacheSize = dCacheSize,
|
||||
bytePerLine = 64,
|
||||
wayCount = 2,
|
||||
wayCount = dCacheWays,
|
||||
addressWidth = 32,
|
||||
cpuDataWidth = 32,
|
||||
memDataWidth = dBusWidth,
|
||||
|
|
|
@ -59,6 +59,10 @@ object VexRiscvLitexSmpClusterCmdGen extends App {
|
|||
var cpuCount = 1
|
||||
var iBusWidth = 64
|
||||
var dBusWidth = 64
|
||||
var iCacheSize = 8192
|
||||
var dCacheSize = 8192
|
||||
var iCacheWays = 2
|
||||
var dCacheWays = 2
|
||||
var liteDramWidth = 128
|
||||
var coherentDma = false
|
||||
var netlistDirectory = "."
|
||||
|
@ -69,6 +73,10 @@ object VexRiscvLitexSmpClusterCmdGen extends App {
|
|||
opt[String]("cpu-count") action { (v, c) => cpuCount = v.toInt }
|
||||
opt[String]("ibus-width") action { (v, c) => iBusWidth = v.toInt }
|
||||
opt[String]("dbus-width") action { (v, c) => dBusWidth = v.toInt }
|
||||
opt[String]("icache-size") action { (v, c) => iCacheSize = v.toInt }
|
||||
opt[String]("dcache-size") action { (v, c) => dCacheSize = v.toInt }
|
||||
opt[String]("icache-ways") action { (v, c) => iCacheWays = v.toInt }
|
||||
opt[String]("dcache-ways") action { (v, c) => dCacheWays = v.toInt }
|
||||
opt[String]("litedram-width") action { (v, c) => liteDramWidth = v.toInt }
|
||||
opt[String]("netlist-directory") action { (v, c) => netlistDirectory = v }
|
||||
opt[String]("netlist-name") action { (v, c) => netlistName = v }
|
||||
|
@ -84,6 +92,10 @@ object VexRiscvLitexSmpClusterCmdGen extends App {
|
|||
resetVector = 0,
|
||||
iBusWidth = iBusWidth,
|
||||
dBusWidth = dBusWidth,
|
||||
iCacheSize = iCacheSize,
|
||||
dCacheSize = dCacheSize,
|
||||
iCacheWays = iCacheWays,
|
||||
dCacheWays = dCacheWays,
|
||||
coherency = coherency
|
||||
)
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue