VexRiscvSmpCluster add a few options

This commit is contained in:
Dolu1990 2021-07-02 19:04:30 +02:00
parent fa2899a1a2
commit 551e76d244
1 changed files with 26 additions and 1 deletions

View File

@ -188,6 +188,31 @@ object VexRiscvSmpClusterGen {
assert(dCacheSize/dCacheWays <= 4096, "Data cache ways can't be bigger than 4096 bytes") assert(dCacheSize/dCacheWays <= 4096, "Data cache ways can't be bigger than 4096 bytes")
assert(!(withDouble && !withFloat)) assert(!(withDouble && !withFloat))
val csrConfig = if(withSupervisor){
CsrPluginConfig.openSbi(mhartid = hartId, misa = Riscv.misaToInt(s"ima${if(withFloat) "f" else ""}${if(withDouble) "d" else ""}s")).copy(utimeAccess = CsrAccess.READ_ONLY)
} else {
CsrPluginConfig(
catchIllegalAccess = true,
mvendorid = null,
marchid = null,
mimpid = null,
mhartid = 0,
misaExtensionsInit = 0,
misaAccess = CsrAccess.NONE,
mtvecAccess = CsrAccess.READ_WRITE,
mtvecInit = null,
mepcAccess = CsrAccess.READ_WRITE,
mscratchGen = false,
mcauseAccess = CsrAccess.READ_ONLY,
mbadaddrAccess = CsrAccess.READ_ONLY,
mcycleAccess = CsrAccess.NONE,
minstretAccess = CsrAccess.NONE,
ecallGen = true,
wfiGenAsWait = false,
wfiGenAsNop = true,
ucycleAccess = CsrAccess.NONE
)
}
val config = VexRiscvConfig( val config = VexRiscvConfig(
plugins = List( plugins = List(
if(withMmu)new MmuPlugin( if(withMmu)new MmuPlugin(
@ -283,7 +308,7 @@ object VexRiscvSmpClusterGen {
mulUnrollFactor = 32, mulUnrollFactor = 32,
divUnrollFactor = 1 divUnrollFactor = 1
), ),
new CsrPlugin(CsrPluginConfig.openSbi(mhartid = hartId, misa = Riscv.misaToInt(s"ima${if(withFloat) "f" else ""}${if(withDouble) "d" else ""}s")).copy(utimeAccess = CsrAccess.READ_ONLY)), new CsrPlugin(csrConfig),
new BranchPlugin( new BranchPlugin(
earlyBranch = earlyBranch, earlyBranch = earlyBranch,
catchAddressMisaligned = true, catchAddressMisaligned = true,