From 9b18d004f36f87588ad36d34b16e24c8ef22f3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20G=C3=BCzel?= <65466875+omerguzelelectronicguy@users.noreply.github.com> Date: Fri, 26 Dec 2025 16:43:16 +0300 Subject: [PATCH] unnecessary dtb to dts operation removed --- riscv/sim.cc | 6 ++++-- riscv/sim.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/riscv/sim.cc b/riscv/sim.cc index 4eb5ed0a..7b07bd67 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -135,7 +135,6 @@ sim_t::sim_t(const cfg_t *cfg, bool halted, std::stringstream strstream; strstream << fin.rdbuf(); dtb = strstream.str(); - dts = dtb_to_dts(dtb); } else { std::string device_nodes; for (const device_factory_sargs_t& factory_sargs: device_factories) { @@ -303,7 +302,10 @@ void sim_t::step(size_t n) } } } - +const char* sim_t::get_dts() { + dts = dtb_to_dts(dtb); + return dts.c_str(); +} void sim_t::add_device(reg_t addr, std::shared_ptr dev) { bus.add_device(addr, dev.get()); devices.push_back(dev); diff --git a/riscv/sim.h b/riscv/sim.h index 8a963954..299e8965 100644 --- a/riscv/sim.h +++ b/riscv/sim.h @@ -55,7 +55,7 @@ public: void set_remote_bitbang(remote_bitbang_t* remote_bitbang) { this->remote_bitbang = remote_bitbang; } - const char* get_dts() { return dts.c_str(); } + const char* get_dts(); processor_t* get_core(size_t i) { return procs.at(i); } abstract_interrupt_controller_t* get_intctrl() const { assert(plic.get()); return plic.get(); } virtual const cfg_t &get_cfg() const override { return *cfg; }