aboutsummaryrefslogtreecommitdiff
path: root/riscv
diff options
context:
space:
mode:
authorMing-Yi Lai <ming-yi.lai@mediatek.com>2024-01-10 14:22:58 +0800
committerMing-Yi Lai <ming-yi.lai@mediatek.com>2024-03-06 17:21:01 +0800
commit677e030594aa51ea8d6304d24b7da2ecd7006fe8 (patch)
tree1ef9eb219ecf2f00454ce105fd1b0e107231f5a5 /riscv
parent7b5eba94285f1d12e8268899d3276bd0ff21d9c4 (diff)
downloadspike-677e030594aa51ea8d6304d24b7da2ecd7006fe8.zip
spike-677e030594aa51ea8d6304d24b7da2ecd7006fe8.tar.gz
spike-677e030594aa51ea8d6304d24b7da2ecd7006fe8.tar.bz2
Zicfilp: Support delegating software check exception handling
Diffstat (limited to 'riscv')
-rw-r--r--riscv/csrs.cc1
-rw-r--r--riscv/processor.cc3
2 files changed, 3 insertions, 1 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc
index 728d671..b1f4b7d 100644
--- a/riscv/csrs.cc
+++ b/riscv/csrs.cc
@@ -906,6 +906,7 @@ bool medeleg_csr_t::unlogged_write(const reg_t val) noexcept {
| (1 << CAUSE_LOAD_PAGE_FAULT)
| (1 << CAUSE_STORE_PAGE_FAULT)
| (proc->extension_enabled('H') ? hypervisor_exceptions : 0)
+ | (proc->extension_enabled(EXT_ZICFILP) ? (1 << CAUSE_SOFTWARE_CHECK_FAULT) : 0)
;
return basic_csr_t::unlogged_write((read() & ~mask) | (val & mask));
}
diff --git a/riscv/processor.cc b/riscv/processor.cc
index 4f78879..165d7b9 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -382,7 +382,8 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)
(1 << CAUSE_USER_ECALL) |
(1 << CAUSE_FETCH_PAGE_FAULT) |
(1 << CAUSE_LOAD_PAGE_FAULT) |
- (1 << CAUSE_STORE_PAGE_FAULT);
+ (1 << CAUSE_STORE_PAGE_FAULT) |
+ (1 << CAUSE_SOFTWARE_CHECK_FAULT);
csrmap[CSR_HEDELEG] = hedeleg = std::make_shared<masked_csr_t>(proc, CSR_HEDELEG, hedeleg_mask, 0);
csrmap[CSR_HCOUNTEREN] = hcounteren = std::make_shared<masked_csr_t>(proc, CSR_HCOUNTEREN, counteren_mask, 0);
htimedelta = std::make_shared<basic_csr_t>(proc, CSR_HTIMEDELTA, 0);