-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openOCD can not configures the related "Width of System Bus Access" (sbcs.sbaccess) by return value of sbcs.sbacccess128/64/32/16/8 ? #1177
Comments
@Qidi-ic, I didn't quite get what your question is. Memory access requests in OpenOCD specify the width of the access. If the requested access width is not supported by System Bus (i.e. the corresponding |
Really thanks for your reply, @en-sc ! Surely, the width of System Bus access depends on e.g. When a new Memory access is requested, which access width is configured in the |
When a user requests a memory access via TCL interface, they specify the width they want to use for this access.
However, GDB's packets do not specify the access width (https://sourceware.org/gdb/current/onlinedocs/gdb.html/Packets.html#Packets), and OpenOCD is free to choose the access width. Currently RISC-V targets use the default implementation that first aligns the access and then accesses the memory using riscv-openocd/src/target/target.c Lines 2437 to 2471 in ea8f9d5
riscv-openocd/src/target/riscv/riscv-013.c Lines 2118 to 2152 in ea8f9d5
There is definitely room for improvement there, e.g. on a target that supports only 32-bit wide unaligned System Bus Access, current algorithm will fail to write a memory region that does is not aligned, since it will attempt to align the start address using accesses with smaller sizes. |
Very appreciate for such a detailed answer! I now have a clearer understanding of the SBA access mechanism. Furthermore, over the past few days, I've been trying to use GDB to try to configure 64bit access on a platform that supports up to 32 bits. OpenOCD would initiate 2 time 32-bit accesses to complete 64-bit System Bus Access request by calling this code: This function is not easy to found in debugging process, this may be that this mechanism is not explicitly stated in the User Guide. By the way, the aim of this issue is to find out the System Bus Access width configuration in openOCD. It seems to be solved! Thanks! |
Closing this one. Created #1184 to track the work on improving |
cfg file has add system bus access option:
riscv set_mem_access sysbus
source code also shows how openOCD handle the sbcs.sbaccess field:
riscv-openocd/src/target/riscv/riscv-013.c
Line 2349 in ca80920
However, this function is called by others in context. I'm not sure whether openOCD will modify sbcs.sbaccess according to sbaccess8/16/32/64 in sbcs to achieve access with different bit widths.
Moreover, I also noticed that "size_bytes" finally is called by this:
riscv-openocd/src/target/riscv/riscv-013.c
Line 1245 in ca80920
The text was updated successfully, but these errors were encountered: