RISC-V CVA6 在 Linux 下相关环境下载与安装

embedded/2025/3/24 4:03:03/

RISC-V CVA6 在 Linux 下相关环境下载与安装

所需环境与源码下载

CVA6 源码下载

首先,我们可以直接从 GitHub 一次性拉取所有源码:

git clone --recursive https://github.com/openhwgroup/cva6.git

如果这里遇到网络问题,拉取失败,分开拉取一下所有包:

首先拉取 CVA6 源码并查看所需要的所有包:

git clone https://github.com/openhwgroup/cva6.git
cat cva6/.gitmodules

image

然后进入源码路径下,拉取所有需要的包:

cd cva6
git clone --recursive https://github.com/pulp-platform/axi_mem_if.git corev_apu/axi_mem_if
git clone --recursive https://github.com/pulp-platform/register_interface.git corev_apu/register_interface
git clone --recursive https://github.com/pulp-platform/apb_uart.git corev_apu/fpga/src/apb_uart
git clone --recursive https://github.com/pulp-platform/apb_node.git corev_apu/fpga/src/apb_node
git clone --recursive https://github.com/pulp-platform/axi2apb.git corev_apu/fpga/src/axi2apb
git clone --recursive https://github.com/pulp-platform/axi_slice.git corev_apu/fpga/src/axi_slice
git clone --recursive https://github.com/lowRISC/ariane-ethernet.git corev_apu/fpga/src/ariane-ethernet
git clone --recursive https://github.com/pulp-platform/axi_riscv_atomics.git corev_apu/src/axi_riscv_atomics
git clone --recursive https://github.com/pulp-platform/riscv-dbg.git corev_apu/riscv-dbg
git clone --recursive https://github.com/pulp-platform/rv_plic.git corev_apu/rv_plic
git clone --recursive https://github.com/pulp-platform/apb_timer.git corev_apu/fpga/src/apb_timer
git clone --recursive https://github.com/pulp-platform/common_verification.git corev_apu/tb/common_verification
git clone --recursive https://github.com/openhwgroup/core-v-verif verif/core-v-verif
git clone --recursive https://github.com/openhwgroup/cv-hpdcache.git core/cache_subsystem/hpdcache
git clone --recursive https://github.com/google/riscv-dv.git verif/sim/dv

这里的 core-v-verif 比较容易下载失败,如果失败,手动重新下载单独模块即可

CVA6-SDK 环境拉取

首先,我们可以直接从 GitHub 一次性拉取所有源码:

git clone --recursive https://github.com/openhwgroup/cva6-sdk.git

如果这里遇到网络问题,拉取失败,分开拉取一下所有包:

首先拉取 CVA6-SDK 源码并查看所需要的所有包:

git clone https://github.com/openhwgroup/cva6-sdk.git
cat cva6-sdk/.gitmodules

然后进入源码路径下,拉取所有需要的包:

cd cva6-sdk
git clone --recursive -b master https://github.com/riscv/riscv-tests.git riscv-tests
git clone --recursive -b master https://github.com/riscv/riscv-isa-sim.git riscv-isa-sim
git clone --recursive git://git.buildroot.net/buildroot buildroot
git clone --recursive https://github.com/pulp-platform/vitetris.git vitetris
git clone --recursive https://github.com/openhwgroup/u-boot/ u-boot
git clone --recursive https://github.com/riscv/opensbi.git opensbi

这里的 core-v-verif 比较容易下载失败,如果失败,手动重新下载单独模块即可

core-v-verif 环境拉取

直接拉取全部即可:

git clone --recursive https://github.com/openhwgroup/core-v-verif

环境编译及配置

CVA6 环境安装

在安装环境前需要安装编译 riscv-toolchain

首先安装需要的软件包

sudo apt-get install help2man device-tree-compilersudo apt-get install autoconf automake autotools-dev curl git libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool bc zlib1g-devsudo apt-get install autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build git cmake libglib2.0-devsudo apt-get install wget cpio zip rsync git

首先编译安装 RISC-V 交叉编译链,先配置好环境变量:

sudo vim ~/.bashrc
# 添加以下内容
export RISCV="/home/ppqppl/riscv_env/cva6_env"
export PATH=$RISCV/bin:$PATH
# 重新应用环境变量
source ~/.bashrc

然后进入指定路径下运行如下命令进行安装:

