use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.
the class CoherenceGraph method containsById.
@Override
public boolean containsById(int id1, int id2) {
EventData a = getEvent(id1);
EventData b = getEvent(id2);
return a.getCoherenceIndex() < b.getCoherenceIndex() && a.isWrite() && b.isWrite() && a.getAccessedAddress().equals(b.getAccessedAddress());
}
use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.
the class CoherenceGraph method size.
@Override
public int size(int id, EdgeDirection dir) {
EventData e = getEvent(id);
if (!e.isWrite()) {
return 0;
}
List<EventData> sameAddrWrites = coMap.get(e.getAccessedAddress());
if (sameAddrWrites == null) {
return 0;
}
int index = e.getCoherenceIndex();
return dir == EdgeDirection.INGOING ? (index - 1) : (sameAddrWrites.size() - index - 1);
}
use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.
the class ExecutionGraphVisualizer method addThreadPo.
private ExecutionGraphVisualizer addThreadPo(Thread thread, ExecutionModel model) {
List<EventData> threadEvents = model.getThreadEventsMap().get(thread);
if (threadEvents.size() <= 1) {
return this;
}
// --- Subgraph start ---
graphviz.beginSubgraph("T" + thread.getId());
graphviz.setEdgeAttributes("weight=10");
// --- Node list ---
for (int i = 1; i < threadEvents.size(); i++) {
EventData e1 = threadEvents.get(i - 1);
EventData e2 = threadEvents.get(i);
if (ignore(e1) || ignore(e2)) {
continue;
}
if (e1.getEvent().getCLine() != e2.getEvent().getCLine()) {
appendEdge(e1, e2, model, (String[]) null);
}
}
// --- Subgraph end ---
graphviz.end();
return this;
}
use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.
the class ExternalGraph method edgeStream.
@Override
public Stream<Edge> edgeStream(int id, EdgeDirection dir) {
EventData e = getEvent(id);
Function<EventData, Edge> edgeMapping = dir == EdgeDirection.OUTGOING ? (x -> new Edge(id, x.getId())) : (x -> new Edge(x.getId(), id));
return threadEventsMap.entrySet().stream().filter(x -> x.getKey() != e.getThread()).flatMap(x -> x.getValue().stream()).map(edgeMapping);
}
use of com.dat3m.dartagnan.verification.model.EventData in project Dat3M by hernanponcedeleon.
the class FenceGraph method edgeStream.
@Override
public Stream<Edge> edgeStream(int id, EdgeDirection dir) {
EventData e = getEvent(id);
if (!e.isMemoryEvent()) {
return Stream.empty();
}
List<EventData> threadEvents = model.getThreadEventsMap().get(e.getThread());
if (dir == EdgeDirection.OUTGOING) {
EventData fence = getNextFence(e);
return fence == null ? Stream.empty() : threadEvents.subList(fence.getLocalId() + 1, threadEvents.size()).stream().filter(EventData::isMemoryEvent).map(x -> new Edge(id, x.getId()));
} else {
EventData fence = getPreviousFence(e);
return fence == null ? Stream.empty() : threadEvents.subList(0, fence.getLocalId()).stream().filter(EventData::isMemoryEvent).map(x -> new Edge(x.getId(), id));
}
}
Aggregations