Skip to content

Version 0.2.2 #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 321 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
eea1f1d
activate push mode when dumping
Apr 28, 2022
a5bd57a
update template
Apr 28, 2022
a3e4d99
delete unneeded files
Apr 28, 2022
ab63df0
format
Apr 28, 2022
0b2b306
bug fix: add missing header
Apr 28, 2022
b74e065
bug fix: pushmode only for MCU
Apr 28, 2022
23d7ffc
Fix template cache
tolauwae Apr 29, 2022
2a093be
bug fix: push event one single time
Apr 29, 2022
7fae5c9
disable starting in pause mode
Apr 29, 2022
b673733
Merge branch 'feat/wood' of github.com:TOPLLab/WARDuino into feat/wood
Apr 29, 2022
d4e6e88
Add event debug interrupts to enum
tolauwae Apr 29, 2022
b1a1287
Fix Makefile
tolauwae Apr 29, 2022
b5eeeec
Update Arduino ESP install instructions
tolauwae Apr 29, 2022
8526a40
Add nlohmann/json library
tolauwae May 3, 2022
419dd23
Make WARDuino a singleton
tolauwae May 3, 2022
745f301
Parse event json
tolauwae May 3, 2022
2da13e1
Add interruptDronify to enum
tolauwae May 4, 2022
4cab2a8
bug fix: push client uses push port
May 4, 2022
9e9e84c
use seperate adress struct for pushclient
May 4, 2022
52d640e
Add Event interrupts
tolauwae May 4, 2022
21b5708
Quickfix Arduino compilation
tolauwae May 4, 2022
a127c08
bug fix: no longer starts a socketserver
May 4, 2022
3bb3b1f
OSX compilation issue fix: removed Event forward reference
May 4, 2022
3b34fae
changed parameter to be a pointer
May 4, 2022
38ebdfb
bug fix: disable mutex + remove &
May 4, 2022
61eadbd
bug fix: removed hardcoded socket descriptor
May 4, 2022
61e9dc8
Restore mutex
tolauwae May 5, 2022
a874ef1
Fix `continuing` function for mutex lock
tolauwae May 5, 2022
ed07248
bug fix: resolving_event set to false once done
May 5, 2022
e18f3af
bug fix: resolving_event disabled for pushmode
May 5, 2022
6860bb9
bug fix: pushing events despite of paused VM
May 5, 2022
7191fe9
delete unneeded printf
May 5, 2022
6c3f474
add interrupt to toggle event push mode
May 5, 2022
b6544d1
increase emulator's event buffer size
May 5, 2022
82ded9d
Enalbe the update of the proxy list more than once
May 5, 2022
0b90a8e
bug fix: json parse error
May 5, 2022
0dfa0c7
add comment
May 5, 2022
aa7bfae
increase pushbuffer socket size if needed
May 6, 2022
e82c316
Add events to full dump
tolauwae May 6, 2022
e8b1fba
Merge branch 'master' into feat/wood
tolauwae May 6, 2022
2cb6f54
Add subscribe_interrupt EMU
tolauwae May 6, 2022
0a8d956
Make `pushingMode` default true
tolauwae May 6, 2022
72ea40b
Fix push code in `CallbackHandler::resolve_event`
tolauwae May 6, 2022
3b3de27
Remove `pushingMode` + add `manual_event_resolution`
tolauwae May 6, 2022
a40ecc3
Fix json parse + compilation
tolauwae May 6, 2022
8631430
Update documentation
tolauwae May 7, 2022
5ca94b2
Remove extra `manual_event_resolution = true`
tolauwae May 7, 2022
9cc9859
Add new pushed event notification + remove breaking print
tolauwae May 7, 2022
f5001d6
Fix events
tolauwae May 7, 2022
bd087c3
Fix `notifyPushedEvent` + support paused drone
tolauwae May 9, 2022
84be87f
Clang format + update README
tolauwae May 9, 2022
96585bf
Add force arg to `resolve_event`
tolauwae May 9, 2022
24f4898
Add callback interrupts + implement dump
tolauwae May 9, 2022
7d91618
Fix compile error + fix infinite loop
tolauwae May 9, 2022
0978acd
Quickfix no binary payload for `0x75`
tolauwae May 9, 2022
7ab5c97
Add import callbackmapping
tolauwae May 10, 2022
8832cca
Update docs + small fix for ci
tolauwae May 10, 2022
d97ee71
Fix nullptr exception
tolauwae May 10, 2022
fd4c18e
added primitives for ESP32 analogwrite
May 11, 2022
bced0f5
Merge branch 'feat/wood' of github.com:TOPLLab/WARDuino into feat/wood
May 11, 2022
546d980
Fix compilation error
tolauwae May 25, 2022
a766d50
Add socket server to warduino template in benchmarks
tolauwae May 25, 2022
505d1bb
Update boardmanager install instructions
tolauwae May 25, 2022
7896022
Fix some compile errors in benchmarks
tolauwae May 25, 2022
0bd2e7b
Use arduino-cli in scripts/upload
tolauwae May 25, 2022
5a00e34
Fix ino template benchmarks
tolauwae May 25, 2022
e9741a8
Fix makefile
tolauwae May 25, 2022
ab21f50
Fix bench upload
tolauwae May 25, 2022
99ca305
Fix upload script
tolauwae May 25, 2022
6e7a5ff
Move socket bench to seperate edward.ino
tolauwae May 25, 2022
2d09e9a
Use singleton WD in warduino.ino.template
tolauwae May 25, 2022
c85bc8e
Add edward to tasks/.gitignore
tolauwae May 25, 2022
d7cdccd
Merge branch 'master' into feat/wood
tolauwae May 30, 2022
2824cb0
Make example more stable
tolauwae May 30, 2022
85a4cc8
Clean examples
tolauwae May 30, 2022
d139b0b
Start ESP-IDF primitive implementations
tolauwae May 30, 2022
16db317
Fix ESP-IDF compilation
tolauwae May 31, 2022
c4db33d
Re-enabled TWDT init on startup
tolauwae May 31, 2022
edeccdc
Fix blink example for ESP IDF
tolauwae May 31, 2022
8b6fd35
Add missing upload.h + update .gitignore
tolauwae May 31, 2022
67e3a48
Update IDF CI action
tolauwae May 31, 2022
9b8157b
Fix ESP compile CI action
tolauwae Jun 2, 2022
662ce39
Allow `updateCallbackmapping` on Arduino
tolauwae Jun 2, 2022
1ba1568
Add dependencies to README
beardhatcode Jun 3, 2022
8ff733c
Clang Tidy and Format `src/Debug/`
tolauwae Jun 3, 2022
959410c
Allow `interruptRecvCallbackmapping` on Arduino
tolauwae Jun 3, 2022
a59000d
Ask for cbkmapping dump after Proxy Call
tolauwae Jun 3, 2022
f2b938f
Add dronify instruction
beardhatcode Jun 3, 2022
b8cf8ed
Clang format
tolauwae Jun 3, 2022
f1bbc1a
Fix Arduino compilation
tolauwae Jun 3, 2022
ddece62
Allow lowercase in debug messages
tolauwae Jun 3, 2022
fed7737
Start SocketServer on interruptDronify
tolauwae Jun 3, 2022
9cb7d26
Clean up. Closes #70
tolauwae Jun 3, 2022
74b8466
Remove scripts/signal
tolauwae Jun 4, 2022
ca1bcdd
Make write2client iterative istead of recursive
beardhatcode Jun 4, 2022
cdeb15d
Reformulate shoud_push event in terms of WARDuino
beardhatcode Jun 4, 2022
c6eed6b
Remove debug print in the middle of capturing events
beardhatcode Jun 4, 2022
000a8e3
Fix wrong buffer length used
beardhatcode Jun 4, 2022
4603ace
Fix request for callback mappting DEC->HEX
beardhatcode Jun 4, 2022
fca41c9
Add notification for missing handlers
beardhatcode Jun 4, 2022
7433590
Improve callback handeling logic
beardhatcode Jun 4, 2022
13cc7f2
CI: remove fill template
beardhatcode Jun 4, 2022
b146ee3
Fix compile CI
tolauwae Jun 6, 2022
66d6865
Fix: don't change `resolving_event` in debugger thread
tolauwae Jun 7, 2022
ced41f2
Add callback guard
tolauwae Jun 7, 2022
6b2fbab
Clang format
tolauwae Jun 7, 2022
107a4d8
Remove socket ino from compile.yml
tolauwae Jun 7, 2022
396facf
Fix ESP IDF compilation
tolauwae Jun 7, 2022
fb76fff
Add retry to assemblyscript examples
tolauwae Jun 7, 2022
174f36f
Fix typos and clang warnings
tolauwae Jun 15, 2022
392eecb
Rename Proxy Server to Proxy Supervisor
tolauwae Jun 15, 2022
b70fbbb
Clang format
tolauwae Jun 16, 2022
52d4eef
Refactor RFC to Proxy
tolauwae Jun 17, 2022
d0557a3
Add `Channel` class to abstract comms socket
tolauwae Jun 17, 2022
b549864
Use debugger channel for oop debugging
tolauwae Jun 17, 2022
5e149ce
Delete SocketServer
tolauwae Jun 17, 2022
e2501d3
Clang-format
tolauwae Jun 17, 2022
1e32d45
Fix Arduino compilation
tolauwae Jun 17, 2022
c44631f
Fix IDF compilation
tolauwae Jun 17, 2022
9b93fd5
Add Carlos to authors
tolauwae Jun 17, 2022
fbd5777
Use serial connection to proxy
tolauwae Jun 17, 2022
3a964e3
Clang-format
tolauwae Jun 17, 2022
e260d33
Clean split Proxy and ProxySupervisor
tolauwae Jul 26, 2022
d9f9d83
Clang format + fix some header includes
tolauwae Jul 28, 2022
91aa40a
Fix include errors
tolauwae Jul 29, 2022
c8de5af
Handle proxy guard (return result)
tolauwae Jul 29, 2022
0a5b5bf
Track proxied calls in supervisor
tolauwae Jul 29, 2022
1eef397
Forward exception in proxy call
tolauwae Jul 29, 2022
ee506a7
Add `--socket` arg to cli
tolauwae Aug 1, 2022
a4285a5
Fix segmentation fault at call instr
tolauwae Aug 1, 2022
559b355
Fix call_indirect
tolauwae Aug 1, 2022
d14ac3f
Merge branch 'feat/wood' into fix/comms
tolauwae Aug 1, 2022
89a83c8
Set version number to v0.2.1
tolauwae Aug 1, 2022
ae2171b
Use espressif/esp-idf-ci-action@v1
tolauwae Aug 1, 2022
d2173a5
Remove valread completely
tolauwae Aug 1, 2022
df10025
Remove unecessary `#ifndef ARDUINO` guards
tolauwae Aug 1, 2022
62130c8
Remove breaking import
tolauwae Aug 1, 2022
124661d
Remove unused variables
tolauwae Aug 1, 2022
128b100
Fix dump_callbacks
tolauwae Aug 1, 2022
13b0a43
Fix nullptr exception on ESP
tolauwae Aug 1, 2022
17b1167
Update main
tolauwae Aug 2, 2022
e34f2c8
Connect to proxy via local socket
tolauwae Aug 2, 2022
a0f03ab
Move connection code to main
tolauwae Aug 2, 2022
2742ad6
Move RFC to Edward
tolauwae Aug 2, 2022
8ed7b7c
Merge pull request #77 from TOPLLab/fix/comms
tolauwae Aug 2, 2022
4dfb65f
Add `--mode` to cli
tolauwae Aug 2, 2022
e2a4c05
Fix: remove unnecessary writes to stdout from Arduino.ino
tolauwae Sep 2, 2022
868d628
Fix ESP-IDF compilation error
Sep 9, 2022
2114dd1
Fix Arduino subscribe interrupt with macros
tolauwae Sep 5, 2022
cfb362b
Rename analog write primitive
tolauwae Sep 5, 2022
5f293dc
Free `interruptData` buffer
tolauwae Sep 16, 2022
39f22cf
Allow connections to proxy over serial in cli
tolauwae Sep 16, 2022
882139d
Fix build of benchmarks
tolauwae Sep 20, 2022
b2a4f7f
Add Rebench config with native tests
tolauwae Sep 20, 2022
83e2580
Add WARDuino executor to Rebench config
tolauwae Sep 20, 2022
7b1e6f0
Rename rebench conf file + remove native executor
tolauwae Sep 20, 2022
3d73519
Add `--no-debug` flag
tolauwae Sep 21, 2022
ee12182
Fix segmentation fault in `disconnect_proxy`
tolauwae Sep 21, 2022
e7cedca
Remove \n from emu print_string primitive
tolauwae Sep 21, 2022
0483510
Move interpret loop to main thread
tolauwae Sep 22, 2022
a657473
Make `Channel` virtual + add open and close methods
tolauwae Sep 23, 2022
71fc608
Update code to use new Channel classes
tolauwae Sep 24, 2022
c79dc23
Update mcu platforms
tolauwae Sep 24, 2022
baed0be
Refactor Channel types to self-documenting names
tolauwae Sep 24, 2022
5fd063b
Add `debugger.stop` function
tolauwae Sep 24, 2022
237620e
Fix #91
tolauwae Sep 24, 2022
24c91f5
Quickfix compilation
tolauwae Sep 24, 2022
f2e7b28
Merge pull request #93 from TOPLLab/fix/91
tolauwae Sep 24, 2022
e7b738b
Remove "got a message ..."
tolauwae Sep 26, 2022
0c5336d
Change `startPushDebuggerSocket()` to also receive proxy replies
tolauwae Oct 6, 2022
facb3ca
RFC returns JSON
Oct 6, 2022
4125fe6
Fix Arduino compilation
tolauwae Oct 6, 2022
79e91ca
replace type to be int
Oct 6, 2022
a2c41e0
Update readReply to handle json
tolauwae Oct 6, 2022
03e3e70
Clang format
tolauwae Oct 7, 2022
9f6590e
Hotfix: add missing install step of ISRs + fix ISR indexing
tolauwae Oct 7, 2022
512e959
Introduce `INTERRUPT_TOPIC_PREFIX` macro
tolauwae Oct 7, 2022
ce0b417
Remove verbose Arduino compilation output
tolauwae Oct 7, 2022
2e79e1f
Update to new CI ubuntu runtimes
tolauwae Aug 11, 2022
d7aea39
Merge pull request #108 from TOPLLab/fix/ci
tolauwae Oct 14, 2022
f810f90
Fix #95
tolauwae Oct 11, 2022
ab5b6c7
Fix #102
tolauwae Oct 11, 2022
bafcd77
Fix readReply for proxy calls over serial
tolauwae Oct 12, 2022
8c13441
Use boolean in json reply for proxy call
tolauwae Oct 12, 2022
aca2b0d
Fix mistake in default case for `printValue` in proxy
tolauwae Oct 14, 2022
7a15951
Fix: don't send a value in proxy result when the call has no return v…
tolauwae Oct 14, 2022
2074174
Improve self-documentation of supervisor
tolauwae Oct 14, 2022
dde0f99
Add acknowledgement of successful proxy.
tolauwae Oct 14, 2022
d36bb7b
Merge pull request #106 from TOPLLab/fix/87
carllocos Oct 17, 2022
d8f3f02
Merge pull request #103 from TOPLLab/fix/95
carllocos Oct 17, 2022
addd9c7
Add disclaimer for ESP IDF primitives
tolauwae Oct 18, 2022
5bcf4c6
Merge pull request #47 from TOPLLab/feat/wood
tolauwae Oct 18, 2022
71f09c2
fix #112
Oct 18, 2022
594b02e
Add unit testing in cmakelist
Nov 16, 2022
893d0e4
Fix: missing newline for local dump (0x11)
tolauwae Nov 16, 2022
125f058
Fix: count is always 0 in dump of locals
tolauwae Nov 16, 2022
3c8ceeb
ignore ccls config
Nov 16, 2022
26bde85
renamed unit tests directory
Nov 16, 2022
14165df
add unit test directory +debugmessagges test file
Nov 28, 2022
77bb2c2
fix clang format
Nov 28, 2022
19868a3
Fix: missing newline for local dump (0x11)
tolauwae Nov 16, 2022
c46ea78
Fix: count is always 0 in dump of locals
tolauwae Nov 16, 2022
1d9060a
fix typo
Dec 2, 2022
afdcf56
added examples for unit tests
Dec 2, 2022
d84cf05
added methods to update module
Dec 2, 2022
35d9f51
fix clang format
Dec 2, 2022
b5117d5
add (disable) tests for state module
Dec 2, 2022
5e29643
fix clang format
Dec 2, 2022
ba530d7
Refactor wat example + add fac.wat
tolauwae Dec 5, 2022
37eb658
[WIP] update module debugger message
Dec 8, 2022
a6057d6
fix #119
Dec 10, 2022
e7b36aa
Added tests for loading and freeing module state
Dec 10, 2022
e19577a
rename `load_module_state` to `instatiate_module`
Dec 10, 2022
945de62
bug fix: copy wasm from interruptdata
Dec 10, 2022
b0fb481
bug fix: setup_call after updating module
Dec 10, 2022
7481a07
update `load_module_state` to `instantiate_module`
Dec 10, 2022
6ff6dbd
fix clang format
Dec 10, 2022
33c3899
Fix fac.wast example
Dec 11, 2022
d8e30fd
Removed unneeded includes
Dec 13, 2022
1fadd60
bug fix: paused VM instantiates
Dec 13, 2022
2f6b88c
add test for execution state preservation
Dec 13, 2022
c8c5b7f
Renamed file and fixture class
Dec 13, 2022
4dee095
Merge pull request #120 from TOPLLab/feat/module-update
carllocos Dec 13, 2022
674079c
Add unit tests for instantiating module
Dec 13, 2022
fbc840a
Fix issue #122
Dec 23, 2022
19d139b
recv state bug fixes and update
Dec 26, 2022
457959b
add ISR 37
Dec 26, 2022
70e2aab
fix issue #123
Dec 26, 2022
376467a
bug fix: race condition
Dec 26, 2022
d4ac2bd
bug fix: add include mutex
Dec 26, 2022
634c439
bug fix: emulated subscribe primitive
Dec 27, 2022
c1524b0
Improved documentation primitives
Dec 27, 2022
3981b3d
fix issue #124
Dec 27, 2022
a6dca35
bug fix: reading callbackmapping and free data
Dec 30, 2022
1a84b1f
removed unused includes
Dec 30, 2022
0a6dc5f
bug fix: shutdown once connection is closed
Dec 30, 2022
f4652fd
Fail if invalid serial port was provided
Dec 30, 2022
7912471
removed unused includes
Dec 30, 2022
76439b7
Fix issue #125
Dec 30, 2022
ba609ee
Refactor: use const map for baudrate
tolauwae Jan 2, 2023
145b030
Refactor: move .gitignore for tests to project level
tolauwae Jan 3, 2023
814b258
Add argument values to invoke function
tolauwae Jan 3, 2023
535dcb8
Add option to cli
tolauwae Jan 3, 2023
875cc27
Fix: module needs to be loaded to get parameters for invoked function
tolauwae Jan 3, 2023
8fe63e7
Fix: `--paused` option always false
tolauwae Jan 3, 2023
773e6a1
Fix: wrong magic number in spec tests
tolauwae Jan 3, 2023
1c2d4b7
Add `interruptINVOKE`
tolauwae Jan 4, 2023
cde6b37
Fix: IDF compilation error on print format
tolauwae Jan 4, 2023
bdb533f
Fix: out of range fidx in invoke message
tolauwae Jan 4, 2023
39d0385
Refactor: use LEB128 encoding in `interruptUPDATEModule`
tolauwae Jan 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # Cancel in-flight jobs for the same branch or PR

