Search in sources :

Example 1 with Printer

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

the class PrinterTest method PrintX86.

@Test()
public void PrintX86() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+mfence-rmw+rmw-mfence.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 2 with Printer

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

the class PrinterTest method PrintPPC.

@Test()
public void PrintPPC() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "litmus/MP+lwsync+data-wsi-rfi-ctrlisync.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 3 with Printer

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

the class PrinterTest method PrintLinux2.

@Test()
public void PrintLinux2() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.LITMUS_RESOURCE_PATH + "litmus/C/dart/C-atomic-fetch-simple-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 4 with Printer

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

the class PrinterTest method PrintBpl2.

@Test()
public void PrintBpl2() throws Exception {
    Program p = new ProgramParser().parse(new File(ResourceHelper.TEST_RESOURCE_PATH + "locks/linuxrwlock-3.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 5 with Printer

use of com.dat3m.dartagnan.utils.printer.Printer 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("===================================");
    }
}
Also used : Printer(com.dat3m.dartagnan.utils.printer.Printer) Thread(com.dat3m.dartagnan.program.Thread)

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