Skip to content

Commit

Permalink
Merge pull request #1523 from YenHaoChen/patch-1
Browse files Browse the repository at this point in the history
miselect: support miselect when enabling smcsrind
  • Loading branch information
aswaterman authored Dec 7, 2023
2 parents e46586e + bdfbd54 commit d94fe56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions riscv/processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,14 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)


// Smcsrind / Sscsrind
csr_t_p miselect;
csr_t_p siselect;
csr_t_p vsiselect;
sscsrind_reg_csr_t::sscsrind_reg_csr_t_p mireg[6];
sscsrind_reg_csr_t::sscsrind_reg_csr_t_p sireg[6];
sscsrind_reg_csr_t::sscsrind_reg_csr_t_p vsireg[6];

if (proc->extension_enabled_const(EXT_SMCSRIND)) {
csr_t_p miselect = std::make_shared<basic_csr_t>(proc, CSR_MISELECT, 0);
csrmap[CSR_MISELECT] = miselect;

const reg_t mireg_csrs[] = { CSR_MIREG, CSR_MIREG2, CSR_MIREG3, CSR_MIREG4, CSR_MIREG5, CSR_MIREG6 };
auto i = 0;
for (auto csr : mireg_csrs) {
Expand All @@ -552,9 +552,9 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)
}

if (proc->extension_enabled_const(EXT_SSCSRIND)) {
vsiselect = std::make_shared<basic_csr_t>(proc, CSR_VSISELECT, 0);
csr_t_p vsiselect = std::make_shared<basic_csr_t>(proc, CSR_VSISELECT, 0);
csrmap[CSR_VSISELECT] = vsiselect;
siselect = std::make_shared<basic_csr_t>(proc, CSR_SISELECT, 0);
csr_t_p siselect = std::make_shared<basic_csr_t>(proc, CSR_SISELECT, 0);
csrmap[CSR_SISELECT] = std::make_shared<virtualized_csr_t>(proc, siselect, vsiselect);

const reg_t vsireg_csrs[] = { CSR_VSIREG, CSR_VSIREG2, CSR_VSIREG3, CSR_VSIREG4, CSR_VSIREG5, CSR_VSIREG6 };
Expand Down

0 comments on commit d94fe56

Please sign in to comment.