env:
BENCHMARKS_CACHE: "build-benchmarks"

jobs:
formatting-check:
name: Formatting Check
Expand All @@ -29,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -45,7 +42,7 @@ jobs:

compile-with-arduino:
name: (Arduino) Compile on ${{matrix.board.platform-name}}
needs: formatting-check
needs: [formatting-check]
runs-on: ubuntu-latest
env:
SKETCHES_REPORTS_PATH: sketches-reports
Expand All @@ -56,6 +53,7 @@ jobs:
- name: HTTPClient
- name: PubSubClient
- name: Adafruit NeoPixel
- source-url: https://github.com/me-no-dev/AsyncTCP.git
strategy:
fail-fast: false
matrix:
Expand All @@ -72,7 +70,11 @@ jobs:
sketches: |
- platforms/Arduino
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Compile sketches
uses: arduino/compile-sketches@v1
with:
Expand All @@ -84,6 +86,7 @@ jobs:
${{ env.LIBRARIES }}
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Upload sketches report to workflow artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -107,9 +110,10 @@ jobs:
submodules: 'recursive'

- name: Build WARDuino for ESP-IDF
uses: espressif/esp-idf-ci-action@main
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: latest
target: esp32
command: idf.py build -DBUILD_ESP=ON
path: .

5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
.vscode/
.ccls

