aboutsummaryrefslogtreecommitdiff
path: root/riscv/debug_module.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2018-12-04 13:46:35 -0800
committerDave.Wen <dave.wen@sifive.com>2019-04-06 00:03:30 +0800
commit86f5029d6ced0c72243bbf2c384fff42df11d97d (patch)
treeb2dec4121600c4eb1b0921a13c17e78ecdb7424a /riscv/debug_module.h
parentd426ff182dca108cc97a2d70c791d39932b5bee0 (diff)
downloadspike-86f5029d6ced0c72243bbf2c384fff42df11d97d.zip
spike-86f5029d6ced0c72243bbf2c384fff42df11d97d.tar.gz
spike-86f5029d6ced0c72243bbf2c384fff42df11d97d.tar.bz2
Add --dmi-rti and --abstract-rti to test OpenOCD.
Optionally make spike behave more like real hardware, to automatically test OpenOCD's handling of such hardware.
Diffstat (limited to 'riscv/debug_module.h')
-rw-r--r--riscv/debug_module.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/riscv/debug_module.h b/riscv/debug_module.h
index 5b43ed6..472ae8e 100644
--- a/riscv/debug_module.h
+++ b/riscv/debug_module.h
@@ -81,9 +81,13 @@ class debug_module_t : public abstract_device_t
* follows:
* 1. Read a 32-bit value from authdata:
* 2. Write the value that was read back, plus one, to authdata.
+ *
+ * abstract_rti is extra run-test/idle cycles that each abstract command
+ * takes to execute. Useful for testing OpenOCD.
*/
- debug_module_t(sim_t *sim, unsigned progbufsize, unsigned max_bus_master_bits,
- bool require_authentication);
+ debug_module_t(sim_t *sim, unsigned progbufsize,
+ unsigned max_bus_master_bits, bool require_authentication,
+ unsigned abstract_rti);
~debug_module_t();
void add_device(bus_t *bus);
@@ -97,6 +101,9 @@ class debug_module_t : public abstract_device_t
bool dmi_read(unsigned address, uint32_t *value);
bool dmi_write(unsigned address, uint32_t value);
+ // Called for every cycle the JTAG TAP spends in Run-Test/Idle.
+ void run_test_idle();
+
// Called when one of the attached harts was reset.
void proc_reset(unsigned id);
@@ -110,6 +117,7 @@ class debug_module_t : public abstract_device_t
unsigned program_buffer_bytes;
unsigned max_bus_master_bits;
bool require_authentication;
+ unsigned abstract_rti;
static const unsigned debug_data_start = 0x380;
unsigned debug_progbuf_start;
@@ -159,6 +167,9 @@ class debug_module_t : public abstract_device_t
processor_t *current_proc() const;
void reset();
bool perform_abstract_command();
+
+ bool abstract_command_completed;
+ unsigned rti_remaining;
};
#endif