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

Console Freezing Issue with CVA5 CPU #1981

Open
Liamfeng opened this issue Jun 5, 2024 · 1 comment
Open

Console Freezing Issue with CVA5 CPU #1981

Liamfeng opened this issue Jun 5, 2024 · 1 comment

Comments

@Liamfeng
Copy link

Liamfeng commented Jun 5, 2024

Hello,

I am experiencing an issue when running the console with the CVA5 CPU using the script ./litex_sim.py --cpu-type cva5 --with-sdram. The console consistently freezes after typing just a few characters, without even pressing enter. On rare occasions, I can enter a full command, but this is uncommon.

I have isolated the problem to the litex_getc(FILE *file) function located in litex/litex/soc/software/libc/stdio.c. The program appears to get trapped in an infinite while loop within this function, preventing it from progressing.

Screenshot from 2024-06-04 16-58-23

In an effort to resolve this, I replaced the while loop with a for loop that iterates 1000 times, hoping that breaking out of the loop would stop the freezing. Unfortunately, the console still freezes after a few characters.

The screenshot below shows my console in a frozen state when running on the CVA5 CPU:

image

I also tested the script with the vexriscv_smp and vexriscv CPUs. Although the issue persists, I am able to type a lot more characters before the console freezes:

image

Could anyone help me resolve this issue or provide insight into what might be happening? Any assistance would be greatly appreciated. Thank you!

Environment:
CPU: CVA5 (also tested with vexriscv_smp and vexriscv)
Script: ./litex_sim.py --cpu-type cva5 --with-sdram
File: litex/litex/soc/software/libc/stdio.c
Function: litex_getc(FILE *file)

@enjoy-digital
Copy link
Owner

Hi @Liamfeng,

I haven't used personally CVA5 yet but if you want more visibility, in simulation it's possible to enable tracing signals to a waveform with --trace , this could allow you to better understand what the CPU is doing through the memory/peripheral accesses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants