diff options
author | Jerry Zhao <jerryz123@berkeley.edu> | 2024-01-17 14:40:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 14:40:52 -0800 |
commit | 5e9eccec75b5feddd4a89ec18551bdace3431c15 (patch) | |
tree | f4015446f22af28be5fb2e0da06821f3846a9e85 | |
parent | f490ef0e9f567bde17cdeb151cc4323f97ca99ff (diff) | |
parent | 221eb465c6960b3e005b3a49d8a62ec481bb357b (diff) | |
download | spike-5e9eccec75b5feddd4a89ec18551bdace3431c15.zip spike-5e9eccec75b5feddd4a89ec18551bdace3431c15.tar.gz spike-5e9eccec75b5feddd4a89ec18551bdace3431c15.tar.bz2 |
Merge pull request #1315 from endeneer/cpus-cpu-map
riscv: sim.cc: Consider cpu-map node in cpus node
-rw-r--r-- | riscv/sim.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc index 57e9630..f4919c9 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -176,15 +176,19 @@ sim_t::sim_t(const cfg_t *cfg, bool halted, } //per core attribute - int cpu_offset = 0, rc; + int cpu_offset = 0, cpu_map_offset, rc; size_t cpu_idx = 0; cpu_offset = fdt_get_offset(fdt, "/cpus"); + cpu_map_offset = fdt_get_offset(fdt, "/cpus/cpu-map"); if (cpu_offset < 0) return; for (cpu_offset = fdt_get_first_subnode(fdt, cpu_offset); cpu_offset >= 0; cpu_offset = fdt_get_next_subnode(fdt, cpu_offset)) { + if (!(cpu_map_offset < 0) && cpu_offset == cpu_map_offset) + continue; + if (cpu_idx >= nprocs()) break; |