From e285daabbd96f4b1b7b9e2b2703e85a8c72190f5 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Mon, 24 Jun 2024 14:16:24 +0000 Subject: [PATCH 01/21] Add initial PVM test vectors --- pvm/README.md | 33 + pvm/TESTCASES.md | 1047 +++++++++++++++++ pvm/programs/inst_add.json | 43 + pvm/programs/inst_add_imm.json | 43 + pvm/programs/inst_add_with_overflow.json | 43 + pvm/programs/inst_and.json | 43 + pvm/programs/inst_and_imm.json | 43 + pvm/programs/inst_branch_eq_nok.json | 60 + pvm/programs/inst_branch_eq_ok.json | 60 + pvm/programs/inst_branch_not_eq_nok.json | 60 + pvm/programs/inst_branch_not_eq_ok.json | 60 + pvm/programs/inst_cmov_if_zero_imm_nok.json | 43 + pvm/programs/inst_cmov_if_zero_imm_ok.json | 43 + pvm/programs/inst_cmov_if_zero_nok.json | 43 + pvm/programs/inst_cmov_if_zero_ok.json | 43 + pvm/programs/inst_div_signed.json | 43 + pvm/programs/inst_div_signed_by_zero.json | 43 + .../inst_div_signed_with_overflow.json | 43 + pvm/programs/inst_div_unsigned.json | 43 + pvm/programs/inst_div_unsigned_by_zero.json | 43 + .../inst_div_unsigned_with_overflow.json | 43 + pvm/programs/inst_fallthrough.json | 41 + pvm/programs/inst_jump.json | 54 + pvm/programs/inst_load_imm.json | 46 + pvm/programs/inst_move_reg.json | 42 + pvm/programs/inst_mul.json | 43 + pvm/programs/inst_mul_imm.json | 43 + pvm/programs/inst_negate_and_add_imm.json | 43 + pvm/programs/inst_or.json | 43 + pvm/programs/inst_or_imm.json | 43 + pvm/programs/inst_rem_signed.json | 43 + pvm/programs/inst_rem_signed_by_zero.json | 43 + .../inst_rem_signed_with_overflow.json | 43 + pvm/programs/inst_rem_unsigned.json | 43 + pvm/programs/inst_rem_unsigned_by_zero.json | 43 + .../inst_rem_unsigned_with_overflow.json | 43 + pvm/programs/inst_ret_halt.json | 42 + pvm/programs/inst_ret_invalid.json | 42 + .../inst_set_greater_than_signed_imm_0.json | 43 + .../inst_set_greater_than_signed_imm_1.json | 43 + .../inst_set_greater_than_unsigned_imm_0.json | 43 + .../inst_set_greater_than_unsigned_imm_1.json | 43 + pvm/programs/inst_set_less_than_signed_0.json | 43 + pvm/programs/inst_set_less_than_signed_1.json | 43 + .../inst_set_less_than_signed_imm_0.json | 43 + .../inst_set_less_than_signed_imm_1.json | 43 + .../inst_set_less_than_unsigned_0.json | 43 + .../inst_set_less_than_unsigned_1.json | 43 + .../inst_set_less_than_unsigned_imm_0.json | 43 + .../inst_set_less_than_unsigned_imm_1.json | 43 + pvm/programs/inst_shift_arithmetic_right.json | 43 + .../inst_shift_arithmetic_right_imm.json | 43 + .../inst_shift_arithmetic_right_imm_alt.json | 46 + ..._shift_arithmetic_right_with_overflow.json | 43 + pvm/programs/inst_shift_logical_left.json | 43 + pvm/programs/inst_shift_logical_left_imm.json | 43 + .../inst_shift_logical_left_imm_alt.json | 46 + ...inst_shift_logical_left_with_overflow.json | 43 + pvm/programs/inst_shift_logical_right.json | 43 + .../inst_shift_logical_right_imm.json | 43 + .../inst_shift_logical_right_imm_alt.json | 46 + ...nst_shift_logical_right_with_overflow.json | 43 + pvm/programs/inst_sub.json | 43 + pvm/programs/inst_sub_imm.json | 43 + pvm/programs/inst_sub_with_overflow.json | 43 + pvm/programs/inst_trap.json | 41 + pvm/programs/inst_xor.json | 43 + pvm/programs/inst_xor_imm.json | 43 + 68 files changed, 4002 insertions(+) create mode 100644 pvm/README.md create mode 100644 pvm/TESTCASES.md create mode 100644 pvm/programs/inst_add.json create mode 100644 pvm/programs/inst_add_imm.json create mode 100644 pvm/programs/inst_add_with_overflow.json create mode 100644 pvm/programs/inst_and.json create mode 100644 pvm/programs/inst_and_imm.json create mode 100644 pvm/programs/inst_branch_eq_nok.json create mode 100644 pvm/programs/inst_branch_eq_ok.json create mode 100644 pvm/programs/inst_branch_not_eq_nok.json create mode 100644 pvm/programs/inst_branch_not_eq_ok.json create mode 100644 pvm/programs/inst_cmov_if_zero_imm_nok.json create mode 100644 pvm/programs/inst_cmov_if_zero_imm_ok.json create mode 100644 pvm/programs/inst_cmov_if_zero_nok.json create mode 100644 pvm/programs/inst_cmov_if_zero_ok.json create mode 100644 pvm/programs/inst_div_signed.json create mode 100644 pvm/programs/inst_div_signed_by_zero.json create mode 100644 pvm/programs/inst_div_signed_with_overflow.json create mode 100644 pvm/programs/inst_div_unsigned.json create mode 100644 pvm/programs/inst_div_unsigned_by_zero.json create mode 100644 pvm/programs/inst_div_unsigned_with_overflow.json create mode 100644 pvm/programs/inst_fallthrough.json create mode 100644 pvm/programs/inst_jump.json create mode 100644 pvm/programs/inst_load_imm.json create mode 100644 pvm/programs/inst_move_reg.json create mode 100644 pvm/programs/inst_mul.json create mode 100644 pvm/programs/inst_mul_imm.json create mode 100644 pvm/programs/inst_negate_and_add_imm.json create mode 100644 pvm/programs/inst_or.json create mode 100644 pvm/programs/inst_or_imm.json create mode 100644 pvm/programs/inst_rem_signed.json create mode 100644 pvm/programs/inst_rem_signed_by_zero.json create mode 100644 pvm/programs/inst_rem_signed_with_overflow.json create mode 100644 pvm/programs/inst_rem_unsigned.json create mode 100644 pvm/programs/inst_rem_unsigned_by_zero.json create mode 100644 pvm/programs/inst_rem_unsigned_with_overflow.json create mode 100644 pvm/programs/inst_ret_halt.json create mode 100644 pvm/programs/inst_ret_invalid.json create mode 100644 pvm/programs/inst_set_greater_than_signed_imm_0.json create mode 100644 pvm/programs/inst_set_greater_than_signed_imm_1.json create mode 100644 pvm/programs/inst_set_greater_than_unsigned_imm_0.json create mode 100644 pvm/programs/inst_set_greater_than_unsigned_imm_1.json create mode 100644 pvm/programs/inst_set_less_than_signed_0.json create mode 100644 pvm/programs/inst_set_less_than_signed_1.json create mode 100644 pvm/programs/inst_set_less_than_signed_imm_0.json create mode 100644 pvm/programs/inst_set_less_than_signed_imm_1.json create mode 100644 pvm/programs/inst_set_less_than_unsigned_0.json create mode 100644 pvm/programs/inst_set_less_than_unsigned_1.json create mode 100644 pvm/programs/inst_set_less_than_unsigned_imm_0.json create mode 100644 pvm/programs/inst_set_less_than_unsigned_imm_1.json create mode 100644 pvm/programs/inst_shift_arithmetic_right.json create mode 100644 pvm/programs/inst_shift_arithmetic_right_imm.json create mode 100644 pvm/programs/inst_shift_arithmetic_right_imm_alt.json create mode 100644 pvm/programs/inst_shift_arithmetic_right_with_overflow.json create mode 100644 pvm/programs/inst_shift_logical_left.json create mode 100644 pvm/programs/inst_shift_logical_left_imm.json create mode 100644 pvm/programs/inst_shift_logical_left_imm_alt.json create mode 100644 pvm/programs/inst_shift_logical_left_with_overflow.json create mode 100644 pvm/programs/inst_shift_logical_right.json create mode 100644 pvm/programs/inst_shift_logical_right_imm.json create mode 100644 pvm/programs/inst_shift_logical_right_imm_alt.json create mode 100644 pvm/programs/inst_shift_logical_right_with_overflow.json create mode 100644 pvm/programs/inst_sub.json create mode 100644 pvm/programs/inst_sub_imm.json create mode 100644 pvm/programs/inst_sub_with_overflow.json create mode 100644 pvm/programs/inst_trap.json create mode 100644 pvm/programs/inst_xor.json create mode 100644 pvm/programs/inst_xor_imm.json diff --git a/pvm/README.md b/pvm/README.md new file mode 100644 index 0000000..7dd2c40 --- /dev/null +++ b/pvm/README.md @@ -0,0 +1,33 @@ +# PVM Test Vectors, version 0.1 + +## How to use this + +The [`programs`](./programs) directory contains `.json` files, each containing a single test. + +Here's an example of such a test: + +``` +{ + "name": "inst_add", + "initial_regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0], + "code": [0, 0, 3, 8, 121, 8, 249], + "expected_status": "trap", + "expected_regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0] +} +``` + +* `name` -- a unique identifier for the test +* `initial_regs` -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed +* `code` -- the code blob of the program to be executed as part of the test +* `expected_status` -- the way the program is supposed to end; currently it can be one of the following: + - `"trap"` -- the execution ended with a trap (the `trap` instruction was executed, the execution went "out of bounds", an invalid jump was made, or an invalid instruction was executed) + - `"halt"` -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made) +* `expected_regs` -- the expected values of each of the 13 registers *after* the test program is executed + +See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases. + +## Changelog + +### v0.1 + + * Initial test vectors. diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md new file mode 100644 index 0000000..cc7b1d7 --- /dev/null +++ b/pvm/TESTCASES.md @@ -0,0 +1,1047 @@ +# Testcases + +This file contains a human-readable index of all of the testcases, +along with their disassemblies and other relevant information. + + +## inst_add + +Initial non-zero registers: + * r7 = 0x1 + * r8 = 0x2 + +``` + : @0 + 0: 08 79 08 r9 = r7 + r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x3 (initially was 0x0) + +Program should end with: trap + + +## inst_add_imm + +Initial non-zero registers: + * r7 = 0x1 + +``` + : @0 + 0: 02 79 02 r9 = r7 + 0x2 +``` + +Registers after execution (only changed registers): + * r9 = 0x3 (initially was 0x0) + +Program should end with: trap + + +## inst_add_with_overflow + +Initial non-zero registers: + * r7 = 0xffffffff + * r8 = 0x2 + +``` + : @0 + 0: 08 79 08 r9 = r7 + r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_and + +Initial non-zero registers: + * r7 = 0x5 + * r8 = 0x3 + +``` + : @0 + 0: 17 79 08 r9 = r7 & r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_and_imm + +Initial non-zero registers: + * r7 = 0x5 + +``` + : @0 + 0: 12 79 03 r9 = r7 & 0x3 +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_branch_eq_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d3 04 r8 = 0x4d3 + 8: 18 87 04 jump 12 if r7 == r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + * r8 = 0x4d3 (initially was 0x0) + +Program should end with: trap + + +## inst_branch_eq_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d2 04 r8 = 0x4d2 + 8: 18 87 04 jump 12 if r7 == r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0x4d2 (initially was 0x0) + +Program should end with: trap + + +## inst_branch_not_eq_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d2 04 r8 = 0x4d2 + 8: 1e 87 04 jump 12 if r7 != r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + * r8 = 0x4d2 (initially was 0x0) + +Program should end with: trap + + +## inst_branch_not_eq_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 04 08 d3 04 r8 = 0x4d3 + 8: 1e 87 04 jump 12 if r7 != r8 + : @1 + 11: 00 trap + : @2 + 12: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0x4d3 (initially was 0x0) + +Program should end with: trap + + +## inst_cmov_if_zero_imm_nok + +Initial non-zero registers: + * r10 = 0x1 + +``` + : @0 + 0: 55 a7 64 r7 = 100 if r10 == 0 +``` + +Program should end with: trap + + +## inst_cmov_if_zero_imm_ok + +``` + : @0 + 0: 55 a7 64 r7 = 100 if r10 == 0 +``` + +Registers after execution (only changed registers): + * r7 = 0x64 (initially was 0x0) + +Program should end with: trap + + +## inst_cmov_if_zero_nok + +Initial non-zero registers: + * r8 = 0x64 + * r10 = 0x1 + +``` + : @0 + 0: 53 87 0a r7 = r8 if r10 == 0 +``` + +Program should end with: trap + + +## inst_cmov_if_zero_ok + +Initial non-zero registers: + * r8 = 0x64 + +``` + : @0 + 0: 53 87 0a r7 = r8 if r10 == 0 +``` + +Registers after execution (only changed registers): + * r7 = 0x64 (initially was 0x0) + +Program should end with: trap + + +## inst_div_signed + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 40 79 08 r9 = r7 /s r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xedb6db70 (initially was 0x0) + +Program should end with: trap + + +## inst_div_signed_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 40 79 08 r9 = r7 /s r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xffffffff (initially was 0x0) + +Program should end with: trap + + +## inst_div_signed_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + +``` + : @0 + 0: 40 79 08 r9 = r7 /s r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x80000000 (initially was 0x0) + +Program should end with: trap + + +## inst_div_unsigned + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 44 79 08 r9 = r7 /u r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x12492494 (initially was 0x0) + +Program should end with: trap + + +## inst_div_unsigned_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 44 79 08 r9 = r7 /u r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xffffffff (initially was 0x0) + +Program should end with: trap + + +## inst_div_unsigned_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + +``` + : @0 + 0: 44 79 08 r9 = r7 /u r8 +``` + +Program should end with: trap + + +## inst_fallthrough + +``` + : @0 + 0: 11 fallthrough +``` + +Program should end with: trap + + +## inst_jump + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 05 03 jump 7 + : @1 + 6: 00 trap + : @2 + 7: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + + +## inst_load_imm + +``` + : @0 + 0: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + + +## inst_move_reg + +Initial non-zero registers: + * r7 = 0x1 + +``` + : @0 + 0: 52 79 r9 = r7 +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_mul + +Initial non-zero registers: + * r7 = 0x3 + * r8 = 0x7 + +``` + : @0 + 0: 22 79 08 r9 = r7 * r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x15 (initially was 0x0) + +Program should end with: trap + + +## inst_mul_imm + +Initial non-zero registers: + * r7 = 0x3 + +``` + : @0 + 0: 23 79 07 r9 = r7 * 7 +``` + +Registers after execution (only changed registers): + * r9 = 0x15 (initially was 0x0) + +Program should end with: trap + + +## inst_negate_and_add_imm + +Initial non-zero registers: + * r8 = 0x2 + +``` + : @0 + 0: 28 89 01 r9 = -r8 + 1 +``` + +Registers after execution (only changed registers): + * r9 = 0xffffffff (initially was 0x0) + +Program should end with: trap + + +## inst_or + +Initial non-zero registers: + * r7 = 0x5 + * r8 = 0x3 + +``` + : @0 + 0: 0c 79 08 r9 = r7 | r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x7 (initially was 0x0) + +Program should end with: trap + + +## inst_or_imm + +Initial non-zero registers: + * r7 = 0x5 + +``` + : @0 + 0: 31 79 03 r9 = r7 | 0x3 +``` + +Registers after execution (only changed registers): + * r9 = 0x7 (initially was 0x0) + +Program should end with: trap + + +## inst_rem_signed + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 46 79 08 r9 = r7 %s r8 +``` + +Program should end with: trap + + +## inst_rem_signed_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 46 79 08 r9 = r7 %s r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x80000010 (initially was 0x0) + +Program should end with: trap + + +## inst_rem_signed_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + +``` + : @0 + 0: 46 79 08 r9 = r7 %s r8 +``` + +Program should end with: trap + + +## inst_rem_unsigned + +Initial non-zero registers: + * r7 = 0x80000010 + * r8 = 0x7 + +``` + : @0 + 0: 49 79 08 r9 = r7 %u r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x4 (initially was 0x0) + +Program should end with: trap + + +## inst_rem_unsigned_by_zero + +Initial non-zero registers: + * r7 = 0x80000010 + +``` + : @0 + 0: 49 79 08 r9 = r7 %u r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x80000010 (initially was 0x0) + +Program should end with: trap + + +## inst_rem_unsigned_with_overflow + +Initial non-zero registers: + * r7 = 0x80000000 + * r8 = 0xffffffff + +``` + : @0 + 0: 49 79 08 r9 = r7 %u r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x80000000 (initially was 0x0) + +Program should end with: trap + + +## inst_ret_halt + +Initial non-zero registers: + * r0 = 0xffff0000 + +``` + : @0 + 0: 13 00 jump [r0 + 0] +``` + +Program should end with: halt + + +## inst_ret_invalid + +``` + : @0 + 0: 13 00 jump [r0 + 0] +``` + +Program should end with: trap + + +## inst_set_greater_than_signed_imm_0 + +Initial non-zero registers: + * r7 = 0xfffffff6 + +``` + : @0 + 0: 3d 79 0a r9 = r7 >s 10 +``` + +Program should end with: trap + + +## inst_set_greater_than_signed_imm_1 + +Initial non-zero registers: + * r7 = 0xa + +``` + : @0 + 0: 3d 79 f6 r9 = r7 >s -10 +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_set_greater_than_unsigned_imm_0 + +Initial non-zero registers: + * r7 = 0xa + +``` + : @0 + 0: 27 79 f6 r9 = r7 >u 0xfffffff6 +``` + +Program should end with: trap + + +## inst_set_greater_than_unsigned_imm_1 + +Initial non-zero registers: + * r7 = 0xfffffff6 + +``` + : @0 + 0: 27 79 0a r9 = r7 >u 0xa +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_set_less_than_signed_0 + +Initial non-zero registers: + * r7 = 0xa + * r8 = 0xfffffff6 + +``` + : @0 + 0: 3a 79 08 r9 = r7 >a r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xf000000e (initially was 0x0) + +Program should end with: trap + + +## inst_shift_arithmetic_right_imm + +Initial non-zero registers: + * r7 = 0x80000075 + +``` + : @0 + 0: 19 79 03 r9 = r7 >>a 3 +``` + +Registers after execution (only changed registers): + * r9 = 0xf000000e (initially was 0x0) + +Program should end with: trap + + +## inst_shift_arithmetic_right_imm_alt + +Initial non-zero registers: + * r8 = 0x3 + +``` + : @0 + 0: 50 89 75 00 00 80 r9 = 2147483765 >>a r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xf000000e (initially was 0x0) + +Program should end with: trap + + +## inst_shift_arithmetic_right_with_overflow + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x21 + +``` + : @0 + 0: 4d 79 08 r9 = r7 >>a r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xc000003a (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_left + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x3 + +``` + : @0 + 0: 37 79 08 r9 = r7 << r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x3a8 (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_left_imm + +Initial non-zero registers: + * r7 = 0x80000075 + +``` + : @0 + 0: 09 79 03 r9 = r7 << 3 +``` + +Registers after execution (only changed registers): + * r9 = 0x3a8 (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_left_imm_alt + +Initial non-zero registers: + * r8 = 0x3 + +``` + : @0 + 0: 4b 89 75 00 00 80 r9 = 2147483765 << r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x3a8 (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_left_with_overflow + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x21 + +``` + : @0 + 0: 37 79 08 r9 = r7 << r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xea (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_right + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x3 + +``` + : @0 + 0: 33 79 08 r9 = r7 >> r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x1000000e (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_right_imm + +Initial non-zero registers: + * r7 = 0x80000075 + +``` + : @0 + 0: 0e 79 03 r9 = r7 >> 3 +``` + +Registers after execution (only changed registers): + * r9 = 0x1000000e (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_right_imm_alt + +Initial non-zero registers: + * r8 = 0x3 + +``` + : @0 + 0: 48 89 75 00 00 80 r9 = 2147483765 >> r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x1000000e (initially was 0x0) + +Program should end with: trap + + +## inst_shift_logical_right_with_overflow + +Initial non-zero registers: + * r7 = 0x80000075 + * r8 = 0x21 + +``` + : @0 + 0: 33 79 08 r9 = r7 >> r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x4000003a (initially was 0x0) + +Program should end with: trap + + +## inst_sub + +Initial non-zero registers: + * r7 = 0x2 + * r8 = 0x1 + +``` + : @0 + 0: 14 79 08 r9 = r7 - r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_sub_imm + +Initial non-zero registers: + * r7 = 0x2 + +``` + : @0 + 0: 02 79 ff r9 = r7 + 0xffffffff +``` + +Registers after execution (only changed registers): + * r9 = 0x1 (initially was 0x0) + +Program should end with: trap + + +## inst_sub_with_overflow + +Initial non-zero registers: + * r7 = 0x2 + * r8 = 0x4 + +``` + : @0 + 0: 14 79 08 r9 = r7 - r8 +``` + +Registers after execution (only changed registers): + * r9 = 0xfffffffe (initially was 0x0) + +Program should end with: trap + + +## inst_trap + +``` + : @0 + 0: 00 trap +``` + +Program should end with: trap + + +## inst_xor + +Initial non-zero registers: + * r7 = 0x5 + * r8 = 0x3 + +``` + : @0 + 0: 1c 79 08 r9 = r7 ^ r8 +``` + +Registers after execution (only changed registers): + * r9 = 0x6 (initially was 0x0) + +Program should end with: trap + + +## inst_xor_imm + +Initial non-zero registers: + * r7 = 0x5 + +``` + : @0 + 0: 1f 79 03 r9 = r7 ^ 0x3 +``` + +Registers after execution (only changed registers): + * r9 = 0x6 (initially was 0x0) + +Program should end with: trap + + diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json new file mode 100644 index 0000000..13f5e35 --- /dev/null +++ b/pvm/programs/inst_add.json @@ -0,0 +1,43 @@ +{ + "name": "inst_add", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 8, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 2, + 3, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json new file mode 100644 index 0000000..88d5f7f --- /dev/null +++ b/pvm/programs/inst_add_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_add_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 2, + 121, + 2, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 3, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json new file mode 100644 index 0000000..39b0e9f --- /dev/null +++ b/pvm/programs/inst_add_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_add_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967295, + 2, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 8, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967295, + 2, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json new file mode 100644 index 0000000..1854fb7 --- /dev/null +++ b/pvm/programs/inst_and.json @@ -0,0 +1,43 @@ +{ + "name": "inst_and", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 23, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json new file mode 100644 index 0000000..e2eb8f7 --- /dev/null +++ b/pvm/programs/inst_and_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_and_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 18, + 121, + 3, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json new file mode 100644 index 0000000..d21396a --- /dev/null +++ b/pvm/programs/inst_branch_eq_nok.json @@ -0,0 +1,60 @@ +{ + "name": "inst_branch_eq_nok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 211, + 4, + 24, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 252 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 1235, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json new file mode 100644 index 0000000..92c8b3f --- /dev/null +++ b/pvm/programs/inst_branch_eq_ok.json @@ -0,0 +1,60 @@ +{ + "name": "inst_branch_eq_ok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 210, + 4, + 24, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 252 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 1234, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json new file mode 100644 index 0000000..dd93160 --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -0,0 +1,60 @@ +{ + "name": "inst_branch_not_eq_nok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 210, + 4, + 30, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 252 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 1234, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json new file mode 100644 index 0000000..fc5094b --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -0,0 +1,60 @@ +{ + "name": "inst_branch_not_eq_ok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 18, + 4, + 7, + 210, + 4, + 4, + 8, + 211, + 4, + 30, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 25, + 252 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 1235, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json new file mode 100644 index 0000000..c8a6ab8 --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -0,0 +1,43 @@ +{ + "name": "inst_cmov_if_zero_imm_nok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 85, + 167, + 100, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json new file mode 100644 index 0000000..2217f6b --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -0,0 +1,43 @@ +{ + "name": "inst_cmov_if_zero_imm_ok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 85, + 167, + 100, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json new file mode 100644 index 0000000..893244c --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -0,0 +1,43 @@ +{ + "name": "inst_cmov_if_zero_nok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 1, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 83, + 135, + 10, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 1, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json new file mode 100644 index 0000000..4a667b1 --- /dev/null +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -0,0 +1,43 @@ +{ + "name": "inst_cmov_if_zero_ok", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 83, + 135, + 10, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 100, + 100, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json new file mode 100644 index 0000000..f78bbae --- /dev/null +++ b/pvm/programs/inst_div_signed.json @@ -0,0 +1,43 @@ +{ + "name": "inst_div_signed", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 64, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 3988183920, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json new file mode 100644 index 0000000..0d0edbe --- /dev/null +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -0,0 +1,43 @@ +{ + "name": "inst_div_signed_by_zero", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 64, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 4294967295, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json new file mode 100644 index 0000000..e5b797d --- /dev/null +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_div_signed_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 64, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 2147483648, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json new file mode 100644 index 0000000..4168019 --- /dev/null +++ b/pvm/programs/inst_div_unsigned.json @@ -0,0 +1,43 @@ +{ + "name": "inst_div_unsigned", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 68, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 306783380, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json new file mode 100644 index 0000000..a1b5f2e --- /dev/null +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -0,0 +1,43 @@ +{ + "name": "inst_div_unsigned_by_zero", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 68, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 4294967295, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json new file mode 100644 index 0000000..34c6f0d --- /dev/null +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_div_unsigned_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 68, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json new file mode 100644 index 0000000..68a9a0f --- /dev/null +++ b/pvm/programs/inst_fallthrough.json @@ -0,0 +1,41 @@ +{ + "name": "inst_fallthrough", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 1, + 17, + 255 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json new file mode 100644 index 0000000..99ecb8c --- /dev/null +++ b/pvm/programs/inst_jump.json @@ -0,0 +1,54 @@ +{ + "name": "inst_jump", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 13, + 4, + 7, + 210, + 4, + 5, + 3, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 209, + 224 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json new file mode 100644 index 0000000..91ab1f9 --- /dev/null +++ b/pvm/programs/inst_load_imm.json @@ -0,0 +1,46 @@ +{ + "name": "inst_load_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 6, + 4, + 7, + 239, + 190, + 173, + 222, + 193 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json new file mode 100644 index 0000000..3aa682b --- /dev/null +++ b/pvm/programs/inst_move_reg.json @@ -0,0 +1,42 @@ +{ + "name": "inst_move_reg", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 2, + 82, + 121, + 253 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json new file mode 100644 index 0000000..03e4cc3 --- /dev/null +++ b/pvm/programs/inst_mul.json @@ -0,0 +1,43 @@ +{ + "name": "inst_mul", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 7, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 34, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 7, + 21, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json new file mode 100644 index 0000000..73426f4 --- /dev/null +++ b/pvm/programs/inst_mul_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_mul_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 35, + 121, + 7, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 21, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json new file mode 100644 index 0000000..20dc881 --- /dev/null +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_negate_and_add_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 40, + 137, + 1, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 4294967295, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json new file mode 100644 index 0000000..ddcf160 --- /dev/null +++ b/pvm/programs/inst_or.json @@ -0,0 +1,43 @@ +{ + "name": "inst_or", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 12, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 7, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json new file mode 100644 index 0000000..bf4053d --- /dev/null +++ b/pvm/programs/inst_or_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_or_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 49, + 121, + 3, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 7, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json new file mode 100644 index 0000000..8c04eee --- /dev/null +++ b/pvm/programs/inst_rem_signed.json @@ -0,0 +1,43 @@ +{ + "name": "inst_rem_signed", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 70, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json new file mode 100644 index 0000000..cc708a6 --- /dev/null +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -0,0 +1,43 @@ +{ + "name": "inst_rem_signed_by_zero", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 70, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 2147483664, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json new file mode 100644 index 0000000..71d300d --- /dev/null +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_rem_signed_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 70, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json new file mode 100644 index 0000000..f693ae8 --- /dev/null +++ b/pvm/programs/inst_rem_unsigned.json @@ -0,0 +1,43 @@ +{ + "name": "inst_rem_unsigned", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 73, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 7, + 4, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json new file mode 100644 index 0000000..4958318 --- /dev/null +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -0,0 +1,43 @@ +{ + "name": "inst_rem_unsigned_by_zero", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 73, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483664, + 0, + 2147483664, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json new file mode 100644 index 0000000..2aee3d4 --- /dev/null +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_rem_unsigned_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 73, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483648, + 4294967295, + 2147483648, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json new file mode 100644 index 0000000..1ccc8c2 --- /dev/null +++ b/pvm/programs/inst_ret_halt.json @@ -0,0 +1,42 @@ +{ + "name": "inst_ret_halt", + "initial_regs": [ + 4294901760, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 2, + 19, + 0, + 253 + ], + "expected_status": "halt", + "expected_regs": [ + 4294901760, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json new file mode 100644 index 0000000..4b2d0a8 --- /dev/null +++ b/pvm/programs/inst_ret_invalid.json @@ -0,0 +1,42 @@ +{ + "name": "inst_ret_invalid", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 2, + 19, + 0, + 253 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json new file mode 100644 index 0000000..8edf07b --- /dev/null +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_greater_than_signed_imm_0", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 61, + 121, + 10, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json new file mode 100644 index 0000000..2655ef4 --- /dev/null +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_greater_than_signed_imm_1", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 61, + 121, + 246, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json new file mode 100644 index 0000000..59586f0 --- /dev/null +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_greater_than_unsigned_imm_0", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 39, + 121, + 246, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json new file mode 100644 index 0000000..322b25a --- /dev/null +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_greater_than_unsigned_imm_1", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 39, + 121, + 10, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json new file mode 100644 index 0000000..0fb694c --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_signed_0", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 58, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json new file mode 100644 index 0000000..245165a --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_signed_1", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 58, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json new file mode 100644 index 0000000..63a0100 --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_signed_imm_0", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 56, + 121, + 246, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json new file mode 100644 index 0000000..1a29c24 --- /dev/null +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_signed_imm_1", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 56, + 121, + 10, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json new file mode 100644 index 0000000..7c1d196 --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_unsigned_0", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 36, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json new file mode 100644 index 0000000..ad2596a --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_unsigned_1", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 36, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json new file mode 100644 index 0000000..92f1a5b --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_unsigned_imm_0", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 27, + 121, + 10, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json new file mode 100644 index 0000000..fbed6e2 --- /dev/null +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -0,0 +1,43 @@ +{ + "name": "inst_set_less_than_unsigned_imm_1", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 27, + 121, + 246, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json new file mode 100644 index 0000000..b8420c8 --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_arithmetic_right", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 77, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 4026531854, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json new file mode 100644 index 0000000..910fa86 --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_arithmetic_right_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 25, + 121, + 3, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 4026531854, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json new file mode 100644 index 0000000..f4ac3c9 --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -0,0 +1,46 @@ +{ + "name": "inst_shift_arithmetic_right_imm_alt", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 6, + 80, + 137, + 117, + 0, + 0, + 128, + 193 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 4026531854, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json new file mode 100644 index 0000000..1ce29ac --- /dev/null +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_arithmetic_right_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 77, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 3221225530, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json new file mode 100644 index 0000000..6681bdf --- /dev/null +++ b/pvm/programs/inst_shift_logical_left.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_logical_left", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 55, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 936, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json new file mode 100644 index 0000000..afe0f40 --- /dev/null +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_logical_left_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 9, + 121, + 3, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 936, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json new file mode 100644 index 0000000..8cbe65c --- /dev/null +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -0,0 +1,46 @@ +{ + "name": "inst_shift_logical_left_imm_alt", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 6, + 75, + 137, + 117, + 0, + 0, + 128, + 193 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 936, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json new file mode 100644 index 0000000..66913ca --- /dev/null +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_logical_left_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 55, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 234, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json new file mode 100644 index 0000000..5fbd602 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_logical_right", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 51, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 3, + 268435470, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json new file mode 100644 index 0000000..66e0e67 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_logical_right_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 14, + 121, + 3, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 0, + 268435470, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json new file mode 100644 index 0000000..dfa4a0a --- /dev/null +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -0,0 +1,46 @@ +{ + "name": "inst_shift_logical_right_imm_alt", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 6, + 72, + 137, + 117, + 0, + 0, + 128, + 193 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3, + 268435470, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json new file mode 100644 index 0000000..6943c72 --- /dev/null +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_shift_logical_right_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 51, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2147483765, + 33, + 1073741882, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json new file mode 100644 index 0000000..f38d336 --- /dev/null +++ b/pvm/programs/inst_sub.json @@ -0,0 +1,43 @@ +{ + "name": "inst_sub", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 1, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 20, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 1, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json new file mode 100644 index 0000000..e16283e --- /dev/null +++ b/pvm/programs/inst_sub_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_sub_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 2, + 121, + 255, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 1, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json new file mode 100644 index 0000000..709b453 --- /dev/null +++ b/pvm/programs/inst_sub_with_overflow.json @@ -0,0 +1,43 @@ +{ + "name": "inst_sub_with_overflow", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 4, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 20, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 4, + 4294967294, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json new file mode 100644 index 0000000..1e4956d --- /dev/null +++ b/pvm/programs/inst_trap.json @@ -0,0 +1,41 @@ +{ + "name": "inst_trap", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 1, + 0, + 255 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json new file mode 100644 index 0000000..f75f739 --- /dev/null +++ b/pvm/programs/inst_xor.json @@ -0,0 +1,43 @@ +{ + "name": "inst_xor", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 28, + 121, + 8, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 3, + 6, + 0, + 0, + 0 + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json new file mode 100644 index 0000000..c1dc4ce --- /dev/null +++ b/pvm/programs/inst_xor_imm.json @@ -0,0 +1,43 @@ +{ + "name": "inst_xor_imm", + "initial_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "code": [ + 0, + 0, + 3, + 31, + 121, + 3, + 249 + ], + "expected_status": "trap", + "expected_regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 6, + 0, + 0, + 0 + ] +} \ No newline at end of file From 19d2ad82a00e636c517e8b2916a6fe58b5af765b Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 06:23:16 +0000 Subject: [PATCH 02/21] Pre-clobber the output reg in `inst_div_unsigned_with_overflow` The test writes a zero here, so make sure the register initially contains something *other* than a zero so that we can actually see that it was modified. --- pvm/TESTCASES.md | 4 ++++ pvm/programs/inst_div_unsigned_with_overflow.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index cc7b1d7..5501405 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -311,12 +311,16 @@ Program should end with: trap Initial non-zero registers: * r7 = 0x80000000 * r8 = 0xffffffff + * r9 = 0x1234 ``` : @0 0: 44 79 08 r9 = r7 /u r8 ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0x1234) + Program should end with: trap diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 34c6f0d..955af35 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -10,7 +10,7 @@ 0, 2147483648, 4294967295, - 0, + 4660, 0, 0, 0 From 9ba4b5b1e86a263e9a246c5c2f241fa08944fa4d Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 07:47:17 +0000 Subject: [PATCH 03/21] Replace underscores with hypens, because ASN.1 doesn't like underscores --- pvm/README.md | 12 ++++++------ pvm/programs/inst_add.json | 6 +++--- pvm/programs/inst_add_imm.json | 6 +++--- pvm/programs/inst_add_with_overflow.json | 6 +++--- pvm/programs/inst_and.json | 6 +++--- pvm/programs/inst_and_imm.json | 6 +++--- pvm/programs/inst_branch_eq_nok.json | 6 +++--- pvm/programs/inst_branch_eq_ok.json | 6 +++--- pvm/programs/inst_branch_not_eq_nok.json | 6 +++--- pvm/programs/inst_branch_not_eq_ok.json | 6 +++--- pvm/programs/inst_cmov_if_zero_imm_nok.json | 6 +++--- pvm/programs/inst_cmov_if_zero_imm_ok.json | 6 +++--- pvm/programs/inst_cmov_if_zero_nok.json | 6 +++--- pvm/programs/inst_cmov_if_zero_ok.json | 6 +++--- pvm/programs/inst_div_signed.json | 6 +++--- pvm/programs/inst_div_signed_by_zero.json | 6 +++--- pvm/programs/inst_div_signed_with_overflow.json | 6 +++--- pvm/programs/inst_div_unsigned.json | 6 +++--- pvm/programs/inst_div_unsigned_by_zero.json | 6 +++--- pvm/programs/inst_div_unsigned_with_overflow.json | 6 +++--- pvm/programs/inst_fallthrough.json | 6 +++--- pvm/programs/inst_jump.json | 6 +++--- pvm/programs/inst_load_imm.json | 6 +++--- pvm/programs/inst_move_reg.json | 6 +++--- pvm/programs/inst_mul.json | 6 +++--- pvm/programs/inst_mul_imm.json | 6 +++--- pvm/programs/inst_negate_and_add_imm.json | 6 +++--- pvm/programs/inst_or.json | 6 +++--- pvm/programs/inst_or_imm.json | 6 +++--- pvm/programs/inst_rem_signed.json | 6 +++--- pvm/programs/inst_rem_signed_by_zero.json | 6 +++--- pvm/programs/inst_rem_signed_with_overflow.json | 6 +++--- pvm/programs/inst_rem_unsigned.json | 6 +++--- pvm/programs/inst_rem_unsigned_by_zero.json | 6 +++--- pvm/programs/inst_rem_unsigned_with_overflow.json | 6 +++--- pvm/programs/inst_ret_halt.json | 6 +++--- pvm/programs/inst_ret_invalid.json | 6 +++--- pvm/programs/inst_set_greater_than_signed_imm_0.json | 6 +++--- pvm/programs/inst_set_greater_than_signed_imm_1.json | 6 +++--- .../inst_set_greater_than_unsigned_imm_0.json | 6 +++--- .../inst_set_greater_than_unsigned_imm_1.json | 6 +++--- pvm/programs/inst_set_less_than_signed_0.json | 6 +++--- pvm/programs/inst_set_less_than_signed_1.json | 6 +++--- pvm/programs/inst_set_less_than_signed_imm_0.json | 6 +++--- pvm/programs/inst_set_less_than_signed_imm_1.json | 6 +++--- pvm/programs/inst_set_less_than_unsigned_0.json | 6 +++--- pvm/programs/inst_set_less_than_unsigned_1.json | 6 +++--- pvm/programs/inst_set_less_than_unsigned_imm_0.json | 6 +++--- pvm/programs/inst_set_less_than_unsigned_imm_1.json | 6 +++--- pvm/programs/inst_shift_arithmetic_right.json | 6 +++--- pvm/programs/inst_shift_arithmetic_right_imm.json | 6 +++--- .../inst_shift_arithmetic_right_imm_alt.json | 6 +++--- .../inst_shift_arithmetic_right_with_overflow.json | 6 +++--- pvm/programs/inst_shift_logical_left.json | 6 +++--- pvm/programs/inst_shift_logical_left_imm.json | 6 +++--- pvm/programs/inst_shift_logical_left_imm_alt.json | 6 +++--- .../inst_shift_logical_left_with_overflow.json | 6 +++--- pvm/programs/inst_shift_logical_right.json | 6 +++--- pvm/programs/inst_shift_logical_right_imm.json | 6 +++--- pvm/programs/inst_shift_logical_right_imm_alt.json | 6 +++--- .../inst_shift_logical_right_with_overflow.json | 6 +++--- pvm/programs/inst_sub.json | 6 +++--- pvm/programs/inst_sub_imm.json | 6 +++--- pvm/programs/inst_sub_with_overflow.json | 6 +++--- pvm/programs/inst_trap.json | 6 +++--- pvm/programs/inst_xor.json | 6 +++--- pvm/programs/inst_xor_imm.json | 6 +++--- 67 files changed, 204 insertions(+), 204 deletions(-) diff --git a/pvm/README.md b/pvm/README.md index 7dd2c40..c45cd8b 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -9,20 +9,20 @@ Here's an example of such a test: ``` { "name": "inst_add", - "initial_regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0], + "initial-regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0], "code": [0, 0, 3, 8, 121, 8, 249], - "expected_status": "trap", - "expected_regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0] + "expected-status": "trap", + "expected-regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0] } ``` * `name` -- a unique identifier for the test -* `initial_regs` -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed +* `initial-regs` -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed * `code` -- the code blob of the program to be executed as part of the test -* `expected_status` -- the way the program is supposed to end; currently it can be one of the following: +* `expected-status` -- the way the program is supposed to end; currently it can be one of the following: - `"trap"` -- the execution ended with a trap (the `trap` instruction was executed, the execution went "out of bounds", an invalid jump was made, or an invalid instruction was executed) - `"halt"` -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made) -* `expected_regs` -- the expected values of each of the 13 registers *after* the test program is executed +* `expected-regs` -- the expected values of each of the 13 registers *after* the test program is executed See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases. diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 13f5e35..7a308e0 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -1,6 +1,6 @@ { "name": "inst_add", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json index 88d5f7f..d7b5b87 100644 --- a/pvm/programs/inst_add_imm.json +++ b/pvm/programs/inst_add_imm.json @@ -1,6 +1,6 @@ { "name": "inst_add_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 2, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index 39b0e9f..3889d2e 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_add_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index 1854fb7..36eb7bc 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -1,6 +1,6 @@ { "name": "inst_and", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json index e2eb8f7..eb6358d 100644 --- a/pvm/programs/inst_and_imm.json +++ b/pvm/programs/inst_and_imm.json @@ -1,6 +1,6 @@ { "name": "inst_and_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 3, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json index d21396a..654853d 100644 --- a/pvm/programs/inst_branch_eq_nok.json +++ b/pvm/programs/inst_branch_eq_nok.json @@ -1,6 +1,6 @@ { "name": "inst_branch_eq_nok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -41,8 +41,8 @@ 25, 252 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json index 92c8b3f..8863399 100644 --- a/pvm/programs/inst_branch_eq_ok.json +++ b/pvm/programs/inst_branch_eq_ok.json @@ -1,6 +1,6 @@ { "name": "inst_branch_eq_ok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -41,8 +41,8 @@ 25, 252 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json index dd93160..743a01f 100644 --- a/pvm/programs/inst_branch_not_eq_nok.json +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -1,6 +1,6 @@ { "name": "inst_branch_not_eq_nok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -41,8 +41,8 @@ 25, 252 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json index fc5094b..5cc54c1 100644 --- a/pvm/programs/inst_branch_not_eq_ok.json +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -1,6 +1,6 @@ { "name": "inst_branch_not_eq_ok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -41,8 +41,8 @@ 25, 252 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json index c8a6ab8..c93ea53 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_nok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -1,6 +1,6 @@ { "name": "inst_cmov_if_zero_imm_nok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 100, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json index 2217f6b..6e6709d 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_ok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -1,6 +1,6 @@ { "name": "inst_cmov_if_zero_imm_ok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 100, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index 893244c..5bf4dee 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -1,6 +1,6 @@ { "name": "inst_cmov_if_zero_nok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 10, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index 4a667b1..5233c23 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -1,6 +1,6 @@ { "name": "inst_cmov_if_zero_ok", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 10, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index f78bbae..edfcb56 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -1,6 +1,6 @@ { "name": "inst_div_signed", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index 0d0edbe..ed009c0 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -1,6 +1,6 @@ { "name": "inst_div_signed_by_zero", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index e5b797d..93f205d 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_div_signed_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index 4168019..6668da0 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -1,6 +1,6 @@ { "name": "inst_div_unsigned", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index a1b5f2e..9ac2d45 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -1,6 +1,6 @@ { "name": "inst_div_unsigned_by_zero", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 955af35..7f1039a 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_div_unsigned_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json index 68a9a0f..b342e48 100644 --- a/pvm/programs/inst_fallthrough.json +++ b/pvm/programs/inst_fallthrough.json @@ -1,6 +1,6 @@ { "name": "inst_fallthrough", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -22,8 +22,8 @@ 17, 255 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json index 99ecb8c..17b1c60 100644 --- a/pvm/programs/inst_jump.json +++ b/pvm/programs/inst_jump.json @@ -1,6 +1,6 @@ { "name": "inst_jump", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -35,8 +35,8 @@ 209, 224 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json index 91ab1f9..a54af10 100644 --- a/pvm/programs/inst_load_imm.json +++ b/pvm/programs/inst_load_imm.json @@ -1,6 +1,6 @@ { "name": "inst_load_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -27,8 +27,8 @@ 222, 193 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json index 3aa682b..4cdc52e 100644 --- a/pvm/programs/inst_move_reg.json +++ b/pvm/programs/inst_move_reg.json @@ -1,6 +1,6 @@ { "name": "inst_move_reg", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -23,8 +23,8 @@ 121, 253 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index 03e4cc3..fb21e00 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -1,6 +1,6 @@ { "name": "inst_mul", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json index 73426f4..07c149a 100644 --- a/pvm/programs/inst_mul_imm.json +++ b/pvm/programs/inst_mul_imm.json @@ -1,6 +1,6 @@ { "name": "inst_mul_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 7, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json index 20dc881..2f69516 100644 --- a/pvm/programs/inst_negate_and_add_imm.json +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -1,6 +1,6 @@ { "name": "inst_negate_and_add_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 1, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index ddcf160..ab93223 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -1,6 +1,6 @@ { "name": "inst_or", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json index bf4053d..62c771c 100644 --- a/pvm/programs/inst_or_imm.json +++ b/pvm/programs/inst_or_imm.json @@ -1,6 +1,6 @@ { "name": "inst_or_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 3, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index 8c04eee..f815f5e 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -1,6 +1,6 @@ { "name": "inst_rem_signed", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index cc708a6..120b805 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -1,6 +1,6 @@ { "name": "inst_rem_signed_by_zero", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index 71d300d..bf0ec7b 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_rem_signed_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index f693ae8..697c9ab 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -1,6 +1,6 @@ { "name": "inst_rem_unsigned", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index 4958318..6a909e8 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -1,6 +1,6 @@ { "name": "inst_rem_unsigned_by_zero", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index 2aee3d4..9436ed7 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_rem_unsigned_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index 1ccc8c2..4bc2700 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -1,6 +1,6 @@ { "name": "inst_ret_halt", - "initial_regs": [ + "initial-regs": [ 4294901760, 0, 0, @@ -23,8 +23,8 @@ 0, 253 ], - "expected_status": "halt", - "expected_regs": [ + "expected-status": "halt", + "expected-regs": [ 4294901760, 0, 0, diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json index 4b2d0a8..f0c11ae 100644 --- a/pvm/programs/inst_ret_invalid.json +++ b/pvm/programs/inst_ret_invalid.json @@ -1,6 +1,6 @@ { "name": "inst_ret_invalid", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -23,8 +23,8 @@ 0, 253 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index 8edf07b..5ddec64 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -1,6 +1,6 @@ { "name": "inst_set_greater_than_signed_imm_0", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 10, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json index 2655ef4..13ce7a8 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_1.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -1,6 +1,6 @@ { "name": "inst_set_greater_than_signed_imm_1", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 246, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index 59586f0..4729552 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -1,6 +1,6 @@ { "name": "inst_set_greater_than_unsigned_imm_0", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 246, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json index 322b25a..b5cf549 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -1,6 +1,6 @@ { "name": "inst_set_greater_than_unsigned_imm_1", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 10, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index 0fb694c..a249c12 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_signed_0", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index 245165a..7646fbc 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_signed_1", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index 63a0100..c860be8 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_signed_imm_0", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 246, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json index 1a29c24..0f789c9 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_1.json +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_signed_imm_1", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 10, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index 7c1d196..aa75b1c 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_unsigned_0", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index ad2596a..2e72e9c 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_unsigned_1", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index 92f1a5b..407e9b3 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_unsigned_imm_0", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 10, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json index fbed6e2..b05596c 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -1,6 +1,6 @@ { "name": "inst_set_less_than_unsigned_imm_1", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 246, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index b8420c8..7591f03 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -1,6 +1,6 @@ { "name": "inst_shift_arithmetic_right", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json index 910fa86..8ae12da 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -1,6 +1,6 @@ { "name": "inst_shift_arithmetic_right_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 3, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json index f4ac3c9..0147109 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -1,6 +1,6 @@ { "name": "inst_shift_arithmetic_right_imm_alt", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -27,8 +27,8 @@ 128, 193 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index 1ce29ac..d2da855 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_shift_arithmetic_right_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index 6681bdf..6d07c8c 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_left", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json index afe0f40..847627c 100644 --- a/pvm/programs/inst_shift_logical_left_imm.json +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_left_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 3, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json index 8cbe65c..7792da6 100644 --- a/pvm/programs/inst_shift_logical_left_imm_alt.json +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_left_imm_alt", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -27,8 +27,8 @@ 128, 193 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index 66913ca..ec590e4 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_left_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index 5fbd602..f65639a 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_right", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json index 66e0e67..ecf352b 100644 --- a/pvm/programs/inst_shift_logical_right_imm.json +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_right_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 3, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json index dfa4a0a..f2875d6 100644 --- a/pvm/programs/inst_shift_logical_right_imm_alt.json +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_right_imm_alt", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -27,8 +27,8 @@ 128, 193 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index 6943c72..9f0cd6e 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_shift_logical_right_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index f38d336..289474b 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -1,6 +1,6 @@ { "name": "inst_sub", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json index e16283e..0869656 100644 --- a/pvm/programs/inst_sub_imm.json +++ b/pvm/programs/inst_sub_imm.json @@ -1,6 +1,6 @@ { "name": "inst_sub_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 255, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index 709b453..ff01f83 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -1,6 +1,6 @@ { "name": "inst_sub_with_overflow", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json index 1e4956d..8d40aaf 100644 --- a/pvm/programs/inst_trap.json +++ b/pvm/programs/inst_trap.json @@ -1,6 +1,6 @@ { "name": "inst_trap", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -22,8 +22,8 @@ 0, 255 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index f75f739..523a161 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -1,6 +1,6 @@ { "name": "inst_xor", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 8, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json index c1dc4ce..2657422 100644 --- a/pvm/programs/inst_xor_imm.json +++ b/pvm/programs/inst_xor_imm.json @@ -1,6 +1,6 @@ { "name": "inst_xor_imm", - "initial_regs": [ + "initial-regs": [ 0, 0, 0, @@ -24,8 +24,8 @@ 3, 249 ], - "expected_status": "trap", - "expected_regs": [ + "expected-status": "trap", + "expected-regs": [ 0, 0, 0, From e89f6b7ccfff7549dc0718092ac1e8f123a3917e Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 07:48:17 +0000 Subject: [PATCH 04/21] Add JSON Schema and ASN.1 schema --- pvm/README.md | 2 ++ pvm/schema.asn | 14 ++++++++++++ pvm/schema.json | 43 +++++++++++++++++++++++++++++++++++++ pvm/validate-asn-schema.py | 10 +++++++++ pvm/validate-json-schema.sh | 7 ++++++ 5 files changed, 76 insertions(+) create mode 100644 pvm/schema.asn create mode 100644 pvm/schema.json create mode 100755 pvm/validate-asn-schema.py create mode 100755 pvm/validate-json-schema.sh diff --git a/pvm/README.md b/pvm/README.md index c45cd8b..8e4106b 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -24,6 +24,8 @@ Here's an example of such a test: - `"halt"` -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made) * `expected-regs` -- the expected values of each of the 13 registers *after* the test program is executed +See [schema.json](./schema.json) for a JSON Schema of the test files, or [schema.asn](./schema.asn) for an ASN.1 schema. + See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases. ## Changelog diff --git a/pvm/schema.asn b/pvm/schema.asn new file mode 100644 index 0000000..ba1db7e --- /dev/null +++ b/pvm/schema.asn @@ -0,0 +1,14 @@ +PVMTestSuite DEFINITIONS ::= BEGIN + +Testcase ::= SEQUENCE { + name UTF8String, + initial-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295), + code SEQUENCE OF INTEGER(0..255), + expected-status ENUMERATED { + trap, + halt + }, + expected-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295) +} + +END diff --git a/pvm/schema.json b/pvm/schema.json new file mode 100644 index 0000000..d8863e6 --- /dev/null +++ b/pvm/schema.json @@ -0,0 +1,43 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "initial-regs": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "minItems": 13, + "maxItems": 13 + }, + "code": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 255 + } + }, + "expected-status": { + "type": "string", + "enum": ["trap", "halt"] + }, + "expected-regs": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "minItems": 13, + "maxItems": 13 + } + }, + "required": ["name", "initial-regs", "code", "expected-status", "expected-regs"], + "additionalProperties": false +} diff --git a/pvm/validate-asn-schema.py b/pvm/validate-asn-schema.py new file mode 100755 index 0000000..d4a291d --- /dev/null +++ b/pvm/validate-asn-schema.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +from pathlib import Path +import asn1tools + +schema = asn1tools.compile_files("schema.asn", codec="jer") + +for path in Path("programs").iterdir(): + print(path) + schema.encode("Testcase", schema.decode("Testcase", open(path, "rb").read())) diff --git a/pvm/validate-json-schema.sh b/pvm/validate-json-schema.sh new file mode 100755 index 0000000..6ec0487 --- /dev/null +++ b/pvm/validate-json-schema.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Requires yajsv to be installed. You can install it with: +# go install github.com/neilpa/yajsv@latest + +set -euo pipefail +~/go/bin/yajsv -s schema.json programs/*.json From 96025c75fdeaf57917460fbdd7e9b5ca9e1f6147 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 09:34:53 +0000 Subject: [PATCH 05/21] Add comments to the ASN.1 schema, reference the paper, update README --- pvm/README.md | 38 +++++++++++++++++--------------------- pvm/schema.asn | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/pvm/README.md b/pvm/README.md index 8e4106b..d9fa508 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -4,30 +4,26 @@ The [`programs`](./programs) directory contains `.json` files, each containing a single test. -Here's an example of such a test: - -``` -{ - "name": "inst_add", - "initial-regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0], - "code": [0, 0, 3, 8, 121, 8, 249], - "expected-status": "trap", - "expected-regs": [0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0] -} -``` - -* `name` -- a unique identifier for the test -* `initial-regs` -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed -* `code` -- the code blob of the program to be executed as part of the test -* `expected-status` -- the way the program is supposed to end; currently it can be one of the following: - - `"trap"` -- the execution ended with a trap (the `trap` instruction was executed, the execution went "out of bounds", an invalid jump was made, or an invalid instruction was executed) - - `"halt"` -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made) -* `expected-regs` -- the expected values of each of the 13 registers *after* the test program is executed - -See [schema.json](./schema.json) for a JSON Schema of the test files, or [schema.asn](./schema.asn) for an ASN.1 schema. +These are meant to test the PVM function Ψ from the Graypaper's Appendix A (equation 203 from v0.2.1 of the paper). + +See [schema.asn](./schema.asn) for a human-readable schema of what each of the fields mean. + +See [schema.json](./schema.json) for a JSON Schema. See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases. +## TODO + + * 100% instruction coverage + * Verify the final value of the instruction counter (ı) + * Tests for abnormal skip values for each instruction type + * Tests for when the initial instruction counter (ı) starts somewhere else than 0 + * Tests for gas metering (ξ) + * Tests involving memory (µ) + * Tests involving host calls + * Tests for invalid/malformed program blobs + * Add bigger integration-like tests + ## Changelog ### v0.1 diff --git a/pvm/schema.asn b/pvm/schema.asn index ba1db7e..2ea2993 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -1,13 +1,30 @@ PVMTestSuite DEFINITIONS ::= BEGIN Testcase ::= SEQUENCE { + -- a unique identifier for the test name UTF8String, + + -- (the "ω" from the paper) + -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed initial-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295), + + -- (the bold "p" from the paper) + -- the program blob to be executed as part of the test code SEQUENCE OF INTEGER(0..255), + + -- (the "ζ" from the paper) + -- the status code of the execution, i.e. the way the program is supposed to end expected-status ENUMERATED { + -- (called "panic" in the Graypaper) + -- the execution ended with a trap (the `trap` instruction was executed, the execution went "out of bounds", an invalid jump was made, or an invalid instruction was executed) trap, + + -- the execution finished gracefully (a dynamic jump to address `0xffff0000` was made) halt }, + + -- (the "ω′" from the paper) + -- the expected values of each of the 13 registers *after* the test program is executed expected-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295) } From 1d43b7d6645911cf4b6681a662c84c32b16a79c6 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 12:07:48 +0000 Subject: [PATCH 06/21] Add the instruction/program counter to the tests --- pvm/README.md | 1 - pvm/TESTCASES.md | 132 ++++++++++++++++++ pvm/programs/inst_add.json | 4 +- pvm/programs/inst_add_imm.json | 4 +- pvm/programs/inst_add_with_overflow.json | 4 +- pvm/programs/inst_and.json | 4 +- pvm/programs/inst_and_imm.json | 4 +- pvm/programs/inst_branch_eq_nok.json | 4 +- pvm/programs/inst_branch_eq_ok.json | 4 +- pvm/programs/inst_branch_not_eq_nok.json | 4 +- pvm/programs/inst_branch_not_eq_ok.json | 4 +- pvm/programs/inst_cmov_if_zero_imm_nok.json | 4 +- pvm/programs/inst_cmov_if_zero_imm_ok.json | 4 +- pvm/programs/inst_cmov_if_zero_nok.json | 4 +- pvm/programs/inst_cmov_if_zero_ok.json | 4 +- pvm/programs/inst_div_signed.json | 4 +- pvm/programs/inst_div_signed_by_zero.json | 4 +- .../inst_div_signed_with_overflow.json | 4 +- pvm/programs/inst_div_unsigned.json | 4 +- pvm/programs/inst_div_unsigned_by_zero.json | 4 +- .../inst_div_unsigned_with_overflow.json | 4 +- pvm/programs/inst_fallthrough.json | 4 +- pvm/programs/inst_jump.json | 4 +- pvm/programs/inst_load_imm.json | 4 +- pvm/programs/inst_move_reg.json | 4 +- pvm/programs/inst_mul.json | 4 +- pvm/programs/inst_mul_imm.json | 4 +- pvm/programs/inst_negate_and_add_imm.json | 4 +- pvm/programs/inst_or.json | 4 +- pvm/programs/inst_or_imm.json | 4 +- pvm/programs/inst_rem_signed.json | 4 +- pvm/programs/inst_rem_signed_by_zero.json | 4 +- .../inst_rem_signed_with_overflow.json | 4 +- pvm/programs/inst_rem_unsigned.json | 4 +- pvm/programs/inst_rem_unsigned_by_zero.json | 4 +- .../inst_rem_unsigned_with_overflow.json | 4 +- pvm/programs/inst_ret_halt.json | 4 +- pvm/programs/inst_ret_invalid.json | 4 +- .../inst_set_greater_than_signed_imm_0.json | 4 +- .../inst_set_greater_than_signed_imm_1.json | 4 +- .../inst_set_greater_than_unsigned_imm_0.json | 4 +- .../inst_set_greater_than_unsigned_imm_1.json | 4 +- pvm/programs/inst_set_less_than_signed_0.json | 4 +- pvm/programs/inst_set_less_than_signed_1.json | 4 +- .../inst_set_less_than_signed_imm_0.json | 4 +- .../inst_set_less_than_signed_imm_1.json | 4 +- .../inst_set_less_than_unsigned_0.json | 4 +- .../inst_set_less_than_unsigned_1.json | 4 +- .../inst_set_less_than_unsigned_imm_0.json | 4 +- .../inst_set_less_than_unsigned_imm_1.json | 4 +- pvm/programs/inst_shift_arithmetic_right.json | 4 +- .../inst_shift_arithmetic_right_imm.json | 4 +- .../inst_shift_arithmetic_right_imm_alt.json | 4 +- ..._shift_arithmetic_right_with_overflow.json | 4 +- pvm/programs/inst_shift_logical_left.json | 4 +- pvm/programs/inst_shift_logical_left_imm.json | 4 +- .../inst_shift_logical_left_imm_alt.json | 4 +- ...inst_shift_logical_left_with_overflow.json | 4 +- pvm/programs/inst_shift_logical_right.json | 4 +- .../inst_shift_logical_right_imm.json | 4 +- .../inst_shift_logical_right_imm_alt.json | 4 +- ...nst_shift_logical_right_with_overflow.json | 4 +- pvm/programs/inst_sub.json | 4 +- pvm/programs/inst_sub_imm.json | 4 +- pvm/programs/inst_sub_with_overflow.json | 4 +- pvm/programs/inst_trap.json | 4 +- pvm/programs/inst_xor.json | 4 +- pvm/programs/inst_xor_imm.json | 4 +- pvm/schema.asn | 10 +- pvm/schema.json | 10 ++ 70 files changed, 349 insertions(+), 68 deletions(-) diff --git a/pvm/README.md b/pvm/README.md index d9fa508..f269213 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -15,7 +15,6 @@ See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test ## TODO * 100% instruction coverage - * Verify the final value of the instruction counter (ı) * Tests for abnormal skip values for each instruction type * Tests for when the initial instruction counter (ı) starts somewhere else than 0 * Tests for gas metering (ξ) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 5501405..6f9e065 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -20,6 +20,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_add_imm @@ -36,6 +38,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_add_with_overflow @@ -53,6 +57,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_and @@ -70,6 +76,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_and_imm @@ -86,6 +94,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_branch_eq_nok @@ -106,6 +116,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 11 + ## inst_branch_eq_ok @@ -126,6 +138,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 18 + ## inst_branch_not_eq_nok @@ -146,6 +160,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 11 + ## inst_branch_not_eq_ok @@ -166,6 +182,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 18 + ## inst_cmov_if_zero_imm_nok @@ -179,6 +197,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_cmov_if_zero_imm_ok @@ -192,6 +212,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_cmov_if_zero_nok @@ -206,6 +228,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_cmov_if_zero_ok @@ -222,6 +246,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_div_signed @@ -239,6 +265,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_div_signed_by_zero @@ -255,6 +283,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_div_signed_with_overflow @@ -272,6 +302,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_div_unsigned @@ -289,6 +321,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_div_unsigned_by_zero @@ -305,6 +339,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_div_unsigned_with_overflow @@ -323,6 +359,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_fallthrough @@ -333,6 +371,8 @@ Program should end with: trap Program should end with: trap +Final value of the program counter: 1 + ## inst_jump @@ -351,6 +391,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 13 + ## inst_load_imm @@ -364,6 +406,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 6 + ## inst_move_reg @@ -380,6 +424,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 2 + ## inst_mul @@ -397,6 +443,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_mul_imm @@ -413,6 +461,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_negate_and_add_imm @@ -429,6 +479,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_or @@ -446,6 +498,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_or_imm @@ -462,6 +516,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_rem_signed @@ -476,6 +532,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_rem_signed_by_zero @@ -492,6 +550,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_rem_signed_with_overflow @@ -506,6 +566,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_rem_unsigned @@ -523,6 +585,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_rem_unsigned_by_zero @@ -539,6 +603,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_rem_unsigned_with_overflow @@ -556,6 +622,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_ret_halt @@ -569,6 +637,8 @@ Initial non-zero registers: Program should end with: halt +Final value of the program counter: 2 + ## inst_ret_invalid @@ -579,6 +649,8 @@ Program should end with: halt Program should end with: trap +Final value of the program counter: 0 + ## inst_set_greater_than_signed_imm_0 @@ -592,6 +664,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_set_greater_than_signed_imm_1 @@ -608,6 +682,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_set_greater_than_unsigned_imm_0 @@ -621,6 +697,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_set_greater_than_unsigned_imm_1 @@ -637,6 +715,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_signed_0 @@ -651,6 +731,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_signed_1 @@ -668,6 +750,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_signed_imm_0 @@ -681,6 +765,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_signed_imm_1 @@ -697,6 +783,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_unsigned_0 @@ -711,6 +799,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_unsigned_1 @@ -728,6 +818,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_unsigned_imm_0 @@ -741,6 +833,8 @@ Initial non-zero registers: Program should end with: trap +Final value of the program counter: 3 + ## inst_set_less_than_unsigned_imm_1 @@ -757,6 +851,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_arithmetic_right @@ -774,6 +870,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_arithmetic_right_imm @@ -790,6 +888,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_arithmetic_right_imm_alt @@ -806,6 +906,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 6 + ## inst_shift_arithmetic_right_with_overflow @@ -823,6 +925,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_logical_left @@ -840,6 +944,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_logical_left_imm @@ -856,6 +962,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_logical_left_imm_alt @@ -872,6 +980,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 6 + ## inst_shift_logical_left_with_overflow @@ -889,6 +999,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_logical_right @@ -906,6 +1018,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_logical_right_imm @@ -922,6 +1036,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_shift_logical_right_imm_alt @@ -938,6 +1054,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 6 + ## inst_shift_logical_right_with_overflow @@ -955,6 +1073,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_sub @@ -972,6 +1092,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_sub_imm @@ -988,6 +1110,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_sub_with_overflow @@ -1005,6 +1129,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_trap @@ -1015,6 +1141,8 @@ Program should end with: trap Program should end with: trap +Final value of the program counter: 0 + ## inst_xor @@ -1032,6 +1160,8 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + ## inst_xor_imm @@ -1048,4 +1178,6 @@ Registers after execution (only changed registers): Program should end with: trap +Final value of the program counter: 3 + diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 7a308e0..1e7364b 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json index d7b5b87..c93b6b7 100644 --- a/pvm/programs/inst_add_imm.json +++ b/pvm/programs/inst_add_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index 3889d2e..441f0a5 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index 36eb7bc..a112fca 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json index eb6358d..2d2d61c 100644 --- a/pvm/programs/inst_and_imm.json +++ b/pvm/programs/inst_and_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json index 654853d..f3b422f 100644 --- a/pvm/programs/inst_branch_eq_nok.json +++ b/pvm/programs/inst_branch_eq_nok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -56,5 +57,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 11 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json index 8863399..0f11b98 100644 --- a/pvm/programs/inst_branch_eq_ok.json +++ b/pvm/programs/inst_branch_eq_ok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -56,5 +57,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 18 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json index 743a01f..6ad0604 100644 --- a/pvm/programs/inst_branch_not_eq_nok.json +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -56,5 +57,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 11 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json index 5cc54c1..4e91d2f 100644 --- a/pvm/programs/inst_branch_not_eq_ok.json +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -56,5 +57,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 18 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json index c93ea53..68fde10 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_nok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 1, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json index 6e6709d..f0d7735 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_ok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index 5bf4dee..bde1076 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 1, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index 5233c23..d1fc428 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index edfcb56..12a0624 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index ed009c0..2cdc0d2 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index 93f205d..3f0f0af 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index 6668da0..e0c0811 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index 9ac2d45..bad943c 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 7f1039a..9972066 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json index b342e48..1d72d4d 100644 --- a/pvm/programs/inst_fallthrough.json +++ b/pvm/programs/inst_fallthrough.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -37,5 +38,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 1 } \ No newline at end of file diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json index 17b1c60..b889d42 100644 --- a/pvm/programs/inst_jump.json +++ b/pvm/programs/inst_jump.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -50,5 +51,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 13 } \ No newline at end of file diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json index a54af10..8bffdf3 100644 --- a/pvm/programs/inst_load_imm.json +++ b/pvm/programs/inst_load_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -42,5 +43,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 6 } \ No newline at end of file diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json index 4cdc52e..5f0e132 100644 --- a/pvm/programs/inst_move_reg.json +++ b/pvm/programs/inst_move_reg.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -38,5 +39,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 2 } \ No newline at end of file diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index fb21e00..05bef3b 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json index 07c149a..c56c710 100644 --- a/pvm/programs/inst_mul_imm.json +++ b/pvm/programs/inst_mul_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json index 2f69516..64dfd24 100644 --- a/pvm/programs/inst_negate_and_add_imm.json +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index ab93223..09c0ef6 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json index 62c771c..b0f595b 100644 --- a/pvm/programs/inst_or_imm.json +++ b/pvm/programs/inst_or_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index f815f5e..fab8478 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index 120b805..7e8c5a9 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index bf0ec7b..f9a2bba 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index 697c9ab..97d29be 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index 6a909e8..e4fd99c 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index 9436ed7..91dfd16 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index 4bc2700..2d6fc18 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -38,5 +39,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 2 } \ No newline at end of file diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json index f0c11ae..e480aaa 100644 --- a/pvm/programs/inst_ret_invalid.json +++ b/pvm/programs/inst_ret_invalid.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -38,5 +39,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 0 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index 5ddec64..1a81b82 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json index 13ce7a8..7b32997 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_1.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index 4729552..ca3f39a 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json index b5cf549..a22b2e0 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index a249c12..a2e0f51 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index 7646fbc..a960997 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index c860be8..bf616fa 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json index 0f789c9..55ce5ac 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_1.json +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index aa75b1c..f7df9e0 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index 2e72e9c..ee925f4 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index 407e9b3..039e971 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json index b05596c..cb3cf01 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index 7591f03..e290c1b 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json index 8ae12da..0118045 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json index 0147109..0a169eb 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -42,5 +43,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 6 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index d2da855..b872b03 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index 6d07c8c..906dc56 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json index 847627c..2542663 100644 --- a/pvm/programs/inst_shift_logical_left_imm.json +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json index 7792da6..21aa4a1 100644 --- a/pvm/programs/inst_shift_logical_left_imm_alt.json +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -42,5 +43,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 6 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index ec590e4..fc88ee5 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index f65639a..673d392 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json index ecf352b..e3b54c2 100644 --- a/pvm/programs/inst_shift_logical_right_imm.json +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json index f2875d6..8c4ae6f 100644 --- a/pvm/programs/inst_shift_logical_right_imm_alt.json +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -42,5 +43,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 6 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index 9f0cd6e..d64f5ea 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index 289474b..338312c 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json index 0869656..4f701ca 100644 --- a/pvm/programs/inst_sub_imm.json +++ b/pvm/programs/inst_sub_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index ff01f83..30929ec 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json index 8d40aaf..ae25930 100644 --- a/pvm/programs/inst_trap.json +++ b/pvm/programs/inst_trap.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -37,5 +38,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 0 } \ No newline at end of file diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index 523a161..d45460d 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json index 2657422..cd10921 100644 --- a/pvm/programs/inst_xor_imm.json +++ b/pvm/programs/inst_xor_imm.json @@ -15,6 +15,7 @@ 0, 0 ], + "initial-pc": 0, "code": [ 0, 0, @@ -39,5 +40,6 @@ 0, 0, 0 - ] + ], + "expected-pc": 3 } \ No newline at end of file diff --git a/pvm/schema.asn b/pvm/schema.asn index 2ea2993..8cdbc9e 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -8,6 +8,10 @@ Testcase ::= SEQUENCE { -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed initial-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295), + -- (the "ı" from the paper) + -- the initial program counter from which to start the execution + initial-pc INTEGER(0..4294967295), + -- (the bold "p" from the paper) -- the program blob to be executed as part of the test code SEQUENCE OF INTEGER(0..255), @@ -25,7 +29,11 @@ Testcase ::= SEQUENCE { -- (the "ω′" from the paper) -- the expected values of each of the 13 registers *after* the test program is executed - expected-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295) + expected-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295), + + -- (the "ı′" from the paper) + -- the final value of the program counter, after the execution finishes + expected-pc INTEGER(0..4294967295) } END diff --git a/pvm/schema.json b/pvm/schema.json index d8863e6..35623a2 100644 --- a/pvm/schema.json +++ b/pvm/schema.json @@ -15,6 +15,11 @@ "minItems": 13, "maxItems": 13 }, + "initial-pc": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, "code": { "type": "array", "items": { @@ -36,6 +41,11 @@ }, "minItems": 13, "maxItems": 13 + }, + "expected-pc": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 } }, "required": ["name", "initial-regs", "code", "expected-status", "expected-regs"], From 9b35cf4caa7d73f3a4bc61c837f88e981c031cdd Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 12:11:57 +0000 Subject: [PATCH 07/21] Correct the expected PC for when the program halts --- pvm/TESTCASES.md | 2 +- pvm/programs/inst_ret_halt.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 6f9e065..87dddb7 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -637,7 +637,7 @@ Initial non-zero registers: Program should end with: halt -Final value of the program counter: 2 +Final value of the program counter: 0 ## inst_ret_invalid diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index 2d6fc18..e0f2983 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -40,5 +40,5 @@ 0, 0 ], - "expected-pc": 2 + "expected-pc": 0 } \ No newline at end of file From f4c9f3f78c989ac53ea969c4460f86d33391df5d Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 14:41:51 +0000 Subject: [PATCH 08/21] Add tests involving memory --- pvm/README.md | 1 - pvm/TESTCASES.md | 131 ++++++++++++++++++ pvm/programs/inst_add.json | 5 +- pvm/programs/inst_add_imm.json | 5 +- pvm/programs/inst_add_with_overflow.json | 5 +- pvm/programs/inst_and.json | 5 +- pvm/programs/inst_and_imm.json | 5 +- pvm/programs/inst_branch_eq_nok.json | 5 +- pvm/programs/inst_branch_eq_ok.json | 5 +- pvm/programs/inst_branch_not_eq_nok.json | 5 +- pvm/programs/inst_branch_not_eq_ok.json | 5 +- pvm/programs/inst_cmov_if_zero_imm_nok.json | 5 +- pvm/programs/inst_cmov_if_zero_imm_ok.json | 5 +- pvm/programs/inst_cmov_if_zero_nok.json | 5 +- pvm/programs/inst_cmov_if_zero_ok.json | 5 +- pvm/programs/inst_div_signed.json | 5 +- pvm/programs/inst_div_signed_by_zero.json | 5 +- .../inst_div_signed_with_overflow.json | 5 +- pvm/programs/inst_div_unsigned.json | 5 +- pvm/programs/inst_div_unsigned_by_zero.json | 5 +- .../inst_div_unsigned_with_overflow.json | 5 +- pvm/programs/inst_fallthrough.json | 5 +- pvm/programs/inst_jump.json | 5 +- pvm/programs/inst_load_imm.json | 5 +- pvm/programs/inst_load_u8.json | 76 ++++++++++ pvm/programs/inst_load_u8_trap.json | 50 +++++++ pvm/programs/inst_move_reg.json | 5 +- pvm/programs/inst_mul.json | 5 +- pvm/programs/inst_mul_imm.json | 5 +- pvm/programs/inst_negate_and_add_imm.json | 5 +- pvm/programs/inst_or.json | 5 +- pvm/programs/inst_or_imm.json | 5 +- pvm/programs/inst_rem_signed.json | 5 +- pvm/programs/inst_rem_signed_by_zero.json | 5 +- .../inst_rem_signed_with_overflow.json | 5 +- pvm/programs/inst_rem_unsigned.json | 5 +- pvm/programs/inst_rem_unsigned_by_zero.json | 5 +- .../inst_rem_unsigned_with_overflow.json | 5 +- pvm/programs/inst_ret_halt.json | 5 +- pvm/programs/inst_ret_invalid.json | 5 +- .../inst_set_greater_than_signed_imm_0.json | 5 +- .../inst_set_greater_than_signed_imm_1.json | 5 +- .../inst_set_greater_than_unsigned_imm_0.json | 5 +- .../inst_set_greater_than_unsigned_imm_1.json | 5 +- pvm/programs/inst_set_less_than_signed_0.json | 5 +- pvm/programs/inst_set_less_than_signed_1.json | 5 +- .../inst_set_less_than_signed_imm_0.json | 5 +- .../inst_set_less_than_signed_imm_1.json | 5 +- .../inst_set_less_than_unsigned_0.json | 5 +- .../inst_set_less_than_unsigned_1.json | 5 +- .../inst_set_less_than_unsigned_imm_0.json | 5 +- .../inst_set_less_than_unsigned_imm_1.json | 5 +- pvm/programs/inst_shift_arithmetic_right.json | 5 +- .../inst_shift_arithmetic_right_imm.json | 5 +- .../inst_shift_arithmetic_right_imm_alt.json | 5 +- ..._shift_arithmetic_right_with_overflow.json | 5 +- pvm/programs/inst_shift_logical_left.json | 5 +- pvm/programs/inst_shift_logical_left_imm.json | 5 +- .../inst_shift_logical_left_imm_alt.json | 5 +- ...inst_shift_logical_left_with_overflow.json | 5 +- pvm/programs/inst_shift_logical_right.json | 5 +- .../inst_shift_logical_right_imm.json | 5 +- .../inst_shift_logical_right_imm_alt.json | 5 +- ...nst_shift_logical_right_with_overflow.json | 5 +- pvm/programs/inst_store_u16.json | 64 +++++++++ pvm/programs/inst_store_u32.json | 66 +++++++++ pvm/programs/inst_store_u8.json | 63 +++++++++ .../inst_store_u8_trap_inaccessible.json | 50 +++++++ .../inst_store_u8_trap_read_only.json | 56 ++++++++ pvm/programs/inst_sub.json | 5 +- pvm/programs/inst_sub_imm.json | 5 +- pvm/programs/inst_sub_with_overflow.json | 5 +- pvm/programs/inst_trap.json | 5 +- pvm/programs/inst_xor.json | 5 +- pvm/programs/inst_xor_imm.json | 5 +- pvm/schema.asn | 38 ++++- pvm/schema.json | 72 +++++++--- 77 files changed, 902 insertions(+), 95 deletions(-) create mode 100644 pvm/programs/inst_load_u8.json create mode 100644 pvm/programs/inst_load_u8_trap.json create mode 100644 pvm/programs/inst_store_u16.json create mode 100644 pvm/programs/inst_store_u32.json create mode 100644 pvm/programs/inst_store_u8.json create mode 100644 pvm/programs/inst_store_u8_trap_inaccessible.json create mode 100644 pvm/programs/inst_store_u8_trap_read_only.json diff --git a/pvm/README.md b/pvm/README.md index f269213..2c84425 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -18,7 +18,6 @@ See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test * Tests for abnormal skip values for each instruction type * Tests for when the initial instruction counter (ı) starts somewhere else than 0 * Tests for gas metering (ξ) - * Tests involving memory (µ) * Tests involving host calls * Tests for invalid/malformed program blobs * Add bigger integration-like tests diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 87dddb7..d67c753 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -409,6 +409,41 @@ Program should end with: trap Final value of the program counter: 6 +## inst_load_u8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +``` + : @0 + 0: 3c 07 00 00 02 r7 = u8 [0x20000] +``` + +Registers after execution (only changed registers): + * r7 = 0x12 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + + +## inst_load_u8_trap + +``` + : @0 + 0: 3c 07 00 00 02 r7 = u8 [0x20000] +``` + +Program should end with: trap + +Final value of the program counter: 0 + + ## inst_move_reg Initial non-zero registers: @@ -1076,6 +1111,102 @@ Program should end with: trap Final value of the program counter: 3 +## inst_store_u16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 45 07 00 00 02 u16 [0x20000] = r7 +``` + +Final non-zero memory chunks: + * 0x20000-0x20002 (0x2 bytes) = [0x78, 0x56] + +Program should end with: trap + +Final value of the program counter: 5 + + +## inst_store_u32 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 16 07 00 00 02 u32 [0x20000] = r7 +``` + +Final non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x78, 0x56, 0x34, 0x12] + +Program should end with: trap + +Final value of the program counter: 5 + + +## inst_store_u8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 47 07 00 00 02 u8 [0x20000] = r7 +``` + +Final non-zero memory chunks: + * 0x20000-0x20001 (0x1 bytes) = [0x78] + +Program should end with: trap + +Final value of the program counter: 5 + + +## inst_store_u8_trap_inaccessible + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 47 07 00 00 02 u8 [0x20000] = r7 +``` + +Program should end with: trap + +Final value of the program counter: 0 + + +## inst_store_u8_trap_read_only + +Initial page map: + * RO: 0x10000-0x11000 (0x1000 bytes) + +Initial non-zero registers: + * r7 = 0x12345678 + +``` + : @0 + 0: 47 07 00 00 01 u8 [0x10000] = r7 +``` + +Program should end with: trap + +Final value of the program counter: 0 + + ## inst_sub Initial non-zero registers: diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 1e7364b..27e71df 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json index c93b6b7..a590faf 100644 --- a/pvm/programs/inst_add_imm.json +++ b/pvm/programs/inst_add_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index 441f0a5..c36d539 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index a112fca..499f780 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json index 2d2d61c..ea73feb 100644 --- a/pvm/programs/inst_and_imm.json +++ b/pvm/programs/inst_and_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json index f3b422f..4f938e5 100644 --- a/pvm/programs/inst_branch_eq_nok.json +++ b/pvm/programs/inst_branch_eq_nok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -58,5 +60,6 @@ 0, 0 ], - "expected-pc": 11 + "expected-pc": 11, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json index 0f11b98..88540ac 100644 --- a/pvm/programs/inst_branch_eq_ok.json +++ b/pvm/programs/inst_branch_eq_ok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -58,5 +60,6 @@ 0, 0 ], - "expected-pc": 18 + "expected-pc": 18, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json index 6ad0604..aeff9ba 100644 --- a/pvm/programs/inst_branch_not_eq_nok.json +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -58,5 +60,6 @@ 0, 0 ], - "expected-pc": 11 + "expected-pc": 11, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json index 4e91d2f..4a82c2a 100644 --- a/pvm/programs/inst_branch_not_eq_ok.json +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -58,5 +60,6 @@ 0, 0 ], - "expected-pc": 18 + "expected-pc": 18, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json index 68fde10..ce4fa52 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_nok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json index f0d7735..d5e55e0 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_ok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index bde1076..d5dc3b4 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index d1fc428..003656e 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index 12a0624..82536dc 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index 2cdc0d2..3f8325e 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index 3f0f0af..62e7b2e 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index e0c0811..902735d 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index bad943c..cd3dc40 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 9972066..6b8ac87 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json index 1d72d4d..f283d56 100644 --- a/pvm/programs/inst_fallthrough.json +++ b/pvm/programs/inst_fallthrough.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -39,5 +41,6 @@ 0, 0 ], - "expected-pc": 1 + "expected-pc": 1, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json index b889d42..bff5a39 100644 --- a/pvm/programs/inst_jump.json +++ b/pvm/programs/inst_jump.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -52,5 +54,6 @@ 0, 0 ], - "expected-pc": 13 + "expected-pc": 13, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json index 8bffdf3..5998ca8 100644 --- a/pvm/programs/inst_load_imm.json +++ b/pvm/programs/inst_load_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -44,5 +46,6 @@ 0, 0 ], - "expected-pc": 6 + "expected-pc": 6, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_load_u8.json b/pvm/programs/inst_load_u8.json new file mode 100644 index 0000000..75d0c0f --- /dev/null +++ b/pvm/programs/inst_load_u8.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_u8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "code": [ + 0, + 0, + 5, + 60, + 7, + 0, + 0, + 2, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 18, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_load_u8_trap.json b/pvm/programs/inst_load_u8_trap.json new file mode 100644 index 0000000..bb5cd25 --- /dev/null +++ b/pvm/programs/inst_load_u8_trap.json @@ -0,0 +1,50 @@ +{ + "name": "inst_load_u8_trap", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "code": [ + 0, + 0, + 5, + 60, + 7, + 0, + 0, + 2, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 0, + "expected-memory": [] +} \ No newline at end of file diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json index 5f0e132..125352a 100644 --- a/pvm/programs/inst_move_reg.json +++ b/pvm/programs/inst_move_reg.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -40,5 +42,6 @@ 0, 0 ], - "expected-pc": 2 + "expected-pc": 2, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index 05bef3b..8dbc380 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json index c56c710..a94f239 100644 --- a/pvm/programs/inst_mul_imm.json +++ b/pvm/programs/inst_mul_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json index 64dfd24..42fda6b 100644 --- a/pvm/programs/inst_negate_and_add_imm.json +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index 09c0ef6..8b069d9 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json index b0f595b..465f3ee 100644 --- a/pvm/programs/inst_or_imm.json +++ b/pvm/programs/inst_or_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index fab8478..4567472 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index 7e8c5a9..acdd9a4 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index f9a2bba..5b3e912 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index 97d29be..b4cd5bf 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index e4fd99c..9c6a2ed 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index 91dfd16..cc10de8 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index e0f2983..e2bbd38 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -40,5 +42,6 @@ 0, 0 ], - "expected-pc": 0 + "expected-pc": 0, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json index e480aaa..d38eb34 100644 --- a/pvm/programs/inst_ret_invalid.json +++ b/pvm/programs/inst_ret_invalid.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -40,5 +42,6 @@ 0, 0 ], - "expected-pc": 0 + "expected-pc": 0, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index 1a81b82..89b5e38 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json index 7b32997..16661db 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_1.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index ca3f39a..74c1d95 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json index a22b2e0..44ce708 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index a2e0f51..dd4124f 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index a960997..f77938c 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index bf616fa..98a8dde 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json index 55ce5ac..fc54d24 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_1.json +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index f7df9e0..c2a8383 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index ee925f4..2f4f1f0 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index 039e971..9b9a6dc 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json index cb3cf01..9662050 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index e290c1b..4503532 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json index 0118045..9c7a31f 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json index 0a169eb..4586434 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -44,5 +46,6 @@ 0, 0 ], - "expected-pc": 6 + "expected-pc": 6, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index b872b03..d96e101 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index 906dc56..ff03f92 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json index 2542663..52050be 100644 --- a/pvm/programs/inst_shift_logical_left_imm.json +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json index 21aa4a1..2a9813d 100644 --- a/pvm/programs/inst_shift_logical_left_imm_alt.json +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -44,5 +46,6 @@ 0, 0 ], - "expected-pc": 6 + "expected-pc": 6, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index fc88ee5..e1a86d5 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index 673d392..425f24c 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json index e3b54c2..f403e9a 100644 --- a/pvm/programs/inst_shift_logical_right_imm.json +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json index 8c4ae6f..7efef60 100644 --- a/pvm/programs/inst_shift_logical_right_imm_alt.json +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -44,5 +46,6 @@ 0, 0 ], - "expected-pc": 6 + "expected-pc": 6, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index d64f5ea..4f51cb7 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_store_u16.json b/pvm/programs/inst_store_u16.json new file mode 100644 index 0000000..8d0e37f --- /dev/null +++ b/pvm/programs/inst_store_u16.json @@ -0,0 +1,64 @@ +{ + "name": "inst_store_u16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "code": [ + 0, + 0, + 5, + 69, + 7, + 0, + 0, + 2, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120, + 86 + ] + } + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u32.json b/pvm/programs/inst_store_u32.json new file mode 100644 index 0000000..90c4380 --- /dev/null +++ b/pvm/programs/inst_store_u32.json @@ -0,0 +1,66 @@ +{ + "name": "inst_store_u32", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "code": [ + 0, + 0, + 5, + 22, + 7, + 0, + 0, + 2, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120, + 86, + 52, + 18 + ] + } + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u8.json b/pvm/programs/inst_store_u8.json new file mode 100644 index 0000000..d9fa305 --- /dev/null +++ b/pvm/programs/inst_store_u8.json @@ -0,0 +1,63 @@ +{ + "name": "inst_store_u8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "code": [ + 0, + 0, + 5, + 71, + 7, + 0, + 0, + 2, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120 + ] + } + ] +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u8_trap_inaccessible.json b/pvm/programs/inst_store_u8_trap_inaccessible.json new file mode 100644 index 0000000..b1ea3c1 --- /dev/null +++ b/pvm/programs/inst_store_u8_trap_inaccessible.json @@ -0,0 +1,50 @@ +{ + "name": "inst_store_u8_trap_inaccessible", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "code": [ + 0, + 0, + 5, + 71, + 7, + 0, + 0, + 2, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 0, + "expected-memory": [] +} \ No newline at end of file diff --git a/pvm/programs/inst_store_u8_trap_read_only.json b/pvm/programs/inst_store_u8_trap_read_only.json new file mode 100644 index 0000000..68446c7 --- /dev/null +++ b/pvm/programs/inst_store_u8_trap_read_only.json @@ -0,0 +1,56 @@ +{ + "name": "inst_store_u8_trap_read_only", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 65536, + "length": 4096, + "is-writable": false + } + ], + "initial-memory": [], + "code": [ + 0, + 0, + 5, + 71, + 7, + 0, + 0, + 1, + 225 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 305419896, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 0, + "expected-memory": [] +} \ No newline at end of file diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index 338312c..7f54497 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json index 4f701ca..d50d6d1 100644 --- a/pvm/programs/inst_sub_imm.json +++ b/pvm/programs/inst_sub_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index 30929ec..6c2a8b2 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json index ae25930..5b68018 100644 --- a/pvm/programs/inst_trap.json +++ b/pvm/programs/inst_trap.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -39,5 +41,6 @@ 0, 0 ], - "expected-pc": 0 + "expected-pc": 0, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index d45460d..0baeb58 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json index cd10921..34222cb 100644 --- a/pvm/programs/inst_xor_imm.json +++ b/pvm/programs/inst_xor_imm.json @@ -16,6 +16,8 @@ 0 ], "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], "code": [ 0, 0, @@ -41,5 +43,6 @@ 0, 0 ], - "expected-pc": 3 + "expected-pc": 3, + "expected-memory": [] } \ No newline at end of file diff --git a/pvm/schema.asn b/pvm/schema.asn index 8cdbc9e..b5ab130 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -1,20 +1,44 @@ PVMTestSuite DEFINITIONS ::= BEGIN +-- a 32-bit integer +U32 ::= INTEGER(0..4294967295) + +-- an 8-bit integer (a byte) +U8 ::= INTEGER(0..255) + +-- a blob of bytes at a given memory address +MemoryChunk ::= SEQUENCE OF SEQUENCE { + address U32, + contents SEQUENCE OF U8 +} + Testcase ::= SEQUENCE { -- a unique identifier for the test name UTF8String, -- (the "ω" from the paper) -- the initial value of each of the 13 registers; these need to be set *before* the test program is executed - initial-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295), + initial-regs SEQUENCE (SIZE(13..13)) OF U32, -- (the "ı" from the paper) -- the initial program counter from which to start the execution - initial-pc INTEGER(0..4294967295), + initial-pc U32, + + -- (part of the "µ" from the paper) + -- lists regions of memory which should be accessible, initialized with zeros by default; any address not on this list should be inaccessible + initial-page-map SEQUENCE OF SEQUENCE { + address U32, + length U32, + is-writable BOOLEAN + }, + + -- (part of the "µ" from the paper) + -- lists all non-zero values to put in memory before execution + initial-memory MemoryChunk, -- (the bold "p" from the paper) -- the program blob to be executed as part of the test - code SEQUENCE OF INTEGER(0..255), + code SEQUENCE OF U8, -- (the "ζ" from the paper) -- the status code of the execution, i.e. the way the program is supposed to end @@ -29,11 +53,15 @@ Testcase ::= SEQUENCE { -- (the "ω′" from the paper) -- the expected values of each of the 13 registers *after* the test program is executed - expected-regs SEQUENCE (SIZE(13..13)) OF INTEGER(0..4294967295), + expected-regs SEQUENCE (SIZE(13..13)) OF U32, -- (the "ı′" from the paper) -- the final value of the program counter, after the execution finishes - expected-pc INTEGER(0..4294967295) + expected-pc U32, + + -- (part of the "µ′" from the paper) + -- lists all non-zero values after the execution finishes; all accessible address not on this list must be filled with zeroes + expected-memory MemoryChunk OPTIONAL } END diff --git a/pvm/schema.json b/pvm/schema.json index 35623a2..2e28ce3 100644 --- a/pvm/schema.json +++ b/pvm/schema.json @@ -7,47 +7,73 @@ }, "initial-regs": { "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, + "items": { "$ref": "#/$defs/u32" }, "minItems": 13, "maxItems": 13 }, - "initial-pc": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "code": { + "initial-pc": { "$ref": "#/$defs/u32" }, + "initial-page-map": { "type": "array", "items": { - "type": "integer", - "minimum": 0, - "maximum": 255 + "type": "object", + "properties": { + "address": { "$ref": "#/$defs/u32" }, + "length": { "$ref": "#/$defs/u32" }, + "is-writable": { "type": "boolean" } + }, + "required": ["address", "length", "is-writable"], + "additionalProperties": false } }, + "initial-memory": { + "$ref": "#/$defs/memory-chunk" + }, + "code": { + "type": "array", + "items": { "$ref": "#/$defs/u8" } + }, "expected-status": { "type": "string", "enum": ["trap", "halt"] }, "expected-regs": { "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, + "items": { "$ref": "#/$defs/u32" }, "minItems": 13, "maxItems": 13 }, - "expected-pc": { + "expected-pc": { "$ref": "#/$defs/u32" }, + "expected-memory": { + "$ref": "#/$defs/memory-chunk" + } + }, + "required": ["name", "initial-regs", "initial-pc", "initial-page-map", "initial-memory", "code", "expected-status", "expected-regs", "expected-pc", "expected-memory"], + "additionalProperties": false, + "$defs": { + "u8": { + "type": "integer", + "minimum": 0, + "maximum": 255 + }, + "u32": { "type": "integer", "minimum": 0, "maximum": 4294967295 + }, + "memory-chunk": { + "type": "array", + "items": { + "type": "object", + "properties": { + "address": { "$ref": "#/$defs/u32" }, + "contents": { + "type": "array", + "items": { "$ref": "#/$defs/u8" } + } + }, + "required": ["address", "contents"], + "additionalProperties": false + } } - }, - "required": ["name", "initial-regs", "code", "expected-status", "expected-regs"], - "additionalProperties": false + } } From dbbfbd4f290a7a6da79c11f8d1643bad121d799f Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 25 Jun 2024 14:44:51 +0000 Subject: [PATCH 09/21] Remove accidental `OPTIONAL` from the ASN.1 schema --- pvm/schema.asn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvm/schema.asn b/pvm/schema.asn index b5ab130..141a85e 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -61,7 +61,7 @@ Testcase ::= SEQUENCE { -- (part of the "µ′" from the paper) -- lists all non-zero values after the execution finishes; all accessible address not on this list must be filled with zeroes - expected-memory MemoryChunk OPTIONAL + expected-memory MemoryChunk } END From 3e18a7f6bf427f306bf709ce39a311ce5748f0cb Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Wed, 26 Jun 2024 08:08:56 +0000 Subject: [PATCH 10/21] Add gas --- pvm/README.md | 2 +- pvm/TESTCASES.md | 160 ++++++++++++++++++ pvm/programs/gas_basic_consume_all.json | 49 ++++++ pvm/programs/inst_add.json | 4 +- pvm/programs/inst_add_imm.json | 4 +- pvm/programs/inst_add_with_overflow.json | 4 +- pvm/programs/inst_and.json | 4 +- pvm/programs/inst_and_imm.json | 4 +- pvm/programs/inst_branch_eq_nok.json | 4 +- pvm/programs/inst_branch_eq_ok.json | 4 +- pvm/programs/inst_branch_not_eq_nok.json | 4 +- pvm/programs/inst_branch_not_eq_ok.json | 4 +- pvm/programs/inst_cmov_if_zero_imm_nok.json | 4 +- pvm/programs/inst_cmov_if_zero_imm_ok.json | 4 +- pvm/programs/inst_cmov_if_zero_nok.json | 4 +- pvm/programs/inst_cmov_if_zero_ok.json | 4 +- pvm/programs/inst_div_signed.json | 4 +- pvm/programs/inst_div_signed_by_zero.json | 4 +- .../inst_div_signed_with_overflow.json | 4 +- pvm/programs/inst_div_unsigned.json | 4 +- pvm/programs/inst_div_unsigned_by_zero.json | 4 +- .../inst_div_unsigned_with_overflow.json | 4 +- pvm/programs/inst_fallthrough.json | 4 +- pvm/programs/inst_jump.json | 4 +- pvm/programs/inst_load_imm.json | 4 +- pvm/programs/inst_load_u8.json | 4 +- pvm/programs/inst_load_u8_trap.json | 4 +- pvm/programs/inst_move_reg.json | 4 +- pvm/programs/inst_mul.json | 4 +- pvm/programs/inst_mul_imm.json | 4 +- pvm/programs/inst_negate_and_add_imm.json | 4 +- pvm/programs/inst_or.json | 4 +- pvm/programs/inst_or_imm.json | 4 +- pvm/programs/inst_rem_signed.json | 4 +- pvm/programs/inst_rem_signed_by_zero.json | 4 +- .../inst_rem_signed_with_overflow.json | 4 +- pvm/programs/inst_rem_unsigned.json | 4 +- pvm/programs/inst_rem_unsigned_by_zero.json | 4 +- .../inst_rem_unsigned_with_overflow.json | 4 +- pvm/programs/inst_ret_halt.json | 4 +- pvm/programs/inst_ret_invalid.json | 4 +- .../inst_set_greater_than_signed_imm_0.json | 4 +- .../inst_set_greater_than_signed_imm_1.json | 4 +- .../inst_set_greater_than_unsigned_imm_0.json | 4 +- .../inst_set_greater_than_unsigned_imm_1.json | 4 +- pvm/programs/inst_set_less_than_signed_0.json | 4 +- pvm/programs/inst_set_less_than_signed_1.json | 4 +- .../inst_set_less_than_signed_imm_0.json | 4 +- .../inst_set_less_than_signed_imm_1.json | 4 +- .../inst_set_less_than_unsigned_0.json | 4 +- .../inst_set_less_than_unsigned_1.json | 4 +- .../inst_set_less_than_unsigned_imm_0.json | 4 +- .../inst_set_less_than_unsigned_imm_1.json | 4 +- pvm/programs/inst_shift_arithmetic_right.json | 4 +- .../inst_shift_arithmetic_right_imm.json | 4 +- .../inst_shift_arithmetic_right_imm_alt.json | 4 +- ..._shift_arithmetic_right_with_overflow.json | 4 +- pvm/programs/inst_shift_logical_left.json | 4 +- pvm/programs/inst_shift_logical_left_imm.json | 4 +- .../inst_shift_logical_left_imm_alt.json | 4 +- ...inst_shift_logical_left_with_overflow.json | 4 +- pvm/programs/inst_shift_logical_right.json | 4 +- .../inst_shift_logical_right_imm.json | 4 +- .../inst_shift_logical_right_imm_alt.json | 4 +- ...nst_shift_logical_right_with_overflow.json | 4 +- pvm/programs/inst_store_u16.json | 4 +- pvm/programs/inst_store_u32.json | 4 +- pvm/programs/inst_store_u8.json | 4 +- .../inst_store_u8_trap_inaccessible.json | 4 +- .../inst_store_u8_trap_read_only.json | 4 +- pvm/programs/inst_sub.json | 4 +- pvm/programs/inst_sub_imm.json | 4 +- pvm/programs/inst_sub_with_overflow.json | 4 +- pvm/programs/inst_trap.json | 4 +- pvm/programs/inst_xor.json | 4 +- pvm/programs/inst_xor_imm.json | 4 +- pvm/schema.asn | 17 +- pvm/schema.json | 13 +- 78 files changed, 455 insertions(+), 78 deletions(-) create mode 100644 pvm/programs/gas_basic_consume_all.json diff --git a/pvm/README.md b/pvm/README.md index 2c84425..ad9067e 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -17,10 +17,10 @@ See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test * 100% instruction coverage * Tests for abnormal skip values for each instruction type * Tests for when the initial instruction counter (ı) starts somewhere else than 0 - * Tests for gas metering (ξ) * Tests involving host calls * Tests for invalid/malformed program blobs * Add bigger integration-like tests + * More gas metering tests; proper gas cost model (current one is a placeholder) ## Changelog diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index d67c753..a3fe260 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -4,6 +4,20 @@ This file contains a human-readable index of all of the testcases, along with their disassemblies and other relevant information. +## gas_basic_consume_all + +``` + : @0 + 0: 52 00 r0 = r0 +``` + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 2 -> 0 + + ## inst_add Initial non-zero registers: @@ -22,6 +36,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_add_imm @@ -40,6 +56,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_add_with_overflow @@ -59,6 +77,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_and @@ -78,6 +98,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_and_imm @@ -96,6 +118,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_branch_eq_nok @@ -118,6 +142,8 @@ Program should end with: trap Final value of the program counter: 11 +Gas consumed: 10000 -> 9996 + ## inst_branch_eq_ok @@ -140,6 +166,8 @@ Program should end with: trap Final value of the program counter: 18 +Gas consumed: 10000 -> 9995 + ## inst_branch_not_eq_nok @@ -162,6 +190,8 @@ Program should end with: trap Final value of the program counter: 11 +Gas consumed: 10000 -> 9996 + ## inst_branch_not_eq_ok @@ -184,6 +214,8 @@ Program should end with: trap Final value of the program counter: 18 +Gas consumed: 10000 -> 9995 + ## inst_cmov_if_zero_imm_nok @@ -199,6 +231,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_cmov_if_zero_imm_ok @@ -214,6 +248,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_cmov_if_zero_nok @@ -230,6 +266,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_cmov_if_zero_ok @@ -248,6 +286,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_div_signed @@ -267,6 +307,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_div_signed_by_zero @@ -285,6 +327,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_div_signed_with_overflow @@ -304,6 +348,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_div_unsigned @@ -323,6 +369,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_div_unsigned_by_zero @@ -341,6 +389,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_div_unsigned_with_overflow @@ -361,6 +411,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_fallthrough @@ -373,6 +425,8 @@ Program should end with: trap Final value of the program counter: 1 +Gas consumed: 10000 -> 9998 + ## inst_jump @@ -393,6 +447,8 @@ Program should end with: trap Final value of the program counter: 13 +Gas consumed: 10000 -> 9996 + ## inst_load_imm @@ -408,6 +464,8 @@ Program should end with: trap Final value of the program counter: 6 +Gas consumed: 10000 -> 9998 + ## inst_load_u8 @@ -431,6 +489,8 @@ Program should end with: trap Final value of the program counter: 5 +Gas consumed: 10000 -> 9998 + ## inst_load_u8_trap @@ -443,6 +503,8 @@ Program should end with: trap Final value of the program counter: 0 +Gas consumed: 10000 -> 9998 + ## inst_move_reg @@ -461,6 +523,8 @@ Program should end with: trap Final value of the program counter: 2 +Gas consumed: 10000 -> 9998 + ## inst_mul @@ -480,6 +544,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_mul_imm @@ -498,6 +564,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_negate_and_add_imm @@ -516,6 +584,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_or @@ -535,6 +605,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_or_imm @@ -553,6 +625,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_rem_signed @@ -569,6 +643,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_rem_signed_by_zero @@ -587,6 +663,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_rem_signed_with_overflow @@ -603,6 +681,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_rem_unsigned @@ -622,6 +702,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_rem_unsigned_by_zero @@ -640,6 +722,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_rem_unsigned_with_overflow @@ -659,6 +743,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_ret_halt @@ -674,6 +760,8 @@ Program should end with: halt Final value of the program counter: 0 +Gas consumed: 10000 -> 9999 + ## inst_ret_invalid @@ -686,6 +774,8 @@ Program should end with: trap Final value of the program counter: 0 +Gas consumed: 10000 -> 9999 + ## inst_set_greater_than_signed_imm_0 @@ -701,6 +791,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_greater_than_signed_imm_1 @@ -719,6 +811,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_greater_than_unsigned_imm_0 @@ -734,6 +828,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_greater_than_unsigned_imm_1 @@ -752,6 +848,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_signed_0 @@ -768,6 +866,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_signed_1 @@ -787,6 +887,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_signed_imm_0 @@ -802,6 +904,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_signed_imm_1 @@ -820,6 +924,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_unsigned_0 @@ -836,6 +942,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_unsigned_1 @@ -855,6 +963,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_unsigned_imm_0 @@ -870,6 +980,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_set_less_than_unsigned_imm_1 @@ -888,6 +1000,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_arithmetic_right @@ -907,6 +1021,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_arithmetic_right_imm @@ -925,6 +1041,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_arithmetic_right_imm_alt @@ -943,6 +1061,8 @@ Program should end with: trap Final value of the program counter: 6 +Gas consumed: 10000 -> 9998 + ## inst_shift_arithmetic_right_with_overflow @@ -962,6 +1082,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_left @@ -981,6 +1103,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_left_imm @@ -999,6 +1123,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_left_imm_alt @@ -1017,6 +1143,8 @@ Program should end with: trap Final value of the program counter: 6 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_left_with_overflow @@ -1036,6 +1164,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_right @@ -1055,6 +1185,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_right_imm @@ -1073,6 +1205,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_right_imm_alt @@ -1091,6 +1225,8 @@ Program should end with: trap Final value of the program counter: 6 +Gas consumed: 10000 -> 9998 + ## inst_shift_logical_right_with_overflow @@ -1110,6 +1246,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_store_u16 @@ -1131,6 +1269,8 @@ Program should end with: trap Final value of the program counter: 5 +Gas consumed: 10000 -> 9998 + ## inst_store_u32 @@ -1152,6 +1292,8 @@ Program should end with: trap Final value of the program counter: 5 +Gas consumed: 10000 -> 9998 + ## inst_store_u8 @@ -1173,6 +1315,8 @@ Program should end with: trap Final value of the program counter: 5 +Gas consumed: 10000 -> 9998 + ## inst_store_u8_trap_inaccessible @@ -1188,6 +1332,8 @@ Program should end with: trap Final value of the program counter: 0 +Gas consumed: 10000 -> 9998 + ## inst_store_u8_trap_read_only @@ -1206,6 +1352,8 @@ Program should end with: trap Final value of the program counter: 0 +Gas consumed: 10000 -> 9998 + ## inst_sub @@ -1225,6 +1373,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_sub_imm @@ -1243,6 +1393,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_sub_with_overflow @@ -1262,6 +1414,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_trap @@ -1274,6 +1428,8 @@ Program should end with: trap Final value of the program counter: 0 +Gas consumed: 10000 -> 9999 + ## inst_xor @@ -1293,6 +1449,8 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + ## inst_xor_imm @@ -1311,4 +1469,6 @@ Program should end with: trap Final value of the program counter: 3 +Gas consumed: 10000 -> 9998 + diff --git a/pvm/programs/gas_basic_consume_all.json b/pvm/programs/gas_basic_consume_all.json new file mode 100644 index 0000000..9f1bc3f --- /dev/null +++ b/pvm/programs/gas_basic_consume_all.json @@ -0,0 +1,49 @@ +{ + "name": "gas_basic_consume_all", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 2, + "code": [ + 0, + 0, + 2, + 82, + 0, + 253 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [], + "expected-gas": 0 +} \ No newline at end of file diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 27e71df..871a53e 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json index a590faf..5aa28a3 100644 --- a/pvm/programs/inst_add_imm.json +++ b/pvm/programs/inst_add_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index c36d539..a83690d 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index 499f780..6aca2cf 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json index ea73feb..7e01d31 100644 --- a/pvm/programs/inst_and_imm.json +++ b/pvm/programs/inst_and_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json index 4f938e5..d6e27da 100644 --- a/pvm/programs/inst_branch_eq_nok.json +++ b/pvm/programs/inst_branch_eq_nok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -61,5 +62,6 @@ 0 ], "expected-pc": 11, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9996 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json index 88540ac..1130fd7 100644 --- a/pvm/programs/inst_branch_eq_ok.json +++ b/pvm/programs/inst_branch_eq_ok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -61,5 +62,6 @@ 0 ], "expected-pc": 18, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9995 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json index aeff9ba..56ec781 100644 --- a/pvm/programs/inst_branch_not_eq_nok.json +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -61,5 +62,6 @@ 0 ], "expected-pc": 11, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9996 } \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json index 4a82c2a..ce76ac9 100644 --- a/pvm/programs/inst_branch_not_eq_ok.json +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -61,5 +62,6 @@ 0 ], "expected-pc": 18, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9995 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json index ce4fa52..8a900a1 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_nok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json index d5e55e0..61c9df5 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_ok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index d5dc3b4..0fbd151 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index 003656e..2af2520 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index 82536dc..56a7d11 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index 3f8325e..7d7cf94 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index 62e7b2e..42bee23 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index 902735d..82302a8 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index cd3dc40..0f302a1 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 6b8ac87..5e09530 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json index f283d56..5eeff3f 100644 --- a/pvm/programs/inst_fallthrough.json +++ b/pvm/programs/inst_fallthrough.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -42,5 +43,6 @@ 0 ], "expected-pc": 1, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json index bff5a39..77daa4c 100644 --- a/pvm/programs/inst_jump.json +++ b/pvm/programs/inst_jump.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -55,5 +56,6 @@ 0 ], "expected-pc": 13, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9996 } \ No newline at end of file diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json index 5998ca8..74f0d66 100644 --- a/pvm/programs/inst_load_imm.json +++ b/pvm/programs/inst_load_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -47,5 +48,6 @@ 0 ], "expected-pc": 6, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_load_u8.json b/pvm/programs/inst_load_u8.json index 75d0c0f..5c4ef60 100644 --- a/pvm/programs/inst_load_u8.json +++ b/pvm/programs/inst_load_u8.json @@ -34,6 +34,7 @@ ] } ], + "initial-gas": 10000, "code": [ 0, 0, @@ -72,5 +73,6 @@ 120 ] } - ] + ], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_load_u8_trap.json b/pvm/programs/inst_load_u8_trap.json index bb5cd25..d1af35b 100644 --- a/pvm/programs/inst_load_u8_trap.json +++ b/pvm/programs/inst_load_u8_trap.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -46,5 +47,6 @@ 0 ], "expected-pc": 0, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json index 125352a..24c03a3 100644 --- a/pvm/programs/inst_move_reg.json +++ b/pvm/programs/inst_move_reg.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -43,5 +44,6 @@ 0 ], "expected-pc": 2, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index 8dbc380..75eb62f 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json index a94f239..db54216 100644 --- a/pvm/programs/inst_mul_imm.json +++ b/pvm/programs/inst_mul_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json index 42fda6b..b39d898 100644 --- a/pvm/programs/inst_negate_and_add_imm.json +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index 8b069d9..066b139 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json index 465f3ee..91a983a 100644 --- a/pvm/programs/inst_or_imm.json +++ b/pvm/programs/inst_or_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index 4567472..4478004 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index acdd9a4..84275c2 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index 5b3e912..dee85c9 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index b4cd5bf..658b800 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index 9c6a2ed..daf8889 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index cc10de8..69aef4d 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index e2bbd38..641253e 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -43,5 +44,6 @@ 0 ], "expected-pc": 0, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9999 } \ No newline at end of file diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json index d38eb34..94db154 100644 --- a/pvm/programs/inst_ret_invalid.json +++ b/pvm/programs/inst_ret_invalid.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -43,5 +44,6 @@ 0 ], "expected-pc": 0, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9999 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index 89b5e38..9e87b59 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json index 16661db..4864645 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_1.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index 74c1d95..c1374e9 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json index 44ce708..3dae233 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index dd4124f..f286237 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index f77938c..c68cb7a 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index 98a8dde..2c1cda0 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json index fc54d24..dce5f63 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_1.json +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index c2a8383..313d5d4 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index 2f4f1f0..e93de55 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index 9b9a6dc..6bf768a 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json index 9662050..bcf429e 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index 4503532..870bd39 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json index 9c7a31f..068dccf 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json index 4586434..f0e74f7 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -47,5 +48,6 @@ 0 ], "expected-pc": 6, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index d96e101..e28838c 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index ff03f92..699ce3e 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json index 52050be..db076c8 100644 --- a/pvm/programs/inst_shift_logical_left_imm.json +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json index 2a9813d..a971e3b 100644 --- a/pvm/programs/inst_shift_logical_left_imm_alt.json +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -47,5 +48,6 @@ 0 ], "expected-pc": 6, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index e1a86d5..51b2a1a 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index 425f24c..3d250dc 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json index f403e9a..81138a5 100644 --- a/pvm/programs/inst_shift_logical_right_imm.json +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json index 7efef60..90b3eec 100644 --- a/pvm/programs/inst_shift_logical_right_imm_alt.json +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -47,5 +48,6 @@ 0 ], "expected-pc": 6, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index 4f51cb7..fab1e58 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_store_u16.json b/pvm/programs/inst_store_u16.json index 8d0e37f..3dee30e 100644 --- a/pvm/programs/inst_store_u16.json +++ b/pvm/programs/inst_store_u16.json @@ -24,6 +24,7 @@ } ], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -60,5 +61,6 @@ 86 ] } - ] + ], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_store_u32.json b/pvm/programs/inst_store_u32.json index 90c4380..51f5a67 100644 --- a/pvm/programs/inst_store_u32.json +++ b/pvm/programs/inst_store_u32.json @@ -24,6 +24,7 @@ } ], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -62,5 +63,6 @@ 18 ] } - ] + ], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_store_u8.json b/pvm/programs/inst_store_u8.json index d9fa305..23d0f25 100644 --- a/pvm/programs/inst_store_u8.json +++ b/pvm/programs/inst_store_u8.json @@ -24,6 +24,7 @@ } ], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -59,5 +60,6 @@ 120 ] } - ] + ], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_store_u8_trap_inaccessible.json b/pvm/programs/inst_store_u8_trap_inaccessible.json index b1ea3c1..1a9f9d9 100644 --- a/pvm/programs/inst_store_u8_trap_inaccessible.json +++ b/pvm/programs/inst_store_u8_trap_inaccessible.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -46,5 +47,6 @@ 0 ], "expected-pc": 0, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_store_u8_trap_read_only.json b/pvm/programs/inst_store_u8_trap_read_only.json index 68446c7..8cbc31d 100644 --- a/pvm/programs/inst_store_u8_trap_read_only.json +++ b/pvm/programs/inst_store_u8_trap_read_only.json @@ -24,6 +24,7 @@ } ], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -52,5 +53,6 @@ 0 ], "expected-pc": 0, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index 7f54497..3711006 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json index d50d6d1..8e23b22 100644 --- a/pvm/programs/inst_sub_imm.json +++ b/pvm/programs/inst_sub_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index 6c2a8b2..e72c8d3 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json index 5b68018..40015bc 100644 --- a/pvm/programs/inst_trap.json +++ b/pvm/programs/inst_trap.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -42,5 +43,6 @@ 0 ], "expected-pc": 0, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9999 } \ No newline at end of file diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index 0baeb58..d725dc2 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json index 34222cb..fd2d578 100644 --- a/pvm/programs/inst_xor_imm.json +++ b/pvm/programs/inst_xor_imm.json @@ -18,6 +18,7 @@ "initial-pc": 0, "initial-page-map": [], "initial-memory": [], + "initial-gas": 10000, "code": [ 0, 0, @@ -44,5 +45,6 @@ 0 ], "expected-pc": 3, - "expected-memory": [] + "expected-memory": [], + "expected-gas": 9998 } \ No newline at end of file diff --git a/pvm/schema.asn b/pvm/schema.asn index 141a85e..e50fea1 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -1,9 +1,12 @@ PVMTestSuite DEFINITIONS ::= BEGIN --- a 32-bit integer +-- a 32-bit signed integer +I64 ::= INTEGER(-9223372036854775808..9223372036854775807) + +-- a 32-bit unsigned integer U32 ::= INTEGER(0..4294967295) --- an 8-bit integer (a byte) +-- an 8-bit unsigned integer (a byte) U8 ::= INTEGER(0..255) -- a blob of bytes at a given memory address @@ -36,6 +39,10 @@ Testcase ::= SEQUENCE { -- lists all non-zero values to put in memory before execution initial-memory MemoryChunk, + -- (the "ξ" from the paper) + -- the initial amount of gas + initial-gas I64, + -- (the bold "p" from the paper) -- the program blob to be executed as part of the test code SEQUENCE OF U8, @@ -61,7 +68,11 @@ Testcase ::= SEQUENCE { -- (part of the "µ′" from the paper) -- lists all non-zero values after the execution finishes; all accessible address not on this list must be filled with zeroes - expected-memory MemoryChunk + expected-memory MemoryChunk, + + -- (the "ξ′" from the paper) + -- the final amount of gas remaining after the execution finishes + expected-gas I64 } END diff --git a/pvm/schema.json b/pvm/schema.json index 2e28ce3..b29c607 100644 --- a/pvm/schema.json +++ b/pvm/schema.json @@ -28,6 +28,9 @@ "initial-memory": { "$ref": "#/$defs/memory-chunk" }, + "initial-gas": { + "$ref": "#/$defs/i64" + }, "code": { "type": "array", "items": { "$ref": "#/$defs/u8" } @@ -45,9 +48,12 @@ "expected-pc": { "$ref": "#/$defs/u32" }, "expected-memory": { "$ref": "#/$defs/memory-chunk" + }, + "expected-gas": { + "$ref": "#/$defs/i64" } }, - "required": ["name", "initial-regs", "initial-pc", "initial-page-map", "initial-memory", "code", "expected-status", "expected-regs", "expected-pc", "expected-memory"], + "required": ["name", "initial-regs", "initial-pc", "initial-page-map", "initial-memory", "initial-gas", "code", "expected-status", "expected-regs", "expected-pc", "expected-memory", "expected-gas"], "additionalProperties": false, "$defs": { "u8": { @@ -60,6 +66,11 @@ "minimum": 0, "maximum": 4294967295 }, + "i64": { + "type": "integer", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + }, "memory-chunk": { "type": "array", "items": { From e267a75092c14cf98b378f5f40e0c34f457647cf Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Wed, 26 Jun 2024 08:14:45 +0000 Subject: [PATCH 11/21] Rename `code` -> `program` --- pvm/programs/gas_basic_consume_all.json | 2 +- pvm/programs/inst_add.json | 2 +- pvm/programs/inst_add_imm.json | 2 +- pvm/programs/inst_add_with_overflow.json | 2 +- pvm/programs/inst_and.json | 2 +- pvm/programs/inst_and_imm.json | 2 +- pvm/programs/inst_branch_eq_nok.json | 2 +- pvm/programs/inst_branch_eq_ok.json | 2 +- pvm/programs/inst_branch_not_eq_nok.json | 2 +- pvm/programs/inst_branch_not_eq_ok.json | 2 +- pvm/programs/inst_cmov_if_zero_imm_nok.json | 2 +- pvm/programs/inst_cmov_if_zero_imm_ok.json | 2 +- pvm/programs/inst_cmov_if_zero_nok.json | 2 +- pvm/programs/inst_cmov_if_zero_ok.json | 2 +- pvm/programs/inst_div_signed.json | 2 +- pvm/programs/inst_div_signed_by_zero.json | 2 +- pvm/programs/inst_div_signed_with_overflow.json | 2 +- pvm/programs/inst_div_unsigned.json | 2 +- pvm/programs/inst_div_unsigned_by_zero.json | 2 +- pvm/programs/inst_div_unsigned_with_overflow.json | 2 +- pvm/programs/inst_fallthrough.json | 2 +- pvm/programs/inst_jump.json | 2 +- pvm/programs/inst_load_imm.json | 2 +- pvm/programs/inst_load_u8.json | 2 +- pvm/programs/inst_load_u8_trap.json | 2 +- pvm/programs/inst_move_reg.json | 2 +- pvm/programs/inst_mul.json | 2 +- pvm/programs/inst_mul_imm.json | 2 +- pvm/programs/inst_negate_and_add_imm.json | 2 +- pvm/programs/inst_or.json | 2 +- pvm/programs/inst_or_imm.json | 2 +- pvm/programs/inst_rem_signed.json | 2 +- pvm/programs/inst_rem_signed_by_zero.json | 2 +- pvm/programs/inst_rem_signed_with_overflow.json | 2 +- pvm/programs/inst_rem_unsigned.json | 2 +- pvm/programs/inst_rem_unsigned_by_zero.json | 2 +- pvm/programs/inst_rem_unsigned_with_overflow.json | 2 +- pvm/programs/inst_ret_halt.json | 2 +- pvm/programs/inst_ret_invalid.json | 2 +- pvm/programs/inst_set_greater_than_signed_imm_0.json | 2 +- pvm/programs/inst_set_greater_than_signed_imm_1.json | 2 +- pvm/programs/inst_set_greater_than_unsigned_imm_0.json | 2 +- pvm/programs/inst_set_greater_than_unsigned_imm_1.json | 2 +- pvm/programs/inst_set_less_than_signed_0.json | 2 +- pvm/programs/inst_set_less_than_signed_1.json | 2 +- pvm/programs/inst_set_less_than_signed_imm_0.json | 2 +- pvm/programs/inst_set_less_than_signed_imm_1.json | 2 +- pvm/programs/inst_set_less_than_unsigned_0.json | 2 +- pvm/programs/inst_set_less_than_unsigned_1.json | 2 +- pvm/programs/inst_set_less_than_unsigned_imm_0.json | 2 +- pvm/programs/inst_set_less_than_unsigned_imm_1.json | 2 +- pvm/programs/inst_shift_arithmetic_right.json | 2 +- pvm/programs/inst_shift_arithmetic_right_imm.json | 2 +- pvm/programs/inst_shift_arithmetic_right_imm_alt.json | 2 +- pvm/programs/inst_shift_arithmetic_right_with_overflow.json | 2 +- pvm/programs/inst_shift_logical_left.json | 2 +- pvm/programs/inst_shift_logical_left_imm.json | 2 +- pvm/programs/inst_shift_logical_left_imm_alt.json | 2 +- pvm/programs/inst_shift_logical_left_with_overflow.json | 2 +- pvm/programs/inst_shift_logical_right.json | 2 +- pvm/programs/inst_shift_logical_right_imm.json | 2 +- pvm/programs/inst_shift_logical_right_imm_alt.json | 2 +- pvm/programs/inst_shift_logical_right_with_overflow.json | 2 +- pvm/programs/inst_store_u16.json | 2 +- pvm/programs/inst_store_u32.json | 2 +- pvm/programs/inst_store_u8.json | 2 +- pvm/programs/inst_store_u8_trap_inaccessible.json | 2 +- pvm/programs/inst_store_u8_trap_read_only.json | 2 +- pvm/programs/inst_sub.json | 2 +- pvm/programs/inst_sub_imm.json | 2 +- pvm/programs/inst_sub_with_overflow.json | 2 +- pvm/programs/inst_trap.json | 2 +- pvm/programs/inst_xor.json | 2 +- pvm/programs/inst_xor_imm.json | 2 +- pvm/schema.asn | 2 +- pvm/schema.json | 4 ++-- 76 files changed, 77 insertions(+), 77 deletions(-) diff --git a/pvm/programs/gas_basic_consume_all.json b/pvm/programs/gas_basic_consume_all.json index 9f1bc3f..8726738 100644 --- a/pvm/programs/gas_basic_consume_all.json +++ b/pvm/programs/gas_basic_consume_all.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 2, - "code": [ + "program": [ 0, 0, 2, diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 871a53e..904ca63 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json index 5aa28a3..d5b8f30 100644 --- a/pvm/programs/inst_add_imm.json +++ b/pvm/programs/inst_add_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index a83690d..4f23520 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index 6aca2cf..3a76097 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json index 7e01d31..d726d70 100644 --- a/pvm/programs/inst_and_imm.json +++ b/pvm/programs/inst_and_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json index d6e27da..7721a56 100644 --- a/pvm/programs/inst_branch_eq_nok.json +++ b/pvm/programs/inst_branch_eq_nok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 18, diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json index 1130fd7..87c3cf9 100644 --- a/pvm/programs/inst_branch_eq_ok.json +++ b/pvm/programs/inst_branch_eq_ok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 18, diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json index 56ec781..b8a7adb 100644 --- a/pvm/programs/inst_branch_not_eq_nok.json +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 18, diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json index ce76ac9..4267109 100644 --- a/pvm/programs/inst_branch_not_eq_ok.json +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 18, diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json index 8a900a1..0862e30 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_nok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json index 61c9df5..c0758f5 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_ok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index 0fbd151..9fe7137 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index 2af2520..c3ca0b4 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index 56a7d11..7a4539f 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index 7d7cf94..f3f3d6b 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index 42bee23..0474546 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index 82302a8..107c330 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index 0f302a1..8bf40a5 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 5e09530..647a570 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json index 5eeff3f..537712f 100644 --- a/pvm/programs/inst_fallthrough.json +++ b/pvm/programs/inst_fallthrough.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 1, diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json index 77daa4c..aaff1e6 100644 --- a/pvm/programs/inst_jump.json +++ b/pvm/programs/inst_jump.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 13, diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json index 74f0d66..22f20ff 100644 --- a/pvm/programs/inst_load_imm.json +++ b/pvm/programs/inst_load_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 6, diff --git a/pvm/programs/inst_load_u8.json b/pvm/programs/inst_load_u8.json index 5c4ef60..bb1e79b 100644 --- a/pvm/programs/inst_load_u8.json +++ b/pvm/programs/inst_load_u8.json @@ -35,7 +35,7 @@ } ], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_load_u8_trap.json b/pvm/programs/inst_load_u8_trap.json index d1af35b..f672509 100644 --- a/pvm/programs/inst_load_u8_trap.json +++ b/pvm/programs/inst_load_u8_trap.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json index 24c03a3..109187b 100644 --- a/pvm/programs/inst_move_reg.json +++ b/pvm/programs/inst_move_reg.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 2, diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index 75eb62f..6dbac36 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json index db54216..63629c6 100644 --- a/pvm/programs/inst_mul_imm.json +++ b/pvm/programs/inst_mul_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json index b39d898..8be3d42 100644 --- a/pvm/programs/inst_negate_and_add_imm.json +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index 066b139..3751dfb 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json index 91a983a..7b6cde3 100644 --- a/pvm/programs/inst_or_imm.json +++ b/pvm/programs/inst_or_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index 4478004..075914c 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index 84275c2..0f75a5d 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index dee85c9..fcd089e 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index 658b800..4d207d3 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index daf8889..ee74d3e 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index 69aef4d..7749a11 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index 641253e..9ca8ea8 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 2, diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json index 94db154..5bdb8ba 100644 --- a/pvm/programs/inst_ret_invalid.json +++ b/pvm/programs/inst_ret_invalid.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 2, diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index 9e87b59..f4def5a 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json index 4864645..7c599ef 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_1.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index c1374e9..876523c 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json index 3dae233..cde7df0 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index f286237..d9d9b52 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index c68cb7a..81510ed 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index 2c1cda0..1695567 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json index dce5f63..41f1d9d 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_1.json +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index 313d5d4..1b87d88 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index e93de55..8751d5e 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index 6bf768a..e7cbdf0 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json index bcf429e..a96f7f1 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index 870bd39..b8e54ae 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json index 068dccf..44768f3 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json index f0e74f7..b68a2ee 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 6, diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index e28838c..af40048 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index 699ce3e..8ce5981 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json index db076c8..4e3a080 100644 --- a/pvm/programs/inst_shift_logical_left_imm.json +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json index a971e3b..ebcc7ff 100644 --- a/pvm/programs/inst_shift_logical_left_imm_alt.json +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 6, diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index 51b2a1a..0b717af 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index 3d250dc..1e66d03 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json index 81138a5..1bc00eb 100644 --- a/pvm/programs/inst_shift_logical_right_imm.json +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json index 90b3eec..f5436b5 100644 --- a/pvm/programs/inst_shift_logical_right_imm_alt.json +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 6, diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index fab1e58..264684b 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_store_u16.json b/pvm/programs/inst_store_u16.json index 3dee30e..4f472fa 100644 --- a/pvm/programs/inst_store_u16.json +++ b/pvm/programs/inst_store_u16.json @@ -25,7 +25,7 @@ ], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_store_u32.json b/pvm/programs/inst_store_u32.json index 51f5a67..5389b54 100644 --- a/pvm/programs/inst_store_u32.json +++ b/pvm/programs/inst_store_u32.json @@ -25,7 +25,7 @@ ], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_store_u8.json b/pvm/programs/inst_store_u8.json index 23d0f25..c0cff51 100644 --- a/pvm/programs/inst_store_u8.json +++ b/pvm/programs/inst_store_u8.json @@ -25,7 +25,7 @@ ], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_store_u8_trap_inaccessible.json b/pvm/programs/inst_store_u8_trap_inaccessible.json index 1a9f9d9..6d878bd 100644 --- a/pvm/programs/inst_store_u8_trap_inaccessible.json +++ b/pvm/programs/inst_store_u8_trap_inaccessible.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_store_u8_trap_read_only.json b/pvm/programs/inst_store_u8_trap_read_only.json index 8cbc31d..7051087 100644 --- a/pvm/programs/inst_store_u8_trap_read_only.json +++ b/pvm/programs/inst_store_u8_trap_read_only.json @@ -25,7 +25,7 @@ ], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 5, diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index 3711006..9f5c214 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json index 8e23b22..7e0736f 100644 --- a/pvm/programs/inst_sub_imm.json +++ b/pvm/programs/inst_sub_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index e72c8d3..4e1afd7 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json index 40015bc..a8e35e4 100644 --- a/pvm/programs/inst_trap.json +++ b/pvm/programs/inst_trap.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 1, diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index d725dc2..31e835f 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json index fd2d578..85d482e 100644 --- a/pvm/programs/inst_xor_imm.json +++ b/pvm/programs/inst_xor_imm.json @@ -19,7 +19,7 @@ "initial-page-map": [], "initial-memory": [], "initial-gas": 10000, - "code": [ + "program": [ 0, 0, 3, diff --git a/pvm/schema.asn b/pvm/schema.asn index e50fea1..5e14fa1 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -45,7 +45,7 @@ Testcase ::= SEQUENCE { -- (the bold "p" from the paper) -- the program blob to be executed as part of the test - code SEQUENCE OF U8, + program SEQUENCE OF U8, -- (the "ζ" from the paper) -- the status code of the execution, i.e. the way the program is supposed to end diff --git a/pvm/schema.json b/pvm/schema.json index b29c607..09cde35 100644 --- a/pvm/schema.json +++ b/pvm/schema.json @@ -31,7 +31,7 @@ "initial-gas": { "$ref": "#/$defs/i64" }, - "code": { + "program": { "type": "array", "items": { "$ref": "#/$defs/u8" } }, @@ -53,7 +53,7 @@ "$ref": "#/$defs/i64" } }, - "required": ["name", "initial-regs", "initial-pc", "initial-page-map", "initial-memory", "initial-gas", "code", "expected-status", "expected-regs", "expected-pc", "expected-memory", "expected-gas"], + "required": ["name", "initial-regs", "initial-pc", "initial-page-map", "initial-memory", "initial-gas", "program", "expected-status", "expected-regs", "expected-pc", "expected-memory", "expected-gas"], "additionalProperties": false, "$defs": { "u8": { From 5581280db77d16654a13f3cbe40049eebaf3afb2 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Wed, 26 Jun 2024 08:16:36 +0000 Subject: [PATCH 12/21] Fix some typos in the ASN.1 schema --- pvm/schema.asn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvm/schema.asn b/pvm/schema.asn index 5e14fa1..8977287 100644 --- a/pvm/schema.asn +++ b/pvm/schema.asn @@ -1,6 +1,6 @@ PVMTestSuite DEFINITIONS ::= BEGIN --- a 32-bit signed integer +-- a 64-bit signed integer I64 ::= INTEGER(-9223372036854775808..9223372036854775807) -- a 32-bit unsigned integer @@ -67,7 +67,7 @@ Testcase ::= SEQUENCE { expected-pc U32, -- (part of the "µ′" from the paper) - -- lists all non-zero values after the execution finishes; all accessible address not on this list must be filled with zeroes + -- lists all non-zero values after the execution finishes; all accessible addresses not on this list must be filled with zeroes expected-memory MemoryChunk, -- (the "ξ′" from the paper) From a2b18702aac7d15b9f51cd1ffcf0be95f987b2f7 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 28 Jun 2024 10:38:54 +0000 Subject: [PATCH 13/21] Align reg3 serialization with the GP and add extra testcases --- pvm/TESTCASES.md | 696 +++++++++++++++++- pvm/programs/inst_add.json | 4 +- pvm/programs/inst_add_with_overflow.json | 4 +- pvm/programs/inst_and.json | 4 +- pvm/programs/inst_branch_eq_imm_nok.json | 64 ++ pvm/programs/inst_branch_eq_imm_ok.json | 64 ++ ...ranch_greater_or_equal_signed_imm_nok.json | 62 ++ ...branch_greater_or_equal_signed_imm_ok.json | 62 ++ ...st_branch_greater_or_equal_signed_nok.json | 64 ++ ...nst_branch_greater_or_equal_signed_ok.json | 64 ++ ...nch_greater_or_equal_unsigned_imm_nok.json | 62 ++ ...anch_greater_or_equal_unsigned_imm_ok.json | 62 ++ ..._branch_greater_or_equal_unsigned_nok.json | 64 ++ ...t_branch_greater_or_equal_unsigned_ok.json | 64 ++ .../inst_branch_greater_signed_imm_nok.json | 62 ++ .../inst_branch_greater_signed_imm_ok.json | 62 ++ .../inst_branch_greater_unsigned_imm_nok.json | 62 ++ .../inst_branch_greater_unsigned_imm_ok.json | 62 ++ ...t_branch_less_or_equal_signed_imm_nok.json | 62 ++ ...st_branch_less_or_equal_signed_imm_ok.json | 62 ++ ...branch_less_or_equal_unsigned_imm_nok.json | 62 ++ ..._branch_less_or_equal_unsigned_imm_ok.json | 62 ++ .../inst_branch_less_signed_imm_nok.json | 62 ++ .../inst_branch_less_signed_imm_ok.json | 62 ++ pvm/programs/inst_branch_less_signed_nok.json | 64 ++ pvm/programs/inst_branch_less_signed_ok.json | 64 ++ .../inst_branch_less_unsigned_imm_nok.json | 62 ++ .../inst_branch_less_unsigned_imm_ok.json | 62 ++ .../inst_branch_less_unsigned_nok.json | 64 ++ .../inst_branch_less_unsigned_ok.json | 64 ++ pvm/programs/inst_branch_not_eq_imm_nok.json | 64 ++ pvm/programs/inst_branch_not_eq_imm_ok.json | 64 ++ pvm/programs/inst_cmov_if_zero_nok.json | 4 +- pvm/programs/inst_cmov_if_zero_ok.json | 4 +- pvm/programs/inst_div_signed.json | 4 +- pvm/programs/inst_div_signed_by_zero.json | 4 +- .../inst_div_signed_with_overflow.json | 4 +- pvm/programs/inst_div_unsigned.json | 4 +- pvm/programs/inst_div_unsigned_by_zero.json | 4 +- .../inst_div_unsigned_with_overflow.json | 4 +- pvm/programs/inst_mul.json | 4 +- pvm/programs/inst_or.json | 4 +- pvm/programs/inst_rem_signed.json | 4 +- pvm/programs/inst_rem_signed_by_zero.json | 4 +- .../inst_rem_signed_with_overflow.json | 4 +- pvm/programs/inst_rem_unsigned.json | 4 +- pvm/programs/inst_rem_unsigned_by_zero.json | 4 +- .../inst_rem_unsigned_with_overflow.json | 4 +- pvm/programs/inst_set_less_than_signed_0.json | 4 +- pvm/programs/inst_set_less_than_signed_1.json | 4 +- .../inst_set_less_than_unsigned_0.json | 4 +- .../inst_set_less_than_unsigned_1.json | 4 +- pvm/programs/inst_shift_arithmetic_right.json | 4 +- ..._shift_arithmetic_right_with_overflow.json | 4 +- pvm/programs/inst_shift_logical_left.json | 4 +- ...inst_shift_logical_left_with_overflow.json | 4 +- pvm/programs/inst_shift_logical_right.json | 4 +- ...nst_shift_logical_right_with_overflow.json | 4 +- pvm/programs/inst_sub.json | 4 +- pvm/programs/inst_sub_with_overflow.json | 4 +- pvm/programs/inst_xor.json | 4 +- 61 files changed, 2488 insertions(+), 96 deletions(-) create mode 100644 pvm/programs/inst_branch_eq_imm_nok.json create mode 100644 pvm/programs/inst_branch_eq_imm_ok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_signed_nok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_signed_ok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json create mode 100644 pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json create mode 100644 pvm/programs/inst_branch_greater_signed_imm_nok.json create mode 100644 pvm/programs/inst_branch_greater_signed_imm_ok.json create mode 100644 pvm/programs/inst_branch_greater_unsigned_imm_nok.json create mode 100644 pvm/programs/inst_branch_greater_unsigned_imm_ok.json create mode 100644 pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json create mode 100644 pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json create mode 100644 pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json create mode 100644 pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json create mode 100644 pvm/programs/inst_branch_less_signed_imm_nok.json create mode 100644 pvm/programs/inst_branch_less_signed_imm_ok.json create mode 100644 pvm/programs/inst_branch_less_signed_nok.json create mode 100644 pvm/programs/inst_branch_less_signed_ok.json create mode 100644 pvm/programs/inst_branch_less_unsigned_imm_nok.json create mode 100644 pvm/programs/inst_branch_less_unsigned_imm_ok.json create mode 100644 pvm/programs/inst_branch_less_unsigned_nok.json create mode 100644 pvm/programs/inst_branch_less_unsigned_ok.json create mode 100644 pvm/programs/inst_branch_not_eq_imm_nok.json create mode 100644 pvm/programs/inst_branch_not_eq_imm_ok.json diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index a3fe260..1a6a6ac 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -26,7 +26,7 @@ Initial non-zero registers: ``` : @0 - 0: 08 79 08 r9 = r7 + r8 + 0: 08 87 09 r9 = r7 + r8 ``` Registers after execution (only changed registers): @@ -67,7 +67,7 @@ Initial non-zero registers: ``` : @0 - 0: 08 79 08 r9 = r7 + r8 + 0: 08 87 09 r9 = r7 + r8 ``` Registers after execution (only changed registers): @@ -88,7 +88,7 @@ Initial non-zero registers: ``` : @0 - 0: 17 79 08 r9 = r7 & r8 + 0: 17 87 09 r9 = r7 & r8 ``` Registers after execution (only changed registers): @@ -121,6 +121,50 @@ Final value of the program counter: 3 Gas consumed: 10000 -> 9998 +## inst_branch_eq_imm_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 07 27 d3 04 06 jump 10 if r7 == 1235 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_eq_imm_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 07 27 d2 04 06 jump 10 if r7 == 1234 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9996 + + ## inst_branch_eq_nok ``` @@ -169,6 +213,594 @@ Final value of the program counter: 18 Gas consumed: 10000 -> 9995 +## inst_branch_greater_or_equal_signed_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 2d 17 0a 05 jump 8 if r7 >=s 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_or_equal_signed_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 2d 17 f6 05 jump 8 if r7 >=s 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_signed_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 2b 87 04 jump 10 if r7 >=s r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + * r8 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_signed_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 2b 87 04 jump 10 if r7 >=s r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9995 + + +## inst_branch_greater_or_equal_unsigned_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 34 17 f6 05 jump 8 if r7 >=u 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_or_equal_unsigned_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 34 17 0a 05 jump 8 if r7 >=u 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_unsigned_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 29 87 04 jump 10 if r7 >=u r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + * r8 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_or_equal_unsigned_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 29 87 04 jump 10 if r7 >=u r8 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + * r8 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9995 + + +## inst_branch_greater_signed_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 35 17 0a 05 jump 8 if r7 >s 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_signed_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 35 17 f6 05 jump 8 if r7 >s 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_greater_unsigned_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 32 17 f6 05 jump 8 if r7 >u 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_greater_unsigned_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 32 17 0a 05 jump 8 if r7 >u 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_less_or_equal_signed_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 2e 17 f6 05 jump 8 if r7 <=s 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xa (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_less_or_equal_signed_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 2e 17 0a 05 jump 8 if r7 <=s 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_less_or_equal_unsigned_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 3b 17 0a 05 jump 8 if r7 <=u 10 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xfffffff6 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_less_or_equal_unsigned_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 3b 17 f6 05 jump 8 if r7 <=u 4294967286 + : @1 + 7: 00 trap + : @2 + 8: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 14 + +Gas consumed: 10000 -> 9996 + + +## inst_branch_less_signed_imm_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 20 17 f5 05 jump 8 if r7 9997 + + +## inst_branch_less_signed_imm_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 20 17 0a 05 jump 8 if r7 9996 + + +## inst_branch_less_signed_nok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 30 87 04 jump 10 if r7 9996 + + +## inst_branch_less_signed_ok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 30 87 04 jump 10 if r7 9995 + + +## inst_branch_less_unsigned_imm_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 2c 17 0a 05 jump 8 if r7 9997 + + +## inst_branch_less_unsigned_imm_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 2c 17 f6 05 jump 8 if r7 9996 + + +## inst_branch_less_unsigned_nok + +``` + : @0 + 0: 04 07 f6 r7 = 0xfffffff6 + 3: 04 08 0a r8 = 0xa + 6: 2f 87 04 jump 10 if r7 9996 + + +## inst_branch_less_unsigned_ok + +``` + : @0 + 0: 04 07 0a r7 = 0xa + 3: 04 08 f6 r8 = 0xfffffff6 + 6: 2f 87 04 jump 10 if r7 9995 + + +## inst_branch_not_eq_imm_nok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 0f 27 d2 04 06 jump 10 if r7 != 1234 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9997 + + +## inst_branch_not_eq_imm_ok + +``` + : @0 + 0: 04 07 d2 04 r7 = 0x4d2 + 4: 0f 27 d3 04 06 jump 10 if r7 != 1235 + : @1 + 9: 00 trap + : @2 + 10: 04 07 ef be ad de r7 = 0xdeadbeef +``` + +Registers after execution (only changed registers): + * r7 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 16 + +Gas consumed: 10000 -> 9996 + + ## inst_branch_not_eq_nok ``` @@ -259,7 +891,7 @@ Initial non-zero registers: ``` : @0 - 0: 53 87 0a r7 = r8 if r10 == 0 + 0: 53 a8 07 r7 = r8 if r10 == 0 ``` Program should end with: trap @@ -276,7 +908,7 @@ Initial non-zero registers: ``` : @0 - 0: 53 87 0a r7 = r8 if r10 == 0 + 0: 53 a8 07 r7 = r8 if r10 == 0 ``` Registers after execution (only changed registers): @@ -297,7 +929,7 @@ Initial non-zero registers: ``` : @0 - 0: 40 79 08 r9 = r7 /s r8 + 0: 40 87 09 r9 = r7 /s r8 ``` Registers after execution (only changed registers): @@ -317,7 +949,7 @@ Initial non-zero registers: ``` : @0 - 0: 40 79 08 r9 = r7 /s r8 + 0: 40 87 09 r9 = r7 /s r8 ``` Registers after execution (only changed registers): @@ -338,7 +970,7 @@ Initial non-zero registers: ``` : @0 - 0: 40 79 08 r9 = r7 /s r8 + 0: 40 87 09 r9 = r7 /s r8 ``` Registers after execution (only changed registers): @@ -359,7 +991,7 @@ Initial non-zero registers: ``` : @0 - 0: 44 79 08 r9 = r7 /u r8 + 0: 44 87 09 r9 = r7 /u r8 ``` Registers after execution (only changed registers): @@ -379,7 +1011,7 @@ Initial non-zero registers: ``` : @0 - 0: 44 79 08 r9 = r7 /u r8 + 0: 44 87 09 r9 = r7 /u r8 ``` Registers after execution (only changed registers): @@ -401,7 +1033,7 @@ Initial non-zero registers: ``` : @0 - 0: 44 79 08 r9 = r7 /u r8 + 0: 44 87 09 r9 = r7 /u r8 ``` Registers after execution (only changed registers): @@ -534,7 +1166,7 @@ Initial non-zero registers: ``` : @0 - 0: 22 79 08 r9 = r7 * r8 + 0: 22 87 09 r9 = r7 * r8 ``` Registers after execution (only changed registers): @@ -595,7 +1227,7 @@ Initial non-zero registers: ``` : @0 - 0: 0c 79 08 r9 = r7 | r8 + 0: 0c 87 09 r9 = r7 | r8 ``` Registers after execution (only changed registers): @@ -636,7 +1268,7 @@ Initial non-zero registers: ``` : @0 - 0: 46 79 08 r9 = r7 %s r8 + 0: 46 87 09 r9 = r7 %s r8 ``` Program should end with: trap @@ -653,7 +1285,7 @@ Initial non-zero registers: ``` : @0 - 0: 46 79 08 r9 = r7 %s r8 + 0: 46 87 09 r9 = r7 %s r8 ``` Registers after execution (only changed registers): @@ -674,7 +1306,7 @@ Initial non-zero registers: ``` : @0 - 0: 46 79 08 r9 = r7 %s r8 + 0: 46 87 09 r9 = r7 %s r8 ``` Program should end with: trap @@ -692,7 +1324,7 @@ Initial non-zero registers: ``` : @0 - 0: 49 79 08 r9 = r7 %u r8 + 0: 49 87 09 r9 = r7 %u r8 ``` Registers after execution (only changed registers): @@ -712,7 +1344,7 @@ Initial non-zero registers: ``` : @0 - 0: 49 79 08 r9 = r7 %u r8 + 0: 49 87 09 r9 = r7 %u r8 ``` Registers after execution (only changed registers): @@ -733,7 +1365,7 @@ Initial non-zero registers: ``` : @0 - 0: 49 79 08 r9 = r7 %u r8 + 0: 49 87 09 r9 = r7 %u r8 ``` Registers after execution (only changed registers): @@ -859,7 +1491,7 @@ Initial non-zero registers: ``` : @0 - 0: 3a 79 08 r9 = r7 >a r8 + 0: 4d 87 09 r9 = r7 >>a r8 ``` Registers after execution (only changed registers): @@ -1072,7 +1704,7 @@ Initial non-zero registers: ``` : @0 - 0: 4d 79 08 r9 = r7 >>a r8 + 0: 4d 87 09 r9 = r7 >>a r8 ``` Registers after execution (only changed registers): @@ -1093,7 +1725,7 @@ Initial non-zero registers: ``` : @0 - 0: 37 79 08 r9 = r7 << r8 + 0: 37 87 09 r9 = r7 << r8 ``` Registers after execution (only changed registers): @@ -1154,7 +1786,7 @@ Initial non-zero registers: ``` : @0 - 0: 37 79 08 r9 = r7 << r8 + 0: 37 87 09 r9 = r7 << r8 ``` Registers after execution (only changed registers): @@ -1175,7 +1807,7 @@ Initial non-zero registers: ``` : @0 - 0: 33 79 08 r9 = r7 >> r8 + 0: 33 87 09 r9 = r7 >> r8 ``` Registers after execution (only changed registers): @@ -1236,7 +1868,7 @@ Initial non-zero registers: ``` : @0 - 0: 33 79 08 r9 = r7 >> r8 + 0: 33 87 09 r9 = r7 >> r8 ``` Registers after execution (only changed registers): @@ -1363,7 +1995,7 @@ Initial non-zero registers: ``` : @0 - 0: 14 79 08 r9 = r7 - r8 + 0: 14 87 09 r9 = r7 - r8 ``` Registers after execution (only changed registers): @@ -1404,7 +2036,7 @@ Initial non-zero registers: ``` : @0 - 0: 14 79 08 r9 = r7 - r8 + 0: 14 87 09 r9 = r7 - r8 ``` Registers after execution (only changed registers): @@ -1439,7 +2071,7 @@ Initial non-zero registers: ``` : @0 - 0: 1c 79 08 r9 = r7 ^ r8 + 0: 1c 87 09 r9 = r7 ^ r8 ``` Registers after execution (only changed registers): diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 904ca63..1127c77 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -24,8 +24,8 @@ 0, 3, 8, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index 4f23520..246b558 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 8, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index 3a76097..fc5a5db 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -24,8 +24,8 @@ 0, 3, 23, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_branch_eq_imm_nok.json b/pvm/programs/inst_branch_eq_imm_nok.json new file mode 100644 index 0000000..f8e2a03 --- /dev/null +++ b/pvm/programs/inst_branch_eq_imm_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_eq_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 7, + 39, + 211, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_eq_imm_ok.json b/pvm/programs/inst_branch_eq_imm_ok.json new file mode 100644 index 0000000..4280053 --- /dev/null +++ b/pvm/programs/inst_branch_eq_imm_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_eq_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 7, + 39, + 210, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json b/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json new file mode 100644 index 0000000..fba3baf --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 45, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json b/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json new file mode 100644 index 0000000..a9f3ca1 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 45, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_nok.json b/pvm/programs/inst_branch_greater_or_equal_signed_nok.json new file mode 100644 index 0000000..94a1d2e --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_signed_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 43, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_ok.json b/pvm/programs/inst_branch_greater_or_equal_signed_ok.json new file mode 100644 index 0000000..6853555 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_signed_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_signed_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 43, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json new file mode 100644 index 0000000..9815c04 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 52, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json new file mode 100644 index 0000000..53de385 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 52, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json new file mode 100644 index 0000000..1b89dd5 --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 41, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json new file mode 100644 index 0000000..464659e --- /dev/null +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_greater_or_equal_unsigned_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 41, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_signed_imm_nok.json b/pvm/programs/inst_branch_greater_signed_imm_nok.json new file mode 100644 index 0000000..9369e95 --- /dev/null +++ b/pvm/programs/inst_branch_greater_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 53, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_signed_imm_ok.json b/pvm/programs/inst_branch_greater_signed_imm_ok.json new file mode 100644 index 0000000..3bf2150 --- /dev/null +++ b/pvm/programs/inst_branch_greater_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 53, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_unsigned_imm_nok.json b/pvm/programs/inst_branch_greater_unsigned_imm_nok.json new file mode 100644 index 0000000..6059c0c --- /dev/null +++ b/pvm/programs/inst_branch_greater_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 50, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_greater_unsigned_imm_ok.json b/pvm/programs/inst_branch_greater_unsigned_imm_ok.json new file mode 100644 index 0000000..eacbda5 --- /dev/null +++ b/pvm/programs/inst_branch_greater_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_greater_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 50, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json b/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json new file mode 100644 index 0000000..dddf023 --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 46, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json b/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json new file mode 100644 index 0000000..8700eb3 --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 46, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json new file mode 100644 index 0000000..dde10a7 --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 59, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json new file mode 100644 index 0000000..d432c39 --- /dev/null +++ b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_or_equal_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 59, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_imm_nok.json b/pvm/programs/inst_branch_less_signed_imm_nok.json new file mode 100644 index 0000000..05cb23b --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_signed_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 32, + 23, + 245, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_imm_ok.json b/pvm/programs/inst_branch_less_signed_imm_ok.json new file mode 100644 index 0000000..ed62abf --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_signed_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 32, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_nok.json b/pvm/programs/inst_branch_less_signed_nok.json new file mode 100644 index 0000000..521157e --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_signed_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 48, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 10, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_signed_ok.json b/pvm/programs/inst_branch_less_signed_ok.json new file mode 100644 index 0000000..f269b23 --- /dev/null +++ b/pvm/programs/inst_branch_less_signed_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_signed_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 48, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_imm_nok.json b/pvm/programs/inst_branch_less_unsigned_imm_nok.json new file mode 100644 index 0000000..d07766b --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_imm_nok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_unsigned_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 246, + 44, + 23, + 10, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_imm_ok.json b/pvm/programs/inst_branch_less_unsigned_imm_ok.json new file mode 100644 index 0000000..bfdfd94 --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_imm_ok.json @@ -0,0 +1,62 @@ +{ + "name": "inst_branch_less_unsigned_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 14, + 4, + 7, + 10, + 44, + 23, + 246, + 5, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 137, + 193 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 14, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_nok.json b/pvm/programs/inst_branch_less_unsigned_nok.json new file mode 100644 index 0000000..d13b952 --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_unsigned_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 246, + 4, + 8, + 10, + 47, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967286, + 10, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_less_unsigned_ok.json b/pvm/programs/inst_branch_less_unsigned_ok.json new file mode 100644 index 0000000..6b0788c --- /dev/null +++ b/pvm/programs/inst_branch_less_unsigned_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_less_unsigned_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 10, + 4, + 8, + 246, + 47, + 135, + 4, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 73, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 4294967286, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9995 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_imm_nok.json b/pvm/programs/inst_branch_not_eq_imm_nok.json new file mode 100644 index 0000000..428470c --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_imm_nok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_not_eq_imm_nok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 15, + 39, + 210, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_branch_not_eq_imm_ok.json b/pvm/programs/inst_branch_not_eq_imm_ok.json new file mode 100644 index 0000000..aacd14f --- /dev/null +++ b/pvm/programs/inst_branch_not_eq_imm_ok.json @@ -0,0 +1,64 @@ +{ + "name": "inst_branch_not_eq_imm_ok", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 16, + 4, + 7, + 210, + 4, + 15, + 39, + 211, + 4, + 6, + 0, + 4, + 7, + 239, + 190, + 173, + 222, + 17, + 6 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 3735928559, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 16, + "expected-memory": [], + "expected-gas": 9996 +} \ No newline at end of file diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index 9fe7137..334b658 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -24,8 +24,8 @@ 0, 3, 83, - 135, - 10, + 168, + 7, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index c3ca0b4..b69b953 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -24,8 +24,8 @@ 0, 3, 83, - 135, - 10, + 168, + 7, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index 7a4539f..76d4118 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -24,8 +24,8 @@ 0, 3, 64, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index f3f3d6b..d3a9015 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -24,8 +24,8 @@ 0, 3, 64, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index 0474546..3e15812 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 64, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index 107c330..7d6770b 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -24,8 +24,8 @@ 0, 3, 68, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index 8bf40a5..609c8d6 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -24,8 +24,8 @@ 0, 3, 68, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 647a570..211e238 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 68, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index 6dbac36..db1cd6a 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -24,8 +24,8 @@ 0, 3, 34, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index 3751dfb..ff3d55d 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -24,8 +24,8 @@ 0, 3, 12, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index 075914c..f37ce9c 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -24,8 +24,8 @@ 0, 3, 70, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index 0f75a5d..082daba 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -24,8 +24,8 @@ 0, 3, 70, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index fcd089e..1a2d874 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 70, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index 4d207d3..ddd111b 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -24,8 +24,8 @@ 0, 3, 73, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index ee74d3e..4b9afc6 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -24,8 +24,8 @@ 0, 3, 73, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index 7749a11..cd150c7 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 73, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index d9d9b52..89d7e27 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -24,8 +24,8 @@ 0, 3, 58, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index 81510ed..aeab000 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -24,8 +24,8 @@ 0, 3, 58, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index 1b87d88..0b15181 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -24,8 +24,8 @@ 0, 3, 36, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index 8751d5e..020bf83 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -24,8 +24,8 @@ 0, 3, 36, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index b8e54ae..d28e12f 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -24,8 +24,8 @@ 0, 3, 77, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index af40048..9dd64ad 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 77, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index 8ce5981..c2b115b 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -24,8 +24,8 @@ 0, 3, 55, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index 0b717af..60aa8b6 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 55, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index 1e66d03..eb05e19 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -24,8 +24,8 @@ 0, 3, 51, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index 264684b..43b2e34 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 51, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index 9f5c214..448f588 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -24,8 +24,8 @@ 0, 3, 20, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index 4e1afd7..f419608 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -24,8 +24,8 @@ 0, 3, 20, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index 31e835f..6d6bc2a 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -24,8 +24,8 @@ 0, 3, 28, - 121, - 8, + 135, + 9, 249 ], "expected-status": "trap", From 0a4c99bc43683561b0e22dd4b552e9bac927a841 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 10:42:51 +0000 Subject: [PATCH 14/21] PVM tests v0.2: add 'invalid' to disassemblies to mark implicit traps --- pvm/TESTCASES.md | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 1a6a6ac..96199cf 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -9,6 +9,7 @@ along with their disassemblies and other relevant information. ``` : @0 0: 52 00 r0 = r0 + 2: invalid ``` Program should end with: trap @@ -27,6 +28,7 @@ Initial non-zero registers: ``` : @0 0: 08 87 09 r9 = r7 + r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -47,6 +49,7 @@ Initial non-zero registers: ``` : @0 0: 02 79 02 r9 = r7 + 0x2 + 3: invalid ``` Registers after execution (only changed registers): @@ -68,6 +71,7 @@ Initial non-zero registers: ``` : @0 0: 08 87 09 r9 = r7 + r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -89,6 +93,7 @@ Initial non-zero registers: ``` : @0 0: 17 87 09 r9 = r7 & r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -109,6 +114,7 @@ Initial non-zero registers: ``` : @0 0: 12 79 03 r9 = r7 & 0x3 + 3: invalid ``` Registers after execution (only changed registers): @@ -131,6 +137,7 @@ Gas consumed: 10000 -> 9998 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -153,6 +160,7 @@ Gas consumed: 10000 -> 9997 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -176,6 +184,7 @@ Gas consumed: 10000 -> 9996 11: 00 trap : @2 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid ``` Registers after execution (only changed registers): @@ -200,6 +209,7 @@ Gas consumed: 10000 -> 9996 11: 00 trap : @2 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid ``` Registers after execution (only changed registers): @@ -223,6 +233,7 @@ Gas consumed: 10000 -> 9995 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -245,6 +256,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -268,6 +280,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -292,6 +305,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -315,6 +329,7 @@ Gas consumed: 10000 -> 9995 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -337,6 +352,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -360,6 +376,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -384,6 +401,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -407,6 +425,7 @@ Gas consumed: 10000 -> 9995 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -429,6 +448,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -451,6 +471,7 @@ Gas consumed: 10000 -> 9996 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -473,6 +494,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -495,6 +517,7 @@ Gas consumed: 10000 -> 9996 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -517,6 +540,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -539,6 +563,7 @@ Gas consumed: 10000 -> 9996 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -561,6 +586,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -583,6 +609,7 @@ Gas consumed: 10000 -> 9996 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -605,6 +632,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -628,6 +656,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -652,6 +681,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -675,6 +705,7 @@ Gas consumed: 10000 -> 9995 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -697,6 +728,7 @@ Gas consumed: 10000 -> 9997 7: 00 trap : @2 8: 04 07 ef be ad de r7 = 0xdeadbeef + 14: invalid ``` Registers after execution (only changed registers): @@ -720,6 +752,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -744,6 +777,7 @@ Gas consumed: 10000 -> 9996 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -767,6 +801,7 @@ Gas consumed: 10000 -> 9995 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -789,6 +824,7 @@ Gas consumed: 10000 -> 9997 9: 00 trap : @2 10: 04 07 ef be ad de r7 = 0xdeadbeef + 16: invalid ``` Registers after execution (only changed registers): @@ -812,6 +848,7 @@ Gas consumed: 10000 -> 9996 11: 00 trap : @2 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid ``` Registers after execution (only changed registers): @@ -836,6 +873,7 @@ Gas consumed: 10000 -> 9996 11: 00 trap : @2 12: 04 07 ef be ad de r7 = 0xdeadbeef + 18: invalid ``` Registers after execution (only changed registers): @@ -857,6 +895,7 @@ Initial non-zero registers: ``` : @0 0: 55 a7 64 r7 = 100 if r10 == 0 + 3: invalid ``` Program should end with: trap @@ -871,6 +910,7 @@ Gas consumed: 10000 -> 9998 ``` : @0 0: 55 a7 64 r7 = 100 if r10 == 0 + 3: invalid ``` Registers after execution (only changed registers): @@ -892,6 +932,7 @@ Initial non-zero registers: ``` : @0 0: 53 a8 07 r7 = r8 if r10 == 0 + 3: invalid ``` Program should end with: trap @@ -909,6 +950,7 @@ Initial non-zero registers: ``` : @0 0: 53 a8 07 r7 = r8 if r10 == 0 + 3: invalid ``` Registers after execution (only changed registers): @@ -930,6 +972,7 @@ Initial non-zero registers: ``` : @0 0: 40 87 09 r9 = r7 /s r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -950,6 +993,7 @@ Initial non-zero registers: ``` : @0 0: 40 87 09 r9 = r7 /s r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -971,6 +1015,7 @@ Initial non-zero registers: ``` : @0 0: 40 87 09 r9 = r7 /s r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -992,6 +1037,7 @@ Initial non-zero registers: ``` : @0 0: 44 87 09 r9 = r7 /u r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1012,6 +1058,7 @@ Initial non-zero registers: ``` : @0 0: 44 87 09 r9 = r7 /u r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1034,6 +1081,7 @@ Initial non-zero registers: ``` : @0 0: 44 87 09 r9 = r7 /u r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1051,6 +1099,8 @@ Gas consumed: 10000 -> 9998 ``` : @0 0: 11 fallthrough + : @1 + 1: invalid ``` Program should end with: trap @@ -1070,6 +1120,7 @@ Gas consumed: 10000 -> 9998 6: 00 trap : @2 7: 04 07 ef be ad de r7 = 0xdeadbeef + 13: invalid ``` Registers after execution (only changed registers): @@ -1087,6 +1138,7 @@ Gas consumed: 10000 -> 9996 ``` : @0 0: 04 07 ef be ad de r7 = 0xdeadbeef + 6: invalid ``` Registers after execution (only changed registers): @@ -1110,6 +1162,7 @@ Initial non-zero memory chunks: ``` : @0 0: 3c 07 00 00 02 r7 = u8 [0x20000] + 5: invalid ``` Registers after execution (only changed registers): @@ -1129,6 +1182,7 @@ Gas consumed: 10000 -> 9998 ``` : @0 0: 3c 07 00 00 02 r7 = u8 [0x20000] + 5: invalid ``` Program should end with: trap @@ -1146,6 +1200,7 @@ Initial non-zero registers: ``` : @0 0: 52 79 r9 = r7 + 2: invalid ``` Registers after execution (only changed registers): @@ -1167,6 +1222,7 @@ Initial non-zero registers: ``` : @0 0: 22 87 09 r9 = r7 * r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1187,6 +1243,7 @@ Initial non-zero registers: ``` : @0 0: 23 79 07 r9 = r7 * 7 + 3: invalid ``` Registers after execution (only changed registers): @@ -1207,6 +1264,7 @@ Initial non-zero registers: ``` : @0 0: 28 89 01 r9 = -r8 + 1 + 3: invalid ``` Registers after execution (only changed registers): @@ -1228,6 +1286,7 @@ Initial non-zero registers: ``` : @0 0: 0c 87 09 r9 = r7 | r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1248,6 +1307,7 @@ Initial non-zero registers: ``` : @0 0: 31 79 03 r9 = r7 | 0x3 + 3: invalid ``` Registers after execution (only changed registers): @@ -1269,6 +1329,7 @@ Initial non-zero registers: ``` : @0 0: 46 87 09 r9 = r7 %s r8 + 3: invalid ``` Program should end with: trap @@ -1286,6 +1347,7 @@ Initial non-zero registers: ``` : @0 0: 46 87 09 r9 = r7 %s r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1307,6 +1369,7 @@ Initial non-zero registers: ``` : @0 0: 46 87 09 r9 = r7 %s r8 + 3: invalid ``` Program should end with: trap @@ -1325,6 +1388,7 @@ Initial non-zero registers: ``` : @0 0: 49 87 09 r9 = r7 %u r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1345,6 +1409,7 @@ Initial non-zero registers: ``` : @0 0: 49 87 09 r9 = r7 %u r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1366,6 +1431,7 @@ Initial non-zero registers: ``` : @0 0: 49 87 09 r9 = r7 %u r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1417,6 +1483,7 @@ Initial non-zero registers: ``` : @0 0: 3d 79 0a r9 = r7 >s 10 + 3: invalid ``` Program should end with: trap @@ -1434,6 +1501,7 @@ Initial non-zero registers: ``` : @0 0: 3d 79 f6 r9 = r7 >s -10 + 3: invalid ``` Registers after execution (only changed registers): @@ -1454,6 +1522,7 @@ Initial non-zero registers: ``` : @0 0: 27 79 f6 r9 = r7 >u 0xfffffff6 + 3: invalid ``` Program should end with: trap @@ -1471,6 +1540,7 @@ Initial non-zero registers: ``` : @0 0: 27 79 0a r9 = r7 >u 0xa + 3: invalid ``` Registers after execution (only changed registers): @@ -1492,6 +1562,7 @@ Initial non-zero registers: ``` : @0 0: 3a 87 09 r9 = r7 >a r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1664,6 +1743,7 @@ Initial non-zero registers: ``` : @0 0: 19 79 03 r9 = r7 >>a 3 + 3: invalid ``` Registers after execution (only changed registers): @@ -1684,6 +1764,7 @@ Initial non-zero registers: ``` : @0 0: 50 89 75 00 00 80 r9 = 2147483765 >>a r8 + 6: invalid ``` Registers after execution (only changed registers): @@ -1705,6 +1786,7 @@ Initial non-zero registers: ``` : @0 0: 4d 87 09 r9 = r7 >>a r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1726,6 +1808,7 @@ Initial non-zero registers: ``` : @0 0: 37 87 09 r9 = r7 << r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1746,6 +1829,7 @@ Initial non-zero registers: ``` : @0 0: 09 79 03 r9 = r7 << 3 + 3: invalid ``` Registers after execution (only changed registers): @@ -1766,6 +1850,7 @@ Initial non-zero registers: ``` : @0 0: 4b 89 75 00 00 80 r9 = 2147483765 << r8 + 6: invalid ``` Registers after execution (only changed registers): @@ -1787,6 +1872,7 @@ Initial non-zero registers: ``` : @0 0: 37 87 09 r9 = r7 << r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1808,6 +1894,7 @@ Initial non-zero registers: ``` : @0 0: 33 87 09 r9 = r7 >> r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1828,6 +1915,7 @@ Initial non-zero registers: ``` : @0 0: 0e 79 03 r9 = r7 >> 3 + 3: invalid ``` Registers after execution (only changed registers): @@ -1848,6 +1936,7 @@ Initial non-zero registers: ``` : @0 0: 48 89 75 00 00 80 r9 = 2147483765 >> r8 + 6: invalid ``` Registers after execution (only changed registers): @@ -1869,6 +1958,7 @@ Initial non-zero registers: ``` : @0 0: 33 87 09 r9 = r7 >> r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -1892,6 +1982,7 @@ Initial non-zero registers: ``` : @0 0: 45 07 00 00 02 u16 [0x20000] = r7 + 5: invalid ``` Final non-zero memory chunks: @@ -1915,6 +2006,7 @@ Initial non-zero registers: ``` : @0 0: 16 07 00 00 02 u32 [0x20000] = r7 + 5: invalid ``` Final non-zero memory chunks: @@ -1938,6 +2030,7 @@ Initial non-zero registers: ``` : @0 0: 47 07 00 00 02 u8 [0x20000] = r7 + 5: invalid ``` Final non-zero memory chunks: @@ -1958,6 +2051,7 @@ Initial non-zero registers: ``` : @0 0: 47 07 00 00 02 u8 [0x20000] = r7 + 5: invalid ``` Program should end with: trap @@ -1978,6 +2072,7 @@ Initial non-zero registers: ``` : @0 0: 47 07 00 00 01 u8 [0x10000] = r7 + 5: invalid ``` Program should end with: trap @@ -1996,6 +2091,7 @@ Initial non-zero registers: ``` : @0 0: 14 87 09 r9 = r7 - r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -2016,6 +2112,7 @@ Initial non-zero registers: ``` : @0 0: 02 79 ff r9 = r7 + 0xffffffff + 3: invalid ``` Registers after execution (only changed registers): @@ -2037,6 +2134,7 @@ Initial non-zero registers: ``` : @0 0: 14 87 09 r9 = r7 - r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -2072,6 +2170,7 @@ Initial non-zero registers: ``` : @0 0: 1c 87 09 r9 = r7 ^ r8 + 3: invalid ``` Registers after execution (only changed registers): @@ -2092,6 +2191,7 @@ Initial non-zero registers: ``` : @0 0: 1f 79 03 r9 = r7 ^ 0x3 + 3: invalid ``` Registers after execution (only changed registers): From 8659541b84d112aadeda04cdd27462e764d38e60 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 10:56:45 +0000 Subject: [PATCH 15/21] PVM tests v0.2: bitmask paddings are now filled with zeros --- pvm/programs/gas_basic_consume_all.json | 2 +- pvm/programs/inst_add.json | 2 +- pvm/programs/inst_add_imm.json | 2 +- pvm/programs/inst_add_with_overflow.json | 2 +- pvm/programs/inst_and.json | 2 +- pvm/programs/inst_and_imm.json | 2 +- pvm/programs/inst_branch_eq_nok.json | 2 +- pvm/programs/inst_branch_eq_ok.json | 2 +- pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json | 2 +- pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json | 2 +- pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json | 2 +- pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json | 2 +- pvm/programs/inst_branch_greater_signed_imm_nok.json | 2 +- pvm/programs/inst_branch_greater_signed_imm_ok.json | 2 +- pvm/programs/inst_branch_greater_unsigned_imm_nok.json | 2 +- pvm/programs/inst_branch_greater_unsigned_imm_ok.json | 2 +- pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json | 2 +- pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json | 2 +- pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json | 2 +- pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json | 2 +- pvm/programs/inst_branch_less_signed_imm_nok.json | 2 +- pvm/programs/inst_branch_less_signed_imm_ok.json | 2 +- pvm/programs/inst_branch_less_unsigned_imm_nok.json | 2 +- pvm/programs/inst_branch_less_unsigned_imm_ok.json | 2 +- pvm/programs/inst_branch_not_eq_nok.json | 2 +- pvm/programs/inst_branch_not_eq_ok.json | 2 +- pvm/programs/inst_cmov_if_zero_imm_nok.json | 2 +- pvm/programs/inst_cmov_if_zero_imm_ok.json | 2 +- pvm/programs/inst_cmov_if_zero_nok.json | 2 +- pvm/programs/inst_cmov_if_zero_ok.json | 2 +- pvm/programs/inst_div_signed.json | 2 +- pvm/programs/inst_div_signed_by_zero.json | 2 +- pvm/programs/inst_div_signed_with_overflow.json | 2 +- pvm/programs/inst_div_unsigned.json | 2 +- pvm/programs/inst_div_unsigned_by_zero.json | 2 +- pvm/programs/inst_div_unsigned_with_overflow.json | 2 +- pvm/programs/inst_fallthrough.json | 2 +- pvm/programs/inst_jump.json | 2 +- pvm/programs/inst_load_imm.json | 2 +- pvm/programs/inst_load_u8.json | 2 +- pvm/programs/inst_load_u8_trap.json | 2 +- pvm/programs/inst_move_reg.json | 2 +- pvm/programs/inst_mul.json | 2 +- pvm/programs/inst_mul_imm.json | 2 +- pvm/programs/inst_negate_and_add_imm.json | 2 +- pvm/programs/inst_or.json | 2 +- pvm/programs/inst_or_imm.json | 2 +- pvm/programs/inst_rem_signed.json | 2 +- pvm/programs/inst_rem_signed_by_zero.json | 2 +- pvm/programs/inst_rem_signed_with_overflow.json | 2 +- pvm/programs/inst_rem_unsigned.json | 2 +- pvm/programs/inst_rem_unsigned_by_zero.json | 2 +- pvm/programs/inst_rem_unsigned_with_overflow.json | 2 +- pvm/programs/inst_ret_halt.json | 2 +- pvm/programs/inst_ret_invalid.json | 2 +- pvm/programs/inst_set_greater_than_signed_imm_0.json | 2 +- pvm/programs/inst_set_greater_than_signed_imm_1.json | 2 +- pvm/programs/inst_set_greater_than_unsigned_imm_0.json | 2 +- pvm/programs/inst_set_greater_than_unsigned_imm_1.json | 2 +- pvm/programs/inst_set_less_than_signed_0.json | 2 +- pvm/programs/inst_set_less_than_signed_1.json | 2 +- pvm/programs/inst_set_less_than_signed_imm_0.json | 2 +- pvm/programs/inst_set_less_than_signed_imm_1.json | 2 +- pvm/programs/inst_set_less_than_unsigned_0.json | 2 +- pvm/programs/inst_set_less_than_unsigned_1.json | 2 +- pvm/programs/inst_set_less_than_unsigned_imm_0.json | 2 +- pvm/programs/inst_set_less_than_unsigned_imm_1.json | 2 +- pvm/programs/inst_shift_arithmetic_right.json | 2 +- pvm/programs/inst_shift_arithmetic_right_imm.json | 2 +- pvm/programs/inst_shift_arithmetic_right_imm_alt.json | 2 +- pvm/programs/inst_shift_arithmetic_right_with_overflow.json | 2 +- pvm/programs/inst_shift_logical_left.json | 2 +- pvm/programs/inst_shift_logical_left_imm.json | 2 +- pvm/programs/inst_shift_logical_left_imm_alt.json | 2 +- pvm/programs/inst_shift_logical_left_with_overflow.json | 2 +- pvm/programs/inst_shift_logical_right.json | 2 +- pvm/programs/inst_shift_logical_right_imm.json | 2 +- pvm/programs/inst_shift_logical_right_imm_alt.json | 2 +- pvm/programs/inst_shift_logical_right_with_overflow.json | 2 +- pvm/programs/inst_store_u16.json | 2 +- pvm/programs/inst_store_u32.json | 2 +- pvm/programs/inst_store_u8.json | 2 +- pvm/programs/inst_store_u8_trap_inaccessible.json | 2 +- pvm/programs/inst_store_u8_trap_read_only.json | 2 +- pvm/programs/inst_sub.json | 2 +- pvm/programs/inst_sub_imm.json | 2 +- pvm/programs/inst_sub_with_overflow.json | 2 +- pvm/programs/inst_trap.json | 2 +- pvm/programs/inst_xor.json | 2 +- pvm/programs/inst_xor_imm.json | 2 +- 90 files changed, 90 insertions(+), 90 deletions(-) diff --git a/pvm/programs/gas_basic_consume_all.json b/pvm/programs/gas_basic_consume_all.json index 8726738..089c445 100644 --- a/pvm/programs/gas_basic_consume_all.json +++ b/pvm/programs/gas_basic_consume_all.json @@ -25,7 +25,7 @@ 2, 82, 0, - 253 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_add.json b/pvm/programs/inst_add.json index 1127c77..de0c6ae 100644 --- a/pvm/programs/inst_add.json +++ b/pvm/programs/inst_add.json @@ -26,7 +26,7 @@ 8, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_add_imm.json b/pvm/programs/inst_add_imm.json index d5b8f30..5130cc6 100644 --- a/pvm/programs/inst_add_imm.json +++ b/pvm/programs/inst_add_imm.json @@ -26,7 +26,7 @@ 2, 121, 2, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_add_with_overflow.json b/pvm/programs/inst_add_with_overflow.json index 246b558..ad49df5 100644 --- a/pvm/programs/inst_add_with_overflow.json +++ b/pvm/programs/inst_add_with_overflow.json @@ -26,7 +26,7 @@ 8, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_and.json b/pvm/programs/inst_and.json index fc5a5db..528f6c0 100644 --- a/pvm/programs/inst_and.json +++ b/pvm/programs/inst_and.json @@ -26,7 +26,7 @@ 23, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_and_imm.json b/pvm/programs/inst_and_imm.json index d726d70..1ffa19c 100644 --- a/pvm/programs/inst_and_imm.json +++ b/pvm/programs/inst_and_imm.json @@ -26,7 +26,7 @@ 18, 121, 3, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_eq_nok.json b/pvm/programs/inst_branch_eq_nok.json index 7721a56..256a391 100644 --- a/pvm/programs/inst_branch_eq_nok.json +++ b/pvm/programs/inst_branch_eq_nok.json @@ -43,7 +43,7 @@ 222, 17, 25, - 252 + 0 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_eq_ok.json b/pvm/programs/inst_branch_eq_ok.json index 87c3cf9..4603ee6 100644 --- a/pvm/programs/inst_branch_eq_ok.json +++ b/pvm/programs/inst_branch_eq_ok.json @@ -43,7 +43,7 @@ 222, 17, 25, - 252 + 0 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json b/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json index fba3baf..aabcee9 100644 --- a/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json +++ b/pvm/programs/inst_branch_greater_or_equal_signed_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json b/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json index a9f3ca1..51c3f39 100644 --- a/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json +++ b/pvm/programs/inst_branch_greater_or_equal_signed_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json index 9815c04..31ba1f8 100644 --- a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json index 53de385..83aefff 100644 --- a/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json +++ b/pvm/programs/inst_branch_greater_or_equal_unsigned_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_signed_imm_nok.json b/pvm/programs/inst_branch_greater_signed_imm_nok.json index 9369e95..b37e5d8 100644 --- a/pvm/programs/inst_branch_greater_signed_imm_nok.json +++ b/pvm/programs/inst_branch_greater_signed_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_signed_imm_ok.json b/pvm/programs/inst_branch_greater_signed_imm_ok.json index 3bf2150..177ac53 100644 --- a/pvm/programs/inst_branch_greater_signed_imm_ok.json +++ b/pvm/programs/inst_branch_greater_signed_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_unsigned_imm_nok.json b/pvm/programs/inst_branch_greater_unsigned_imm_nok.json index 6059c0c..3b97b7c 100644 --- a/pvm/programs/inst_branch_greater_unsigned_imm_nok.json +++ b/pvm/programs/inst_branch_greater_unsigned_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_greater_unsigned_imm_ok.json b/pvm/programs/inst_branch_greater_unsigned_imm_ok.json index eacbda5..c551282 100644 --- a/pvm/programs/inst_branch_greater_unsigned_imm_ok.json +++ b/pvm/programs/inst_branch_greater_unsigned_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json b/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json index dddf023..b559e8f 100644 --- a/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json +++ b/pvm/programs/inst_branch_less_or_equal_signed_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json b/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json index 8700eb3..3b26274 100644 --- a/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json +++ b/pvm/programs/inst_branch_less_or_equal_signed_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json index dde10a7..dee2f03 100644 --- a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json +++ b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json index d432c39..34f5753 100644 --- a/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json +++ b/pvm/programs/inst_branch_less_or_equal_unsigned_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_signed_imm_nok.json b/pvm/programs/inst_branch_less_signed_imm_nok.json index 05cb23b..909dfc0 100644 --- a/pvm/programs/inst_branch_less_signed_imm_nok.json +++ b/pvm/programs/inst_branch_less_signed_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_signed_imm_ok.json b/pvm/programs/inst_branch_less_signed_imm_ok.json index ed62abf..83dd905 100644 --- a/pvm/programs/inst_branch_less_signed_imm_ok.json +++ b/pvm/programs/inst_branch_less_signed_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_unsigned_imm_nok.json b/pvm/programs/inst_branch_less_unsigned_imm_nok.json index d07766b..5dcb891 100644 --- a/pvm/programs/inst_branch_less_unsigned_imm_nok.json +++ b/pvm/programs/inst_branch_less_unsigned_imm_nok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_less_unsigned_imm_ok.json b/pvm/programs/inst_branch_less_unsigned_imm_ok.json index bfdfd94..39f56fc 100644 --- a/pvm/programs/inst_branch_less_unsigned_imm_ok.json +++ b/pvm/programs/inst_branch_less_unsigned_imm_ok.json @@ -38,7 +38,7 @@ 173, 222, 137, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_not_eq_nok.json b/pvm/programs/inst_branch_not_eq_nok.json index b8a7adb..7674b1d 100644 --- a/pvm/programs/inst_branch_not_eq_nok.json +++ b/pvm/programs/inst_branch_not_eq_nok.json @@ -43,7 +43,7 @@ 222, 17, 25, - 252 + 0 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_branch_not_eq_ok.json b/pvm/programs/inst_branch_not_eq_ok.json index 4267109..f8f9464 100644 --- a/pvm/programs/inst_branch_not_eq_ok.json +++ b/pvm/programs/inst_branch_not_eq_ok.json @@ -43,7 +43,7 @@ 222, 17, 25, - 252 + 0 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_cmov_if_zero_imm_nok.json b/pvm/programs/inst_cmov_if_zero_imm_nok.json index 0862e30..639e059 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_nok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_nok.json @@ -26,7 +26,7 @@ 85, 167, 100, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_cmov_if_zero_imm_ok.json b/pvm/programs/inst_cmov_if_zero_imm_ok.json index c0758f5..40d2e77 100644 --- a/pvm/programs/inst_cmov_if_zero_imm_ok.json +++ b/pvm/programs/inst_cmov_if_zero_imm_ok.json @@ -26,7 +26,7 @@ 85, 167, 100, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_cmov_if_zero_nok.json b/pvm/programs/inst_cmov_if_zero_nok.json index 334b658..33d0b82 100644 --- a/pvm/programs/inst_cmov_if_zero_nok.json +++ b/pvm/programs/inst_cmov_if_zero_nok.json @@ -26,7 +26,7 @@ 83, 168, 7, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_cmov_if_zero_ok.json b/pvm/programs/inst_cmov_if_zero_ok.json index b69b953..1fab7ca 100644 --- a/pvm/programs/inst_cmov_if_zero_ok.json +++ b/pvm/programs/inst_cmov_if_zero_ok.json @@ -26,7 +26,7 @@ 83, 168, 7, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_div_signed.json b/pvm/programs/inst_div_signed.json index 76d4118..b397e4d 100644 --- a/pvm/programs/inst_div_signed.json +++ b/pvm/programs/inst_div_signed.json @@ -26,7 +26,7 @@ 64, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_div_signed_by_zero.json b/pvm/programs/inst_div_signed_by_zero.json index d3a9015..899a4c2 100644 --- a/pvm/programs/inst_div_signed_by_zero.json +++ b/pvm/programs/inst_div_signed_by_zero.json @@ -26,7 +26,7 @@ 64, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_div_signed_with_overflow.json b/pvm/programs/inst_div_signed_with_overflow.json index 3e15812..e2fb72f 100644 --- a/pvm/programs/inst_div_signed_with_overflow.json +++ b/pvm/programs/inst_div_signed_with_overflow.json @@ -26,7 +26,7 @@ 64, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_div_unsigned.json b/pvm/programs/inst_div_unsigned.json index 7d6770b..5b8e820 100644 --- a/pvm/programs/inst_div_unsigned.json +++ b/pvm/programs/inst_div_unsigned.json @@ -26,7 +26,7 @@ 68, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_div_unsigned_by_zero.json b/pvm/programs/inst_div_unsigned_by_zero.json index 609c8d6..280ba35 100644 --- a/pvm/programs/inst_div_unsigned_by_zero.json +++ b/pvm/programs/inst_div_unsigned_by_zero.json @@ -26,7 +26,7 @@ 68, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_div_unsigned_with_overflow.json b/pvm/programs/inst_div_unsigned_with_overflow.json index 211e238..5e86d5e 100644 --- a/pvm/programs/inst_div_unsigned_with_overflow.json +++ b/pvm/programs/inst_div_unsigned_with_overflow.json @@ -26,7 +26,7 @@ 68, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_fallthrough.json b/pvm/programs/inst_fallthrough.json index 537712f..344a443 100644 --- a/pvm/programs/inst_fallthrough.json +++ b/pvm/programs/inst_fallthrough.json @@ -24,7 +24,7 @@ 0, 1, 17, - 255 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_jump.json b/pvm/programs/inst_jump.json index aaff1e6..35c9185 100644 --- a/pvm/programs/inst_jump.json +++ b/pvm/programs/inst_jump.json @@ -37,7 +37,7 @@ 173, 222, 209, - 224 + 0 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_load_imm.json b/pvm/programs/inst_load_imm.json index 22f20ff..74a6153 100644 --- a/pvm/programs/inst_load_imm.json +++ b/pvm/programs/inst_load_imm.json @@ -29,7 +29,7 @@ 190, 173, 222, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_load_u8.json b/pvm/programs/inst_load_u8.json index bb1e79b..e349c69 100644 --- a/pvm/programs/inst_load_u8.json +++ b/pvm/programs/inst_load_u8.json @@ -44,7 +44,7 @@ 0, 0, 2, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_load_u8_trap.json b/pvm/programs/inst_load_u8_trap.json index f672509..bda3c09 100644 --- a/pvm/programs/inst_load_u8_trap.json +++ b/pvm/programs/inst_load_u8_trap.json @@ -28,7 +28,7 @@ 0, 0, 2, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_move_reg.json b/pvm/programs/inst_move_reg.json index 109187b..b51838d 100644 --- a/pvm/programs/inst_move_reg.json +++ b/pvm/programs/inst_move_reg.json @@ -25,7 +25,7 @@ 2, 82, 121, - 253 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_mul.json b/pvm/programs/inst_mul.json index db1cd6a..4d436e0 100644 --- a/pvm/programs/inst_mul.json +++ b/pvm/programs/inst_mul.json @@ -26,7 +26,7 @@ 34, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_mul_imm.json b/pvm/programs/inst_mul_imm.json index 63629c6..2beed58 100644 --- a/pvm/programs/inst_mul_imm.json +++ b/pvm/programs/inst_mul_imm.json @@ -26,7 +26,7 @@ 35, 121, 7, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_negate_and_add_imm.json b/pvm/programs/inst_negate_and_add_imm.json index 8be3d42..c2e8ab8 100644 --- a/pvm/programs/inst_negate_and_add_imm.json +++ b/pvm/programs/inst_negate_and_add_imm.json @@ -26,7 +26,7 @@ 40, 137, 1, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_or.json b/pvm/programs/inst_or.json index ff3d55d..4ad3056 100644 --- a/pvm/programs/inst_or.json +++ b/pvm/programs/inst_or.json @@ -26,7 +26,7 @@ 12, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_or_imm.json b/pvm/programs/inst_or_imm.json index 7b6cde3..418ed4a 100644 --- a/pvm/programs/inst_or_imm.json +++ b/pvm/programs/inst_or_imm.json @@ -26,7 +26,7 @@ 49, 121, 3, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index f37ce9c..3b18ec7 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -26,7 +26,7 @@ 70, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_rem_signed_by_zero.json b/pvm/programs/inst_rem_signed_by_zero.json index 082daba..a144fb1 100644 --- a/pvm/programs/inst_rem_signed_by_zero.json +++ b/pvm/programs/inst_rem_signed_by_zero.json @@ -26,7 +26,7 @@ 70, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index 1a2d874..0aa799f 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -26,7 +26,7 @@ 70, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_rem_unsigned.json b/pvm/programs/inst_rem_unsigned.json index ddd111b..b566240 100644 --- a/pvm/programs/inst_rem_unsigned.json +++ b/pvm/programs/inst_rem_unsigned.json @@ -26,7 +26,7 @@ 73, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_rem_unsigned_by_zero.json b/pvm/programs/inst_rem_unsigned_by_zero.json index 4b9afc6..b62dae1 100644 --- a/pvm/programs/inst_rem_unsigned_by_zero.json +++ b/pvm/programs/inst_rem_unsigned_by_zero.json @@ -26,7 +26,7 @@ 73, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_rem_unsigned_with_overflow.json b/pvm/programs/inst_rem_unsigned_with_overflow.json index cd150c7..52dd0e3 100644 --- a/pvm/programs/inst_rem_unsigned_with_overflow.json +++ b/pvm/programs/inst_rem_unsigned_with_overflow.json @@ -26,7 +26,7 @@ 73, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_ret_halt.json b/pvm/programs/inst_ret_halt.json index 9ca8ea8..f6758e5 100644 --- a/pvm/programs/inst_ret_halt.json +++ b/pvm/programs/inst_ret_halt.json @@ -25,7 +25,7 @@ 2, 19, 0, - 253 + 1 ], "expected-status": "halt", "expected-regs": [ diff --git a/pvm/programs/inst_ret_invalid.json b/pvm/programs/inst_ret_invalid.json index 5bdb8ba..ab3dcd1 100644 --- a/pvm/programs/inst_ret_invalid.json +++ b/pvm/programs/inst_ret_invalid.json @@ -25,7 +25,7 @@ 2, 19, 0, - 253 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index f4def5a..7470911 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -26,7 +26,7 @@ 61, 121, 10, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_greater_than_signed_imm_1.json b/pvm/programs/inst_set_greater_than_signed_imm_1.json index 7c599ef..19666e9 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_1.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_1.json @@ -26,7 +26,7 @@ 61, 121, 246, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index 876523c..ea93004 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -26,7 +26,7 @@ 39, 121, 246, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json index cde7df0..4e332bc 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_1.json @@ -26,7 +26,7 @@ 39, 121, 10, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index 89d7e27..c7f9193 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -26,7 +26,7 @@ 58, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_signed_1.json b/pvm/programs/inst_set_less_than_signed_1.json index aeab000..7864501 100644 --- a/pvm/programs/inst_set_less_than_signed_1.json +++ b/pvm/programs/inst_set_less_than_signed_1.json @@ -26,7 +26,7 @@ 58, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index 1695567..ba98506 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -26,7 +26,7 @@ 56, 121, 246, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_signed_imm_1.json b/pvm/programs/inst_set_less_than_signed_imm_1.json index 41f1d9d..60bf550 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_1.json +++ b/pvm/programs/inst_set_less_than_signed_imm_1.json @@ -26,7 +26,7 @@ 56, 121, 10, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index 0b15181..59c0dbd 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -26,7 +26,7 @@ 36, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_unsigned_1.json b/pvm/programs/inst_set_less_than_unsigned_1.json index 020bf83..7ee0dbd 100644 --- a/pvm/programs/inst_set_less_than_unsigned_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_1.json @@ -26,7 +26,7 @@ 36, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index e7cbdf0..ca38fd9 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -26,7 +26,7 @@ 27, 121, 10, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_1.json b/pvm/programs/inst_set_less_than_unsigned_imm_1.json index a96f7f1..f0866c0 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_1.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_1.json @@ -26,7 +26,7 @@ 27, 121, 246, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_arithmetic_right.json b/pvm/programs/inst_shift_arithmetic_right.json index d28e12f..36f4fa5 100644 --- a/pvm/programs/inst_shift_arithmetic_right.json +++ b/pvm/programs/inst_shift_arithmetic_right.json @@ -26,7 +26,7 @@ 77, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_arithmetic_right_imm.json b/pvm/programs/inst_shift_arithmetic_right_imm.json index 44768f3..8cd7a3f 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm.json @@ -26,7 +26,7 @@ 25, 121, 3, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json index b68a2ee..a0e7339 100644 --- a/pvm/programs/inst_shift_arithmetic_right_imm_alt.json +++ b/pvm/programs/inst_shift_arithmetic_right_imm_alt.json @@ -29,7 +29,7 @@ 0, 0, 128, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json index 9dd64ad..7e3048b 100644 --- a/pvm/programs/inst_shift_arithmetic_right_with_overflow.json +++ b/pvm/programs/inst_shift_arithmetic_right_with_overflow.json @@ -26,7 +26,7 @@ 77, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_left.json b/pvm/programs/inst_shift_logical_left.json index c2b115b..f4768a1 100644 --- a/pvm/programs/inst_shift_logical_left.json +++ b/pvm/programs/inst_shift_logical_left.json @@ -26,7 +26,7 @@ 55, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_left_imm.json b/pvm/programs/inst_shift_logical_left_imm.json index 4e3a080..a81c10b 100644 --- a/pvm/programs/inst_shift_logical_left_imm.json +++ b/pvm/programs/inst_shift_logical_left_imm.json @@ -26,7 +26,7 @@ 9, 121, 3, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_left_imm_alt.json b/pvm/programs/inst_shift_logical_left_imm_alt.json index ebcc7ff..a940f50 100644 --- a/pvm/programs/inst_shift_logical_left_imm_alt.json +++ b/pvm/programs/inst_shift_logical_left_imm_alt.json @@ -29,7 +29,7 @@ 0, 0, 128, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_left_with_overflow.json b/pvm/programs/inst_shift_logical_left_with_overflow.json index 60aa8b6..0b656a0 100644 --- a/pvm/programs/inst_shift_logical_left_with_overflow.json +++ b/pvm/programs/inst_shift_logical_left_with_overflow.json @@ -26,7 +26,7 @@ 55, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_right.json b/pvm/programs/inst_shift_logical_right.json index eb05e19..a06a6ee 100644 --- a/pvm/programs/inst_shift_logical_right.json +++ b/pvm/programs/inst_shift_logical_right.json @@ -26,7 +26,7 @@ 51, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_right_imm.json b/pvm/programs/inst_shift_logical_right_imm.json index 1bc00eb..23049e3 100644 --- a/pvm/programs/inst_shift_logical_right_imm.json +++ b/pvm/programs/inst_shift_logical_right_imm.json @@ -26,7 +26,7 @@ 14, 121, 3, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_right_imm_alt.json b/pvm/programs/inst_shift_logical_right_imm_alt.json index f5436b5..e225e54 100644 --- a/pvm/programs/inst_shift_logical_right_imm_alt.json +++ b/pvm/programs/inst_shift_logical_right_imm_alt.json @@ -29,7 +29,7 @@ 0, 0, 128, - 193 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_shift_logical_right_with_overflow.json b/pvm/programs/inst_shift_logical_right_with_overflow.json index 43b2e34..b1282b0 100644 --- a/pvm/programs/inst_shift_logical_right_with_overflow.json +++ b/pvm/programs/inst_shift_logical_right_with_overflow.json @@ -26,7 +26,7 @@ 51, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_store_u16.json b/pvm/programs/inst_store_u16.json index 4f472fa..4280fdc 100644 --- a/pvm/programs/inst_store_u16.json +++ b/pvm/programs/inst_store_u16.json @@ -34,7 +34,7 @@ 0, 0, 2, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_store_u32.json b/pvm/programs/inst_store_u32.json index 5389b54..426208b 100644 --- a/pvm/programs/inst_store_u32.json +++ b/pvm/programs/inst_store_u32.json @@ -34,7 +34,7 @@ 0, 0, 2, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_store_u8.json b/pvm/programs/inst_store_u8.json index c0cff51..55f7f54 100644 --- a/pvm/programs/inst_store_u8.json +++ b/pvm/programs/inst_store_u8.json @@ -34,7 +34,7 @@ 0, 0, 2, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_store_u8_trap_inaccessible.json b/pvm/programs/inst_store_u8_trap_inaccessible.json index 6d878bd..60fc614 100644 --- a/pvm/programs/inst_store_u8_trap_inaccessible.json +++ b/pvm/programs/inst_store_u8_trap_inaccessible.json @@ -28,7 +28,7 @@ 0, 0, 2, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_store_u8_trap_read_only.json b/pvm/programs/inst_store_u8_trap_read_only.json index 7051087..f57cc9c 100644 --- a/pvm/programs/inst_store_u8_trap_read_only.json +++ b/pvm/programs/inst_store_u8_trap_read_only.json @@ -34,7 +34,7 @@ 0, 0, 1, - 225 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_sub.json b/pvm/programs/inst_sub.json index 448f588..d36a8d4 100644 --- a/pvm/programs/inst_sub.json +++ b/pvm/programs/inst_sub.json @@ -26,7 +26,7 @@ 20, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_sub_imm.json b/pvm/programs/inst_sub_imm.json index 7e0736f..70a083b 100644 --- a/pvm/programs/inst_sub_imm.json +++ b/pvm/programs/inst_sub_imm.json @@ -26,7 +26,7 @@ 2, 121, 255, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_sub_with_overflow.json b/pvm/programs/inst_sub_with_overflow.json index f419608..cee8c9e 100644 --- a/pvm/programs/inst_sub_with_overflow.json +++ b/pvm/programs/inst_sub_with_overflow.json @@ -26,7 +26,7 @@ 20, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_trap.json b/pvm/programs/inst_trap.json index a8e35e4..e0596ac 100644 --- a/pvm/programs/inst_trap.json +++ b/pvm/programs/inst_trap.json @@ -24,7 +24,7 @@ 0, 1, 0, - 255 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_xor.json b/pvm/programs/inst_xor.json index 6d6bc2a..849a20d 100644 --- a/pvm/programs/inst_xor.json +++ b/pvm/programs/inst_xor.json @@ -26,7 +26,7 @@ 28, 135, 9, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ diff --git a/pvm/programs/inst_xor_imm.json b/pvm/programs/inst_xor_imm.json index 85d482e..10518ca 100644 --- a/pvm/programs/inst_xor_imm.json +++ b/pvm/programs/inst_xor_imm.json @@ -26,7 +26,7 @@ 31, 121, 3, - 249 + 1 ], "expected-status": "trap", "expected-regs": [ From fb4de8a695ba19405b1971bcd27e388c0e7bae99 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 10:49:43 +0000 Subject: [PATCH 16/21] PVM tests v0.2: `inst_rem_signed`: make output non-zero --- pvm/TESTCASES.md | 5 ++++- pvm/programs/inst_rem_signed.json | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 96199cf..8941491 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -1323,7 +1323,7 @@ Gas consumed: 10000 -> 9998 ## inst_rem_signed Initial non-zero registers: - * r7 = 0x80000010 + * r7 = 0x80000011 * r8 = 0x7 ``` @@ -1332,6 +1332,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0xfffffffa (initially was 0x0) + Program should end with: trap Final value of the program counter: 3 diff --git a/pvm/programs/inst_rem_signed.json b/pvm/programs/inst_rem_signed.json index 3b18ec7..50b2be5 100644 --- a/pvm/programs/inst_rem_signed.json +++ b/pvm/programs/inst_rem_signed.json @@ -8,7 +8,7 @@ 0, 0, 0, - 2147483664, + 2147483665, 7, 0, 0, @@ -37,9 +37,9 @@ 0, 0, 0, - 2147483664, + 2147483665, 7, - 0, + 4294967290, 0, 0, 0 From fa6cf0aecfe8c1944dc9a0f408376a9589ed8758 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 12:05:54 +0000 Subject: [PATCH 17/21] PVM tests v0.2: `inst_rem_signed_with_overflow`: non-zero initial value of reg --- pvm/TESTCASES.md | 4 ++++ pvm/programs/inst_rem_signed_with_overflow.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 8941491..d13ab6d 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -1368,6 +1368,7 @@ Gas consumed: 10000 -> 9998 Initial non-zero registers: * r7 = 0x80000000 * r8 = 0xffffffff + * r9 = 0xdeadbeef ``` : @0 @@ -1375,6 +1376,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 diff --git a/pvm/programs/inst_rem_signed_with_overflow.json b/pvm/programs/inst_rem_signed_with_overflow.json index 0aa799f..9d8a299 100644 --- a/pvm/programs/inst_rem_signed_with_overflow.json +++ b/pvm/programs/inst_rem_signed_with_overflow.json @@ -10,7 +10,7 @@ 0, 2147483648, 4294967295, - 0, + 3735928559, 0, 0, 0 From 83596b55c02f22f7b6754579342d3577e7e91326 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 12:07:41 +0000 Subject: [PATCH 18/21] PVM tests v0.2: `inst_set_*`: non-zero initial value of output reg --- pvm/TESTCASES.md | 24 +++++++++++++++++++ .../inst_set_greater_than_signed_imm_0.json | 2 +- .../inst_set_greater_than_unsigned_imm_0.json | 2 +- pvm/programs/inst_set_less_than_signed_0.json | 2 +- .../inst_set_less_than_signed_imm_0.json | 2 +- .../inst_set_less_than_unsigned_0.json | 2 +- .../inst_set_less_than_unsigned_imm_0.json | 2 +- 7 files changed, 30 insertions(+), 6 deletions(-) diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index d13ab6d..f1c5a77 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -1486,6 +1486,7 @@ Gas consumed: 10000 -> 9999 Initial non-zero registers: * r7 = 0xfffffff6 + * r9 = 0xdeadbeef ``` : @0 @@ -1493,6 +1494,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 @@ -1525,6 +1529,7 @@ Gas consumed: 10000 -> 9998 Initial non-zero registers: * r7 = 0xa + * r9 = 0xdeadbeef ``` : @0 @@ -1532,6 +1537,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 @@ -1565,6 +1573,7 @@ Gas consumed: 10000 -> 9998 Initial non-zero registers: * r7 = 0xa * r8 = 0xfffffff6 + * r9 = 0xdeadbeef ``` : @0 @@ -1572,6 +1581,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 @@ -1605,6 +1617,7 @@ Gas consumed: 10000 -> 9998 Initial non-zero registers: * r7 = 0xa + * r9 = 0xdeadbeef ``` : @0 @@ -1612,6 +1625,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 @@ -1645,6 +1661,7 @@ Gas consumed: 10000 -> 9998 Initial non-zero registers: * r7 = 0xfffffff6 * r8 = 0xa + * r9 = 0xdeadbeef ``` : @0 @@ -1652,6 +1669,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 @@ -1685,6 +1705,7 @@ Gas consumed: 10000 -> 9998 Initial non-zero registers: * r7 = 0xfffffff6 + * r9 = 0xdeadbeef ``` : @0 @@ -1692,6 +1713,9 @@ Initial non-zero registers: 3: invalid ``` +Registers after execution (only changed registers): + * r9 = 0x0 (initially was 0xdeadbeef) + Program should end with: trap Final value of the program counter: 3 diff --git a/pvm/programs/inst_set_greater_than_signed_imm_0.json b/pvm/programs/inst_set_greater_than_signed_imm_0.json index 7470911..e4b6ac6 100644 --- a/pvm/programs/inst_set_greater_than_signed_imm_0.json +++ b/pvm/programs/inst_set_greater_than_signed_imm_0.json @@ -10,7 +10,7 @@ 0, 4294967286, 0, - 0, + 3735928559, 0, 0, 0 diff --git a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json index ea93004..d8ca37c 100644 --- a/pvm/programs/inst_set_greater_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_greater_than_unsigned_imm_0.json @@ -10,7 +10,7 @@ 0, 10, 0, - 0, + 3735928559, 0, 0, 0 diff --git a/pvm/programs/inst_set_less_than_signed_0.json b/pvm/programs/inst_set_less_than_signed_0.json index c7f9193..d8eccb6 100644 --- a/pvm/programs/inst_set_less_than_signed_0.json +++ b/pvm/programs/inst_set_less_than_signed_0.json @@ -10,7 +10,7 @@ 0, 10, 4294967286, - 0, + 3735928559, 0, 0, 0 diff --git a/pvm/programs/inst_set_less_than_signed_imm_0.json b/pvm/programs/inst_set_less_than_signed_imm_0.json index ba98506..4b98b94 100644 --- a/pvm/programs/inst_set_less_than_signed_imm_0.json +++ b/pvm/programs/inst_set_less_than_signed_imm_0.json @@ -10,7 +10,7 @@ 0, 10, 0, - 0, + 3735928559, 0, 0, 0 diff --git a/pvm/programs/inst_set_less_than_unsigned_0.json b/pvm/programs/inst_set_less_than_unsigned_0.json index 59c0dbd..98ce7ab 100644 --- a/pvm/programs/inst_set_less_than_unsigned_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_0.json @@ -10,7 +10,7 @@ 0, 4294967286, 10, - 0, + 3735928559, 0, 0, 0 diff --git a/pvm/programs/inst_set_less_than_unsigned_imm_0.json b/pvm/programs/inst_set_less_than_unsigned_imm_0.json index ca38fd9..e7b8bd6 100644 --- a/pvm/programs/inst_set_less_than_unsigned_imm_0.json +++ b/pvm/programs/inst_set_less_than_unsigned_imm_0.json @@ -10,7 +10,7 @@ 0, 4294967286, 0, - 0, + 3735928559, 0, 0, 0 From 51e134ec1b46a481cf0f91884804e08eed9c464a Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 12:24:09 +0000 Subject: [PATCH 19/21] PVM tests v0.2: add more load/store tests --- pvm/TESTCASES.md | 480 ++++++++++++++++++ pvm/programs/inst_load_i16.json | 74 +++ pvm/programs/inst_load_i8.json | 72 +++ pvm/programs/inst_load_imm_and_jump.json | 60 +++ .../inst_load_indirect_i16_with_offset.json | 76 +++ ...inst_load_indirect_i16_without_offset.json | 75 +++ .../inst_load_indirect_i8_with_offset.json | 76 +++ .../inst_load_indirect_i8_without_offset.json | 75 +++ .../inst_load_indirect_u16_with_offset.json | 76 +++ ...inst_load_indirect_u16_without_offset.json | 75 +++ .../inst_load_indirect_u32_with_offset.json | 78 +++ ...inst_load_indirect_u32_without_offset.json | 75 +++ .../inst_load_indirect_u8_with_offset.json | 76 +++ .../inst_load_indirect_u8_without_offset.json | 75 +++ pvm/programs/inst_load_u16.json | 78 +++ pvm/programs/inst_load_u32.json | 78 +++ pvm/programs/inst_store_imm_u16.json | 68 +++ pvm/programs/inst_store_imm_u32.json | 73 +++ pvm/programs/inst_store_imm_u8.json | 66 +++ 19 files changed, 1806 insertions(+) create mode 100644 pvm/programs/inst_load_i16.json create mode 100644 pvm/programs/inst_load_i8.json create mode 100644 pvm/programs/inst_load_imm_and_jump.json create mode 100644 pvm/programs/inst_load_indirect_i16_with_offset.json create mode 100644 pvm/programs/inst_load_indirect_i16_without_offset.json create mode 100644 pvm/programs/inst_load_indirect_i8_with_offset.json create mode 100644 pvm/programs/inst_load_indirect_i8_without_offset.json create mode 100644 pvm/programs/inst_load_indirect_u16_with_offset.json create mode 100644 pvm/programs/inst_load_indirect_u16_without_offset.json create mode 100644 pvm/programs/inst_load_indirect_u32_with_offset.json create mode 100644 pvm/programs/inst_load_indirect_u32_without_offset.json create mode 100644 pvm/programs/inst_load_indirect_u8_with_offset.json create mode 100644 pvm/programs/inst_load_indirect_u8_without_offset.json create mode 100644 pvm/programs/inst_load_u16.json create mode 100644 pvm/programs/inst_load_u32.json create mode 100644 pvm/programs/inst_store_imm_u16.json create mode 100644 pvm/programs/inst_store_imm_u32.json create mode 100644 pvm/programs/inst_store_imm_u8.json diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index f1c5a77..5d48545 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -1133,6 +1133,58 @@ Final value of the program counter: 13 Gas consumed: 10000 -> 9996 +## inst_load_i16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20002 (0x2 bytes) = [0x81, 0x82] + +``` + : @0 + 0: 42 07 00 00 02 r7 = i16 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xffff8281 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_load_i8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20001 (0x1 bytes) = [0x81] + +``` + : @0 + 0: 4a 07 00 00 02 r7 = i8 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0xffffff81 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + ## inst_load_imm ``` @@ -1151,6 +1203,371 @@ Final value of the program counter: 6 Gas consumed: 10000 -> 9998 +## inst_load_imm_and_jump + +``` + : @0 + 0: 06 27 d2 04 06 r7 = 1234, jump 6 + : @1 + 5: 00 trap + : @2 + 6: 04 08 ef be ad de r8 = 0xdeadbeef + 12: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x4d2 (initially was 0x0) + * r8 = 0xdeadbeef (initially was 0x0) + +Program should end with: trap + +Final value of the program counter: 12 + +Gas consumed: 10000 -> 9997 + + +## inst_load_indirect_i16_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 21 78 01 r8 = i16 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffff8382 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_i16_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 21 78 r8 = i16 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffff8281 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_i8_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 15 78 01 r8 = i8 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffffff82 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_i8_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x81, 0x82, 0x83, 0x84] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 15 78 r8 = i8 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0xffffff81 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u16_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 25 78 01 r8 = u16 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x5634 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u16_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 25 78 r8 = u16 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x3412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u32_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20005 (0x5 bytes) = [0x12, 0x34, 0x56, 0x78, 0x9a] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 01 78 01 r8 = u32 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x9a785634 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u32_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 01 78 r8 = u32 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x78563412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u8_with_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 0b 78 01 r8 = u8 [r7 + 1] + 3: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x34 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 3 + +Gas consumed: 10000 -> 9998 + + +## inst_load_indirect_u8_without_offset + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +Initial non-zero registers: + * r7 = 0x20000 + +``` + : @0 + 0: 0b 78 r8 = u8 [r7 + 0] + 2: invalid +``` + +Registers after execution (only changed registers): + * r8 = 0x12 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 2 + +Gas consumed: 10000 -> 9998 + + +## inst_load_u16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +``` + : @0 + 0: 4c 07 00 00 02 r7 = u16 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x3412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + +## inst_load_u32 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +Initial non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x12, 0x34, 0x56, 0x78] + +``` + : @0 + 0: 0a 07 00 00 02 r7 = u32 [0x20000] + 5: invalid +``` + +Registers after execution (only changed registers): + * r7 = 0x78563412 (initially was 0x0) + +The memory contents after execution should be unchanged. + +Program should end with: trap + +Final value of the program counter: 5 + +Gas consumed: 10000 -> 9998 + + ## inst_load_u8 Initial page map: @@ -2002,6 +2419,69 @@ Final value of the program counter: 3 Gas consumed: 10000 -> 9998 +## inst_store_imm_u16 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +``` + : @0 + 0: 4f 03 00 00 02 34 12 u16 [0x20000] = 4660 + 7: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20002 (0x2 bytes) = [0x34, 0x12] + +Program should end with: trap + +Final value of the program counter: 7 + +Gas consumed: 10000 -> 9998 + + +## inst_store_imm_u32 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +``` + : @0 + 0: 26 03 00 00 02 78 56 34 12 u32 [0x20000] = 305419896 + 9: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20004 (0x4 bytes) = [0x78, 0x56, 0x34, 0x12] + +Program should end with: trap + +Final value of the program counter: 9 + +Gas consumed: 10000 -> 9998 + + +## inst_store_imm_u8 + +Initial page map: + * RW: 0x20000-0x21000 (0x1000 bytes) + +``` + : @0 + 0: 3e 03 00 00 02 12 u8 [0x20000] = 18 + 6: invalid +``` + +Final non-zero memory chunks: + * 0x20000-0x20001 (0x1 bytes) = [0x12] + +Program should end with: trap + +Final value of the program counter: 6 + +Gas consumed: 10000 -> 9998 + + ## inst_store_u16 Initial page map: diff --git a/pvm/programs/inst_load_i16.json b/pvm/programs/inst_load_i16.json new file mode 100644 index 0000000..51309dc --- /dev/null +++ b/pvm/programs/inst_load_i16.json @@ -0,0 +1,74 @@ +{ + "name": "inst_load_i16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 66, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294935169, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_i8.json b/pvm/programs/inst_load_i8.json new file mode 100644 index 0000000..ed89e35 --- /dev/null +++ b/pvm/programs/inst_load_i8.json @@ -0,0 +1,72 @@ +{ + "name": "inst_load_i8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 74, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4294967169, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_imm_and_jump.json b/pvm/programs/inst_load_imm_and_jump.json new file mode 100644 index 0000000..9bf6cb0 --- /dev/null +++ b/pvm/programs/inst_load_imm_and_jump.json @@ -0,0 +1,60 @@ +{ + "name": "inst_load_imm_and_jump", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 12, + 6, + 39, + 210, + 4, + 6, + 0, + 4, + 8, + 239, + 190, + 173, + 222, + 97, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1234, + 3735928559, + 0, + 0, + 0, + 0 + ], + "expected-pc": 12, + "expected-memory": [], + "expected-gas": 9997 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i16_with_offset.json b/pvm/programs/inst_load_indirect_i16_with_offset.json new file mode 100644 index 0000000..2b8997e --- /dev/null +++ b/pvm/programs/inst_load_indirect_i16_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_i16_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 33, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294935426, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i16_without_offset.json b/pvm/programs/inst_load_indirect_i16_without_offset.json new file mode 100644 index 0000000..176c99e --- /dev/null +++ b/pvm/programs/inst_load_indirect_i16_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_i16_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 33, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294935169, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i8_with_offset.json b/pvm/programs/inst_load_indirect_i8_with_offset.json new file mode 100644 index 0000000..2b730c2 --- /dev/null +++ b/pvm/programs/inst_load_indirect_i8_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_i8_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 21, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294967170, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_i8_without_offset.json b/pvm/programs/inst_load_indirect_i8_without_offset.json new file mode 100644 index 0000000..de51b94 --- /dev/null +++ b/pvm/programs/inst_load_indirect_i8_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_i8_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 21, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 4294967169, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 129, + 130, + 131, + 132 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u16_with_offset.json b/pvm/programs/inst_load_indirect_u16_with_offset.json new file mode 100644 index 0000000..ac74af1 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u16_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_u16_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 37, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 22068, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u16_without_offset.json b/pvm/programs/inst_load_indirect_u16_without_offset.json new file mode 100644 index 0000000..f65347f --- /dev/null +++ b/pvm/programs/inst_load_indirect_u16_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_u16_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 37, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 13330, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u32_with_offset.json b/pvm/programs/inst_load_indirect_u32_with_offset.json new file mode 100644 index 0000000..c145cbf --- /dev/null +++ b/pvm/programs/inst_load_indirect_u32_with_offset.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_indirect_u32_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120, + 154 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 1, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 2591577652, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120, + 154 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u32_without_offset.json b/pvm/programs/inst_load_indirect_u32_without_offset.json new file mode 100644 index 0000000..dbaae37 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u32_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_u32_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 1, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 2018915346, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u8_with_offset.json b/pvm/programs/inst_load_indirect_u8_with_offset.json new file mode 100644 index 0000000..8c6ac79 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u8_with_offset.json @@ -0,0 +1,76 @@ +{ + "name": "inst_load_indirect_u8_with_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 3, + 11, + 120, + 1, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 52, + 0, + 0, + 0, + 0 + ], + "expected-pc": 3, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_indirect_u8_without_offset.json b/pvm/programs/inst_load_indirect_u8_without_offset.json new file mode 100644 index 0000000..19b1320 --- /dev/null +++ b/pvm/programs/inst_load_indirect_u8_without_offset.json @@ -0,0 +1,75 @@ +{ + "name": "inst_load_indirect_u8_without_offset", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 2, + 11, + 120, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 131072, + 18, + 0, + 0, + 0, + 0 + ], + "expected-pc": 2, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_u16.json b/pvm/programs/inst_load_u16.json new file mode 100644 index 0000000..b23b07d --- /dev/null +++ b/pvm/programs/inst_load_u16.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_u16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 76, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 13330, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_load_u32.json b/pvm/programs/inst_load_u32.json new file mode 100644 index 0000000..fdc97b8 --- /dev/null +++ b/pvm/programs/inst_load_u32.json @@ -0,0 +1,78 @@ +{ + "name": "inst_load_u32", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "initial-gas": 10000, + "program": [ + 0, + 0, + 5, + 10, + 7, + 0, + 0, + 2, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2018915346, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 5, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18, + 52, + 86, + 120 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_imm_u16.json b/pvm/programs/inst_store_imm_u16.json new file mode 100644 index 0000000..578f638 --- /dev/null +++ b/pvm/programs/inst_store_imm_u16.json @@ -0,0 +1,68 @@ +{ + "name": "inst_store_imm_u16", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 7, + 79, + 3, + 0, + 0, + 2, + 52, + 18, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 7, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 52, + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_imm_u32.json b/pvm/programs/inst_store_imm_u32.json new file mode 100644 index 0000000..45cb1c3 --- /dev/null +++ b/pvm/programs/inst_store_imm_u32.json @@ -0,0 +1,73 @@ +{ + "name": "inst_store_imm_u32", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 9, + 38, + 3, + 0, + 0, + 2, + 120, + 86, + 52, + 18, + 1, + 0 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 9, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 120, + 86, + 52, + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file diff --git a/pvm/programs/inst_store_imm_u8.json b/pvm/programs/inst_store_imm_u8.json new file mode 100644 index 0000000..4ffc628 --- /dev/null +++ b/pvm/programs/inst_store_imm_u8.json @@ -0,0 +1,66 @@ +{ + "name": "inst_store_imm_u8", + "initial-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "initial-pc": 0, + "initial-page-map": [ + { + "address": 131072, + "length": 4096, + "is-writable": true + } + ], + "initial-memory": [], + "initial-gas": 10000, + "program": [ + 0, + 0, + 6, + 62, + 3, + 0, + 0, + 2, + 18, + 1 + ], + "expected-status": "trap", + "expected-regs": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "expected-pc": 6, + "expected-memory": [ + { + "address": 131072, + "contents": [ + 18 + ] + } + ], + "expected-gas": 9998 +} \ No newline at end of file From 30ba85a4cd5f3ecf8003afbc89242b40fb5adc92 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Fri, 4 Oct 2024 12:25:45 +0000 Subject: [PATCH 20/21] PVM tests v0.2: update README --- pvm/README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pvm/README.md b/pvm/README.md index ad9067e..ef24a41 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -24,6 +24,43 @@ See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test ## Changelog +### v0.2 + + * Bitmask paddings are now filled with zeros, in alignment with the GP. + * Disassemblies now end with an `invalid` instruction to signify places where + the execution traps when going out of bounds. This is a purely cosmetic change + to the reference disassemblies and doesn't affect the test vectors themselves. + * The `inst_rem_signed` test was changed to make the output value non-zero. + (The behavior is unchanged; the instruction still works the same as before.) + * Set the initial value of the output register to a non-zero for the following tests: + (The behavior is unchanged; the instructions still work the same as before.) + - `inst_rem_signed_with_overflow` + - `inst_set_greater_than_signed_imm_0` + - `inst_set_greater_than_unsigned_imm_0`, + - `inst_set_less_than_signed_0` + - `inst_set_less_than_signed_imm_0` + - `inst_set_less_than_unsigned_0`, + - `inst_set_less_than_unsigned_imm_0` + * Add new tests: + - `inst_load_i16` + - `inst_load_i8` + - `inst_load_imm_and_jump` + - `inst_load_indirect_i16_with_offset` + - `inst_load_indirect_i16_without_offset` + - `inst_load_indirect_i8_with_offset` + - `inst_load_indirect_i8_without_offset` + - `inst_load_indirect_u16_with_offset` + - `inst_load_indirect_u16_without_offset` + - `inst_load_indirect_u32_with_offset` + - `inst_load_indirect_u32_without_offset` + - `inst_load_indirect_u8_with_offset` + - `inst_load_indirect_u8_without_offset` + - `inst_load_u16` + - `inst_load_u32` + - `inst_store_imm_u16` + - `inst_store_imm_u32` + - `inst_store_imm_u8` + ### v0.1 * Initial test vectors. From a54d7cf22ad90211f516f0525b05cf297e62546a Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Thu, 10 Oct 2024 20:45:38 +0000 Subject: [PATCH 21/21] PVM tests v0.3: remove tests which expose gas precharging --- pvm/README.md | 9 ++- pvm/TESTCASES.md | 54 ----------------- pvm/programs/inst_load_u8_trap.json | 52 ----------------- .../inst_store_u8_trap_inaccessible.json | 52 ----------------- .../inst_store_u8_trap_read_only.json | 58 ------------------- 5 files changed, 8 insertions(+), 217 deletions(-) delete mode 100644 pvm/programs/inst_load_u8_trap.json delete mode 100644 pvm/programs/inst_store_u8_trap_inaccessible.json delete mode 100644 pvm/programs/inst_store_u8_trap_read_only.json diff --git a/pvm/README.md b/pvm/README.md index ef24a41..ea75a72 100644 --- a/pvm/README.md +++ b/pvm/README.md @@ -1,4 +1,4 @@ -# PVM Test Vectors, version 0.1 +# PVM Test Vectors, version 0.3 ## How to use this @@ -24,6 +24,13 @@ See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test ## Changelog +### v0.3 + + * Removed tests which were testing gas behavior that is not yet described in the GP: + - `inst_load_u8_trap.json`, + - `inst_store_u8_trap_inaccessible` + - `inst_store_u8_trap_read_only` + ### v0.2 * Bitmask paddings are now filled with zeros, in alignment with the GP. diff --git a/pvm/TESTCASES.md b/pvm/TESTCASES.md index 5d48545..eec4ffc 100644 --- a/pvm/TESTCASES.md +++ b/pvm/TESTCASES.md @@ -1594,21 +1594,6 @@ Final value of the program counter: 5 Gas consumed: 10000 -> 9998 -## inst_load_u8_trap - -``` - : @0 - 0: 3c 07 00 00 02 r7 = u8 [0x20000] - 5: invalid -``` - -Program should end with: trap - -Final value of the program counter: 0 - -Gas consumed: 10000 -> 9998 - - ## inst_move_reg Initial non-zero registers: @@ -2554,45 +2539,6 @@ Final value of the program counter: 5 Gas consumed: 10000 -> 9998 -## inst_store_u8_trap_inaccessible - -Initial non-zero registers: - * r7 = 0x12345678 - -``` - : @0 - 0: 47 07 00 00 02 u8 [0x20000] = r7 - 5: invalid -``` - -Program should end with: trap - -Final value of the program counter: 0 - -Gas consumed: 10000 -> 9998 - - -## inst_store_u8_trap_read_only - -Initial page map: - * RO: 0x10000-0x11000 (0x1000 bytes) - -Initial non-zero registers: - * r7 = 0x12345678 - -``` - : @0 - 0: 47 07 00 00 01 u8 [0x10000] = r7 - 5: invalid -``` - -Program should end with: trap - -Final value of the program counter: 0 - -Gas consumed: 10000 -> 9998 - - ## inst_sub Initial non-zero registers: diff --git a/pvm/programs/inst_load_u8_trap.json b/pvm/programs/inst_load_u8_trap.json deleted file mode 100644 index bda3c09..0000000 --- a/pvm/programs/inst_load_u8_trap.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "inst_load_u8_trap", - "initial-regs": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "initial-pc": 0, - "initial-page-map": [], - "initial-memory": [], - "initial-gas": 10000, - "program": [ - 0, - 0, - 5, - 60, - 7, - 0, - 0, - 2, - 1 - ], - "expected-status": "trap", - "expected-regs": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "expected-pc": 0, - "expected-memory": [], - "expected-gas": 9998 -} \ No newline at end of file diff --git a/pvm/programs/inst_store_u8_trap_inaccessible.json b/pvm/programs/inst_store_u8_trap_inaccessible.json deleted file mode 100644 index 60fc614..0000000 --- a/pvm/programs/inst_store_u8_trap_inaccessible.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "inst_store_u8_trap_inaccessible", - "initial-regs": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 305419896, - 0, - 0, - 0, - 0, - 0 - ], - "initial-pc": 0, - "initial-page-map": [], - "initial-memory": [], - "initial-gas": 10000, - "program": [ - 0, - 0, - 5, - 71, - 7, - 0, - 0, - 2, - 1 - ], - "expected-status": "trap", - "expected-regs": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 305419896, - 0, - 0, - 0, - 0, - 0 - ], - "expected-pc": 0, - "expected-memory": [], - "expected-gas": 9998 -} \ No newline at end of file diff --git a/pvm/programs/inst_store_u8_trap_read_only.json b/pvm/programs/inst_store_u8_trap_read_only.json deleted file mode 100644 index f57cc9c..0000000 --- a/pvm/programs/inst_store_u8_trap_read_only.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "inst_store_u8_trap_read_only", - "initial-regs": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 305419896, - 0, - 0, - 0, - 0, - 0 - ], - "initial-pc": 0, - "initial-page-map": [ - { - "address": 65536, - "length": 4096, - "is-writable": false - } - ], - "initial-memory": [], - "initial-gas": 10000, - "program": [ - 0, - 0, - 5, - 71, - 7, - 0, - 0, - 1, - 1 - ], - "expected-status": "trap", - "expected-regs": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 305419896, - 0, - 0, - 0, - 0, - 0 - ], - "expected-pc": 0, - "expected-memory": [], - "expected-gas": 9998 -} \ No newline at end of file