CsrPlugin now implement dummy HPM

This commit is contained in:
Dolu1990 2023-04-13 16:51:44 +02:00
parent d966c4efe1
commit 051080e060
1 changed files with 7 additions and 0 deletions

View File

@ -1697,6 +1697,13 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep
csrMapping.allowCsrSignal := True
}
}
//When no HPM
if(!csrMapping.mapping.contains(0xB03)){
val masked = U(csrAddress & 0xF60)
when(arbitration.isValid && input(IS_CSR) && U(csrAddress(4 downto 0)) >= 3 && (masked === 0xB00 || masked === 0xC00 && !writeInstruction && privilege === 3 || U(csrAddress & 0xFE0) === 0x320)){
csrMapping.allowCsrSignal := True
}
}
illegalAccess clearWhen(csrMapping.allowCsrSignal)