From ab15a795061c1ecafea765dc46b499d713e87810 Mon Sep 17 00:00:00 2001 From: Rupert Swarbrick Date: Fri, 18 Feb 2022 11:50:00 +0000 Subject: Remove duplicate DTB load step This code is identical to make_dtb() which is called in the class constructor, so I don't think we have to generate/load/parse things again: we can just use the stuff we made earlier. --- riscv/sim.cc | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'riscv/sim.cc') diff --git a/riscv/sim.cc b/riscv/sim.cc index 1ec6a9f..97b3746 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -335,23 +335,6 @@ void sim_t::set_rom() std::vector rom((char*)reset_vec, (char*)reset_vec + sizeof(reset_vec)); - std::string dtb; - if (!dtb_file.empty()) { - std::ifstream fin(dtb_file.c_str(), std::ios::binary); - if (!fin.good()) { - std::cerr << "can't find dtb file: " << dtb_file << std::endl; - exit(-1); - } - - std::stringstream strstream; - strstream << fin.rdbuf(); - - dtb = strstream.str(); - } else { - dts = make_dts(INSNS_PER_RTC_TICK, CPU_HZ, initrd_start, initrd_end, bootargs, procs, mems); - dtb = dts_compile(dts); - } - rom.insert(rom.end(), dtb.begin(), dtb.end()); const int align = 0x1000; rom.resize((rom.size() + align - 1) / align * align); -- cgit v1.1