*.bin
*.ipch
Expand Down Expand Up @@ -28,3 +29,7 @@ _deps
.AppleDouble
.LSOverride

*.old

core
venv
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "tests/sexpr-parser"]
path = tests/integration/sexpr-parser
url = [email protected]:benthepoet/c-sexpr-parser.git
[submodule "lib/json"]
path = lib/json
url = https://github.com/nlohmann/json
96 changes: 82 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
cmake_minimum_required(VERSION 3.15)
option(BUILD_ESP "Build for esp" OFF)
option(BUILD_EMULATOR "Build for emulator" OFF)
option(BUILD_UNITTEST "Build for testing" OFF)

if (NOT BUILD_ESP AND NOT BUILD_EMULATOR)

if (NOT BUILD_ESP AND NOT BUILD_EMULATOR AND NOT BUILD_UNITTEST)
message(WARNING "No build target set. Nothing to do.")
endif ()

Expand All @@ -13,7 +15,7 @@ if (BUILD_ESP)
if (NOT EXISTS $ENV{IDF_PATH}/tools/cmake/project.cmake)
message(FATAL_ERROR "Can't find $IDF_PATH/tools/cmake/project.cmake. Make sure ESP-IDF is installed and $IDF_PATH is set.")
endif ()

message(VERBOSE "Using ESP-IDF toolchain")

