Ideas‎ > ‎

Delli10: FPGA Synthesizable Native Dalvik Machine

 Google created Dalvik Virtual Machine as part of its Android Open Source mobile handset platform. 

The Dalvik VM is similar to JVM, but differs in many significant ways. Its file format and opcodes are different and so are the API (to a large extent, the API is a subset). Dalvik VM is optimized for Smartphones. See the Google I/O deep dive video.  

A tool called dx is used to compile jar file to Dalvik executable file.

The idea is to create an experimental, FPGA synthesizable, Dalvik Machine written in Verilog, with codes derived from the proven OpenSPARC design.
The challenge is to make it fit within a small LUT (Look Up Table) footprint, say Actel's Igloo Nano family of low power devices.

Dalvik VM (Virtual Machine) Specification

The Google (in)formal Dalvik VM specification can be found within the source code of the Google code project:
Download the source zip and look into the doc sub-directory.
Also look inside the opcodes sub-directory

However, the Google IO Dalvik VM Internals presentation PDF provides many insightful details.

Also, you can download the Android source code and look into the Delvik VM source.
The download instructions are here:

Within the source tree, the Dalvik VM file are in:  

The Dalvik interpreter can be found in mterp sub-directory.

The VM is implemented in assembly, but a portable 'C' version is available in the portable sub-directory.

The entry.c file contains the top half of the interpreter.

The opcodes are the middle part. There are 46 opcodes (compared to 203+ opcodes in JVM). 
The C sub-directory contain the architecture independent op-codes, one 'C' file for each op-code. Also, opcommon.c contain common macros. There is also optimized opcode implementations for different processors like ARM and x86, look into their respective sub-directories. 

The file enddefs.c contains the bottom of the interpreter.