diff options
author | Tilmann Bartsch <info@tebartsch.ai> | 2024-01-22 23:18:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 23:18:36 +0100 |
commit | e53f9cb74c7f82f5de2e115cf3e53b853cb07812 (patch) | |
tree | 509db57071e4c19617995a60fe81fdc1ee4393f4 /riscv/plic.cc | |
parent | b3ea08457bee8f9f59751685871302601006ab4a (diff) | |
download | riscv-isa-sim-e53f9cb74c7f82f5de2e115cf3e53b853cb07812.zip riscv-isa-sim-e53f9cb74c7f82f5de2e115cf3e53b853cb07812.tar.gz riscv-isa-sim-e53f9cb74c7f82f5de2e115cf3e53b853cb07812.tar.bz2 |
PLIC: Implement threshold masking
Signed-off-by: Tilmann Bartsch <info@tebartsch.ai>
Diffstat (limited to 'riscv/plic.cc')
-rw-r--r-- | riscv/plic.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/riscv/plic.cc b/riscv/plic.cc index 44f80cf..01def70 100644 --- a/riscv/plic.cc +++ b/riscv/plic.cc @@ -113,6 +113,15 @@ uint32_t plic_t::context_best_pending(const plic_context_t *c) } } + /* + From Spec 1.0.0: 6. Priority Thresholds + The PLIC will mask all PLIC interrupts of a priority less than or equal to + threshold. + */ + if (best_id_prio <= c->priority_threshold) { + return 0; + } + return best_id; } |