From: Luke Kenneth Casson Leighton Date: Sat, 29 Sep 2018 03:23:18 +0000 (+0100) Subject: fix bug in CSR set SVVL: val has already been looked up X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88a882c1e325d1a824dacabac536ead772d52b55;p=riscv-isa-sim.git fix bug in CSR set SVVL: val has already been looked up csrrw.h has been modified to invert the order of set/get, so the call to processor_t::set_csr(SVVL, val) will do the right thing and the subsequent (delayed) call to get_csr will return the state.vl value in the chosen RD all good --- diff --git a/riscv/processor.cc b/riscv/processor.cc index 71b030b..0ad4e3e 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -343,7 +343,7 @@ void processor_t::set_csr(int which, reg_t val) state.vl = std::min(val, state.mvl); // limited to MVL break; case CSR_SVVL: - state.vl = std::min(state.mvl, state.XPR[val]); + state.vl = std::min(state.mvl, val); state.XPR.write(val, state.vl); break; case CSR_SVREGCFG0: