一键安装gem5环境&&下载RISCV编译器Windows中Ubuntu子系统wsl

本文档详述了如何在Ubuntu环境下安装Gem5模拟器以及构建RISC-V GNU工具链的过程。首先,通过更新系统和安装必要的依赖,然后克隆并构建Gem5的X86、ARM和RISCV版本。接着,下载并编译RISC-V的源代码,包括GCC、Glibc、Newlib、Binutils和Dejagnu。最后,配置和安装RISC-V工具链到指定路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • environment deployment
cd /mnt/

sudo apt-get update

sudo apt install build-essential git m4 scons zlib1g zlib1g-dev libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev python-dev python

sudo apt install git

sudo apt install build-essential

sudo apt install scons

sudo apt install python3-dev

sudo apt install libprotobuf-dev protobuf-compiler libgoogle-perftools-dev

sudo apt install libboost-all-dev

sudo apt install python3-pip

sudo git clone https://gitee.com/lizeyujack/gem5.git

cd /mnt/gem5

sudo python3 `which scons` build/X86/gem5.opt -j3
sudo python3 `which scons` build/ARM/gem5.opt -j3
sudo python3 `which scons` build/RISCV/gem5.opt -j3
  • download RISCV in wsl (windows-ubuntu-16.0)
cd $HOME
mkdir riscv
mkdir source-code
cd source-code

sudo git clone https://gitee.com/lizeyujack/riscv-gnu-toolchain.git
cd riscv-gnu-toolchain

rm -rf riscv-*

sudo git clone https://gitee.com/mirrors/riscv-dejagnu.git
sudo git clone -b riscv-gcc-10.2.0 https://gitee.com/woshinieao/riscv-gcc.git
sudo git clone -b riscv-glibc-2.29 https://gitee.com/mirrors/riscv-glibc.git
sudo git clone https://gitee.com/mirrors/riscv-newlib.git

sudo git clone -b riscv-binutils-2.35 https://gitee.com/mirrors/riscv-binutils-gdb.git  riscv-binutils
sudo git clone -b fsf-gdb-10.1-with-sim https://gitee.com/mirrors/riscv-binutils-gdb.git riscv-gdb


sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
sudo apt-get install libnewlib-dev

NSTALL_PATH='/opt/riscv'
NUM_CPU=2

export PATH=$PATH:$INSTALL_PATH/BIN
sudo ./configure --prefix=$INSTALL_PATH
sudo make -j$NUM_CPU
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值