CsrPlugin implement dummy pmp if no pmp is there
This commit is contained in:
parent
9c2e05cce0
commit
b4d5a315cf
|
@ -1692,11 +1692,11 @@ class CsrPlugin(val config: CsrPluginConfig) extends Plugin[VexRiscv] with Excep
|
|||
}
|
||||
|
||||
//When no PMP =>
|
||||
// if(!csrMapping.mapping.contains(0x3A0)){
|
||||
// when(arbitration.isValid && input(IS_CSR) && U(csrAddress) >= 0x3A0 && U(csrAddress) <= 0x3EF){
|
||||
// csrMapping.allowCsrSignal := True
|
||||
// }
|
||||
// }
|
||||
if(!csrMapping.mapping.contains(0x3A0)){
|
||||
when(arbitration.isValid && input(IS_CSR) && (csrAddress(11 downto 2) ## B"00" === 0x3A0 || csrAddress(11 downto 4) ## B"0000" === 0x3B0)){
|
||||
csrMapping.allowCsrSignal := True
|
||||
}
|
||||
}
|
||||
|
||||
illegalAccess clearWhen(csrMapping.allowCsrSignal)
|
||||
|
||||
|
|
|
@ -630,7 +630,7 @@ public:
|
|||
#endif
|
||||
|
||||
default: {
|
||||
// if(csr >= 0x3A0 && csr <= 0x3EF) break; //PMP
|
||||
if(csr >= 0x3A0 && csr <= 0x3A3 || csr >= 0x3B0 && csr <= 0x3BF) break; //PMP
|
||||
return true;
|
||||
}break;
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ public:
|
|||
#endif
|
||||
|
||||
default: {
|
||||
// if(csr >= 0x3A0 && csr <= 0x3EF) break; //PMP
|
||||
if(csr >= 0x3A0 && csr <= 0x3A3 || csr >= 0x3B0 && csr <= 0x3BF) break; //PMP
|
||||
ilegalInstruction();
|
||||
return true;
|
||||
}break;
|
||||
|
|
Loading…
Reference in New Issue