From: Luke Kenneth Casson Leighton Date: Sat, 29 Sep 2018 03:55:00 +0000 (+0100) Subject: add support for CSR_SVVL to CSRRWI as well X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2a1c0de016976ee276b0b99fee2a4abe6613806c;p=riscv-isa-sim.git add support for CSR_SVVL to CSRRWI as well --- diff --git a/riscv/insns/csrrwi.h b/riscv/insns/csrrwi.h index decadf4..8793d31 100644 --- a/riscv/insns/csrrwi.h +++ b/riscv/insns/csrrwi.h @@ -1,5 +1,18 @@ int csr = validate_csr(insn.csr(), true); +#ifdef SPIKE_SIMPLEV +reg_t old = 0; // stop compiler bitchin +if (csr != CSR_SVVL) +{ + old = p->get_csr(csr); +} +p->set_csr(csr, insn.rs1()); +if (csr == CSR_SVVL) +{ + old = p->get_csr(csr); +} +#else reg_t old = p->get_csr(csr); p->set_csr(csr, insn.rs1()); +#endif WRITE_RD(sext_xlen(old)); serialize();