Search in sources :

Example 31 with Event

use of com.dat3m.dartagnan.program.event.core.Event in project Dat3M by hernanponcedeleon.

the class SvcompProcedures method __VERIFIER_atomic.

public static void __VERIFIER_atomic(VisitorBoogie visitor, boolean begin) {
    Register register = visitor.programBuilder.getOrCreateRegister(visitor.threadCount, null, ARCH_PRECISION);
    MemoryObject lockAddress = visitor.programBuilder.getOrNewObject("__VERIFIER_atomic");
    Label label = visitor.programBuilder.getOrCreateLabel("END_OF_T" + visitor.threadCount);
    LinkedList<Event> events = new LinkedList<>();
    events.add(EventFactory.newLoad(register, lockAddress, null));
    events.add(EventFactory.newJump(new Atom(register, NEQ, begin ? IValue.ZERO : IValue.ONE), label));
    events.add(EventFactory.newStore(lockAddress, begin ? IValue.ONE : IValue.ZERO, null));
    for (Event e : events) {
        e.addFilters(Tag.C11.LOCK, Tag.RMW);
        visitor.programBuilder.addChild(visitor.threadCount, e);
    }
}
Also used : Register(com.dat3m.dartagnan.program.Register) MemoryObject(com.dat3m.dartagnan.program.memory.MemoryObject) Label(com.dat3m.dartagnan.program.event.core.Label) Event(com.dat3m.dartagnan.program.event.core.Event) LinkedList(java.util.LinkedList)

Example 32 with Event

use of com.dat3m.dartagnan.program.event.core.Event in project Dat3M by hernanponcedeleon.

the class Thread method updateExit.

public void updateExit(Event event) {
    exit = event;
    Event next = exit.getSuccessor();
    while (next != null) {
        exit = next;
        exit.setThread(this);
        next = next.getSuccessor();
    }
}
Also used : Event(com.dat3m.dartagnan.program.event.core.Event)

Example 33 with Event

use of com.dat3m.dartagnan.program.event.core.Event in project Dat3M by hernanponcedeleon.

the class VisitorBase method visitLock.

@Override
public List<Event> visitLock(Lock e) {
    Register resultRegister = e.getResultRegister();
    String mo = e.getMo();
    List<Event> events = eventSequence(newLoad(resultRegister, e.getAddress(), mo), newJump(new Atom(resultRegister, NEQ, IValue.ZERO), (Label) e.getThread().getExit()), newStore(e.getAddress(), IValue.ONE, mo));
    for (Event child : events) {
        child.addFilters(C11.LOCK, RMW);
    }
    return events;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Label(com.dat3m.dartagnan.program.event.core.Label) Event(com.dat3m.dartagnan.program.event.core.Event) Atom(com.dat3m.dartagnan.expression.Atom)

Example 34 with Event

use of com.dat3m.dartagnan.program.event.core.Event in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitReLoad.

@Override
public IExpr visitReLoad(LitmusCParser.ReLoadContext ctx) {
    Register register = getReturnRegister(true);
    Event event = EventFactory.newLoad(register, getAddress(ctx.address), ctx.mo);
    programBuilder.addChild(currentThread, event);
    return register;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event)

Example 35 with Event

use of com.dat3m.dartagnan.program.event.core.Event in project Dat3M by hernanponcedeleon.

the class VisitorLitmusC method visitReReadOnce.

@Override
public IExpr visitReReadOnce(LitmusCParser.ReReadOnceContext ctx) {
    Register register = getReturnRegister(true);
    Event event = EventFactory.newLoad(register, getAddress(ctx.address), ctx.mo);
    programBuilder.addChild(currentThread, event);
    return register;
}
Also used : Register(com.dat3m.dartagnan.program.Register) Event(com.dat3m.dartagnan.program.event.core.Event)

Aggregations

Event (com.dat3m.dartagnan.program.event.core.Event)104 Tuple (com.dat3m.dartagnan.wmm.utils.Tuple)34 Thread (com.dat3m.dartagnan.program.Thread)32 Register (com.dat3m.dartagnan.program.Register)25 TupleSet (com.dat3m.dartagnan.wmm.utils.TupleSet)25 MemEvent (com.dat3m.dartagnan.program.event.core.MemEvent)20 Tag (com.dat3m.dartagnan.program.event.Tag)16 Label (com.dat3m.dartagnan.program.event.core.Label)16 Collectors (java.util.stream.Collectors)16 BooleanFormula (org.sosy_lab.java_smt.api.BooleanFormula)16 BooleanFormulaManager (org.sosy_lab.java_smt.api.BooleanFormulaManager)16 LogManager (org.apache.logging.log4j.LogManager)15 Logger (org.apache.logging.log4j.Logger)15 Program (com.dat3m.dartagnan.program.Program)12 ExecutionAnalysis (com.dat3m.dartagnan.program.analysis.ExecutionAnalysis)12 RegWriter (com.dat3m.dartagnan.program.event.core.utils.RegWriter)12 java.util (java.util)12 SolverContext (org.sosy_lab.java_smt.api.SolverContext)12 FilterBasic (com.dat3m.dartagnan.program.filter.FilterBasic)11 CondJump (com.dat3m.dartagnan.program.event.core.CondJump)10