You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement basic support for running Miri with GenMC.
- Implement memory allocation compatible with GenMC.
- Extract address generator struct from Miri's allocator.
- Support thread creation and joining.
- Support atomic load and store.
- Support scheduling through GenMC.
- Add tests for GenMC mode.
- Add clang-format file for C++ code in Miri.
- Update genmc-sys crate license to MIT/Apache to match GenMC dependency.
- Add documentation for GenMC mode.
Note: this commit depends on changes to GenMC not yet upstreamed to its official repository.
Co-authored-by: Ralf Jung <[email protected]>
Copy file name to clipboardExpand all lines: doc/genmc.md
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,7 @@ Miri-GenMC integrates that model checker into Miri.
9
9
10
10
## Usage
11
11
12
-
**IMPORTANT: The license of GenMC and thus the `genmc-sys` crate in the Miri repo is currently "GPL-3.0-or-later", so a binary produced with the `genmc` feature is subject to the requirements of the GPL. As long as that remains the case, the `genmc` feature of Miri is OFF-BY-DEFAULT and must be OFF for all Miri releases.**
13
-
14
-
For testing/developing Miri-GenMC (while keeping in mind the licensing issues):
12
+
For testing/developing Miri-GenMC:
15
13
- clone the Miri repo.
16
14
- build Miri-GenMC with `./miri build --features=genmc`.
17
15
- OR: install Miri-GenMC in the current system with `./miri install --features=genmc`
@@ -21,6 +19,21 @@ Basic usage:
21
19
MIRIFLAGS="-Zmiri-genmc" cargo miri run
22
20
```
23
21
22
+
Note that `cargo miri test` in GenMC mode is currently not supported.
23
+
24
+
### Supported Parameters
25
+
26
+
-`-Zmiri-genmc`: Enable GenMC mode (not required if any other GenMC options are used).
27
+
-`-Zmiri-genmc-log=LOG_LEVEL`: Change the log level for GenMC. Default: `warning`.
28
+
-`quiet`: Disable logging.
29
+
-`error`: Print errors.
30
+
-`warning`: Print errors and warnings.
31
+
-`tip`: Print errors, warnings and tips.
32
+
- If Miri is built with debug assertions, there are additional log levels available (downgraded to `tip` without debug assertions):
33
+
-`debug1`: Print revisits considered by GenMC.
34
+
-`debug2`: Print the execution graph after every memory access.
35
+
-`debug3`: Print reads-from values considered by GenMC.
36
+
24
37
<!-- FIXME(genmc): explain options. -->
25
38
26
39
<!-- FIXME(genmc): explain Miri-GenMC specific functions. -->
@@ -57,6 +70,15 @@ The process for obtaining them is as follows:
57
70
If you place this directory inside the Miri folder, it is recommended to call it `genmc-src` as that tells `./miri fmt` to avoid
58
71
formatting the Rust files inside that folder.
59
72
73
+
### Formatting the C++ code
74
+
75
+
For formatting the C++ code we provide a `.clang-format` file in the `genmc-sys` directory.
76
+
With `clang-format` installed, run this command to format the c++ files (replace the `-i` with `--dry-run` to just see the changes.):
0 commit comments