diff options
author | Ved Shanbhogue <ved@rivosinc.com> | 2024-01-10 15:37:00 -0600 |
---|---|---|
committer | Ved Shanbhogue <ved@rivosinc.com> | 2024-01-10 16:06:32 -0600 |
commit | 0bf0a60ad870ba3d59f87c03b41b6d06ca5fa30c (patch) | |
tree | b6c22172ea4753c5ef207366563b0eb3e139a63f /riscv/csrs.cc | |
parent | 5fa1cd541872ac601580fda58eb093aaf12aab32 (diff) | |
download | riscv-isa-sim-0bf0a60ad870ba3d59f87c03b41b6d06ca5fa30c.zip riscv-isa-sim-0bf0a60ad870ba3d59f87c03b41b6d06ca5fa30c.tar.gz riscv-isa-sim-0bf0a60ad870ba3d59f87c03b41b6d06ca5fa30c.tar.bz2 |
Add Zaamo and Zalrsc extensions
Diffstat (limited to 'riscv/csrs.cc')
-rw-r--r-- | riscv/csrs.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index ce14b28..b76b496 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -622,9 +622,10 @@ bool sstatus_csr_t::enabled(const reg_t which) { misa_csr_t::misa_csr_t(processor_t* const proc, const reg_t addr, const reg_t max_isa): basic_csr_t(proc, addr, max_isa), max_isa(max_isa), - write_mask(max_isa & (0 // allow MAFDQCHV bits in MISA to be modified + write_mask(max_isa & (0 // allow MABFDQCHV bits in MISA to be modified | (1L << ('M' - 'A')) | (1L << ('A' - 'A')) + | (1L << ('B' - 'A')) | (1L << ('F' - 'A')) | (1L << ('D' - 'A')) | (1L << ('Q' - 'A')) @@ -665,6 +666,11 @@ bool misa_csr_t::unlogged_write(const reg_t val) noexcept { proc->set_extension_enable(EXT_ZFHMIN, new_misa & (1L << ('F' - 'A'))); proc->set_extension_enable(EXT_ZVFH, (new_misa & (1L << ('V' - 'A'))) && proc->extension_enabled(EXT_ZFHMIN)); proc->set_extension_enable(EXT_ZVFHMIN, new_misa & (1L << ('V' - 'A'))); + proc->set_extension_enable(EXT_ZAAMO, (new_misa & (1L << ('A' - 'A'))) || !proc->get_isa().extension_enabled('A')); + proc->set_extension_enable(EXT_ZALRSC, (new_misa & (1L << ('A' - 'A'))) || !proc->get_isa().extension_enabled('A')); + proc->set_extension_enable(EXT_ZBA, (new_misa & (1L << ('B' - 'A'))) || !proc->get_isa().extension_enabled('B')); + proc->set_extension_enable(EXT_ZBB, (new_misa & (1L << ('B' - 'A'))) || !proc->get_isa().extension_enabled('B')); + proc->set_extension_enable(EXT_ZBS, (new_misa & (1L << ('B' - 'A'))) || !proc->get_isa().extension_enabled('B')); // update the hypervisor-only bits in MEDELEG and other CSRs if (!new_h && prev_h) { |