cva6 icon indicating copy to clipboard operation
cva6 copied to clipboard

GCC 13.1.0 Prerequisites to run benchmark.sh

Open Tanishqgithub opened this issue 1 year ago • 4 comments

Is there an existing CVA6 bug for this?

  • [X] I have searched the existing bug issues

Bug Description

Re-opening the issue #2200

I saw that while reading the README for Verification Environment in https://github.com/openhwgroup/cva6/blob/master/verif/README.md there is a Prerequisites for GCC 13.1.0 Compiler . As per https://github.com/openhwgroup/cva6/blob/master/util/gcc-toolchain-builder/README.md we have already build the GCC 13.1.0 baremetal Is it necessary to built again the gcc 13.1.0 compiler to run benchmark.sh and others in ./verif/regress. And if it is necessary i tried to install the toolchain but facing the issue : image image How to overcome in cloning the submodule binutils

And with reference to #2200 how can i run the benchmark.sh on cv32a60x or any other then cv64a6_imafdc_sv39 [steps i need to follow to run on cv32a60x explicitly]

To run hello_world and smoke test : export RISCV=/home/pescampus/Desktop/CVA6/cva6/util/gcc-toolchain-builder/gcc-13.1.0-baremetal/ whereas to run bechmarks.sh and others in ./verif/regress. image I just want to ensure I'm on the right track. Am I understanding correctly, or do I need clarification? Your feedback would be greatly appreciated.

Tanishqgithub avatar Jun 11 '24 06:06 Tanishqgithub

It is necessary to build one time GCC. To use it (and prevent to re-build it), please setup the RISCV shell variable.

JeanRochCoulon avatar Jun 11 '24 10:06 JeanRochCoulon

As you said if i use the gcc13.1.0 baremetal to run the benchmark.sh to setup the RISCV variables i don't have /bin/riscv64-unknown- ; /bin/riscv64-unknown-gcc to setup for RISCV_PREFIX ; RISCV_GCC ; CV_SW_PREFIX variables .

The RISCV toolchain [gcc 13.1.0 baremetal] has the following files in that path [/home/pescampus/Desktop/CVA6/cva6/util/gcc-toolchain-builder/gcc-13.1.0-baremetal/bin/] image

So how can i setup the variables using this gcc 13.1.0 baremetal which was installed using https://github.com/openhwgroup/cva6/blob/master/util/gcc-toolchain-builder/README.md

Tanishqgithub avatar Jun 11 '24 10:06 Tanishqgithub

I do not understand your issue. Just follow the steps in the verif readme:

These commands will install the riscv gcc 13.1.0 compiler which is the latest version. Once running the previous commands, your environment must be updated with :

  • export RISCV=/path/to/installation/directory
  • export RISCV_PREFIX=/path/to/installation/directory/bin/riscv64-unknown-
  • export RISCV_GCC=/path/to/installation/directory/bin/riscv64-unknown-gcc
  • export CV_SW_PREFIX=riscv64-unknown-elf-

Obviously, you have to replace the /path/to/installation with your path where you installed the toolchain.

Moschn avatar Jun 11 '24 11:06 Moschn

I followed the commands in https://github.com/openhwgroup/cva6/blob/master/verif/README.md the commands i gave is :

1. git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain ~/Desktop/CVA6/cva6/riscv-gnu-toolchain
2.  cd riscv-gnu-toolchain
3.  git clone https://github.com/gcc-mirror/gcc -b releases/gcc-13 gcc-13
4.  ./configure –prefix:/path/to/installation/directory --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;" --with-gcc-src=`pwd`/gcc-13
5. make –j32

The last part of log in terminal after running make -j32 is as follows : make_log_file.txt

Then i set environment variables as follows :

export RISCV=/home/pescampus/Desktop/CVA6/cva6/riscv-gnu-toolchain/riscv
export RISCV_PREFIX=/home/pescampus/Desktop/CVA6/cva6/riscv-gnu-toolchain/riscv/bin/riscv64-unknown-
export RISCV_GCC=/home/pescampus/Desktop/CVA6/cva6/riscv-gnu-toolchain/riscv/bin/riscv64-unknown-gcc
export CV_SW_PREFIX=riscv64-unknown-elf-

