一.先下载并初始化rocket-chip仓库
用一般用户就可以在/home/登陆账号(whch)/ 下载,用如下命令
si# Download and initialize the Rocket Chip repository
git clone https://github.com/ucb-bar/rocket-chip.git
cd rocket-chip
git submodule update --init
下面安装 rocket-chip generator所需要的依赖:工具链和chisel工具
二.下载riscv编译工具链
就是在rocket-chip下进行,以下命令都是连续的。
$ git clone https://github.com/freechipsproject/rocket-tools
$ cd rocket-tools
$ git submodule update --init --recursive
三.配置环境变量
whch@whch:~/rocket-chip$ pwd
/home/whch/rocket-chip #下面的环境路径
vim ~/.bashrc
#在里面加入如下命令
export TOP=/home/whch/rocket-chip
export RISCV=$TOP/ rocket-tools
export PATH=$PATH:$RISCV/bin
#然后wq保存
#接着让环境生效
source ~/.bashrc