Skip to content

Commit f74c1c4

Browse files
committed
Merge branch 'master_pvm_initial'
2 parents 7037a03 + e231523 commit f74c1c4

File tree

314 files changed

+144707
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+144707
-0
lines changed

pvm/LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
The `programs/riscv_*` test files are licensed under the following terms:
2+
3+
Copyright (c) 2012-2015, The Regents of the University of California (Regents).
4+
All Rights Reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
1. Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
2. Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
3. Neither the name of the Regents nor the
14+
names of its contributors may be used to endorse or promote products
15+
derived from this software without specific prior written permission.
16+
17+
IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
18+
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
19+
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS
20+
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21+
22+
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24+
PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
25+
HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
26+
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

pvm/README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# PVM Test Vectors, version 0.4
2+
3+
## How to use this
4+
5+
The [`programs`](./programs) directory contains `.json` files, each containing a single test.
6+
7+
These are meant to test the PVM function Ψ from the Graypaper's Appendix A (equation 203 from v0.2.1 of the paper).
8+
9+
See [schema.asn](./schema.asn) for a human-readable schema of what each of the fields mean.
10+
11+
See [schema.json](./schema.json) for a JSON Schema.
12+
13+
See [TESTCASES.md](./TESTCASES.md) for a human-readable index of all of the test cases.
14+
15+
## TODO
16+
17+
* 100% instruction coverage
18+
* Tests for abnormal skip values for each instruction type
19+
* Tests involving host calls
20+
* Tests for invalid/malformed program blobs
21+
* More gas metering tests; proper gas cost model (current one is a placeholder)
22+
23+
## Changelog
24+
25+
### v0.4
26+
27+
* The tests now target 64-bit PVM, in alignment with GP 0.5.4.
28+
* The `trap` exit status is now called `panic` to align with the GP.
29+
* Added new exit status: `page-fault`; tests which previously panicked when accessing unpaged memory now generate page faults.
30+
* Added 106 new tests from the [RISC-V test suite](https://github.com/riscv-software-src/riscv-tests) transpiled into PVM.
31+
32+
### v0.3
33+
34+
* Removed tests which were testing gas behavior that is not yet described in the GP:
35+
- `inst_load_u8_trap`
36+
- `inst_store_u8_trap_inaccessible`
37+
- `inst_store_u8_trap_read_only`
38+
39+
### v0.2
40+
41+
* Bitmask paddings are now filled with zeros, in alignment with the GP.
42+
* Disassemblies now end with an `invalid` instruction to signify places where
43+
the execution traps when going out of bounds. This is a purely cosmetic change
44+
to the reference disassemblies and doesn't affect the test vectors themselves.
45+
* The `inst_rem_signed` test was changed to make the output value non-zero.
46+
(The behavior is unchanged; the instruction still works the same as before.)
47+
* Set the initial value of the output register to a non-zero for the following tests:
48+
(The behavior is unchanged; the instructions still work the same as before.)
49+
- `inst_rem_signed_with_overflow`
50+
- `inst_set_greater_than_signed_imm_0`
51+
- `inst_set_greater_than_unsigned_imm_0`,
52+
- `inst_set_less_than_signed_0`
53+
- `inst_set_less_than_signed_imm_0`
54+
- `inst_set_less_than_unsigned_0`,
55+
- `inst_set_less_than_unsigned_imm_0`
56+
* Add new tests:
57+
- `inst_load_i16`
58+
- `inst_load_i8`
59+
- `inst_load_imm_and_jump`
60+
- `inst_load_indirect_i16_with_offset`
61+
- `inst_load_indirect_i16_without_offset`
62+
- `inst_load_indirect_i8_with_offset`
63+
- `inst_load_indirect_i8_without_offset`
64+
- `inst_load_indirect_u16_with_offset`
65+
- `inst_load_indirect_u16_without_offset`
66+
- `inst_load_indirect_u32_with_offset`
67+
- `inst_load_indirect_u32_without_offset`
68+
- `inst_load_indirect_u8_with_offset`
69+
- `inst_load_indirect_u8_without_offset`
70+
- `inst_load_u16`
71+
- `inst_load_u32`
72+
- `inst_store_imm_u16`
73+
- `inst_store_imm_u32`
74+
- `inst_store_imm_u8`
75+
76+
### v0.1
77+
78+
* Initial test vectors.

0 commit comments

Comments
 (0)