WAIT is a lightweight WebAssembly AOT compiler for resource-constrained IoT devices.
WAIT is conditionally accepted by ACM MobiSys'22, see MobiSys homepage for more details.
we propose WAIT, a lightweight WebAssembly runtime on resource-constrained IoT devices for device-cloud integrated applications. WAIT is the first work to enable the Ahead-of-Time (AOT) compilation of WebAssembly on resource-constrained devices by leveraging several approaches to reduce memory usage.
We implemented WAIT for AVR ATMega128 MCU. To facilitate easy build and test, we present a simulated execution environment for ATMega128 MCU (based on Avrora simulation framework) along with our WAIT's implementationin this repository.
- We suggest you use Ubuntu 20.04 LTS to run the simulation of WAIT.
- Clone this repo
- Install dependencies for building WAIT:
apt install git build-essential wget curl unzip gcc-multilib xxd cmake wabt python3
apt install gcc-avr avr-libc avrdude gdb-avr openjdk-11-jdk
- First, download the WASI SDK to compile
*.c
to WebAssembly. Go intothird-party
folder, and
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
tar xvf wasi-sdk-12.0-linux.tar.gz
The WASI SDK should reside in third-party
folder.
- Go into the
example
folder, and compile the example WebAssembly helloworld module using:
./compile.sh
- (Optional) python 3.7
pip3 install wasmer wasmer_compiler_cranelift
python3.7 instance.py helloworld
- Compile WAIT In root
rm -rf build
mkdir build&&cd build
cmake ..
make
- Run WAIT with avrora
bash third-party/runwait.sh
You can see the avrora output.
- Go to
example
folder, modify theCMakeLists.txt
to compile your WebAssembly module, and compile it.- The compilation will generate a
xxxx.wasm.h
, which is the WebAssembly module (using a C array to save the WebAssembly binary format).
- The compilation will generate a
- Modify the
src/main.c
to cope with thexxxx.wasm.h
header to bring the WebAssembly with WAIT.
- Code comments in the
src
- Tree layout of this folder
- Compiling WASM do not generate the native benchmark
- Complete gitignore
- wasmer test for helloworld
- (maybe) docker env?
- finalize this readme
- stub.txt what for?
- abstract the modifications scattered in the code (e.g., example/Cmakelist, src/main.c)
- what wasmbench.sh for?