Skip to main content

A simple 32-bit RISC-V CPU emulator

Project description

Voyager CPU

PyPI PyPI - Python Version PyPI - Downloads PyPI - License

Voyager is a (very) experimental Python emulator of a 32-bit RISC-V core. It's built for research and education with simplicity in mind.

Features

  • Supports the RV32I ISA using a non-pipelined CPU with a single-cycle instruction fetch, decode, and execution stage.
  • A simple virtual RAM into which test programs (ELF binaries) are loaded.
  • A basic REPL for viewing register and RAM contents, and executing the next N cycles.
  • MIT license.

Build and Run

  1. (Optional) Clone the pre-built RV32UI tests using:
git submodule init
git submodule update

The binaries will be placed under tests/riscv-tests-prebuilt-binaries/. Alternatively, you can build the test suites from the official repo.

  1. See the example in src/voyagercpu/example.py. You may run this directly using python src/voyagercpu/example.py.

  2. Enjoy!

  3. (Optional) Run the Voyager unit tests using pytest

Todo

  • Add more tests, particularly at the execution stage.
  • Implement some ISA extensions, e.g. the M and C specifications.
  • Add pipelining and privileged mode.
  • Improve pretty printing.
  • Etc.

Please contribute!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

voyager_cpu-0.2.4.tar.gz (659.4 kB view hashes)

Uploaded Source

Built Distribution

voyager_cpu-0.2.4-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page