set(EXTRA_COMPONENT_DIRS "platforms/ESP-IDF")
Expand All @@ -25,23 +27,29 @@ project(WARDuino)

# Build the emulator version of WARDuino
if (BUILD_EMULATOR)
set(EXTERNAL_LIB_HEADERS lib/json/single_include)

find_package(Threads REQUIRED)

set(SOURCE_FILES
src/WARDuino/WARDuino.cpp
src/WARDuino/CallbackHandler.cpp
src/Primitives/emulated.cpp
src/Interpreter/instructions.cpp
src/Memory/mem.cpp
src/Utils/util.cpp
src/Utils/util_arduino.cpp
src/Debug/debugger.cpp
src/Utils/macros.cpp
src/WARDuino/WARDuino.cpp
src/WARDuino/CallbackHandler.cpp
src/Primitives/primitives.cpp
src/Interpreter/instructions.cpp
)
src/Utils/sockets.cpp
src/Debug/debugger.cpp
src/Edward/proxy.cpp
src/Edward/proxy_supervisor.cpp
src/Edward/RFC.cpp)

set(TEST_FRAMEWORK
tests/integration/wasm_tests.cpp
tests/integration/assertion.cpp
tests/integration/sexpr-parser/src/sexpr.c
)
tests/integration/wasm_tests.cpp
tests/integration/assertion.cpp
tests/integration/sexpr-parser/src/sexpr.c)

