From: Wesley W. Terpstra Date: Tue, 21 Mar 2017 23:44:43 +0000 (-0700) Subject: configstring: rename variables to dts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0647cce541357bf8f35c8930b78ae98b71ab1f02;p=riscv-isa-sim.git configstring: rename variables to dts --- diff --git a/riscv/sim.cc b/riscv/sim.cc index 004ccaa..445c17a 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -53,7 +53,7 @@ sim_t::sim_t(const char* isa, size_t nprocs, size_t mem_mb, bool halted, } rtc.reset(new rtc_t(procs)); - make_config_string(); + make_dtb(); } sim_t::~sim_t() @@ -234,7 +234,7 @@ static std::string dts_compile(const std::string& dts) return dtb.str(); } -void sim_t::make_config_string() +void sim_t::make_dtb() { reg_t rtc_addr = EXT_IO_BASE; bus.add_device(rtc_addr, rtc.get()); @@ -303,8 +303,8 @@ void sim_t::make_config_string() " };\n" "};\n"; - config_string = s.str(); - std::string dtb = dts_compile(config_string); + dts = s.str(); + std::string dtb = dts_compile(dts); rom.insert(rom.end(), dtb.begin(), dtb.end()); rom.resize((rom.size() / align + 1) * align); diff --git a/riscv/sim.h b/riscv/sim.h index f655914..4111caf 100644 --- a/riscv/sim.h +++ b/riscv/sim.h @@ -30,7 +30,7 @@ public: void set_histogram(bool value); void set_procs_debug(bool value); void set_gdbserver(gdbserver_t* gdbserver) { this->gdbserver = gdbserver; } - const char* get_config_string() { return config_string.c_str(); } + const char* get_dts() { return dts.c_str(); } processor_t* get_core(size_t i) { return procs.at(i); } private: @@ -38,7 +38,7 @@ private: size_t memsz; // memory size in bytes mmu_t* debug_mmu; // debug port into main memory std::vector procs; - std::string config_string; + std::string dts; std::unique_ptr boot_rom; std::unique_ptr rtc; bus_t bus; @@ -64,7 +64,7 @@ private: reg_t mem_to_addr(char* x) { return x - mem + DRAM_BASE; } bool mmio_load(reg_t addr, size_t len, uint8_t* bytes); bool mmio_store(reg_t addr, size_t len, const uint8_t* bytes); - void make_config_string(); + void make_dtb(); // presents a prompt for introspection into the simulation void interactive(); diff --git a/spike_main/spike.cc b/spike_main/spike.cc index 424bf37..dde6f5a 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -31,7 +31,7 @@ static void help() fprintf(stderr, " --extension= Specify RoCC Extension\n"); fprintf(stderr, " --extlib= Shared library to load\n"); fprintf(stderr, " --gdb-port= Listen on for gdb to connect\n"); - fprintf(stderr, " --dump-config-string Print platform configuration string and exit\n"); + fprintf(stderr, " --dump-dts Print device tree string and exit\n"); exit(1); } @@ -41,7 +41,7 @@ int main(int argc, char** argv) bool halted = false; bool histogram = false; bool log = false; - bool dump_config_string = false; + bool dump_dts = false; size_t nprocs = 1; size_t mem_mb = 0; std::unique_ptr ic; @@ -67,7 +67,7 @@ int main(int argc, char** argv) parser.option(0, "l2", 1, [&](const char* s){l2.reset(cache_sim_t::construct(s, "L2$"));}); parser.option(0, "isa", 1, [&](const char* s){isa = s;}); parser.option(0, "extension", 1, [&](const char* s){extension = find_extension(s);}); - parser.option(0, "dump-config-string", 0, [&](const char *s){dump_config_string = true;}); + parser.option(0, "dump-dts", 0, [&](const char *s){dump_dts = true;}); parser.option(0, "extlib", 1, [&](const char *s){ void *lib = dlopen(s, RTLD_NOW | RTLD_GLOBAL); if (lib == NULL) { @@ -85,8 +85,8 @@ int main(int argc, char** argv) s.set_gdbserver(&(*gdbserver)); } - if (dump_config_string) { - printf("%s", s.get_config_string()); + if (dump_dts) { + printf("%s", s.get_dts()); return 0; }