aboutsummaryrefslogtreecommitdiff
path: root/riscv/plic.cc
diff options
context:
space:
mode:
authorTilmann Bartsch <info@tebartsch.ai>2024-01-22 23:18:36 +0100
committerGitHub <noreply@github.com>2024-01-22 23:18:36 +0100
commite53f9cb74c7f82f5de2e115cf3e53b853cb07812 (patch)
tree509db57071e4c19617995a60fe81fdc1ee4393f4 /riscv/plic.cc
parentb3ea08457bee8f9f59751685871302601006ab4a (diff)
downloadriscv-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.cc9
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;
}