use of com.dat3m.dartagnan.program.Thread in project Dat3M by hernanponcedeleon.
the class RelExt method getMaxTupleSet.
@Override
public TupleSet getMaxTupleSet() {
if (maxTupleSet == null) {
maxTupleSet = new TupleSet();
List<Thread> threads = task.getProgram().getThreads();
for (int i = 0; i < threads.size(); i++) {
Thread t1 = threads.get(i);
for (int j = i + 1; j < threads.size(); j++) {
Thread t2 = threads.get(j);
for (Event e1 : t1.getCache().getEvents(FilterBasic.get(Tag.VISIBLE))) {
for (Event e2 : t2.getCache().getEvents(FilterBasic.get(Tag.VISIBLE))) {
maxTupleSet.add(new Tuple(e1, e2));
maxTupleSet.add(new Tuple(e2, e1));
}
}
}
}
}
return maxTupleSet;
}
use of com.dat3m.dartagnan.program.Thread in project Dat3M by hernanponcedeleon.
the class RelInt method getMaxTupleSet.
@Override
public TupleSet getMaxTupleSet() {
if (maxTupleSet == null) {
maxTupleSet = new TupleSet();
for (Thread t : task.getProgram().getThreads()) {
List<Event> events = t.getCache().getEvents(FilterBasic.get(Tag.VISIBLE));
for (Event e1 : events) {
for (Event e2 : events) {
maxTupleSet.add(new Tuple(e1, e2));
}
}
}
removeMutuallyExclusiveTuples(maxTupleSet);
}
return maxTupleSet;
}
use of com.dat3m.dartagnan.program.Thread in project Dat3M by hernanponcedeleon.
the class RelPo method getMaxTupleSet.
@Override
public TupleSet getMaxTupleSet() {
if (maxTupleSet == null) {
maxTupleSet = new TupleSet();
for (Thread t : task.getProgram().getThreads()) {
List<Event> events = t.getCache().getEvents(filter);
for (int i = 0; i < events.size(); i++) {
Event e1 = events.get(i);
for (int j = i + 1; j < events.size(); j++) {
Event e2 = events.get(j);
maxTupleSet.add(new Tuple(e1, e2));
}
}
}
removeMutuallyExclusiveTuples(maxTupleSet);
}
return maxTupleSet;
}
use of com.dat3m.dartagnan.program.Thread in project Dat3M by hernanponcedeleon.
the class ExceptionsTest method RegisterAlreadyExist.
@Test(expected = MalformedProgramException.class)
public void RegisterAlreadyExist() throws Exception {
ProgramBuilder pb = new ProgramBuilder(SourceLanguage.LITMUS);
pb.initThread(0);
Thread t = pb.build().getThreads().get(0);
t.newRegister("r1", -1);
// Adding same register a second time
t.newRegister("r1", -1);
}
use of com.dat3m.dartagnan.program.Thread in project Dat3M by hernanponcedeleon.
the class LoopUnrolling method run.
@Override
public void run(Program program) {
if (program.isUnrolled()) {
logger.warn("Skipped unrolling: Program is already unrolled.");
return;
}
int nextId = 0;
for (Thread thread : program.getThreads()) {
nextId = unrollThreadAndUpdate(thread, bound, nextId);
}
program.clearCache(false);
program.markAsUnrolled(bound);
logger.info("Program unrolled {} times", bound);
if (print) {
System.out.println("===== Program after unrolling =====");
System.out.println(new Printer().print(program));
System.out.println("===================================");
}
}
Aggregations