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

Exit cycle accurate simulation #398

Open
ashuthosh-mr opened this issue Mar 12, 2024 · 1 comment
Open

Exit cycle accurate simulation #398

ashuthosh-mr opened this issue Mar 12, 2024 · 1 comment

Comments

@ashuthosh-mr
Copy link

Hi,

Is there a way to exit the verilator simulation from the C code whose hex is getting executed using RUN_HEX. For some reason, certain C codes are exiting but others are not. I do not know the exact reason why it executes all instructions and gets stuck at the end of main. By default (hello_world), it falls in infinite loop. But on changing crt.S to include

li x2, 0xF00FFF20
sw x0, 0(x2)

few codes come out of simulation, printing cycles. But as I mentioned this fix didn't work for certain C codes. Is there a way to exit simulation through C code?

Thank you

@Dolu1990
Copy link
Member

Hi,

For some reason, if you the debug plugin is enabled, those exit condition are disabled :

#ifndef DEBUG_PLUGIN_EXTERNAL

Try removing the #ifndef

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

No branches or pull requests

2 participants