Skip to content

Commit d3b8933

Browse files
authored
Merge pull request #2145 from nadime15/add-dm-no-abstractauto-flag
Make abstractauto register optional in debug module
2 parents 5bea40c + 3ab6f34 commit d3b8933

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

riscv/debug_module.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,6 @@ bool debug_module_t::dmi_write(unsigned address, uint32_t value)
10401040
dmcontrol.ndmreset = get_field(value, DM_DMCONTROL_NDMRESET);
10411041
if (config.support_hasel)
10421042
dmcontrol.hasel = get_field(value, DM_DMCONTROL_HASEL);
1043-
else
1044-
dmcontrol.hasel = 0;
10451043
dmcontrol.hartsel = get_field(value, DM_DMCONTROL_HARTSELHI) <<
10461044
DM_DMCONTROL_HARTSELLO_LENGTH;
10471045
dmcontrol.hartsel |= get_field(value, DM_DMCONTROL_HARTSELLO);
@@ -1101,10 +1099,12 @@ bool debug_module_t::dmi_write(unsigned address, uint32_t value)
11011099
return true;
11021100

11031101
case DM_ABSTRACTAUTO:
1104-
abstractauto.autoexecprogbuf = get_field(value,
1105-
DM_ABSTRACTAUTO_AUTOEXECPROGBUF);
1106-
abstractauto.autoexecdata = get_field(value,
1107-
DM_ABSTRACTAUTO_AUTOEXECDATA);
1102+
if (config.support_abstractauto) {
1103+
abstractauto.autoexecprogbuf = get_field(value,
1104+
DM_ABSTRACTAUTO_AUTOEXECPROGBUF);
1105+
abstractauto.autoexecdata = get_field(value,
1106+
DM_ABSTRACTAUTO_AUTOEXECDATA);
1107+
}
11081108
return true;
11091109
case DM_SBCS:
11101110
sbcs.readonaddr = get_field(value, DM_SBCS_SBREADONADDR);

riscv/debug_module.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct debug_module_config_t {
2424
bool support_abstract_fpr_access = true;
2525
bool support_haltgroups = true;
2626
bool support_impebreak = true;
27+
bool support_abstractauto = true;
2728
};
2829

2930
struct dmcontrol_t {

spike_main/spike.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static void help(int exit_code = 1)
8484
fprintf(stderr, " --dm-no-abstract-fpr Debug module won't support abstract FPR access\n");
8585
fprintf(stderr, " --dm-no-halt-groups Debug module won't support halt groups\n");
8686
fprintf(stderr, " --dm-no-impebreak Debug module won't support implicit ebreak in program buffer\n");
87+
fprintf(stderr, " --dm-no-abstractauto Debug module won't support the abstractauto register\n");
8788
fprintf(stderr, " --blocksz=<size> Cache block size (B) for CMO operations(powers of 2) [default 64]\n");
8889
fprintf(stderr, " --instructions=<n> Stop after n instructions\n");
8990

@@ -434,6 +435,8 @@ int main(int argc, char** argv)
434435
[&](const char UNUSED *s){dm_config.support_abstract_fpr_access = false;});
435436
parser.option(0, "dm-no-halt-groups", 0,
436437
[&](const char UNUSED *s){dm_config.support_haltgroups = false;});
438+
parser.option(0, "dm-no-abstractauto", 0,
439+
[&](const char UNUSED *s){dm_config.support_abstractauto = false;});
437440
parser.option(0, "log-commits", 0,
438441
[&](const char UNUSED *s){log_commits = true;});
439442
parser.option(0, "log", 1,

0 commit comments

Comments
 (0)