Skip to content
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

Fix cv32e40x hanging on fence.i instructions #614

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

Vincenzo-Petrolo
Copy link
Contributor

Motivation

The cv32e40x core within X-HEEP currently hangs on all fence.i instructions. This issue arises because fence.i instructions wait for an external handshake signal (fencei_flush_ack_i) before proceeding to commit the instruction. According to cv32e40x documentation:

It is recommended to tie fencei_flush_ack_i to 1 in order to avoid stalling fence.i instructions indefinitely.

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 stalled fence.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

  • Pull the latest version of X-HEEP.
  • Set cv32e40x as the Host CPU, then generate and build the project.
  • Connect to the core using GDB following the debugging guide.
  • Observe the Ignoring packet error message in the GDB terminal, indicating that the connection timed out because the cv32e40x 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.

@davideschiavone davideschiavone merged commit c0567bd into esl-epfl:main Dec 23, 2024
5 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.

2 participants