projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fe678ee
)
Handle abstractcs.busy
author
Palmer Dabbelt
<palmer@dabbelt.com>
Wed, 26 Apr 2017 16:13:19 +0000
(09:13 -0700)
committer
Palmer Dabbelt
<palmer@dabbelt.com>
Wed, 26 Apr 2017 16:14:27 +0000
(09:14 -0700)
riscv/debug_module.cc
patch
|
blob
|
history
diff --git
a/riscv/debug_module.cc
b/riscv/debug_module.cc
index 5f66ebed0a1843d07ac038c83baf9a5172e37ba7..fafddf14ab3d6fdd9328b6c811eda57feac92589 100644
(file)
--- a/
riscv/debug_module.cc
+++ b/
riscv/debug_module.cc
@@
-205,19
+205,19
@@
bool debug_module_t::dmi_read(unsigned address, uint32_t *value)
D(fprintf(stderr, "dmi_read(0x%x) -> ", address));
if (address >= DMI_DATA0 && address < DMI_DATA0 + abstractcs.datacount) {
unsigned i = address - DMI_DATA0;
D(fprintf(stderr, "dmi_read(0x%x) -> ", address));
if (address >= DMI_DATA0 && address < DMI_DATA0 + abstractcs.datacount) {
unsigned i = address - DMI_DATA0;
- result = read32(dmdata, i);
+ result =
abstractcs.busy ? -1 :
read32(dmdata, i);
if (abstractcs.busy && abstractcs.cmderr == CMDERR_NONE) {
abstractcs.cmderr = CMDERR_BUSY;
}
if (abstractcs.busy && abstractcs.cmderr == CMDERR_NONE) {
abstractcs.cmderr = CMDERR_BUSY;
}
- if (
(abstractauto.autoexecdata >> i) & 1)
{
+ if (
!abstractcs.busy && ((abstractauto.autoexecdata >> i) & 1))
{
perform_abstract_command();
}
} else if (address >= DMI_PROGBUF0 && address < DMI_PROGBUF0 + progsize) {
unsigned i = address - DMI_PROGBUF0;
perform_abstract_command();
}
} else if (address >= DMI_PROGBUF0 && address < DMI_PROGBUF0 + progsize) {
unsigned i = address - DMI_PROGBUF0;
- result = read32(program_buffer, i);
- if (
(abstractauto.autoexecprogbuf >> i) & 1
) {
+ result =
abstractcs.busy ? -1 :
read32(program_buffer, i);
+ if (
!abstractcs.busy && ((abstractauto.autoexecprogbuf >> i) & 1)
) {
perform_abstract_command();
}
perform_abstract_command();
}
@@
-396,13
+396,14
@@
bool debug_module_t::dmi_write(unsigned address, uint32_t value)
D(fprintf(stderr, "dmi_write(0x%x, 0x%x)\n", address, value));
if (address >= DMI_DATA0 && address < DMI_DATA0 + abstractcs.datacount) {
unsigned i = address - DMI_DATA0;
D(fprintf(stderr, "dmi_write(0x%x, 0x%x)\n", address, value));
if (address >= DMI_DATA0 && address < DMI_DATA0 + abstractcs.datacount) {
unsigned i = address - DMI_DATA0;
- write32(dmdata, address - DMI_DATA0, value);
+ if (!abstractcs.busy)
+ write32(dmdata, address - DMI_DATA0, value);
if (abstractcs.busy && abstractcs.cmderr == CMDERR_NONE) {
abstractcs.cmderr = CMDERR_BUSY;
}
if (abstractcs.busy && abstractcs.cmderr == CMDERR_NONE) {
abstractcs.cmderr = CMDERR_BUSY;
}
- if (
(abstractauto.autoexecdata >> i) & 1
) {
+ if (
!abstractcs.busy && ((abstractauto.autoexecdata >> i) & 1)
) {
perform_abstract_command();
}
return true;
perform_abstract_command();
}
return true;
@@
-410,9
+411,10
@@
bool debug_module_t::dmi_write(unsigned address, uint32_t value)
} else if (address >= DMI_PROGBUF0 && address < DMI_PROGBUF0 + progsize) {
unsigned i = address - DMI_PROGBUF0;
} else if (address >= DMI_PROGBUF0 && address < DMI_PROGBUF0 + progsize) {
unsigned i = address - DMI_PROGBUF0;
- write32(program_buffer, i, value);
+ if (!abstractcs.busy)
+ write32(program_buffer, i, value);
- if (
(abstractauto.autoexecprogbuf >> i) & 1
) {
+ if (
!abstractcs.busy && ((abstractauto.autoexecprogbuf >> i) & 1)
) {
perform_abstract_command();
}
return true;
perform_abstract_command();
}
return true;