From 2a1c0de016976ee276b0b99fee2a4abe6613806c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 29 Sep 2018 04:55:00 +0100 Subject: [PATCH] add support for CSR_SVVL to CSRRWI as well --- riscv/insns/csrrwi.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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(); -- 2.30.2