Skip to content

Commit 6597b65

Browse files
committed
not generate klee file by default; toString for TestPrg
1 parent c3c6d27 commit 6597b65

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

benchmarks/demo-benchmarks/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ KLEE_GEN := $(wildcard ./klee-*)
1414

1515
LLSC_TARGET := $(SRC_FILES:%.c=%.ll)
1616

17-
all: llsc klee
17+
all: llsc
1818

1919
llsc: $(LLSC_TARGET)
2020
klee: $(KLEE_TARGET)

benchmarks/external-lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ KLEE_GEN := $(wildcard ./klee-*)
1414

1515
LLSC_TARGET := $(SRC_FILES:%.c=%.ll)
1616

17-
all: llsc klee
17+
all: llsc
1818

1919
llsc: $(LLSC_TARGET)
2020
klee: $(KLEE_TARGET)

benchmarks/llvm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ KLEE_GEN := $(wildcard ./klee-*)
1414

1515
LLSC_TARGET := $(SRC_FILES:%.c=%.ll)
1616

17-
all: llsc klee
17+
all: llsc
1818

1919
llsc: $(LLSC_TARGET)
2020
klee: $(KLEE_TARGET)

benchmarks/oopsla20/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
KLEE_INCLUDE = ../../../../klee_experiment/klee-2.1/include
22

3-
all: generate_sse generate_klee
3+
all: generate_sse
44

55
generate_sse:
66
clang-11 multipath_1024_sym.c -O0 -emit-llvm -S -fno-discard-value-names -o multipath_1024_sym.ll

benchmarks/opt-experiments/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ KLEE_GEN := $(wildcard ./klee-*)
1414

1515
LLSC_TARGET := $(SRC_FILES:%.c=%.ll)
1616

17-
all: llsc klee
17+
all: llsc
1818

1919
llsc: $(LLSC_TARGET)
2020
klee: $(KLEE_TARGET)

src/test/scala/sai/llsc/OptExperiment.scala

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,40 @@ class Optimization extends TestLLSC {
2929
import scala.collection.mutable.ListBuffer
3030
import java.io.{File, FileWriter}
3131
val writer = new FileWriter(new File("opt_exp.csv"), true)
32-
val N = 0
32+
val N = 5
3333

3434
def testLLSC(N: Int, llsc: LLSC, tst: TestPrg): Unit = {
3535
val TestPrg(m, name, f, config, cliArg, exp) = tst
3636
test(llsc.insName + "_" + name) {
3737
val code = llsc.run(m, llsc.insName + "_" + name, f, config)
38-
val mkRet = code.make(4)
38+
val mkRet = code.make(8)
3939
assert(mkRet == 0, "make failed")
4040
for (i <- 1 to N) {
4141
Thread.sleep(1 * 1000)
4242
val prefix = "numactl -N1 -m1"
4343
val (output, ret) = code.runWithStatus(cliArg, prefix)
4444
val resStat = parseOutput(llsc.insName, name, output)
4545
System.out.println(resStat)
46-
writer.append(s"$resStat\n")
46+
writer.append(s"${tst.toString}\n")
47+
writer.append(s"$output\n")
48+
writer.append(s"$resStat\n\n")
4749
writer.flush()
4850
}
4951
}
5052
}
5153
}
5254

5355
/*
56+
// Test algorithm benchmarks
5457
class TestImpCPSOpt extends Optimization {
5558
val llsc = new ImpCPSLLSC
5659
Config.enableOpt
57-
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/mergesort.ll"), "mergeSort_Opt", "@main", noArg, "--solver=z3", nPath(5040)))
58-
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/bubblesort.ll"), "bubbleSort_Opt", "@main", noArg, "--solver=z3", nPath(720)))
59-
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/knapsack.ll"), "knapsack_Opt", "@main", noArg, "--solver=z3", nPath(1666)))
60-
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/kmpmatcher.ll"), "kmp_Opt", "@main", noArg, "--solver=z3", nPath(4181)))
61-
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/nqueen.ll"), "nqueen_Opt", "@main", noArg, "--solver=z3", nPath(1363)))
62-
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/quicksort.ll"), "quicksort_Opt", "@main", noArg, "--solver=z3", nPath(5040)))
60+
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/kmpmatcher.ll"), "kmp_Opt", "@main", noArg, "--cons-indep --solver=z3", nPath(4181)))
61+
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/mergesort.ll"), "mergeSort_Opt", "@main", noArg, "--cons-indep --solver=z3", nPath(5040)))
62+
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/bubblesort.ll"), "bubbleSort_Opt", "@main", noArg, "--cons-indep --solver=z3", nPath(720)))
63+
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/knapsack.ll"), "knapsack_Opt", "@main", noArg, "--cons-indep --solver=z3", nPath(1666)))
64+
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/nqueen.ll"), "nqueen_Opt", "@main", noArg, "--cons-indep --solver=z3", nPath(1363)))
65+
testLLSC(N, llsc, TestPrg(parseFile("benchmarks/opt-experiments/quicksort.ll"), "quicksort_Opt", "@main", noArg, "--cons-indep --solver=z3", nPath(5040)))
6366
}
6467
6568
class TestPureCPSOpt extends Optimization {

src/test/scala/sai/llsc/TestCases.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ import Config._
2323
* runOpt: the command line argument to run the compiled executable
2424
* exp: expected return status of the compiled executable, use the Map combinator in object TestPrg
2525
*/
26-
case class TestPrg(m: Module, name: String, f: String, config: Config, runOpt: Seq[String], exp: Map[String, Any])
26+
case class TestPrg(m: Module, name: String, f: String, config: Config, runOpt: Seq[String], exp: Map[String, Any]) {
27+
override def toString = s"${m.mname}, $name, $f, $config, $runOpt, $exp"
28+
}
2729

2830
object TestPrg {
2931
val nPath = "nPath" // expected number of explored paths

0 commit comments

Comments
 (0)