diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-02-14 11:31:38 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-02-14 11:31:38 +0530 |
commit | 813ab1718417e09465edc2ed2e4910ce4a58f07a (patch) | |
tree | 2d646f0a1b7fc1fa76e7f15f5dd7c2473d1e8ac4 /riscv/sim.cc | |
parent | 6baf42ac1d93c82ff59669c00a6a8991e3b7e4e1 (diff) | |
download | riscv-isa-sim-813ab1718417e09465edc2ed2e4910ce4a58f07a.zip riscv-isa-sim-813ab1718417e09465edc2ed2e4910ce4a58f07a.tar.gz riscv-isa-sim-813ab1718417e09465edc2ed2e4910ce4a58f07a.tar.bz2 |
Make spike capable of booting Linux
Latest Linux does not boot Spike mainly because:
1. Spike does not set bootargs in DTS
2. Spike does not provide mechanism to load initrd for Linux
This patch addresses both above issues and we can now
get latest Linux to prompt on Spike.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r-- | riscv/sim.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc index 7d6f3c1..3d7cd88 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -26,14 +26,14 @@ static void handle_signal(int sig) } sim_t::sim_t(const char* isa, const char* priv, const char* varch, - size_t nprocs, bool halted, + size_t nprocs, bool halted, reg_t initrd_start, reg_t initrd_end, reg_t start_pc, std::vector<std::pair<reg_t, mem_t*>> mems, std::vector<std::pair<reg_t, abstract_device_t*>> plugin_devices, const std::vector<std::string>& args, std::vector<int> const hartids, const debug_module_config_t &dm_config) : htif_t(args), mems(mems), plugin_devices(plugin_devices), - procs(std::max(nprocs, size_t(1))), start_pc(start_pc), current_step(0), + procs(std::max(nprocs, size_t(1))), initrd_start(initrd_start), initrd_end(initrd_end), start_pc(start_pc), current_step(0), current_proc(0), debug(false), histogram_enabled(false), log_commits_enabled(false), dtb_enabled(true), remote_bitbang(NULL), debug_module(this, dm_config) @@ -201,7 +201,7 @@ void sim_t::make_dtb() std::vector<char> rom((char*)reset_vec, (char*)reset_vec + sizeof(reset_vec)); - dts = make_dts(INSNS_PER_RTC_TICK, CPU_HZ, procs, mems); + dts = make_dts(INSNS_PER_RTC_TICK, CPU_HZ, initrd_start, initrd_end, procs, mems); std::string dtb = dts_compile(dts); rom.insert(rom.end(), dtb.begin(), dtb.end()); |