- // 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];
-
- static const unsigned datacount = 8;
- static const unsigned progsize = 8;
-
- uint32_t dmcontrol;
- uint32_t abstractcs;
- uint32_t data[datacount];
- uint32_t ibuf[progsize];
+ static const unsigned datasize = 2;
+ // Size of program_buffer in 32-bit words, as exposed to the rest of the
+ // world.
+ unsigned progbufsize;
+ // Actual size of the program buffer, which is 1 word bigger than we let on
+ // to implement the implicit ebreak at the end.
+ unsigned program_buffer_bytes;
+ static const unsigned debug_data_start = 0x380;
+ unsigned debug_progbuf_start;
+
+ static const unsigned debug_abstract_size = 2;
+ unsigned debug_abstract_start;
+
+ static const unsigned hartsellen = 10;
+
+ sim_t *sim;
+
+ uint8_t debug_rom_whereto[4];
+ uint8_t debug_abstract[debug_abstract_size * 4];
+ uint8_t *program_buffer;
+ uint8_t dmdata[datasize * 4];
+
+ bool halted[1024];
+ bool resumeack[1024];
+ uint8_t debug_rom_flags[1024];
+
+ void write32(uint8_t *rom, unsigned int index, uint32_t value);
+ uint32_t read32(uint8_t *rom, unsigned int index);
+
+ void sb_autoincrement();
+ void sb_read();
+ void sb_write();
+ unsigned sb_access_bits();
+
+ dmcontrol_t dmcontrol;
+ dmstatus_t dmstatus;
+ abstractcs_t abstractcs;
+ abstractauto_t abstractauto;
+ uint32_t command;
+
+ sbcs_t sbcs;
+ uint32_t sbaddress[4];
+ uint32_t sbdata[4];
+
+ processor_t *current_proc() const;
+ void reset();
+ bool perform_abstract_command();