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

How can I use CVA6 to run User-Space applications(e.g hello.c)? #1871

Closed
niuzhi1221 opened this issue Feb 24, 2024 · 2 comments
Closed

How can I use CVA6 to run User-Space applications(e.g hello.c)? #1871

niuzhi1221 opened this issue Feb 24, 2024 · 2 comments
Assignees
Labels
Type:Question For general questions

Comments

@niuzhi1221
Copy link

I'm new to use CVA6.Following setup tutorial, I still can't find the way to run user-space applications.
I write a hello.c file, the content is as following:
#include<stdio.h>
int main(){
printf("hello, cva6!\n");
return 0;
}
I would appreciate if u could help me!Thanks!!

@Juan-Gg
Copy link
Contributor

Juan-Gg commented Feb 25, 2024

See the instructions on the project readme Running standalone simulations

The path to your C file is specified when calling cva6.py, after --c_tests.

python3 cva6.py --target cv32a60x --iss=$DV_SIMULATORS --iss_yaml=cva6.yaml \
--c_tests ../tests/custom/hello_world/hello_world.c \ <--####### PATH TO C FILE ########
--linker=../tests/custom/common/test.ld \
--gcc_opts="-static -mcmodel=medany -fvisibility=hidden -nostdlib \
-nostartfiles -g ../tests/custom/common/syscalls.c \
../tests/custom/common/crt.S -lgcc \
-I../tests/custom/env -I../tests/custom/common"

But you will not see any output from printf. See #748, #1783.
You can generate a .vcd waveform file though, by doing export TRACE_FAST=1 before running the simulation. I found I needed to run make clean && make -C verif/sim clean_all for this to work.

@JeanRochCoulon
Copy link
Contributor

Thanks @Juan-Gg for the support.
@niuzhi1221 If this answer your question, please close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Question For general questions
Projects
None yet
Development

No branches or pull requests

3 participants