openhwgroup / cva6

The CORE-V CVA6 is an Application class 6-stage RISC-V CPU capable of booting Linux
https://docs.openhwgroup.org/projects/cva6-user-manual/
Other
2.14k stars 651 forks source link

Failed to run any other C programs other than hell_world.c #2200

Closed Tanishqgithub closed 3 weeks ago

Tanishqgithub commented 1 month ago

Is there an existing CVA6 bug for this?

Bug Description

I am constantly trying to run many other C programs other than hello_world.c program specified in the repository(which is program to print hello world! ) and i can see that only the C programs which uses only gets successfully executed. like this progam : binary_sort.c
binary_sort.txt

And then i tried with other programs which uses other libraries such as ; ; like these programs : reverse_string.c
image and some more examples which contain malloc() {like Huffman Coding examples which is there in
huffman_coding.txt }

The above programs are not successfully running and produce this log file : hello_world.cv32a60x.log.iss_for_issue.txt and even it is failing the smoke test (not the other benchmarks but the test where hello_world.c is tested)

I don't know if i am following the correct procedure to execute these programs or is there any issue regarding this. Please help me out. This is what i did to run any other C program :

  1. change the contents of hello_world.c to whichever C program i need to run
  2. run the smoke test
  3. then use the classical command to run hello_world.c in processor i,e image Please clarify me if i am correct regarding the steps followed to run C programs or is there any additional steps that has to included to achieve successful execution

And please can u give an example command to run the Assembly level Programs in this processor

JeanRochCoulon commented 1 month ago

Perhaps analyzing coremark or dhrystone benchmarks which are included in the CI canhelp you. They are in C and dayly run on CVA6.

Tanishqgithub commented 4 weeks ago

As specified by you i tried to run the dhrystone benchmarks and got this log file : image and the corresponding log file : dhrystone_main.hwconfig.log.iss.txt i tried to analyze the trace file but couldn't get any conclusions from it .

i even tried to run all the benchmarks using the file verif/regress/benchmark.sh and all failed to run successfully some of the log files :

  1. median.cv64a6_imafdc_sv39.log.iss.txt
  2. mm.cv64a6_imafdc_sv39.log.iss.txt and some more where all failed

Can u please tell me what is wrong with my toolchain here

And can u please comment on the procedure i have employed to running other C program in the previous message

JeanRochCoulon commented 4 weeks ago

Are you on the up to date master branch, what is your hash ?

JeanRochCoulon commented 4 weeks ago

If you clone the master branch (without any modification) and you simulate benchmark.sh, does it work ?

Tanishqgithub commented 4 weeks ago

Are you on the up to date master branch, what is your hash ?

Yes, I am on the master branch and here is the details of my hash : image

JeanRochCoulon commented 4 weeks ago

If you run your tests on origin/master, it should work

Tanishqgithub commented 4 weeks ago

as you said i cloned the repository again and simulated the smoke test : iss_regr_log.txt

then i simulated the benchmark.sh but the result i got is same as the previous message , none of the benchmarks are running successfully Please help me out in what is the mistake i may have been doing

Moschn commented 4 weeks ago

I noticed that some of your logs have cv64a6_imafdc_sv39 and your run.py uses cv32a60x. These are different configurations of the core, one in 64bit with floating point and MMU support and the other a 32-bit configuration. Make sure you use the correct compiler and the correct configuration you want to test. Also you could take a look at the CI which successfully executes the benchmarks and numerous more tests on every commit.

BTW: Your original question asked for stdio.h. CVA6 no longer supports riscv-pk which is required to print in simulation. Therefore, it will be tricky to print right out of the box.

JeanRochCoulon commented 3 weeks ago

No update... I suppose the @Moschn feedback solved the issue. I close it, re-open it if needed.