add_definitions(-DINFO=0)
add_definitions(-DDEBUG=0)
Expand All @@ -52,11 +60,71 @@ if (BUILD_EMULATOR)
set(CMAKE_CXX_STANDARD 11)

# Set default compile flags for GCC
if(CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-g -v -Wall -Wextra -Wunused)
endif(CMAKE_COMPILER_IS_GNUCXX)
endif (CMAKE_COMPILER_IS_GNUCXX)

# WARDuino CLI
add_executable(wdcli platforms/CLI-Emulator/main.cpp ${SOURCE_FILES} ${TEST_FRAMEWORK})
target_link_libraries(wdcli PRIVATE Threads::Threads)
target_include_directories(wdcli PRIVATE ${EXTERNAL_LIB_HEADERS})
endif (BUILD_EMULATOR)

if(BUILD_UNITTEST)
enable_testing()

message(VERBOSE "Building for unit tests ")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # for tooling support
set(EXTERNAL_LIB_HEADERS lib/json/single_include)

set(SOURCE_FILES
src/WARDuino/WARDuino.cpp
src/WARDuino/CallbackHandler.cpp
src/Primitives/emulated.cpp
src/Interpreter/instructions.cpp
src/Memory/mem.cpp
src/Utils/util.cpp
src/Utils/util_arduino.cpp
src/Utils/macros.cpp
src/Utils/sockets.cpp
src/Debug/debugger.cpp
src/Edward/proxy.cpp
src/Edward/proxy_supervisor.cpp
src/Edward/RFC.cpp)

