#include "sim.h"
#include "mmu.h"
#include "htif.h"
+#include "gdbserver.h"
#include <map>
#include <iostream>
#include <sstream>
fprintf(stderr, "warning: only got %lu bytes of target mem (wanted %lu)\n",
(unsigned long)memsz, (unsigned long)memsz0);
- /* Copy Debug ROM into the end of the allocated block, because we surely
- * didn't succeed in allocating 0xfffffffff800 bytes. */
- /* TODO: Once everything uses the new memory map, just put this at the
- * address that it actually belongs at. */
- memcpy(mem + memsz - DEBUG_SIZE + DEBUG_ROM_START - DEBUG_START,
- debug_rom_raw, debug_rom_raw_len);
+ bus.add_device(DEBUG_START, &debug_module);
debug_mmu = new mmu_t(this, NULL);
for (size_t i = 0; i < procs.size(); i++) {
- procs[i] = new processor_t(isa, this, i);
- if (halted)
- procs[i]->enter_debug_mode(DCSR_CAUSE_HALT);
+ procs[i] = new processor_t(isa, this, i, halted);
}
rtc.reset(new rtc_t(procs));