@@ -10,14 +10,73 @@ with a model checker such as [Dartagnan][] or [vsyncer][].
1010
1111The atomics implementations are being gradually verified to comply with VMM. At
1212the moment, we have completed the verification of ARMv8 64-bits with and
13- without LSE instructions.
13+ without LSE instructions, and RISC-V using compiler builtins .
1414
1515This project is a spinoff of the VSync project and a key component in
16- [ libvsync] [ ] .
17-
18- Refer to our ASPLOS'21 [ publication] [ paper ] describing part of the
16+ [ libvsync] [ ] . Refer to our ASPLOS'21 [ publication] [ paper ] describing part of the
1917research effort put into this library.
2018
19+ ## Getting started
20+
21+ ``` sh
22+ cmake -S . -B build
23+ cmake --build build
24+ ctest --test-dir build --output-on-failure
25+ cmake --install build --prefix /desired/prefix
26+ ```
27+
28+ ` vatomic ` installs headers under ` include/vsync/ ` and a CMake package file,
29+ allowing downstream projects to simply ` find_package(vatomic CONFIG REQUIRED) `
30+ and link against the ` vatomic::vatomic ` interface target.
31+
32+ ### Using the C API
33+
34+ ``` c
35+ #include < vsync/atomic.h>
36+
37+ void example (void)
38+ {
39+ vatomic32_t counter;
40+ vatomic32_write_rlx(&counter, 0);
41+ vuint32_t old = vatomic32_add(&counter, 2);
42+ (void)old;
43+ }
44+ ```
45+
46+ ### Using the C++ API
47+
48+ ```c++
49+ #include <vsync/atomic.hpp>
50+
51+ void example()
52+ {
53+ vsync::atomic<int> counter{};
54+ counter.store(42, vsync::memory_order_relaxed);
55+ auto prev = counter.fetch_add(1);
56+ (void)prev;
57+ }
58+ ```
59+
60+ ## Testing and verification
61+
62+ Besides the unit tests (` ctest ` ) the repository ships a Boogie-based
63+ verification harness. To run it locally:
64+
65+ ``` sh
66+ cmake -S . -B build -DVATOMIC_DEV=ON
67+ cmake --build build --target build_boogie_lse
68+ ctest --test-dir build/verify -R lse --output-on-failure
69+ ```
70+
71+ Targets exist for ` lse ` , ` llsc ` , ` lxe ` , and ` no_polite_await ` . Refer to
72+ [ ` verify/README.md ` ] ( verify/README.md ) for dependency details.
73+
74+ ## Releases and support
75+
76+ Changes between versions are tracked in [ CHANGELOG.md] ( CHANGELOG.md ) . Issues
77+ and pull requests are welcome in this repository; please include details about
78+ the architecture, compiler, and toolchain you are using.
79+
2180## Acknowledgements
2281
2382This project was initially developed under the support of
0 commit comments