aboutsummaryrefslogtreecommitdiff
path: root/riscv/sim.cc
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2023-02-04 18:02:19 -0800
committerAndrew Waterman <andrew@sifive.com>2023-02-04 18:12:56 -0800
commit749b03f3b86b601dee814d4299deee3e97e0e3b7 (patch)
tree090d3f7a918598efc59f6fad86c8591e6e0efd4a /riscv/sim.cc
parentb04229ee59cbe5286478b7cfa930b9995d2bdd93 (diff)
downloadspike-749b03f3b86b601dee814d4299deee3e97e0e3b7.zip
spike-749b03f3b86b601dee814d4299deee3e97e0e3b7.tar.gz
spike-749b03f3b86b601dee814d4299deee3e97e0e3b7.tar.bz2
Correctly instantiate PLIC contexts for mixed-hart targets
This commit started as an attempt to make the PLIC tolerant of discontiguous hart IDs, but it turns out it was already most of the way there: PLIC contexts can still be dense even if the hart IDs are not. Nevertheless, I wanted to avoid passing the procs vector directly to the plic_t constructor. In removing it, I realized I could also get rid of the smode parameter by querying whether each hart has S-mode. This is also more correct; previously, we were instantiating the PLIC as though all harts had S-mode, regardless of whether they actually did.
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r--riscv/sim.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc
index 274a7c2..4e5e9a7 100644
--- a/riscv/sim.cc
+++ b/riscv/sim.cc
@@ -127,7 +127,7 @@ sim_t::sim_t(const cfg_t *cfg, bool halted,
reg_t plic_base;
uint32_t plic_ndev;
if (fdt_parse_plic(fdt, &plic_base, &plic_ndev, "riscv,plic0") == 0) {
- plic.reset(new plic_t(procs, true, plic_ndev));
+ plic.reset(new plic_t(this, plic_ndev));
bus.add_device(plic_base, plic.get());
intctrl = plic.get();
}