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);
}
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;
}
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;
}
Aggregations