joe 发表于 2021-7-28 13:46:47

手把手教你开始搭建Risc-v Rocket环境(1)

为了搭建Rocke环境,我买了一个2T的移动硬盘,安装的ubuntu-16.04 LTS版。没有java8,gcc是5.4.0
joe@joe-Inspiron-7460:~$ java -version程序 'java' 已包含在下列软件包中: * default-jre * gcj-5-jre-headless * openjdk-8-jre-headless * gcj-4.8-jre-headless * gcj-4.9-jre-headless * openjdk-9-jre-headless请尝试:sudo apt install <选定的软件包>joe@joe-Inspiron-7460:~$ echo $JAVA_HOME
joe@joe-Inspiron-7460:~$ gcc --versiongcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609Copyright (C) 2015 Free Software Foundation, Inc.This is free software; see the source for copying conditions.There is NOwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.1:下载jdk-8u171-linux-x64.tar.gz然后再执行 如下命令:
joe@joe-Inspiron-7460:~/Downloads$ sudo mkdir /usr/lib/jdk8u171
joe@joe-Inspiron-7460:~/Downloads$ tar -zxvf jdk-8u171-linux-x64.tar.gz
joe@joe-Inspiron-7460:~/Downloads$ sudo mv jdk1.8.0_171 /usr/lib/jdk8u171/
joe@joe-Inspiron-7460:~$ gedit .bashrc在.bashrc文件中增加如下内容:export JAVA_HOME=/usr/lib/jdk8u171/jdk1.8.0_171export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=.:${JAVA_HOME}/bin:$PATH
joe@joe-Inspiron-7460:~$ source ~/.bashrc
此时再测试java -version则成功:joe@joe-Inspiron-7460:~$ java -versionjava version "1.8.0_171"Java(TM) SE Runtime Environment (build 1.8.0_171-b11)Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)2:参考
https://github.com/freechipsproject/rocket-chip
https://github.com/freechipsproject/rocket-chip#quick
https://github.com/riscv/riscv-tools/blob/master/README.md
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev3:因为是新系统没有git ,所以先安装git 命令 sudo apt-get install git 然后在主目录下建立rocketchip目录并进入目录:
joe@joe-Inspiron-7460:~/rocketchip$ git clone https://github.com/ucb-bar/rocket-chip.gitjoe@joe-Inspiron-7460:~/rocketchip$ cd rocket-chipjoe@joe-Inspiron-7460:~/rocketchip/rocket-chip$ git submodule update --init子模组 'chisel3' (https://github.com/ucb-bar/chisel3.git) 未对路径 'chisel3' 注册子模组 'firrtl' (https://github.com/ucb-bar/firrtl.git) 未对路径 'firrtl' 注册子模组 'hardfloat' (https://github.com/ucb-bar/berkeley-hardfloat.git) 未对路径 'hardfloat' 注册子模组 'riscv-tools' (https://github.com/riscv/riscv-tools.git) 未对路径 'riscv-tools' 注册子模组 'torture' (https://github.com/ucb-bar/riscv-torture.git) 未对路径 'torture' 注册正克隆到 'chisel3'...remote: Counting objects: 16295, done.remote: Compressing objects: 100% (155/155), done.remote: Total 16295 (delta 81), reused 186 (delta 51), pack-reused 16042接收对象中: 100% (16295/16295), 2.77 MiB | 17.00 KiB/s, 完成.处理 delta 中: 100% (7605/7605), 完成.检查连接... 完成。子模组路径 'chisel3':检出 'e03e3f730250673ffa48c000caa369ed582467a2'正克隆到 'firrtl'...remote: Counting objects: 19723, done.remote: Compressing objects: 100% (104/104), done.error: RPC failed; curl 18 transfer closed with outstanding read data remainingfatal: The remote end hung up unexpectedlyfatal: 过早的文件结束符(EOF)fatal: index-pack failedfatal: 无法克隆 'https://github.com/ucb-bar/firrtl.git' 到子模组路径 'firrtl'
查看文件夹~/rocketchip/ 发现其中的rocket-chip,torture,hardfloat目录中都是空的,并且firrtl目录也不存在。
页: [1]
查看完整版本: 手把手教你开始搭建Risc-v Rocket环境(1)