After running the dv-riscv-compliance.sh or any test in ./verif/regress i got the issue : image

I certainly know something wrong while installing GCC 13.1.0 ; but couldn't debug it can u please help me what am i missing with.

And while installing GCC 13.1.0 the submodules binutils ; gdb ; newlib are suspiciously not getting cloned using the classical command git submodule update --init --recursive then i visited the website which stated "Page not found 404" So i change the command slightly which is there in [1] git clone --recursive https://github.com/riscv-collab/riscv-gnu-toolchain ~/Desktop/CVA6/cva6/riscv-gnu-toolchain I don't know how to handle these case.

Tanishqgithub avatar Jun 11 '24 13:06 Tanishqgithub

benchmark.sh has been updated. Can you confirm it works and close the github issue if ok.

JeanRochCoulon avatar Jul 05 '24 13:07 JeanRochCoulon

Hello @Tanishqgithub, I would advise not following the instructions on the verif README which seems out of date. Instead, you should be good by just setting the RISCV env variable to your toolchain installation and running the benchmark script from the root of the repository as you would do to run the smoke tests for instance (more like following the root README). Let me know if it works !

valentinThomazic avatar Jul 08 '24 08:07 valentinThomazic

@valentinThomazic
Respected sir U understood my issue correctly, thanks for that I will check it out and let you know

Tanishqgithub avatar Jul 09 '24 01:07 Tanishqgithub

No worries, I would add that you should use the toolchain built with the scripts in util/, not the one built with the verif readme instructions

valentinThomazic avatar Jul 09 '24 08:07 valentinThomazic

@valentinThomazic Respected Sir

I did try to run the benchmark.sh script after installing the gcc 13.1.0 baremetal as per main README

  1. I ran the smoke test first , which everything is passing : smoke_test.txt

  2. then i tried running the benchmark test : benchmark.txt

and i am even attaching the log.iss file for dhystrone program : dhrystone_main.cv64a6_imafdc_sv39_log_iss.txt

  1. I am trying to run my own C program so i replaced the file contents of hello_world.c to some other program ex : Binary sort And when i run with the vcd dump [i,e export TRACE_FAST=1] i am getting this : hello_world_log_iss.txt and the target is cv64a6_imafdc_sv39

  2. Please help me out in running any C program Is the procedure followed to run any other C program given in last step 3. correct?

Tanishqgithub avatar Jul 10 '24 11:07 Tanishqgithub

Anyone please update on this issue

Tanishqgithub avatar Jul 15 '24 11:07 Tanishqgithub

Hello,

It seems that you are running the benchmark script with DV_SIMULATORS=veri-testharness,spike. This means that verilator and spike trace are compared. I am not sure the benchmarks should be ran with trace comparison, as you can see in your dhrystone log, the simulation successes.

For you c program : did you clean the work-ver (there are makefiles target) before doing so ? Did you try without trace_fast argument ?

valentinThomazic avatar Jul 15 '24 11:07 valentinThomazic

  1. For benchmark.sh : I though similar to smoke_test.sh i could run this benchmark.sh as some testing file so i gave DV_SIMULATORS=veri-testharness,spike If only SUCESS is the case then it is running successfully

  2. Regarding own C program : This is acting in haphazard manner (a) first when i replaced the HELLO_WORLD program with another C program then i got SUCESS message (b) then i tried with trace_fast argument which failed (c) after this i tried it without trace_fast then again it came failed which actually passed in (a); NOTE : I started with new command prompt with not enabling trace_fast command Am i following the correct method or some other insights are needed ?

Tanishqgithub avatar Jul 15 '24 13:07 Tanishqgithub

The success would mean that the trace comparison between spike and verilator is the same. It is apparently not but the information we use is the cycle count of the cva6 itself meaning we only run it with veri-testharness in CI and check the cycle count value.

About the trace issue, did you try running make clean before trying again ? (you can also use make -C verif/sim clean_all)

valentinThomazic avatar Jul 23 '24 15:07 valentinThomazic

Sorry to insert me in your discussion, but a github issue should report one and only one issue. When the issue is fixed, the github issue is close, then feel free to open another one. That is why I close this issue

JeanRochCoulon avatar Jul 23 '24 20:07 JeanRochCoulon