From 3efc161e2ceca7ae963026863fc168706aee0453 Mon Sep 17 00:00:00 2001 From: Liang Date: Sun, 10 Sep 2023 22:09:49 +0800 Subject: [PATCH] [bsp] add xemu bsp, this is a risc-v simulator --- bsp/yuheng-riscv-xemu/README.md | 71 +++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 bsp/yuheng-riscv-xemu/README.md diff --git a/bsp/yuheng-riscv-xemu/README.md b/bsp/yuheng-riscv-xemu/README.md new file mode 100644 index 0000000000..209a2cc488 --- /dev/null +++ b/bsp/yuheng-riscv-xemu/README.md @@ -0,0 +1,71 @@ +21:59 2023/9/10 + +## What is it + +- A simple riscv simulator with a graphical interface for quick functional verification + +- A RV32IM risc-v core with uart and lcd + +## How to Use + +0. install `xcb` if using graphical interface + +- Ubuntu + +``` +sudo apt-get update +sudo apt-get install -y libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libxcb-image0-dev +``` + +- CentOS 6.10 + +``` +mkdir xcb.rpm +cd xcb.rpm + +wget http://bay.uchicago.edu/centos-vault/centos/6.10/os/x86_64/Packages/xcb-util-image-0.4.0-3.el6.x86_64.rpm +wget http://bay.uchicago.edu/centos-vault/centos/6.10/os/x86_64/Packages/xcb-util-image-devel-0.4.0-3.el6.x86_64.rpm + +rpm -ivh xcb-* --force --nodeps +``` + +1. clone `xemu` + +``` +git clone git@gitee.com:dengchow/xemu.git +``` + +2. add cpu bsp + +``` +cp xemu/sim/rtthread/bsp/. . -r +``` + +3. open `rtconfig.py`, modify compiler path + +``` +EXEC_PATH = r'/home/crazy/Tools/compiler/xuantie/v8.4.0/riscv64-elf-x86_64-20210307/bin' +``` + +4. compile simulator + +``` +make build +``` + +5. compile rt-thread and run + +``` +scons +make run +``` + +6. clean + +``` +scons --clean +make clean +``` + +ATONEMAN +2023.09.10 -- Gitee