Search in sources :

Example 26 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class ExecutionGraphVisualizer method generateGraphOfExecutionModel.

public void generateGraphOfExecutionModel(Writer writer, String graphName, ExecutionModel model) throws IOException {
    for (EventData data : model.getThreadEventsMap().values().stream().collect(ArrayList<EventData>::new, List::addAll, List::addAll)) {
        if (data.isMemoryEvent()) {
            MemEvent m = (MemEvent) data.getEvent();
            if (!(m.getAddress() instanceof Register)) {
                addresses.putIfAbsent(data.getAccessedAddress(), m.getAddress());
            }
        }
    }
    graphviz.begin(graphName);
    graphviz.append(String.format("label=\"%s\" \n", graphName));
    addAllThreadPos(model);
    addReadFrom(model);
    addCoherence(model);
    graphviz.end();
    graphviz.generateOutput(writer);
}
Also used : Register(com.dat3m.dartagnan.program.Register) MemEvent(com.dat3m.dartagnan.program.event.core.MemEvent) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) EventData(com.dat3m.dartagnan.verification.model.EventData)

Example 27 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class ExecutionGraphVisualizer method addCoherence.

private ExecutionGraphVisualizer addCoherence(ExecutionModel model) {
    graphviz.beginSubgraph("Coherence");
    graphviz.setEdgeAttributes("color=red");
    for (List<EventData> co : model.getCoherenceMap().values()) {
        for (int i = 2; i < co.size(); i++) {
            // We skip the init writes
            EventData w1 = co.get(i - 1);
            EventData w2 = co.get(i);
            if (ignore(w1) || ignore(w2) || !coFilter.test(w1, w2)) {
                continue;
            }
            appendEdge(w1, w2, model, "label=co");
        }
    }
    graphviz.end();
    return this;
}
Also used : EventData(com.dat3m.dartagnan.verification.model.EventData)

Example 28 with EventData

use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.

the class ExecutionGraphVisualizer method addReadFrom.

private ExecutionGraphVisualizer addReadFrom(ExecutionModel model) {
    graphviz.beginSubgraph("ReadFrom");
    graphviz.setEdgeAttributes("color=green");
    for (Map.Entry<EventData, EventData> rw : model.getReadWriteMap().entrySet()) {
        EventData r = rw.getKey();
        EventData w = rw.getValue();
        if (ignore(r) || ignore(w) || !rfFilter.test(w, r)) {
            continue;
        }
        appendEdge(w, r, model, "label=rf");
    }
    graphviz.end();
    return this;
}
Also used : HashMap(java.util.HashMap) Map(java.util.Map) EventData(com.dat3m.dartagnan.verification.model.EventData)

Aggregations

EventData (com.dat3m.dartagnan.verification.model.EventData)28 Edge (com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge)10 EdgeDirection (com.dat3m.dartagnan.solver.caat.misc.EdgeDirection)6 Stream (java.util.stream.Stream)6 Function (java.util.function.Function)5 Thread (com.dat3m.dartagnan.program.Thread)4 BigInteger (java.math.BigInteger)4 java.util (java.util)4 List (java.util.List)3 Map (java.util.Map)3 Iterators (com.google.common.collect.Iterators)2 Spliterator (java.util.Spliterator)2 IntStream (java.util.stream.IntStream)2 StreamSupport (java.util.stream.StreamSupport)2 Register (com.dat3m.dartagnan.program.Register)1 MemEvent (com.dat3m.dartagnan.program.event.core.MemEvent)1 RMWStore (com.dat3m.dartagnan.program.event.core.rmw.RMWStore)1 EventDomain (com.dat3m.dartagnan.solver.caat4wmm.EventDomain)1 FenceGraph (com.dat3m.dartagnan.solver.caat4wmm.basePredicates.FenceGraph)1 ArrayList (java.util.ArrayList)1