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

Running hello.elf on Ariane 4.2 Simulation stuck #1638

Closed
1 task done
hhhsiang opened this issue Nov 16, 2023 · 11 comments
Closed
1 task done

Running hello.elf on Ariane 4.2 Simulation stuck #1638

hhhsiang opened this issue Nov 16, 2023 · 11 comments
Assignees
Labels
Type:Item-of-task This issue is an item of a larger task.

Comments

@hhhsiang
Copy link

hhhsiang commented Nov 16, 2023

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

I'm interested in conducting academic research on CPUs, and for this purpose, I've chosen Ariane (release 4.2) as it appears to be a stable version. After successfully running asm-tests and benchmarks using verilator4.110, everything seemed to be functioning well. However, when attempting to run a user application (work-ver/Ariane_testharness -v hello.vcd $RISCV/riscv64-unknown-elf/bin/pk hello.elf) following the README instructions, I encountered a simulation issue.
image
The simulation appears to be stuck, and there is no output or progress, even after waiting for two days. Additionally, I noticed that the hello.vcd file continuously grows and exceeds 200GB.

I came across similar issues reported in #282 and #298.

Since I need to run various test programs to validate my design, resolving this simulation problem for user applications is crucial.

I appreciate any assistance or insights you can provide. Thank you!

@hhhsiang hhhsiang added the Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system label Nov 16, 2023
@hhhsiang hhhsiang changed the title Running hello.elf on Ariane 4.2 Simulation Running hello.elf on Ariane 4.2 Simulation stuck Nov 16, 2023
@valentinThomazic
Copy link
Contributor

Did you try to run your hello.elf using Spike and the pk ? Trying to do so may help knowing wether the issue is coming from your build of Ariane or your pk / hello.elf.
I suggest you use either a version of Spike you would build yourself or to use a version of this repo prior to 220f534 since I personally did not manage to run the pk with Spike since these modifications even though there may be a way.

You can also try to run $RISCV/riscv64-unknown-elf/bin/bbl without your hello.elf and the -v option with Ariane. It is only the bootloader (so faster to load than the bbl, then the pk and finally your hello.elf) and may help you seeing if the simulation eventually finishes

@JeanRochCoulon JeanRochCoulon added Type:Item-of-task This issue is an item of a larger task. and removed Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system labels Nov 20, 2023
@JeanRochCoulon
Copy link
Contributor

related to #1569

@hhhsiang
Copy link
Author

@JeanRochCoulon ,I ran user application(hello.elf) on ariane4v2(release4.2). I think that using verilator is the right way to run simulation for release4.2, and it is a different issue with #1569, right?

@Moschn
Copy link
Contributor

Moschn commented Nov 24, 2023

@hhhsiang release 4.2 is very old and does not really reflect the current state of CVA6. Since we work on master, it will be hard to help you with specific issues. Nevertheless, I can give you some pointers on how you could investigate your issues and fix them yourself.

From your description, I understand that simulation is actually already running; it just never terminates. Further steps now would involve figuring out why the hello world application does not terminate. As you already enabled trace generation, you can check which instructions are retired in the trace. The commit stage has two signals commit_instr_i[0].pc and commit_instr_i[1].pc, which contain the instructions that the core retires. In your case, you can use them to understand which instructions are executed/retired. This should help pin down the issues.

Many people have been able to run a simple hello world at the time of release 4.2, so I assume the problems do not lie with the core nor the simulation (as you use the correct verilator version). Instead, I think the issues come from your toolchain and pk version. I have not yet seen any newish version of the pk or the toolchain be incompatible with the old release, but this could very well be the case.

@hhhsiang
Copy link
Author

@Moschn ,thanks for your help! I changed to older version of pk, and it finally worked!

@valentinThomazic
Copy link
Contributor

Hey @hhhsiang, could you close the issue if your problem is solved ?

@hhhsiang hhhsiang closed this as completed Dec 4, 2023
@yulong-lan
Copy link

Hi @hhhsiang. I run into the same problem as you did and I am also using an older version of everything. Could you tell me how you changed pk version and which, to run an elf?

@hhhsiang
Copy link
Author

Hi @yulong-lan. You can try to change the version of riscv-pk to 46cd5082c5d324bb843be35d8130aa9d44068d7d. You can go to newer version of cva6 to copy .sh file to intall riscv-pk. I go to newer commit (about 2023/3), and copy the install-riscvpk.sh file then change the pk version in it.
image

@yulong-lan
Copy link

@hhhsiang I didn't get the terminal output ""Hello CVA6", but the simulation indeed terminated this time. So your way at least partly works on my CVA6 version (I'm not using the version as old as Release 4,2 but still at the beginning of 2023) and I really appreciate your very detailed answer to my question!

@yulong-lan
Copy link

@hhhsiang have you tried to run an elf program directly without using proxy kernel?

@hhhsiang
Copy link
Author

@yulong-lan if you want to print "Hello CVA6", you can search related issue, some people have proposed it. You just need to modify some code, and it will print mormally.

@hhhsiang have you tried to run an elf program directly without using proxy kernel?

I didn't try it ever, but i think i will need to run elf program in the future. Maybe we can discuss together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Item-of-task This issue is an item of a larger task.
Projects
None yet
Development

No branches or pull requests

5 participants