学习riscv-vector加速器(1):搭建pulp-platform/ara的测试环境

搭建pulp-platform/ara测试环境

ara是一个比较完整的开源riscv-vector加速器,也是目前为止我所见到的最认真、更新最积极的riscv-vector加速器项目。不过pulp项目组比较高冷,其入门帮助写的比较简略,我在配置这个项目时踩了不少坑,故记录分享一下经验。

我的系统:deepin 20.4(其它Debian发行版可以参考)

  1. clone项目:git clone https://github.com/pulp-platform/ara.git
  2. 检查ara各个子项目的依赖需求,依次安装:
    1. riscv-gnu-toolchain: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
    2. riscv-isa-sim:sudo apt-get install device-tree-compiler
    3. riscv-llvm:sudo apt-get install clang cmake ninja-build
    4. Verilator:sudo apt-get install git perl python3 make autoconf g++ flex bison ccache && sudo apt-get install libgoogle-perftools-dev numactl perl-doc && sudo apt-get install libfl2 # Ubuntu only (ignore if gives error) && sudo apt-get install libfl-dev # Ubuntu only (ignore if gives error) && sudo apt-get install zlibc zlib1g zlib1g-dev # Ubuntu only (ignore if gives error)
  3. 额外还需要安装sudo apt-get install libelf-dev,否则编译hardware的时候会报错
  4. 在ara目录中执行:git submodule update --init --recursive(这一步需要下载大量文件,建议科学上网)
  5. 在ara目录中执行make toolchain-llvm、make riscv-isa-sim、make verilator
  6. 该步仅deepin需要,ubuntu系统应该不需要:去https://github.com/pulp-platform/bender/releases下载一个新版本的bender-{xxx}-x86_64-linux-gnu.tar.gz,解压后将可执行文件bender放到/ara/hardware目录中,编辑hardware目录下的Makefile文件,注释掉第95行的“curl --proto ‘=https’ --tlsv1.2 https://fabianschuiki.github.io/bender/init -sSf | sh -s – 0.23.1”,最后一行 rm -f bender也需要注释掉
  7. (可选)如果发现执行完上述步骤,在编译apps时报gcc相关的错误,可以在ara目录下执行make toolchain-gcc,单独编译一次riscv gcc(在一台电脑上碰到了,另一台倒是没有)

到此万事大吉,可以按照https://github.com/pulp-platform/ara#software的步骤在apps目录下编译软件或者按照https://github.com/pulp-platform/ara#rtl-simulation在hardware目录下编译RTL(注意,没安装ModelSim的话,编译RTL需要用Verilator,即包含simv的指令)
需要用gtkwave看波形的话,记得单独sudo apt-get install ,在hardware里clean一下,从make verilator开始,每一步都要加上trace=1

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值