cd cva6/util/gcc-toolchain-builder
INSTALL_DIR=$RISCV
sh get-toolchain.sh
sh build-toolchain.sh $INSTALL_DIR

安装成功后,可以开始安装准备环境

首先安装需要的 python 包:

pip3 install -r verif/sim/dv/requirements.txt

然后运行以下命令安装 Spike 和 Verilator

注意这里必须安装指定版本的 Spike 和 Verilator

# DV_SIMULATORS is detailed in the next section
export DV_SIMULATORS=veri-testharness,spike
bash verif/regress/smoke-tests.sh

注意这里需要使用 python,推荐使用 python 3.10 版本,或者安装 anaconda,由于运行 python 部分会报错,所以安装 anaconda 会更好切换 python 版本

CVA6-SDK 环境编译

首先安装需要的软件包

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-devsudo apt-get install wget cpio zip rsync git

添加交叉编译路径

sudo vim ~/.bashrc
# 添加如下
export PATH="/home/ppqppl/cva6_env/cva6-sdk/buildroot/output/host/bin":$PATH

首先进行全部编译

nake all 2>&1 | tee makeout.log

编译安装报错处理

这里可以选择只删除 make 产生的文件,或同时删除 make 产生的文件和 configure 产生的文件

sudo make clean			# 只删除 make 产生的文件
sudo make distclean		# 同时删除 make 和 configure 产生的文件

http://www.ppmy.cn/embedded/11864.html

相关文章

XiaodiSec day034 Learn Note 小迪安全学习笔记

XiaodiSec day034 Learn Note 小迪安全学习笔记 记录得比较凌乱,不尽详细 day34 黑盒审计和白盒审计 与 cms 相关 .net java php 代码审计 开始 黑盒:找文件上传的功能 个人用户中心是否存在文件上传功能后台管理系统是否存在文件上传功能字典目录…

C语言-内存操作函数

C语言有一类内存函数,他们可以以字节为单位进行数据的拷贝、追加,甚至可以替代部分字符串函数。于是让我们来狠狠地学习它一百万遍吧~ 目录 1.memcpy函数的使用和模拟实现 1.1memcpy函数的使用 1.2memcpy函数的模拟实现 2.memmove函数的使用和模拟…

LabVIEW仪器信息管理系统

LabVIEW仪器信息管理系统 在计量检测实验室的日常工作中,仪器检定校准是一项基础而重要的任务。随着科技的进步和实验室工作量的增加,传统的人工管理方式已经难以满足现代实验室对效率和准确性的要求。开发一套基于LabVIEW的仪器信息管理系统显得尤为必…

实现动态组件的方式

一、<component :is"放置组件名"></component>&#xff08;常用&#xff09; 我们可以定义一个数据并将该数据作为 component 元素的 is 属性值&#xff0c;这个数据保存了组件的名称&#xff0c;当我们需要切换组件时&#xff0c;只需要改变数据所保存…

2232: 【数学】因子个数

题目描述 对于任意给定的一个正整数&#xff0c;计算其因数个数。 输入 输入正整数N。 输出 输出N的因子个数。 样例输入 6 样例输出 4 Code: #include<bits/stdc.h> using namespace std; int c(int n){int cu2;double ksqrt(n);for(int i2;i<k;i){if(n%i…

Linux 第一章

&#x1f436;博主主页&#xff1a;ᰔᩚ. 一怀明月ꦿ ❤️‍&#x1f525;专栏系列&#xff1a;线性代数&#xff0c;C初学者入门训练&#xff0c;题解C&#xff0c;C的使用文章&#xff0c;「初学」C&#xff0c;linux &#x1f525;座右铭&#xff1a;“不要等到什么都没有了…

Json三方库介绍

目录 Json是干什么的Json序列化代码Json反序列化代码 Json是干什么的 Json是一种轻量级的数据交换格式&#xff0c;也叫做数据序列化方式。Json完全独立于编程语言的文本格式来存储和表述数据。易于人阅读和编写&#xff0c;同时也易于机器解析和生成&#xff0c;并有效地提升…

贪心算法练习day.1

理论基础 贪心算法是一种常见的解决优化问题的方法&#xff0c;其基本思想就是在问题的每个决策阶段&#xff0c;都选择当前看起来最优的选择&#xff0c;即贪心地做出局部的最优决策&#xff0c;以此得到全局的最优解&#xff0c;例如在十张面额不同的钞票&#xff0c;让我们…