} dmcontrol_t;
typedef struct {
+ bool impebreak;
bool allnonexistant;
bool anynonexistant;
bool allunavail;
bool authenticated;
bool authbusy;
bool cfgstrvalid;
- unsigned versionhi;
- unsigned versionlo;
+ unsigned version;
} dmstatus_t;
typedef enum cmderr {
typedef struct {
bool busy;
unsigned datacount;
- unsigned progsize;
+ unsigned progbufsize;
cmderr_t cmderr;
} abstractcs_t;
class debug_module_t : public abstract_device_t
{
public:
- debug_module_t(sim_t *sim);
+ debug_module_t(sim_t *sim, unsigned progbufsize);
+ ~debug_module_t();
void add_device(bus_t *bus);
bool dmi_write(unsigned address, uint32_t value);
private:
- static const unsigned progsize = 8;
+ 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;
sim_t *sim;
uint8_t debug_rom_whereto[4];
- uint8_t debug_rom_abstract[4*2];
- uint8_t program_buffer[progsize * 4];
- uint8_t dmdata[DEBUG_DATA_SIZE];
+ uint8_t debug_abstract[debug_abstract_size * 4];
+ uint8_t *program_buffer;
+ uint8_t dmdata[datasize * 4];
bool halted[1024];
bool resumeack[1024];