diff options
author | Andrew Waterman <andrew@sifive.com> | 2023-02-04 18:02:19 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2023-03-01 13:34:07 -0800 |
commit | ef1638be6cdb6cfb77d77f5ae233e5e196e40125 (patch) | |
tree | 07839eb485f33bd71701a0222fc4609eae01fabc /riscv/sim.cc | |
parent | b6d8da39bca349352b69913ef1b2b88b31ddc5b5 (diff) | |
download | spike-ef1638be6cdb6cfb77d77f5ae233e5e196e40125.zip spike-ef1638be6cdb6cfb77d77f5ae233e5e196e40125.tar.gz spike-ef1638be6cdb6cfb77d77f5ae233e5e196e40125.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.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc index c623de1..a7ffc87 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -130,7 +130,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(); } |