Skip to content

Commit d3a8f62

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

File tree

2 files changed

+78
-5
lines changed

2 files changed

+78
-5
lines changed

.github/workflows/actions.yml

Lines changed: 15 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,14 +34,27 @@ jobs:
3334
with:
3435
filters: |
3536
changed:
36-
- 'verify/**'
37+
- 'verify/**.bpl'
38+
- uses: dorny/paths-filter@v3
39+
id: markdown
40+
with:
41+
filters: |
42+
changed:
43+
- '**.md'
3744
- uses: dorny/paths-filter@v3
3845
id: test
3946
with:
4047
filters: |
4148
changed:
4249
- 'test/**'
4350
51+
print-changed:
52+
name: Print information about changed paths
53+
needs: changed
54+
runs-on: ubuntu-latest
55+
steps:
56+
- run: echo "${{ needs.changed.outputs.markdown }}"
57+
4458
test-install:
4559
strategy:
4660
matrix:

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)