Search in sources :

Example 6 with Printer

use of com.dat3m.dartagnan.utils.printer.Printer in project Dat3M by hernanponcedeleon.

the class Simplifier method run.

@Override
public void run(Program program) {
    Preconditions.checkArgument(!program.isUnrolled(), "Simplifying should be performed before unrolling.");
    logger.info("pre-simplification: " + program.getEvents().size() + " events");
    for (Thread t : program.getThreads()) {
        if (simplify(t)) {
            t.clearCache();
        }
    }
    program.clearCache(false);
    logger.info("post-simplification: " + program.getEvents().size() + " events");
    if (print) {
        System.out.println("===== Program after simplification =====");
        System.out.println(new Printer().print(program));
        System.out.println("========================================");
    }
}
Also used : Printer(com.dat3m.dartagnan.utils.printer.Printer) Thread(com.dat3m.dartagnan.program.Thread)

Example 7 with Printer

use of com.dat3m.dartagnan.utils.printer.Printer in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintLinux3.

@Test()
public void PrintLinux3() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.LITMUS_RESOURCE_PATH + "litmus/C/manual/atomic/C-atomic-01.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 8 with Printer

use of com.dat3m.dartagnan.utils.printer.Printer in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintLinux.

@Test()
public void PrintLinux() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/C-rcu-link-after.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 9 with Printer

use of com.dat3m.dartagnan.utils.printer.Printer in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintBpl1.

// Test to call toString() of most events
@Test()
public void PrintBpl1() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "boogie/concurrency/fib_bench-1-O0.bpl"));
    assertNotNull(new Printer().print(p));
    LoopUnrolling.newInstance().run(p);
    Compilation.newInstance().run(p);
    assertNotNull(new Printer().print(p));
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Example 10 with Printer

use of com.dat3m.dartagnan.utils.printer.Printer in project Dat3M by hernanponcedeleon.

the class PrinterTest method PrintAARCH64.

@Test()
public void PrintAARCH64() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+popl+poap.litmus"));
    assertNotNull(new Printer().print(p));
    assertNotNull(p.getAss().toString());
}
Also used : Program(com.dat3m.dartagnan.program.Program) ProgramParser(com.dat3m.dartagnan.parsers.program.ProgramParser) Printer(com.dat3m.dartagnan.utils.printer.Printer) File(java.io.File) Test(org.junit.Test)

Aggregations

Printer (com.dat3m.dartagnan.utils.printer.Printer)11 ProgramParser (com.dat3m.dartagnan.parsers.program.ProgramParser)8 Program (com.dat3m.dartagnan.program.Program)8 File (java.io.File)8 Test (org.junit.Test)8 Thread (com.dat3m.dartagnan.program.Thread)3 Event (com.dat3m.dartagnan.program.event.core.Event)1 List (java.util.List)1