diff options
-rw-r--r-- | benchmarks/polybench-syn-div/data-mining/covariance.c | 2 | ||||
-rw-r--r-- | benchmarks/polybench-syn-div/exec.csv | 34 | ||||
-rw-r--r-- | benchmarks/polybench-syn-div/medley/Makefile | 3 | ||||
-rw-r--r-- | benchmarks/polybench-syn-div/medley/floyd-warshall.c | 4 | ||||
-rw-r--r-- | benchmarks/polybench-syn-div/stencils/adi.c | 16 | ||||
-rw-r--r-- | benchmarks/polybench-syn/common.mk | 4 | ||||
-rwxr-xr-x | benchmarks/polybench-syn/run-vericert.sh | 14 | ||||
-rw-r--r-- | scripts/docker/artifact.org | 7 |
8 files changed, 35 insertions, 49 deletions
diff --git a/benchmarks/polybench-syn-div/data-mining/covariance.c b/benchmarks/polybench-syn-div/data-mining/covariance.c index b29a5bd..88de67e 100644 --- a/benchmarks/polybench-syn-div/data-mining/covariance.c +++ b/benchmarks/polybench-syn-div/data-mining/covariance.c @@ -27,7 +27,7 @@ void init_array (int m, int n, for (i = 0; i < 32; plus(i)) for (j = 0; j < 28; plus(j)) - data[i][j] = ((int) i*j) / 28; + data[i][j] = ((int) i*j) / (27+ONE); } diff --git a/benchmarks/polybench-syn-div/exec.csv b/benchmarks/polybench-syn-div/exec.csv index 6ebeced..8d1f5da 100644 --- a/benchmarks/polybench-syn-div/exec.csv +++ b/benchmarks/polybench-syn-div/exec.csv @@ -1,27 +1,7 @@ -2mm,467612 -3mm,604582 -adi,1831462 -atas,101618 -bicg,130790 -cholesky,2575070 -covariance,340794 -doitgen,386782 -durbin,23832 -fdtd-2d,958412 -floyd-warshall,5414366 -gemm,406774 -gemver,193048 -gesummv,116556 -heat-3d,592770 -jacobi-1d,19996 -jacobi-2d,397200 -lu,2893146 -ludcmp,2641694 -mvt,148874 -nussinov,956490 -seidel-2d,942338 -symm,279832 -syr2k,525908 -syrk,338286 -trisolv,36050 -trmm,165828 +adi,1422354 +heat-3d,580770 +fdtd-2d,901430 +jacobi-1d,19622 +seidel-2d,664780 +jacobi-2d,344072 +nussinov,954402 diff --git a/benchmarks/polybench-syn-div/medley/Makefile b/benchmarks/polybench-syn-div/medley/Makefile index 816a0ce..01da9de 100644 --- a/benchmarks/polybench-syn-div/medley/Makefile +++ b/benchmarks/polybench-syn-div/medley/Makefile @@ -1,3 +1,6 @@ TARGETS := floyd-warshall nussinov include ../common.mk + +floyd-warshall.v: floyd-warshall.c + $(VERICERT) $(VERICERT_OPTS) -O0 -finline $< -o $@ diff --git a/benchmarks/polybench-syn-div/medley/floyd-warshall.c b/benchmarks/polybench-syn-div/medley/floyd-warshall.c index 74d5c9b..776d95a 100644 --- a/benchmarks/polybench-syn-div/medley/floyd-warshall.c +++ b/benchmarks/polybench-syn-div/medley/floyd-warshall.c @@ -23,9 +23,9 @@ void init_array (int n, for (i = 0; i < n; plus(i)) for (j = 0; j < n; plus(j)) { - path[i][j] = i*(j % 7)+ONE; + path[i][j] = i*(j % (ONE+6))+ONE; //if (((i+j)%13 == ZERO || (i+j)%7== ZERO || (i+j)%11 == ZERO ) != 0 ) - if(((((i+j) % 13) == (int)0 || ((i+j) % 7) == (int)0)!=0 || ((i+j) % 11) == (int)0 ) != 0) + if(((((i+j) % (12+ONE)) == (int)0 || ((i+j) % (ONE+6)) == (int)0)!=0 || ((i+j) % (10+ONE)) == (int)0 ) != 0) path[i][j] = 999; } } diff --git a/benchmarks/polybench-syn-div/stencils/adi.c b/benchmarks/polybench-syn-div/stencils/adi.c index 9fa4f2a..be2b766 100644 --- a/benchmarks/polybench-syn-div/stencils/adi.c +++ b/benchmarks/polybench-syn-div/stencils/adi.c @@ -58,13 +58,13 @@ void kernel_adi(int tsteps, int n, B1 = 2; B2 = 1; - mul1 = divider(B1 * n * n, tsteps); - mul2 = divider(B2 * n * n, tsteps); + mul1 = ((B1 * n * n) / tsteps); + mul2 = ((B2 * n * n) /tsteps); - a = -(sdivider(mul1,2)); + a = -((mul1 / 2)); b = 1+mul1; c = a; - d = -(sdivider(mul2,2)); + d = -((mul2 / 2)); e = 1+mul2; f = d; int ZERO = 0; @@ -76,8 +76,8 @@ void kernel_adi(int tsteps, int n, p[i][ZERO] = 0; q[i][ZERO] = v[ZERO][i]; for (j=1; j<n-1; j++) { - p[i][j] = -sdivider(c, (a*p[i][j-1]+b)); - q[i][j] = -sdivider((-d*u[j][i-1]+(1+2*d)*u[j][i] - f*u[j][i+1]-a*q[i][j-1]),(a*p[i][j-1]+b)); + p[i][j] = -(c / (a*p[i][j-1]+b)); + q[i][j] = -((-d*u[j][i-1]+(1+2*d)*u[j][i] - f*u[j][i+1]-a*q[i][j-1]) / (a*p[i][j-1]+b)); } v[n-1][i] = 1; @@ -91,8 +91,8 @@ void kernel_adi(int tsteps, int n, p[i][ZERO] = 0; q[i][ZERO] = u[i][ZERO]; for (j=1; j<n-1; j++) { - p[i][j] = -sdivider(f, (d*p[i][j-1]+e)); - q[i][j] = sdivider((-a*v[i-1][j]+(1+2*a)*v[i][j] - c*v[i+1][j]-d*q[i][j-1]),(d*p[i][j-1]+e)); + p[i][j] = -(f / (d*p[i][j-1]+e)); + q[i][j] = ((-a*v[i-1][j]+(1+2*a)*v[i][j] - c*v[i+1][j]-d*q[i][j-1]) / (d*p[i][j-1]+e)); } u[i][n-1] = 1; for (j=n-2; j>=1; j--) { diff --git a/benchmarks/polybench-syn/common.mk b/benchmarks/polybench-syn/common.mk index 7e14602..fbada0b 100644 --- a/benchmarks/polybench-syn/common.mk +++ b/benchmarks/polybench-syn/common.mk @@ -10,7 +10,7 @@ TARGETS ?= $(VERICERT) $(VERICERT_OPTS) $< -o $@ %.iver: %.v - $(IVERILOG) $(IVERILOG_OPTS) $< -o $@ + $(IVERILOG) -o $@ $(IVERILOG_OPTS) $< %.gcc: %.c $(CC) $(CFLAGS) $< -o $@ @@ -24,6 +24,8 @@ clean: rm -f *.iver rm -f *.v rm -f *.gcc + rm -f *.clog + rm -f *.tmp rm -f $(TARGETS) .PRECIOUS: %.v %.gcc %.iver diff --git a/benchmarks/polybench-syn/run-vericert.sh b/benchmarks/polybench-syn/run-vericert.sh index 2f8097f..6cf4cd9 100755 --- a/benchmarks/polybench-syn/run-vericert.sh +++ b/benchmarks/polybench-syn/run-vericert.sh @@ -1,20 +1,18 @@ -#! /bin/bash +#!/usr/bin/env bash + +rm exec.csv top=$(pwd) #set up while read benchmark ; do echo "Running "$benchmark - clang -Wall -Werror -fsanitize=undefined $benchmark.c -o $benchmark.o - ./$benchmark.o > $benchmark.clog + ./$benchmark.gcc > $benchmark.clog cresult=$(cat $benchmark.clog | cut -d' ' -f2) echo "C output: "$cresult - { time ../../bin/vericert -DSYNTHESIS -finline -fschedule --debug-hls $benchmark.c -o $benchmark.v ; } 2> $benchmark.comp - iverilog -o $benchmark.iver -- $benchmark.v ./$benchmark.iver > $benchmark.tmp veriresult=$(tail -1 $benchmark.tmp | cut -d' ' -f2) cycles=$(tail -2 $benchmark.tmp | head -1 | tr -s ' ' | cut -d' ' -f2) - ctime=$(cat $benchmark.comp | head -2 | tail -1 | xargs | cut -d' ' -f2 | cut -d'm' -f2 | sed 's/s//g') - echo "Veri output: "$veriresult + echo "Verilog output: "$veriresult #Undefined checks if test -z $veriresult @@ -39,5 +37,5 @@ while read benchmark ; do echo "PASS" fi name=$(echo $benchmark | awk -v FS="/" '{print $NF}') - echo $name","$cycles","$ctime >> exec.csv + echo $name","$cycles >> exec.csv done < benchmark-list-master diff --git a/scripts/docker/artifact.org b/scripts/docker/artifact.org index 0f9ca8b..d6029f8 100644 --- a/scripts/docker/artifact.org +++ b/scripts/docker/artifact.org @@ -33,7 +33,7 @@ cd /vericert nix-shell #+end_src -Then, any commands can be run in this shell to run ~vericert~, which has already been compiled and can be found in the ~/vericert/bin~ directory. For a quick test that it is working, a few very simple examples in the ~/vericert/test~ directory can be run using: +Then, any commands can be run in this shell to run ~vericert~, which has already been compiled and can be found in the ~/vericert/bin~ directory. For a quick test that it is working, a few very simple examples in the ~/vericert/test~ directory can be run by using the following inside of the ~/vericert~ directory: #+begin_src shell make test @@ -64,7 +64,10 @@ This should print out the return value from the main function in addition to the ** Getting cycle counts for Vericert -There are two benchmark sets for which the results are given in the paper. +There are two benchmark sets for which the results are given in the paper: + +- ~/vericert/benchmarks + To get the cycle counts for Vericert from the benchmarks * Footnotes |