aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-09-21 13:43:29 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-09-21 13:43:29 +0200
commitc75dcab5988f5c0b5e0629015f384e5aa1440690 (patch)
tree0fa4d4dece1a6710e62cf25bde4605918cf9f4a4 /tests
parentf462785ee0894432e1e1d07793aba73b5ec20134 (diff)
downloadAGH-engineering-thesis-c75dcab5988f5c0b5e0629015f384e5aa1440690.tar.gz
AGH-engineering-thesis-c75dcab5988f5c0b5e0629015f384e5aa1440690.zip
enable translation of few arithmetic operations (testbench included)
Diffstat (limited to 'tests')
l---------tests/wasm_compile_arithm/Makefile1
-rw-r--r--tests/wasm_compile_arithm/instructions.wat16
l---------tests/wasm_compile_arithm/test.v1
-rw-r--r--tests/wasm_compile_arithm/words_to_verify.mem7
4 files changed, 25 insertions, 0 deletions
diff --git a/tests/wasm_compile_arithm/Makefile b/tests/wasm_compile_arithm/Makefile
new file mode 120000
index 0000000..e451c8b
--- /dev/null
+++ b/tests/wasm_compile_arithm/Makefile
@@ -0,0 +1 @@
+../wasm_compile_simple_module/Makefile \ No newline at end of file
diff --git a/tests/wasm_compile_arithm/instructions.wat b/tests/wasm_compile_arithm/instructions.wat
new file mode 100644
index 0000000..a43a348
--- /dev/null
+++ b/tests/wasm_compile_arithm/instructions.wat
@@ -0,0 +1,16 @@
+(module
+ (memory 0 2)
+ (func $main
+ ;; write 0xFFEFE021 at MEMORY_BOTTOM_ADDR + 0x0
+ (i32.store offset=0x0 align=2 (i32.const 0x0)
+ (i32.sub (i32.const 0x42143) (i32.const 0x144122)))
+ ;; write 0x16D3B7 at MEMORY_BOTTOM_ADDR + 0x4
+ (i32.store offset=0x0 align=2 (i32.const 0x4)
+ (i32.add (i32.const 0x7109D) (i32.const 0xFC31A)))
+ ;; write 0xED8 at MEMORY_BOTTOM_ADDR + 0x8
+ (i32.store offset=0x0 align=2 (i32.const 0x8)
+ (i32.div_u (i32.const 0x193E324F) (i32.const 0x1B342)))
+ ;; write 0x3C773E7C at MEMORY_BOTTOM_ADDR + 0xC
+ (i32.store offset=0x0 align=2 (i32.const 0xC)
+ (i32.mul (i32.const 0x38F2C) (i32.const 0x10FD))))
+ (export "main" (func $main)))
diff --git a/tests/wasm_compile_arithm/test.v b/tests/wasm_compile_arithm/test.v
new file mode 120000
index 0000000..f0235d8
--- /dev/null
+++ b/tests/wasm_compile_arithm/test.v
@@ -0,0 +1 @@
+../wasm_compile_simple_module/test.v \ No newline at end of file
diff --git a/tests/wasm_compile_arithm/words_to_verify.mem b/tests/wasm_compile_arithm/words_to_verify.mem
new file mode 100644
index 0000000..d3f3c4e
--- /dev/null
+++ b/tests/wasm_compile_arithm/words_to_verify.mem
@@ -0,0 +1,7 @@
+// address value
+ 0FFFFC 23
+
+ 200 FFEFE021
+ 204 16D3B7
+ 208 ED8
+ 20C 3C773E7C