-
Notifications
You must be signed in to change notification settings - Fork 353
Description
From the RISC-V Debug Specification (ratified February 2025), in the definition of the sbcs register, the sbasize field is defined (Page 44, Table on top) as:
sbasize : Width of system bus addresses in bits. (0 indicates there is no bus access support.)
But these lines in riscv-013.c, where sbasize is examined to return status about implementation support for memory sampling, do not include the case when sbasize is zero.
if (sbasize > 64) {
LOG_TARGET_ERROR(target, "Memory sampling is only implemented for sbasize <= 64.");
return ERROR_NOT_IMPLEMENTED;
}
This behaviour was observed when trying MemorySample tests from the RISC-V Debug Test suite on a design with only Program Buffer support.
The following patch fixes the issue:
if (sbasize == 0 || sbasize > 64)
Thanks.