-
Notifications
You must be signed in to change notification settings - Fork 1
Generating input
Matt Windsor edited this page Nov 13, 2018
·
3 revisions
act expects a certain format of input; this page gives tips on how to generate it.
Refer also to the list of supported architectures.
act makes the following assumptions about the assembly:
- The assembly file contains a contiguous run of subprogram code where each subprogram starts with a label
containing either
Pn(wherenis a non-negative number), or a label thatactcan recognise as a compiler-mangled form ofPn(eg_P0); - All subroutine calls and returns can be ignored;
- All stack pointer manipulations can be ignored (though
actwill generally translate stack locations to symbolic heap locations, assuming that each stack offset corresponds to a single and unique location for each thread); - All directives can be ignored.
To get the right assembly input, the C input should follow a specific format:
- The C file should contain several functions of the form
void Pn() { /* ... */ }, where the only function calls are to<stdatomic.h>atomic actions; - All variables should be global, in the form
tXrY(whereXis the program number andYis a number unique within threadX); - Any other code (for example,
mainmethods and thread running harnesses) should be conditionally compiled (andacttold not to compile it, through compiler flags).
The test command expects, as input, a directory containing:
- a
C/directory containing*.cfiles (as above); - a
litmus/directory containing, for eachX.cin the above, a corresponding C11 litmus test with the nameX.litmus.
This deliberately follows the structure of memalloy results output (see below).
Recent versions of the dev branch of memalloy produce the format act needs. An example invocation that gives useful output is:
./comparator -arch C -violates models/c11_lahav.cat -satisfies models/c11_normws.cat -events 4 -iter
(Note that the default Herd model is weaker than c11_lahav, and thus produces some false positives. A Herd7 compatible version of c11_lahav is forthcoming.)