在Ubuntu下跑通wujian100_open仿真测试

简介: 使用Ubuntu系统,下载wujian100_open项目代码、T-Head Tools,跑通仿真测试

本机系统Ubuntu 19.04,内核5.0.0-36-generic

获取T-Head Tools

浏览器进入 https://www.t-head.cn/product/mcu-platform?spm=a2ouz.12987052.0.0.167548abiiSAQs 下载相关工具:“T-Head Tools package.zip”

从压缩包中获取工具链

vircoys@ubuntu:~/Downloads$ unzip ‘T-Head Tools package.zip’ -d ~/Documents/

Archive:  T-Head Tools package.zip
 extracting: /home/vircoys/Documents/T-Head CDK-windows-V1.18.10-20191018-1527.zip  
   creating: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/
  inflating: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/changelog.txt  
  inflating: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/CSKY-DebugServer-linux-i686-V5.8.6-20191010.sh  
 extracting: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/CSKY-DebugServer-linux-i686-V5.8.6-20191010.sh.tar.gz  
  inflating: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/CSKY-DebugServer-linux-x86_64-V5.8.6-20191010.sh  
 extracting: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/CSKY-DebugServer-linux-x86_64-V5.8.6-20191010.sh.tar.gz  
 extracting: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/CSKY-DebugServer-windows-V5.8.6-20191010-1638.zip  
  inflating: /home/vircoys/Documents/T-Head DebugServer-V5.8.6/Readme.txt  
   creating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/
  inflating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/changelog.txt  
  inflating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/Readme.txt  
  inflating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/riscv64-elf-i386-20190801.tar.gz  
  inflating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/riscv64-elf-mingw-20190731.tar.gz  
  inflating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/riscv64-elf-x86_64-20190731.tar.gz  
  inflating: /home/vircoys/Documents/T-Head RISC-V Toolchain-V1.2.2/riscv64-linux-x86_64-20190731.tar.gz 

vircoys@ubuntu:~/Downloads$ cd Documents

vircoys@ubuntu:~/Documents$ mkdir riscv_toolchain/

将riscv64-elf-x86_64-20190731.tar.gz解压到riscv_toolchain

vircoys@ubuntu:~/Documents$ tar -zxf “T-Head RISC-V Toolchain-V1.2.2”/riscv64-elf-x86_64-20190731.tar.gz -C riscv_toolchain/

安装开源EDA工具

vircoys@ubuntu:~/Documents$ sudo apt install iverilog verilator gtkwave

获取平台代码(forked from T-head-Semi/wujian100_open)

vircoys@ubuntu:~/Documents$ git clone git@github.com:T-head-Semi/wujian100_open.git

Cloning into 'wujian100_open'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 911 (delta 0), reused 0 (delta 0), pack-reused 906
Receiving objects: 100% (911/911), 1.26 MiB | 193.00 KiB/s, done.
Resolving deltas: 100% (313/313), done.

vircoys@ubuntu:~/Documents$ cd wujian100_open/

vircoys@ubuntu:~/Documents$ cd wujian100_open/tools/

安装csh

vircoys@ubuntu:~/Documents/wujian100_open/tools$ sudo apt install csh

使用csh脚本设置环境变量

vircoys@ubuntu:~/Documents/wujian100_open/tools$ csh setup.csh

vircoys@ubuntu:~/Documents/wujian100_open/tools$ csh

% source setup.csh
% exit

vircoys@ubuntu:~/Documents/wujian100_open/tools$ cd …/workdir/

第一次仿真测试不通过,make: /bin/riscv64-unknown-elf-gcc: Command not found

vircoys@ubuntu:~/Documents/wujian100_open/workdir$ …/tools/run_case -sim_tool iverilog …/case/timer/timer_test.c

Useless use of not in void context at ../tools/run_case line 204.

Step1 (Remove all things in current 'workdir') is finished!
../case/timer//timer_test.c

