项目作者: shady831213

项目描述 :
A riscv isa simulator in rust.
高级语言: Rust
项目地址: git://github.com/shady831213/terminus.git
创建时间: 2020-02-27T03:59:05Z
项目社区:https://github.com/shady831213/terminus

开源协议:MIT License

下载


terminus

A RISC-V instruction set simulator in Rust.

Rust Version Requirement

  1. >= 1.56(edition2021)

2018 edition is move to ‘eidtion2018’ branch

Boot Linux in 20s

Boot Linux in 20s

Getting Started

  1. git clone https://github.com/shady831213/terminus
  2. cd terminus
  3. cargo update -p terminus-spaceport
  4. cargo update -p terminus-vault
  5. cargo install --path .
  6. terminus examples/linux/image/br-5-4
  7. //or
  8. cd examples/linux/image
  9. tar -zxvf rootfs.ext4.gz
  10. cd -
  11. terminus examples/linux/image/br-5-4.disk --image=examples/linux/image/rootfs.ext4

Multi-core Support

Specify the -p option to configure the number of RISC-V HARTs (HARdware Threads):

  1. terminus examples/linux/image/br-5-4 -p 4
  2. //booting...
  3. //booting...
  4. //booting...
  5. //...
  6. buildroot login: root
  7. //password is terminus
  8. Password:
  9. # cat /proc/cpuinfo
  10. processor : 0
  11. hart : 0
  12. mmu : sv48
  13. processor : 1
  14. hart : 1
  15. mmu : sv48
  16. processor : 2
  17. hart : 2
  18. mmu : sv48
  19. processor : 3
  20. hart : 3
  21. mmu : sv48

Networking Support

Run the setup_tuntap.sh script to create a simulated network interface and networking bridge.

  1. terminus examples/linux/image/br-5-4.disk --image=examples/linux/image/rootfs.ext4 --net=tap0
  2. //booting...
  3. //booting...
  4. //booting...
  5. //...
  6. buildroot login: root
  7. //password is terminus
  8. Password:
  9. //config guset according to help message.
  10. # ping -c 1 www.baidu.com

then you will see:

  1. PING www.baidu.com (103.235.47.103): 56 data bytes
  2. 64 bytes from 103.235.47.103: seq=0 ttl=46 time=17.685 ms
  3. --- www.baidu.com ping statistics ---
  4. 1 packets transmitted, 1 packets received, 0% packet loss
  5. round-trip min/avg/max = 17.685/17.685/17.685 ms

Display Support

Terminus with display supported needs the “sdl” operating system packages and related dependencies.

  1. // Example for Ubuntu
  2. sudo apt-get install libsdl2-dev
  3. git clone https://github.com/shady831213/terminus
  4. cd terminus
  5. cargo update -p terminus-spaceport
  6. cargo install --features="sdl" --path .
  7. cd examples/linux/image
  8. tar -zxvf rootfs.ext4.gz
  9. cd -
  10. terminus examples/linux/image/br-5-4.disk --image=examples/linux/image/rootfs.ext4 --boot_args="root=/dev/vda console=tty0 earlycon=sbi" --display

Cosimulation with HDL

Please refer to terminus_cosim.

RoadMap

  • RV32/64I
  • MADFC
  • M/S/U privilege
  • Pass all riscv_tests
  • CLINT and Timer
  • HTIF console
  • FDT generation
  • Multi Cores
  • Boot Linux
  • Emu mode binary
  • Boot Linux(smp)
  • Publish to crate.io
  • PLIC
  • VirtIO console
  • VirtIO disk
  • VirtIO network
  • framebuffer
  • VirtIO keyboard
  • VirtIO mouse
  • Cosimulation with HDL
  • debug mode
  • other extensions(b, v …)