From 48cf4120f2e5e44224ca25fc783be96c338767cd Mon Sep 17 00:00:00 2001 From: Dolu1990 Date: Mon, 23 May 2022 15:49:32 +0200 Subject: [PATCH] Add VexRiscvSmpCluster forceMisa/forceMscratch --- .../scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala b/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala index a0ad2c7..ec2aa50 100644 --- a/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala +++ b/src/main/scala/vexriscv/demo/smp/VexRiscvSmpCluster.scala @@ -192,7 +192,9 @@ object VexRiscvSmpClusterGen { dTlbSize : Int = 4, prediction : BranchPrediction = vexriscv.plugin.NONE, withDataCache : Boolean = true, - withInstructionCache : Boolean = true + withInstructionCache : Boolean = true, + forceMisa : Boolean = false, + forceMscratch : Boolean = false ) = { 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") @@ -207,12 +209,12 @@ object VexRiscvSmpClusterGen { marchid = null, mimpid = null, mhartid = hartId, - misaExtensionsInit = 0, - misaAccess = CsrAccess.NONE, + misaExtensionsInit = Riscv.misaToInt(s"ima${if(withFloat) "f" else ""}${if(withDouble) "d" else ""}s"), + misaAccess = if(forceMisa) CsrAccess.WRITE_ONLY else CsrAccess.NONE, mtvecAccess = CsrAccess.READ_WRITE, mtvecInit = null, mepcAccess = CsrAccess.READ_WRITE, - mscratchGen = false, + mscratchGen = forceMscratch, mcauseAccess = CsrAccess.READ_ONLY, mbadaddrAccess = CsrAccess.READ_ONLY, mcycleAccess = CsrAccess.NONE,