Step2 (Process the command line arguments) is finished!
mkdir: cannot create directory ‘../regress/regress_result’: File exists
rm -rf *.o *.pat *.elf *.obj *.hex
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o crt0.o crt0.s
make: /bin/riscv64-unknown-elf-gcc: Command not found
make: *** [Makefile:58: crt0.o] Error 127
can't make at ../tools/run_case line 208.

vircoys@ubuntu:~/Documents/wujian100_open/tools$ cd …/…/riscv_toolchain/bin/

vircoys@ubuntu:~/Documents/riscv_toolchain/bin$ pwd

/home/vircoys/Documents/riscv_toolchain/bin

建立工具链的软连接

vircoys@ubuntu:~/Documents/riscv_toolchain/bin$ sudo ln -s /home/vircoys/Documents/riscv_toolchain/bin/riscv64-unknown-elf-gcc /bin/riscv64-unknown-elf-gcc

vircoys@ubuntu:~/Documents/riscv_toolchain/bin$ sudo ln -s /home/vircoys/Documents/riscv_toolchain/bin/riscv64-unknown-elf-objcopy /bin/riscv64-unknown-elf-objcopy

vircoys@ubuntu:~/Documents/riscv_toolchain/bin$ sudo ln -s /home/vircoys/Documents/riscv_toolchain/bin/riscv64-unknown-elf-objdump /bin/riscv64-unknown-elf-objdump

仿真测试通过

vircoys@ubuntu:~/Documents/riscv_toolchain/bin$ cd …/…/wujian100_open/workdir/

vircoys@ubuntu:~/Documents/wujian100_open/workdir$ …/tools/run_case -sim_tool iverilog …/case/timer/timer_test.c

Useless use of not in void context at ../tools/run_case line 204.

Step1 (Remove all things in current 'workdir') is finished!
../case/timer//timer_test.c

Step2 (Process the command line arguments) is finished!
mkdir: cannot create directory ‘../regress/regress_result’: File exists
rm -rf *.o *.pat *.elf *.obj *.hex
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o crt0.o crt0.s
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o __dtostr.o __dtostr.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o __isnan.o __isnan.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o printf.o printf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o vprintf.o vprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o sprintf.o sprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o snprintf.o snprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o vfprintf.o vfprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o fprintf.o fprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o getchar.o getchar.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o timer_test.o timer_test.c
In file included from timer_test.c:12:
vtimer.h: In function 'get_vtimer':
vtimer.h:14:14: warning: assignment to 'int *' from 'unsigned int' makes pointer from integer without a cast [-Wint-conversion]
   TIMER_ADDR = 0xE0013000;
              ^
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o putc.o putc.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o puts.o puts.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o fputc.o fputc.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o getc.o getc.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o __isinf.o __isinf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o putchar.o putchar.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o vsprintf.o vsprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o __v_printf.o __v_printf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o vsnprintf.o vsnprintf.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o __ltostr.o __ltostr.c
/bin/riscv64-unknown-elf-gcc -c -march=rv32emcxcki -mabi=ilp32e -De902 -Wa,--defsym=e902=1 -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections -o __lltostr.o __lltostr.c
/bin/riscv64-unknown-elf-gcc -Tlinker.lcf -nostartfiles -march=rv32emc -mabi=ilp32e -lc -lgcc  crt0.o vprintf.o sprintf.o snprintf.o fprintf.o puts.o getchar.o __isnan.o timer_test.o getc.o printf.o vsprintf.o __v_printf.o vsnprintf.o __dtostr.o vfprintf.o putc.o fputc.o __isinf.o putchar.o __lltostr.o __ltostr.o -o timer_test.elf -lm 
/bin/riscv64-unknown-elf-objcopy -O srec timer_test.elf timer_test.hex 
rm -f *.pat
#../tools/Srec2vmem.py timer_test.hex test.pat
../tools/Srec2vmem.py -i timer_test.hex -o test.pat
/bin/riscv64-unknown-elf-objdump -S -Mnumeric timer_test.elf > timer_test.obj
make clean; make all CPU=e902m ENDIAN_MODE=little-endian FILE=timer_test HGPR=

