From f425905f5a233520acb58c77ec6d6cb51668d3db Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 27 Jun 2019 07:34:11 +0100 Subject: [PATCH] add SUBVL CSR set --- riscv/processor.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/riscv/processor.cc b/riscv/processor.cc index 19ebffc..09467bc 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -539,6 +539,12 @@ reg_t processor_t::set_csr(int which, reg_t val, bool imm_mode) } break; } + case CSR_USVSUBVL: + state.sv().subvl = std::max(1, std::min(4, (int)val)); + old_val = state.sv().subvl; + // TODO XXX throw exception if val attempted to be set == 0 + fprintf(stderr, "set VL %lx\n", state.sv().vl); + break; case CSR_USVVL: state.sv().vl = std::min(state.sv().mvl, val + 1); old_val = state.sv().mvl - 1; -- 2.30.2