Browse Source

AIA: Add read-only 0 mvien CSR (minimal required implementation)

pull/1988/head
YenHaoChen 2 years ago
committed by Binno
parent
commit
4484d17bd2
  1. 7
      riscv/csr_init.cc
  2. 2
      riscv/processor.h

7
riscv/csr_init.cc

@ -475,7 +475,14 @@ void state_t::csr_init(processor_t* const proc, reg_t max_isa)
const reg_t srmcfg_mask = SRMCFG_MCID | SRMCFG_RCID; const reg_t srmcfg_mask = SRMCFG_MCID | SRMCFG_RCID;
add_const_ext_csr(EXT_SSQOSID, CSR_SRMCFG, std::make_shared<srmcfg_csr_t>(proc, CSR_SRMCFG, srmcfg_mask, 0)); add_const_ext_csr(EXT_SSQOSID, CSR_SRMCFG, std::make_shared<srmcfg_csr_t>(proc, CSR_SRMCFG, srmcfg_mask, 0));
mvien = std::make_shared<const_csr_t>(proc, CSR_MVIEN, 0);
if (proc->extension_enabled_const(EXT_SMAIA)) { if (proc->extension_enabled_const(EXT_SMAIA)) {
add_csr(CSR_MTOPI, std::make_shared<mtopi_csr_t>(proc, CSR_MTOPI)); add_csr(CSR_MTOPI, std::make_shared<mtopi_csr_t>(proc, CSR_MTOPI));
if (xlen == 32) {
add_supervisor_csr(CSR_MVIEN, std::make_shared<rv32_low_csr_t>(proc, CSR_MVIEN, mvien));
add_supervisor_csr(CSR_MVIENH, std::make_shared<rv32_high_csr_t>(proc, CSR_MVIENH, mvien));
} else {
add_supervisor_csr(CSR_MVIEN, mvien);
}
} }
} }

2
riscv/processor.h

@ -174,6 +174,8 @@ struct state_t
csr_t_p ssp; csr_t_p ssp;
csr_t_p mvien;
bool serialized; // whether timer CSRs are in a well-defined state bool serialized; // whether timer CSRs are in a well-defined state
// When true, execute a single instruction and then enter debug mode. This // When true, execute a single instruction and then enter debug mode. This

Loading…
Cancel
Save