diff options
author | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-02-18 11:50:00 +0000 |
---|---|---|
committer | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-02-18 11:53:10 +0000 |
commit | ab15a795061c1ecafea765dc46b499d713e87810 (patch) | |
tree | e5320021b360d881903f8ff2c498f001c940447b /riscv/sim.cc | |
parent | 51c9805f6732d58f29846774e7413babb1ef2def (diff) | |
download | spike-ab15a795061c1ecafea765dc46b499d713e87810.zip spike-ab15a795061c1ecafea765dc46b499d713e87810.tar.gz spike-ab15a795061c1ecafea765dc46b499d713e87810.tar.bz2 |
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.
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r-- | riscv/sim.cc | 17 |
1 files changed, 0 insertions, 17 deletions
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<char> 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); |