-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[diy7] C code generation #905
Comments
Hi @hernanponcedeleon, you can use "annotations" that specify atomic accesses. For instance:
For diy7, you have to specify a lists of edges. The most convenient way to do so is writing configuration files. Typically:
Finally, notice that one can list all available annotations with the option
|
Thanks @maranget for the pointer. What about rmw instructions? Is there any way of generating test cases using them or does diy7 only supports atomic loads/stores? |
There is some code to generate Exchange primitives. Unfortunately, it does not work... |
Can you please point me to this code? |
At the end of |
@maranget I just tried your branch, and it looks good. Thanks for the quick patch! Can you give me an example of how the Also, here is a patch (to be applied on top of bfef3ec) that adds an option to allow using I am also considering adding support for CASes (not yet sure if it makes much sense to add |
To generate exchanges with diy7 you can try this X.conf file:
As regards your patch I'll have a look. Further developments are probably more involved. I'd rather merge the simple fix of PR #907 before planning further improvements. To get an idea of the task, you can have a look at the various access-modify instructions of AArch64 which are generated by all thoses edges:
|
Hi @hernanponcedeleon, I had a look at your patch. I see that a specific command-line option commands that the |
Is it possible to generate real C code out of the .litmus file? |
Yes it is possible with litmus7. For instance, first build a test:
Then, assuming a C11 compiler and allocating four cores to the test, compile the test to C files:
Finally, compile and run the resulting program:
See litmus7 documentation for more. |
Super nice! Thank you. |
Tests generated by
diy7 -arch C
make use of fences, but not atomic load/store or rmw instructions.Is there a way to force diy7 to generate rmw and atomic memory accesses when the target arch is C?
The text was updated successfully, but these errors were encountered: