{"id":22203266,"url":"https://github.com/mackieloeffel/avr-vm","last_synced_at":"2025-07-27T05:32:02.197Z","repository":{"id":62438414,"uuid":"82285122","full_name":"MackieLoeffel/avr-vm","owner":"MackieLoeffel","description":"VM with JIT-compiler for ATMega32 written in Rust","archived":false,"fork":false,"pushed_at":"2018-10-28T11:47:34.000Z","size":75,"stargazers_count":113,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-21T22:34:00.958Z","etag":null,"topics":["avr","jit","rust","vm"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MackieLoeffel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-17T10:18:54.000Z","updated_at":"2024-11-17T10:35:48.000Z","dependencies_parsed_at":"2022-11-01T21:47:03.189Z","dependency_job_id":null,"html_url":"https://github.com/MackieLoeffel/avr-vm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackieLoeffel%2Favr-vm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackieLoeffel%2Favr-vm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackieLoeffel%2Favr-vm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackieLoeffel%2Favr-vm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MackieLoeffel","download_url":"https://codeload.github.com/MackieLoeffel/avr-vm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227764089,"owners_count":17816316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avr","jit","rust","vm"],"created_at":"2024-12-02T16:42:50.895Z","updated_at":"2024-12-02T16:42:51.708Z","avatar_url":"https://github.com/MackieLoeffel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AVR-VM\n[![Build Status](https://travis-ci.org/MackieLoeffel/avr-vm.svg?branch=master)](https://travis-ci.org/MackieLoeffel/avr-vm)\n\nThis is a VM for the AVR ATmega32 microcontroller written in Rust.\nIt can handle most of the instructions and has support for I/O, ADC,\ntimer and button interrupts. It also features a JIT compiler, which\ncompiles the AVR bytecode to x64 machinecode at runtime. It is quite\nfast, about 5x faster than the real microcontroller.\n\nThis VM was built as part of an university course, so it is not under current\ndevelopment. But if you want to use it and have a problem, feel free\nto open an issue or a PR.\n\nSome test programs can be found in `./test`. The VM is only tested to\nwork with these programs. Only the instructions of these programs\nare currently implemented (which are quite a few, but not all).\n\nIt includes a GUI with some LEDs, buttons, two potentiometers and two\nseven segment digits. There are diffent testprograms, which use\nthese peripherals. The wiring is roughly the one here (JTAG, ISP and\nUSB is missing): [Wiring](https://www4.cs.fau.de/Lehre/SS16/V_SPIC/Uebungen/Board/spicboard2_sch.pdf). It can be changed by tweaking `main.rs`.\n\nAn example, how the GUI looks with the `boardtest` program running:\n![boardtest](https://mackieloeffel.github.io/boardtest.gif)\n\nAll characters, which are written to `UDR` by the microcontroller,\nare displayed in the console.\n\n## Installation\n\nFor using this VM you need to do the following steps:\n\n1.  Clone this repository.\n\n2.  If you want to use the GUI, you need to have at least gtk 3.4\n    installed.\n\n3.  **ONLY FOR JIT-COMPILATION:**\n    This project uses [Dynasm-rs](https://github.com/CensoredUsername/dynasm-rs) for the JIT-compiler, which is a\n    compiler plugin and needs a nightly version of the Rust compiler. A working\n    version can be installed using [Rustup](https://rustup.rs/):\n    `rustup override set nightly-2018-10-09`\n    Furthermore the JIT-Compiler needs to be enabled using the feature \"jit\",\n    see below.\n\n4.  For running the tests and compiling C-Code and assembler to AVR\n    bytecode, `gcc-avr` is needed. It can be installed either from\n    \u003chttp://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx\u003e\n    or on Ubuntu / Debian / BashOnWindows using\n    `sudo apt-get install gcc-avr binutils-avr avr-libc`\n    If you are using a different distribution, you can probably find\n    an equivalent packages there.\n\n## Usage\n\nYou can execute the VM using the following command:\n`cargo run --release -- ./test/boardtest/boardtest.bin`\n\nYou can exucute a different binary by changing `./test/boardtest/boardtest.bin`.\n\n### Without GUI\n\nThe GUI can be disabled using\n`cargo run --release --no-default-features -- ./test/jump/jump.bin`\n\nOnly the output on the console is visible then and the program\nstops on the first NOP. This is useful for benchmarking the\ncompiler, see `./tests/jump/jump-time` for an example program used\nfor benchmarking.\n\n### Use the JIT compiler\n\nThe JIT-Compiler can be enabled with the following flags:\n`cargo run --release --features jit -- ./test/jump/jump.bin`\n\nYou need to make sure, that you are using a nightly version of the\nRust compiler, if you want to use the JIT-compiler. For\ninstructions, which version to use, see above.\n\n## Material\n\n-   [Instruction Set](http://www.atmel.com/images/Atmel-0856-AVR-Instruction-Set-Manual.pdf)\n-   [Hardware Description](http://www.atmel.com/images/doc2503.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackieloeffel%2Favr-vm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmackieloeffel%2Favr-vm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackieloeffel%2Favr-vm/lists"}