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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file voyager_cpu-0.2.4.tar.gz.

File metadata

  • Download URL: voyager_cpu-0.2.4.tar.gz
  • Upload date:
  • Size: 659.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for voyager_cpu-0.2.4.tar.gz
Algorithm Hash digest
SHA256 264c7f522237d80f851a1f2313c5346acda3b36084a9095f800d00e03debd9ad
MD5 9dd5b22195f132e68ae6c85aa0cea200
BLAKE2b-256 019272ff39665ca32027930e3d050d2d13a543a46afc536efa297a695976db64

See more details on using hashes here.

File details

Details for the file voyager_cpu-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: voyager_cpu-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for voyager_cpu-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b0857ac2079e832894db35338ffc53816c5ed23fa8b7f1eebff0d8eeaa89ad
MD5 2385d1288653665064a6306951a62768
BLAKE2b-256 4e6fb7790c5c729c0f9286bc8b47c3c3a4696d0dfa59ef9cf3a13fddc321de07

See more details on using hashes here.

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