Giter Site home page Giter Site logo

yantrabuddhi / embedvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrysn/embedvm

0.0 2.0 0.0 284 KB

my branch of EmbedVM for publishing the Python compiler until it is merged upstream

Home Page: http://www.clifford.at/embedvm/

Makefile 2.60% Python 50.20% Shell 2.25% Pascal 0.13% C 23.04% Lex 2.75% Yacc 19.03%

embedvm's Introduction

EmbedVM - Embedded Virtual Machine
==================================

EmbedVM is a small embeddable virtual machine for microcontrollers with a
C-like language frontend. It has been tested with GCC and AVR microcontrollers.
But as the Virtual machine is rather simple it should be easy to port it to
other architectures.

The VM simulates a 16bit CPU that can access up to 64kB of memory. It can
only operate on 16bit values and arrays of 16bit and 8bit values. There is
no support for complex data structures (struct, objects, etc.). A function
can have a maximum of 32 local variables and 32 arguments.

Besides the memory for the VM, a small structure holding the VM state and
the reasonable amount of memory the EmbedVM functions need on the stack there
are no additional memory requirements for the VM. Especially the VM does not
depend on any dymaic memory management.

EmbedVM is optimized for size and simplicity, not execution speed. The VM
itself takes up about 3kB of program memory on an AVR microcontroller. On an
AVR ATmega168 running at 16MHz the VM can execute about 75 VM instructions
per millisecond.

All memory accesses done by the VM are parformed using user callback functions.
So it is possible to have some or all of the VM memory on external memory
devices, flash memory, etc. or "memory-map" hardware functions to the VM.

The compiler is a UNIX/Linux commandline tool that reads in a *.evm file and
generates bytecode in vaious formats (binary file, intel hex, C array
initializers and a special debug output format). It also generates a symbol
file that can be used to access data in the VM memory from the host
application.

The file README.VM contains a brief description of the virtual machine.

A documentation of the high level language frontend is still to be done.

The directory tools/ contains a compiler for the C-like EVM lagnuage that
can be used for generating VM bytecode in various formats.
See tools/example.evm for a simple demo application.

The directory vmsrc/ contains the virtual machine itself and a simple demo
host application as a reference for how to embedd the VM.

The directory examples/ contains example applications using EmbedVM.

embedvm's People

Contributors

chrysn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.