uint32_t ram_read32(unsigned int index);
void set_interrupt(uint32_t hartid) {
- fprintf(stderr, "set debug interrupt 0x%x\n", hartid);
interrupt.insert(hartid);
}
void clear_interrupt(uint32_t hartid) {
- fprintf(stderr, "clear debug interrupt 0x%x\n", hartid);
interrupt.erase(hartid);
}
bool get_interrupt(uint32_t hartid) const {
return interrupt.find(hartid) != interrupt.end();
}
+ void set_halt_notification(uint32_t hartid) {
+ halt_notification.insert(hartid);
+ }
+ void clear_halt_notification(uint32_t hartid) {
+ halt_notification.erase(hartid);
+ }
+ bool get_halt_notification(uint32_t hartid) const {
+ return halt_notification.find(hartid) != halt_notification.end();
+ }
+
+ // Debug Module Interface that the debugger (in our case through JTAG DTM)
+ // uses to access the DM.
+ uint32_t dmi_read(unsigned address);
+ void dmi_write(unsigned address, uint32_t value);
+
private:
// Track which interrupts from module to debugger are set.
std::set<uint32_t> interrupt;
+ // Track which halt notifications from debugger to module are set.
+ std::set<uint32_t> halt_notification;
char debug_ram[DEBUG_RAM_SIZE];
};