# Use C++11
set(CMAKE_CXX_STANDARD 11)

# Set default compile flags for GCC
if (CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-g -v -Wall -Wextra -Wunused)
endif (CMAKE_COMPILER_IS_GNUCXX)


include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)

# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

set(PATH_TO_UNIT_TEST ${PROJECT_SOURCE_DIR}/tests/vm_unit_tests)

file(GLOB TEST_SRC_FILES ${PATH_TO_UNIT_TEST}/*.cpp)

message(DEBUG "Unit test source codes: " ${TEST_SRC_FILES})

foreach(TEST_FILE ${TEST_SRC_FILES})
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
message(DEBUG "Add executable for " ${TEST_FILE})
add_executable(${TEST_NAME} ${TEST_FILE} ${SOURCE_FILES})
target_link_libraries(${TEST_NAME} gtest_main)
target_include_directories(${TEST_NAME} PRIVATE ${EXTERNAL_LIB_HEADERS})
add_test(${TEST_NAME} ${TEST_NAME})
endforeach()
endif(BUILD_UNITTEST)
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<a href="https://github.com/TOPLLab/WARDuino/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MPL_2.0-blue.svg"></a>
</p>

This project is released under the Mozilla Public License 2.0, and is being developed as part of an active research project at the University of Ghent's [TOPL](https://github.com/TOPLLab) lab.
This project is released under the Mozilla Public License 2.0, and is being developed as part of an active research project at the University of Ghent's [TOPL Lab](https://github.com/TOPLLab).

The WARDuino virtual machine is a WebAssembly runtime for microcontrollers, which runs both under the Arduino and ESP-IDF toolchains.
The WARDuino project also includes a [VS Code extension](https://github.com/TOPLLab/WARDuino-VSCode) to use the remote debugging facilities offered by the virtual machine.
The WARDuino project also includes a [VS Code extension](https://github.com/TOPLLab/WARDuino-VSCode) to use both the remote debugging and the out-of-place debugging facilities offered by the virtual machine.

<p align="center">
<a href="./README.md#build-and-development-instructions">Installation</a> | <a href="./examples/">Examples</a> | <a href="./README.md#webassembly-specification-tests">Run Specification tests</a> | <a href="./documentation/">Documentation</a>
Expand All @@ -22,7 +22,7 @@ Supported platforms: Linux (Ubuntu), macOS, ESP-IDF, Arduino
The project uses CMake. Quick install looks like this:

```bash
git clone [email protected]:TOPLLab/WARDuino.git
git clone --recursive [email protected]:TOPLLab/WARDuino.git
cd WARDuino
mkdir build-emu
cd build-emu
Expand All @@ -36,6 +36,8 @@ The WARDuino VM can be compiled with both the Arduino and ESP-IDF toolchains, an

### Build for ESP-IDF

> warning: primitive support for IDF is under construction

Before you can compile and flash with ESP-IDF, you must install and enable [the toolchain](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html).
You also need to disable the watchdog timer:

Expand All @@ -62,22 +64,35 @@ Or simply run `idf.py flash`.
### Build for Arduino

First, install the [arduino-cli](https://arduino.github.io/arduino-cli/0.21/installation/).
You will also need python3 with the pyserial pacakge.

Second, create the config file:

```bash
arduino-cli config init
```

If you need additional boards, such as the esp32 boards, you can add them in the generated config file. More information [here](https://arduino.github.io/arduino-cli/0.21/getting-started/).
If you need additional boards, such as the esp32 boards, you can add them in the generated config file. More information on how to install the esp32 boards can be found <a href="./documentation/InstallArduinoESP32.md">here</a>.
(_note: WARDuino requires at least version 2.0.2 of the esp32 board manager when using esp32 devices)_

Thirdly, make sure you install the `PubSubClient` and `Adafruit NeoPixel` library. (used for MQTT and pixel primitives)

```bash
arduino-cli lib install "PubSubClient"
arduino-cli lib install "Adafruit NeoPixel"
arduino-cli lib install "PubSubClient" # for MQTT
arduino-cli lib install "Adafruit NeoPixel" # for some primitives
```

To build for Arduino with WIFI support you need to also install the following third-party libraries.
(Wou might need to set `enable_unsafe_install` to `true` in your arduino config ) <!-- Todo remove one day ---!>

```bash
arduino-cli lib install FreeRTOS
arduino-cli lib install --git-url https://github.com/me-no-dev/AsyncTCP.git
```

If you haven't done so already, clone (or symlink) this repository to `~/Arduino/libraries` to make WARDuino availible to Arduino.


After this initial installation steps you can start using WARDuino with the Arduino toolchain.
You can upload the example file as follows, starting from the project root:

Expand Down
3 changes: 3 additions & 0 deletions benchmarks/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ bin/

output
*.csv

*.json
*.data
12 changes: 9 additions & 3 deletions benchmarks/all_bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ to_csv() {
sed -i -n '0~2{N;s/\n/,/p}' $1
}

sleep 5
./espruino_bench.sh $tmpdir/espruino
to_csv $tmpdir/espruino
#sleep 5
#./espruino_bench.sh $tmpdir/espruino
#to_csv $tmpdir/espruino

sleep 5
./warduino_bench.sh $tmpdir/warduino
to_csv $tmpdir/warduino

sleep 5
./edward_bench.sh $tmpdir/edward
to_csv $tmpdir/edward

sleep 5
./wasm3_bench.sh $tmpdir/wasm3
to_csv $tmpdir/wasm3
Expand All @@ -38,6 +42,8 @@ echo "# Espruino"
cat $tmpdir/espruino
echo "# Warduino"
cat $tmpdir/warduino
echo "# Edward"
cat $tmpdir/edward
echo "# Wasm3"
cat $tmpdir/wasm3
echo "# Native"
Expand Down
5 changes: 3 additions & 2 deletions benchmarks/benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

#include <iostream>

#include "../debug.h"
#include "../src/Debug/debugger.h"
#include "../src/Utils/macros.h"
#include "../src/WARDuino.h"
#include "timer.h"

Expand Down Expand Up @@ -48,7 +49,7 @@ int run_benchmarks(size_t num_benchmarks, string benchmarks[],
char path[MAX_PATH];
unsigned char bytes[MAX_BYTE_CODE_SIZE];
unsigned int bytes_length;
auto *w = new WARDuino();
auto *w = WARDuino::instance();
size_t correct = 0;
for (size_t i = 0; i < num_benchmarks; i++) {
string name = benchmarks[i];
Expand Down
Loading