Skip to content

Commit 8a7b16c

Browse files
committed
doc: Improve readme
Signed-off-by: Diogo Behrens <[email protected]>
1 parent bcd8abd commit 8a7b16c

File tree

2 files changed

+74
-5
lines changed

2 files changed

+74
-5
lines changed

.github/workflows/actions.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
include: ${{ steps.include.outputs.changed }}
1616
verify: ${{ steps.verify.outputs.changed }}
1717
test: ${{ steps.test.outputs.changed }}
18+
markdown: ${{ steps.markdown.outputs.changed }}
1819
steps:
1920
- uses: dorny/paths-filter@v3
2021
id: include
@@ -33,7 +34,16 @@ jobs:
3334
with:
3435
filters: |
3536
changed:
36-
- 'verify/**'
37+
- 'verify/**.bpl'
38+
- 'verify/**.rs'
39+
- 'verify/**.sh'
40+
- 'verify/**.txt'
41+
- uses: dorny/paths-filter@v3
42+
id: markdown
43+
with:
44+
filters: |
45+
changed:
46+
- '**.md'
3747
- uses: dorny/paths-filter@v3
3848
id: test
3949
with:

README.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,73 @@ with a model checker such as [Dartagnan][] or [vsyncer][].
1010

1111
The atomics implementations are being gradually verified to comply with VMM. At
1212
the 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

1515
This 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
1917
research 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

2382
This project was initially developed under the support of

0 commit comments

Comments
 (0)