Step3 (Make) is finished!
Use of uninitialized value $had_v in concatenation (.) or string at ../tools/run_case line 241.
warning: Found both default and `timescale based delays. Use
         -Wtimescale to find the module(s) with no `timescale.
######time:                   0, Dump start######
VCD info: dumpfile test.vcd opened for output.
    ******START TO LOAD PROGRAM******


Hello Friend!

timer test successfully
***************************************

*              Test Pass              *

***************************************


Step4 (Run simulation) is finished

原文作者:Vircoys
点击查看原文

相关文章
|
4月前
|
Ubuntu 测试技术 Linux
dpdk测试环境搭建(vmware下ubuntu环境参考上文汇总流程)
dpdk测试环境搭建(vmware下ubuntu环境参考上文汇总流程)
105 0
|
4月前
|
机器学习/深度学习 存储 人工智能
极智AI | 周易AIPU算法部署仿真测试
本教程详细记录了使用周易 AIPU 进行算法部署仿真测试的方法,带大家尝尝鲜。
190 0
|
7月前
|
算法
m基于gardner环的定时同步matlab仿真,采用四倍采样,QPSK调制进行测试
m基于gardner环的定时同步matlab仿真,采用四倍采样,QPSK调制进行测试
96 3
|
8月前
|
Ubuntu 机器人 API
ubuntu 16.04+ros kinetic + gazebo+ aws-robotics 室内环境导航仿真
ubuntu 16.04+ros kinetic + gazebo+ aws-robotics 室内环境导航仿真
173 0
|
1月前
|
算法
m基于OFDM+QPSK和LDPC编译码以及MMSE信道估计的无线图像传输matlab仿真,输出误码率,并用图片进行测试
MATLAB2022a仿真实现了无线图像传输的算法,包括OFDM、QPSK调制、LDPC编码和MMSE信道估计。OFDM抗频率选择性衰落,QPSK用相位表示二进制,LDPC码用于前向纠错,MMSE估计信道响应。算法流程涉及编码、调制、信道估计、均衡、解码和图像重建。MATLAB代码展示了从串行数据到OFDM信号的生成,经过信道模型、噪声添加,再到接收端的信道估计和解码过程,最终计算误码率。
22 1
|
1月前
|
资源调度 算法
m基于OFDM+QPSK和LDPC编译码以及LS信道估计的无线图像传输matlab仿真,输出误码率,并用图片进行测试
m基于OFDM+QPSK和LDPC编译码以及LS信道估计的无线图像传输matlab仿真,输出误码率,并用图片进行测试
26 2
|
9月前
|
机器学习/深度学习 算法
m基于OFDM+QPSK和DNN深度学习信道估计的无线图像传输matlab仿真,输出误码率曲线,并用实际图片进行测试
m基于OFDM+QPSK和DNN深度学习信道估计的无线图像传输matlab仿真,输出误码率曲线,并用实际图片进行测试
295 0
|
4月前
|
Ubuntu 数据库 数据安全/隐私保护
百度搜索:蓝易云【ubuntu中编译安装opensips并测试】
以上是在Ubuntu中编译安装OpenSIPS并进行测试的基本步骤。请注意,这是一个简化的指南,实际操作中可能会有一些特定的配置和调整。建议参考OpenSIPS官方文档或其他详细教程以获得更全面和准确的信息。
53 1
|
4月前
|
机器学习/深度学习 算法 数据库
基于HOG特征提取和GRNN神经网络的人脸表情识别算法matlab仿真,测试使用JAFFE表情数据库
基于HOG特征提取和GRNN神经网络的人脸表情识别算法matlab仿真,测试使用JAFFE表情数据库
|
6月前
|
算法 异构计算
m基于FPGA的GFDM调制解调系统verilog实现,包含testbench仿真测试文件
m基于FPGA的GFDM调制解调系统verilog实现,包含testbench仿真测试文件
35 0

热门文章

最新文章