|
|
|
@ -247,7 +247,7 @@ void state_t::reset(processor_t* const proc, reg_t max_isa) |
|
|
|
auto mcounter = std::make_shared<const_csr_t>(proc, which_mcounter, 0); |
|
|
|
csrmap[which_mcounter] = mcounter; |
|
|
|
|
|
|
|
if (proc->extension_enabled_const(EXT_ZICNTR) && proc->extension_enabled_const(EXT_ZIHPM)) { |
|
|
|
if (proc->extension_enabled_const(EXT_ZIHPM)) { |
|
|
|
auto counter = std::make_shared<counter_proxy_csr_t>(proc, which_counter, mcounter); |
|
|
|
csrmap[which_counter] = counter; |
|
|
|
} |
|
|
|
@ -255,7 +255,7 @@ void state_t::reset(processor_t* const proc, reg_t max_isa) |
|
|
|
csrmap[which_mevent] = std::make_shared<rv32_low_csr_t>(proc, which_mevent, mevent[i - 3]);; |
|
|
|
auto mcounterh = std::make_shared<const_csr_t>(proc, which_mcounterh, 0); |
|
|
|
csrmap[which_mcounterh] = mcounterh; |
|
|
|
if (proc->extension_enabled_const(EXT_ZICNTR) && proc->extension_enabled_const(EXT_ZIHPM)) { |
|
|
|
if (proc->extension_enabled_const(EXT_ZIHPM)) { |
|
|
|
auto counterh = std::make_shared<counter_proxy_csr_t>(proc, which_counterh, mcounterh); |
|
|
|
csrmap[which_counterh] = counterh; |
|
|
|
} |
|
|
|
@ -323,7 +323,7 @@ void state_t::reset(processor_t* const proc, reg_t max_isa) |
|
|
|
|
|
|
|
csrmap[CSR_MEDELEG] = medeleg = std::make_shared<medeleg_csr_t>(proc, CSR_MEDELEG); |
|
|
|
csrmap[CSR_MIDELEG] = mideleg = std::make_shared<mideleg_csr_t>(proc, CSR_MIDELEG); |
|
|
|
const reg_t counteren_mask = 0xffffffffULL; |
|
|
|
const reg_t counteren_mask = (proc->extension_enabled_const(EXT_ZICNTR) ? 0x7UL : 0x0) | (proc->extension_enabled_const(EXT_ZIHPM) ? 0xfffffff8ULL : 0x0); |
|
|
|
mcounteren = std::make_shared<masked_csr_t>(proc, CSR_MCOUNTEREN, counteren_mask, 0); |
|
|
|
if (proc->extension_enabled_const('U')) csrmap[CSR_MCOUNTEREN] = mcounteren; |
|
|
|
csrmap[CSR_SCOUNTEREN] = scounteren = std::make_shared<masked_csr_t>(proc, CSR_SCOUNTEREN, counteren_mask, 0); |
|
|
|
|