clint.reset(new clint_t(procs));
bus.add_device(CLINT_BASE, clint.get());
-
- make_dtb();
}
sim_t::~sim_t()
{
const int reset_vec_size = 8;
+ start_pc = start_pc == reg_t(-1) ? get_entry_point() : start_pc;
reg_t pc_delta = start_pc - DEFAULT_RSTVEC;
reg_t pc_delta_hi = (pc_delta + 0x800U) & ~reg_t(0xfffU);
reg_t pc_delta_lo = pc_delta - pc_delta_hi;
// htif
+void sim_t::reset()
+{
+ make_dtb();
+}
+
void sim_t::idle()
{
target.switch_to();
void set_histogram(bool value);
void set_procs_debug(bool value);
void set_gdbserver(gdbserver_t* gdbserver) { this->gdbserver = gdbserver; }
- const char* get_dts() { return dts.c_str(); }
+ const char* get_dts() { if (dts.empty()) reset(); return dts.c_str(); }
processor_t* get_core(size_t i) { return procs.at(i); }
private:
context_t* host;
context_t target;
- void reset() { }
+ void reset();
void idle();
void read_chunk(addr_t taddr, size_t len, void* dst);
void write_chunk(addr_t taddr, size_t len, const void* src);
fprintf(stderr, " -h Print this help message\n");
fprintf(stderr, " -H Start halted, allowing a debugger to connect\n");
fprintf(stderr, " --isa=<name> RISC-V ISA string [default %s]\n", DEFAULT_ISA);
- fprintf(stderr, " --pc=<address> Set the initial program counter [default 0x80000000]\n");
+ fprintf(stderr, " --pc=<address> Override ELF entry point\n");
fprintf(stderr, " --ic=<S>:<W>:<B> Instantiate a cache model with S sets,\n");
fprintf(stderr, " --dc=<S>:<W>:<B> W ways, and B-byte blocks (with S and\n");
fprintf(stderr, " --l2=<S>:<W>:<B> B both powers of 2).\n");
bool log = false;
bool dump_dts = false;
size_t nprocs = 1;
- reg_t start_pc = DRAM_BASE;
+ reg_t start_pc = reg_t(-1);
std::vector<std::pair<reg_t, mem_t*>> mems;
std::unique_ptr<icache_sim_t> ic;
std::unique_ptr<dcache_sim_t> dc;