Browse Source

add check for H extension requires S mode (#1042)

pull/1040/head
liweiwei90 4 years ago
committed by GitHub
parent
commit
5eada616d4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      riscv/csrs.cc
  2. 3
      riscv/isa_parser.cc

2
riscv/csrs.cc

@ -474,7 +474,7 @@ mstatus_csr_t::mstatus_csr_t(processor_t* const proc, const reg_t addr):
}
bool mstatus_csr_t::unlogged_write(const reg_t val) noexcept {
const bool has_mpv = proc->extension_enabled('S') && proc->extension_enabled('H');
const bool has_mpv = proc->extension_enabled('H');
const bool has_gva = has_mpv;
const reg_t mask = sstatus_write_mask

3
riscv/isa_parser.cc

@ -246,4 +246,7 @@ isa_parser_t::isa_parser_t(const char* str, const char *priv)
max_isa |= reg_t(supervisor) << ('s' - 'a');
extension_table['S'] = true;
}
if (((max_isa >> ('h' - 'a')) & 1) && !supervisor)
bad_isa_string(str, "'H' extension requires S mode");
}

Loading…
Cancel
Save