Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .ci/run_test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ case $CPU_EXCEPTION_TYPE in
;;
esac

# Multi-value support
if [ "${ENABLE_MULTI_VALUE:-false}" = true ]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DZEN_ENABLE_WASI_MULTI_VALUE=ON"
fi

STACK_TYPES=("-DZEN_ENABLE_VIRTUAL_STACK=ON" "-DZEN_ENABLE_VIRTUAL_STACK=OFF")
if [[ $RUN_MODE == "interpreter" ]]; then
STACK_TYPES=("-DZEN_ENABLE_VIRTUAL_STACK=OFF")
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/dtvm_wasm_test_x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,126 @@ jobs:
cmake --build build -j7
# use dtvm to test evm abi wasm files
# ./build/dtvm -m 2 -f call counter.wasm

build_test_multi_value_interp_on_x86:
name: Build and test DTVM multi-value (interpreter) on x86-64
runs-on: ubuntu-latest
container:
image: dtvmdev1/dtvm-dev-x64:main
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"
- name: Code Format Check
run: |
./tools/format.sh check
- name: Test Git clone
run: |
git clone https://github.com/asmjit/asmjit.git
- name: Install llvm
run: |
echo "current home is $HOME"
export CUR_PROJECT=$(pwd)
cd /opt
cd $CUR_PROJECT
export LLVM_SYS_150_PREFIX=/opt/llvm15
export LLVM_DIR=$LLVM_SYS_150_PREFIX/lib/cmake/llvm
export PATH=$LLVM_SYS_150_PREFIX/bin:$PATH
cd tests/wast/spec
git apply ../spec.patch
cd $CUR_PROJECT
export CMAKE_BUILD_TARGET=Debug
export ENABLE_ASAN=true
export RUN_MODE=interpreter
export INPUT_FORMAT=wasm
export ENABLE_LAZY=true
export ENABLE_MULTITHREAD=true
export TestSuite=microsuite
export CPU_EXCEPTION_TYPE='check'
export ENABLE_GAS_METER=false
export ENABLE_MULTI_VALUE=true

bash .ci/run_test_suite.sh

build_test_multi_value_singlepass_on_x86:
name: Build and test DTVM multi-value (singlepass) on x86-64
runs-on: ubuntu-latest
container:
image: dtvmdev1/dtvm-dev-x64:main
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"
- name: Code Format Check
run: |
./tools/format.sh check
- name: Test Git clone
run: |
git clone https://github.com/asmjit/asmjit.git
- name: Install llvm
run: |
echo "current home is $HOME"
export CUR_PROJECT=$(pwd)
cd /opt
cd $CUR_PROJECT
export LLVM_SYS_150_PREFIX=/opt/llvm15
export LLVM_DIR=$LLVM_SYS_150_PREFIX/lib/cmake/llvm
export PATH=$LLVM_SYS_150_PREFIX/bin:$PATH
cd tests/wast/spec
git apply ../spec.patch
cd $CUR_PROJECT
export CMAKE_BUILD_TARGET=Debug
export ENABLE_ASAN=true
export RUN_MODE=singlepass
export INPUT_FORMAT=wasm
export ENABLE_LAZY=true
export ENABLE_MULTITHREAD=true
export TestSuite=microsuite
export CPU_EXCEPTION_TYPE='check'
export ENABLE_GAS_METER=false
export ENABLE_MULTI_VALUE=true

bash .ci/run_test_suite.sh

build_test_multi_value_multipass_on_x86:
name: Build and test DTVM multi-value (multipass) on x86-64
runs-on: ubuntu-latest
container:
image: dtvmdev1/dtvm-dev-x64:main
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"
- name: Code Format Check
run: |
./tools/format.sh check
- name: Test Git clone
run: |
git clone https://github.com/asmjit/asmjit.git
- name: Install llvm
run: |
echo "current home is $HOME"
export CUR_PROJECT=$(pwd)
cd /opt
cd $CUR_PROJECT
export LLVM_SYS_150_PREFIX=/opt/llvm15
export LLVM_DIR=$LLVM_SYS_150_PREFIX/lib/cmake/llvm
export PATH=$LLVM_SYS_150_PREFIX/bin:$PATH
cd tests/wast/spec
git apply ../spec.patch
cd $CUR_PROJECT
export CMAKE_BUILD_TARGET=Debug
export ENABLE_ASAN=true
export RUN_MODE=multipass
export INPUT_FORMAT=wasm
export ENABLE_LAZY=true
export ENABLE_MULTITHREAD=true
export TestSuite=microsuite
export CPU_EXCEPTION_TYPE='check'
export ENABLE_GAS_METER=false
export ENABLE_MULTI_VALUE=true

bash .ci/run_test_suite.sh
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ option(ZEN_ENABLE_DUMP_CALL_STACK "Enable exception call stack dump" OFF)
option(ZEN_ENABLE_EVM_GAS_REGISTER
"Enable gas register optimization for x86_64 multipass JIT" OFF
)
option(ZEN_ENABLE_WASI_MULTI_VALUE
"Enable WASI multi-value extension (multiple return values)" OFF
)

# Blockchain options
option(ZEN_ENABLE_CHECKED_ARITHMETIC "Enable checked arithmetic" OFF)
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ if(ZEN_ENABLE_DWASM)
add_definitions(-DZEN_ENABLE_DWASM)
endif()

if(ZEN_ENABLE_WASI_MULTI_VALUE)
add_definitions(-DZEN_ENABLE_WASI_MULTI_VALUE)
endif()

if(ZEN_ENABLE_VIRTUAL_STACK)
add_definitions(-DZEN_ENABLE_VIRTUAL_STACK)
endif()
Expand Down
Loading
Loading