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 652 forks source link

GCC 13.1.0 Prerequisites to run benchmark.sh #2230

Open Tanishqgithub opened 3 weeks ago

Tanishqgithub commented 3 weeks ago

Is there an existing CVA6 bug for this?

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.

JeanRochCoulon commented 3 weeks ago

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

Tanishqgithub commented 3 weeks ago

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

Moschn commented 3 weeks ago

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.

Tanishqgithub commented 3 weeks ago

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.