All Projects → MackieLoeffel → Avr Vm

MackieLoeffel / Avr Vm

Licence: mit
VM with JIT-compiler for ATMega32 written in Rust

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Avr Vm

Moarvm
A VM with adaptive optimization and JIT compilation, built for Rakudo
Stars: ✭ 537 (+406.6%)
Mutual labels:  jit, vm
wazero
wazero: the zero dependency WebAssembly runtime for Go developers
Stars: ✭ 2,065 (+1848.11%)
Mutual labels:  vm, jit
neos
Language agnostic scripting engine with a custom bytecode JIT
Stars: ✭ 36 (-66.04%)
Mutual labels:  vm, jit
qemujs
Qemu.js source code with proof-of-concept machine-code-to-WASM JIT.
Stars: ✭ 101 (-4.72%)
Mutual labels:  vm, jit
go-jdk
Run JVM-based code in Go efficiently
Stars: ✭ 61 (-42.45%)
Mutual labels:  vm, jit
kcs
Scripting in C with JIT(x64)/VM.
Stars: ✭ 25 (-76.42%)
Mutual labels:  vm, jit
RSqueak
A Squeak/Smalltalk VM written in RPython.
Stars: ✭ 78 (-26.42%)
Mutual labels:  vm, jit
Opensmalltalk Vm
Cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak.
Stars: ✭ 345 (+225.47%)
Mutual labels:  jit, vm
Zetavm
Multi-Language Platform for Dynamic Programming Languages
Stars: ✭ 592 (+458.49%)
Mutual labels:  jit, vm
Luwa
WIP jit lua to wasm
Stars: ✭ 88 (-16.98%)
Mutual labels:  jit
Zenroom
Small, secure and portable virtual machine for crypto language processing
Stars: ✭ 96 (-9.43%)
Mutual labels:  vm
Micronucleus
ATTiny usb bootloader with a strong emphasis on bootloader compactness.
Stars: ✭ 1,240 (+1069.81%)
Mutual labels:  avr
Footloose
Container Machines - Containers that look like Virtual Machines
Stars: ✭ 1,289 (+1116.04%)
Mutual labels:  vm
Vagrant Docker Vm
💻 Development Vagrant VM with Docker, Samba and Mail sandbox (customizable)
Stars: ✭ 97 (-8.49%)
Mutual labels:  vm
Uefi Jitfuck
A JIT compiler for Brainfuck running on x86_64 UEFI
Stars: ✭ 83 (-21.7%)
Mutual labels:  jit
Nanojit
NanoJIT is a small, cross-platform C++ library that emits machine code.
Stars: ✭ 101 (-4.72%)
Mutual labels:  jit
Bfjit
Brainfuck JIT 虚拟机教程
Stars: ✭ 81 (-23.58%)
Mutual labels:  jit
Beebjit
A very fast BBC Micro emulator.
Stars: ✭ 81 (-23.58%)
Mutual labels:  jit
S2e
S2E: A platform for multi-path program analysis with selective symbolic execution.
Stars: ✭ 102 (-3.77%)
Mutual labels:  vm
Mono
Mono open source ECMA CLI, C# and .NET implementation.
Stars: ✭ 9,606 (+8962.26%)
Mutual labels:  jit

AVR-VM

Build Status

This is a VM for the AVR ATmega32 microcontroller written in Rust. It can handle most of the instructions and has support for I/O, ADC, timer and button interrupts. It also features a JIT compiler, which compiles the AVR bytecode to x64 machinecode at runtime. It is quite fast, about 5x faster than the real microcontroller.

This VM was built as part of an university course, so it is not under current development. But if you want to use it and have a problem, feel free to open an issue or a PR.

Some test programs can be found in ./test. The VM is only tested to work with these programs. Only the instructions of these programs are currently implemented (which are quite a few, but not all).

It includes a GUI with some LEDs, buttons, two potentiometers and two seven segment digits. There are diffent testprograms, which use these peripherals. The wiring is roughly the one here (JTAG, ISP and USB is missing): Wiring. It can be changed by tweaking main.rs.

An example, how the GUI looks with the boardtest program running: boardtest

All characters, which are written to UDR by the microcontroller, are displayed in the console.

Installation

For using this VM you need to do the following steps:

  1. Clone this repository.

  2. If you want to use the GUI, you need to have at least gtk 3.4 installed.

  3. ONLY FOR JIT-COMPILATION: This project uses Dynasm-rs for the JIT-compiler, which is a compiler plugin and needs a nightly version of the Rust compiler. A working version can be installed using Rustup: rustup override set nightly-2018-10-09 Furthermore the JIT-Compiler needs to be enabled using the feature "jit", see below.

  4. For running the tests and compiling C-Code and assembler to AVR bytecode, gcc-avr is needed. It can be installed either from http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx or on Ubuntu / Debian / BashOnWindows using sudo apt-get install gcc-avr binutils-avr avr-libc If you are using a different distribution, you can probably find an equivalent packages there.

Usage

You can execute the VM using the following command: cargo run --release -- ./test/boardtest/boardtest.bin

You can exucute a different binary by changing ./test/boardtest/boardtest.bin.

Without GUI

The GUI can be disabled using cargo run --release --no-default-features -- ./test/jump/jump.bin

Only the output on the console is visible then and the program stops on the first NOP. This is useful for benchmarking the compiler, see ./tests/jump/jump-time for an example program used for benchmarking.

Use the JIT compiler

The JIT-Compiler can be enabled with the following flags: cargo run --release --features jit -- ./test/jump/jump.bin

You need to make sure, that you are using a nightly version of the Rust compiler, if you want to use the JIT-compiler. For instructions, which version to use, see above.

Material

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].