Skip to content

Conversation

@fkhaidari
Copy link
Contributor

This commit adds support for configuring the number of data registers available in the debug module. Previously, the debug module had a fixed datasize of 2, but now users can specify the number of data registers using the --dm-datacount option when running spike.

The changes include:

  • Adding a datacount parameter to debug_module_config_t
  • Making dmdata a std::vector instead of a fixed array
  • Validating that datacount is between 1 and 12
  • Updating the debug module to use the configured datacount
  • Adding command-line option to set datacount
  • Updating documentation in help output

@fkhaidari fkhaidari force-pushed the fk-sc/configurable-datacount branch from c4b3cf5 to 5a6f947 Compare October 14, 2025 15:27
@fkhaidari
Copy link
Contributor Author

@aswaterman, @arrv-sc, could you take a look?

@fkhaidari
Copy link
Contributor Author

I've mentioned this feature in #2086

This commit adds support for configuring the number of data registers available
in the debug module. Previously, the debug module had a fixed datasize of 2,
but now users can specify the number of data registers using the --dm-datacount
option when running spike.

The changes include:
- Adding a datacount parameter to debug_module_config_t
- Making dmdata a std::vector instead of a fixed array
- Validating that datacount is between 1 and 12
- Updating the debug module to use the configured datacount
- Adding command-line option to set datacount
- Updating documentation in help output

Signed-off-by: Farid Khaydari <[email protected]>
@fkhaidari fkhaidari force-pushed the fk-sc/configurable-datacount branch from 5a6f947 to 5397899 Compare October 14, 2025 19:29
std::find_if(debug_memory_regions.begin(), debug_memory_regions.end(),
[addr, len](const auto &range) {
return belongs_to_range(addr, len, range.addr, range.len);
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is obviously going to perform somewhat more poorly than the old code, but I think that's OK in this context; Spike should not be spending much time in these routines in normal operation.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@aswaterman
Copy link
Collaborator

@arrv-sc I'll wait for your approval before I merge.

@arromanoff arromanoff self-requested a review October 15, 2025 07:55
@arromanoff
Copy link
Collaborator

LGTM!

@aswaterman aswaterman merged commit 11ee6d0 into riscv-software-src:master Oct 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants