2053 views|2 replies

1668

Posts

0

Resources
The OP
 

Compilation and use of rocket-chip tool chain [Copy link]

 

Compilation steps of rocket-chip toolchain:

1. Configure the Ubuntu environment first. The tutorials on GitHub are all based on Ubuntu. This is why Ubuntu is recommended for Linux systems. Install the following tools and make sure that the version of GCC is greater than or equal to 4.8.
$ sudo apt-get install autoconf automake autotools-dev curl device-tree-compiler libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat1-dev pkg-config
Copy code
2. Then enter the directory of riscv-tools to update the directory. Because riscv-tools has too much content, it needs to be updated twice. At the same time, you need to set environment variables, and the specific path should be configured according to your needs.
$ cd rocket-chip/riscv-tools
$ git submodule update --init --recursive
$ export RISCV=/path/to/install/riscv/toolchain
Copy code
3. The third step is to compile the cross toolchain. I usually use the build.sh script directly to compile all the tools. I generate a 32-bit cross toolchain.
$ ./build.sh
Copy code
4. The fourth step is a long wait. The longest compile time of the riscv-tools tool is riscv-gnu-toolchain. The compile time of other tools is not too bad. You need to wait until all tools are compiled successfully.

Problems you may encounter when compiling a cross-toolchain:

1. The problem of "c++11" appears:
This problem is caused by the gcc version being too low. The gcc version cannot be lower than 4.8. You can use gcc –version to view the gcc version.

2. The message "error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+" appears. This is because the version of gcc's dependent tools is not high enough. You can try the following operations:
cd <riscv-tools>/riscv-gnu-toolchain/riscv-gcc
contrib/download_prerequisites
sudo yum install gmp gmp-devel mpfr mpfr-devel libmpc libmpc-devel
Copy code
3. Don't be afraid of errors. Just search for corresponding keywords in Google/Baidu according to the error prompt to find the solution, because most errors are caused by the improper configuration of Ubuntu environment. As long as all the tools in the first step are installed successfully, the cross tool chain will be compiled successfully.

This post is from Domestic Chip Exchange

Latest reply

I thought it was rockchip...   Details Published on 2021-9-27 18:04
 
 

1942

Posts

2

Resources
2
 

What is the rocket-chip toolchain mainly used for compilation?

This post is from Domestic Chip Exchange
 
 
 

7452

Posts

2

Resources
3
 

I thought it was rockchip...

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list