Fix cv32e40x
hanging on fence.i
instructions
#614
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The
cv32e40x
core within X-HEEP currently hangs on allfence.i
instructions. This issue arises becausefence.i
instructions wait for an external handshake signal (fencei_flush_ack_i
) before proceeding to commit the instruction. According tocv32e40x
documentation:However, in X-HEEP, such signal is tied to 0.
This behavior creates a critical problem when using GDB, as
fence.i
instructions are sent when establishing a new connection with the core. A stalledfence.i
instruction causes the core to hang, leading to a timeout in the remote connection and ultimately causing the debugger to fail.Reproducing the issue
cv32e40x
as the Host CPU, then generate and build the project.Ignoring packet error
message in the GDB terminal, indicating that the connection timed out because thecv32e40x
core is stalled.Fix
The proposed fix resolves the stalling issue, allowing the
cv32e40x
core to operate correctly without hanging during fence.i instructions. With this fix, the GDB connection does not time out.The solution has been tested in both simulation and on the FPGA target device
zcu104
.