喜欢0次
队伍编号:CICC3280 团队名称:芯新星队
sudo apt-get install autoconf automake autotools-dev curl device-tree-compiler libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev git
git clone https://github.com/riscv-mcu/e203_hbirdv2.git
#下载RISC-V GNU Toolchain
#配置riscv测试
cp nuclei*.bz2 ~/
cd ~/
tar -xjvf nuclei*.bz2
cd /
mkdir -p ./riscv-tools/prebuilt_tools/prefix/bin
cd ./riscv-tools/prebuilt_tools/prefix/bin/
ln -s ~/gcc/bin/* .
#编译测试
cd /riscv-tools/riscv-tests/isa
source regen.sh
#编译RTL
cd /vsim
make clean
make install
#For iVerilog:
sudo apt-get install iverilog gtkwave
make compile SIM=iverilog
make run_test SIM=iverilog
#会报错,找到报错位置的语法错误删除&符号即可
vsim/run目录中的Makefile文件第131行tee前的&删除
#显示波形
#Using GTKWave:
make wave SIM=iverilog
#运行回归
#For iVerilog:
make regress_run SIM=iverilog
这样方便做出来整体的实现,但是每次使用都需要 source setup.sh
修改.zshrc(或者bash环境修改.bashrc)
#根据自己的shell环境修改环境变量
gedit ~/.zshrc
#在最下方插入下列配置
#Nuclei SDK PATH
export NUCLEI_TOOL_ROOT="/home/burch/nuclei-tools"
# Create your setup_config.sh
# and define NUCLEI_TOOL_ROOT like below
# NUCLEI_TOOL_ROOT=/home/develop/Software/Nuclei
export SETUP_CONFIG="/home/burch/hbird-sdk/setup_config.sh"
[ -f $SETUP_CONFIG ] && source $SETUP_CONFIG
[ -f .ci/build_sdk.sh ] && source .ci/build_sdk.sh
[ -f .ci/build_applications.sh ] && source .ci/build_applications.sh
#echo "Setup Nuclei SDK Tool Environment"
#echo "NUCLEI_TOOL_ROOT=$NUCLEI_TOOL_ROOT"
export PATH=$NUCLEI_TOOL_ROOT/gcc/bin:$NUCLEI_TOOL_ROOT/openocd/bin:$PATH
#配置完成之后保存退出
source ~/.zshrc
#打开串口的terminal
sudo screen /dev/ttyUSB1 115200
#测试jtag是否接好
make run_openocd SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
#烧录程序
make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
#debug
make debug SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
#测试benchmark
sudo screen /dev/ttyUSB1 115200
#dhrystone
cd ~/hbird-sdk/application/baremetal/benchmark/dhrystone
make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
#coremark
cd ../coremark
make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash
#whetstone
cd ../whetstone
make upload SOC=hbirdv2 BOARD=ddr200t CORE=e203 DOWNLOAD=flash