aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2022-03-17 14:57:23 +0000
committerYann Herklotz <git@yannherklotz.com>2022-03-17 14:57:23 +0000
commit314592d5593faa02a0330451a22fd9b8cc251b8d (patch)
treecc82d540a3982a18893b3423c77b904746373df3 /scripts
parentc897f9ab9c515501f88199003bd3e696bf7b9692 (diff)
downloadvericert-314592d5593faa02a0330451a22fd9b8cc251b8d.tar.gz
vericert-314592d5593faa02a0330451a22fd9b8cc251b8d.zip
Add synthesis bash scripts
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/synth-ssh.sh27
-rwxr-xr-xscripts/synth-ssh0.sh27
-rwxr-xr-xscripts/synth.sh32
3 files changed, 86 insertions, 0 deletions
diff --git a/scripts/synth-ssh.sh b/scripts/synth-ssh.sh
new file mode 100755
index 0000000..fffb9f9
--- /dev/null
+++ b/scripts/synth-ssh.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/bash
+
+# Assumes that the Verilog is passed on the command line, that the tcl file is in synth.tcl and
+# returns encode_report.xml.
+
+scriptsdir=$(dirname "$(readlink -f "$BASH_SOURCE")")
+
+bench=$1
+output=$2
+machine=ee-beholder1.ee.ic.ac.uk
+user=ymh15
+files="$scriptsdir/synth.tcl $output/$bench.v"
+log="$output/${bench}_synth.log"
+
+date >$log
+
+temp=$(ssh $user@$machine "mktemp -d" 2>>$log)
+
+>&2 echo "synthesising $bench $temp"
+rsync $files $user@$machine:$temp/ >>$log 2>&1
+ssh $user@$machine \
+ "bash -lc 'cd $temp && cp $(basename $bench).v main.v && vivado -mode batch -source synth.tcl'" \
+ >>$log 2>&1
+rsync $user@$machine:$temp/encode_report.xml $output/${bench}_report.xml >>$log 2>&1
+ssh $user@$machine "rm -rf '$temp'" >>$log 2>&1
+rm -f main.v >>$log 2>&1
+>&2 echo "done $bench"
diff --git a/scripts/synth-ssh0.sh b/scripts/synth-ssh0.sh
new file mode 100755
index 0000000..977309c
--- /dev/null
+++ b/scripts/synth-ssh0.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/bash
+
+# Assumes that the Verilog is passed on the command line, that the tcl file is in synth.tcl and
+# returns encode_report.xml.
+
+scriptsdir=$(dirname "$(readlink -f "$BASH_SOURCE")")
+
+bench=$1
+output=$2
+machine=ee-beholder0.ee.ic.ac.uk
+user=ymh15
+files="$scriptsdir/synth.tcl $output/$bench.v"
+log="$output/${bench}_synth.log"
+
+date >$log
+
+temp=$(ssh $user@$machine "mktemp -d" 2>>$log)
+
+>&2 echo "synthesising $bench $temp"
+rsync $files $user@$machine:$temp/ >>$log 2>&1
+ssh $user@$machine \
+ "bash -lc 'cd $temp && cp $(basename $bench).v main.v && vivado -mode batch -source synth.tcl'" \
+ >>$log 2>&1
+rsync $user@$machine:$temp/encode_report.xml $output/${bench}_report.xml >>$log 2>&1
+ssh $user@$machine "rm -rf '$temp'" >>$log 2>&1
+rm -f main.v >>$log 2>&1
+>&2 echo "done $bench"
diff --git a/scripts/synth.sh b/scripts/synth.sh
new file mode 100755
index 0000000..79d7164
--- /dev/null
+++ b/scripts/synth.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/bash
+
+set -x
+
+scriptsdir=$(dirname "$(readlink -f "$BASH_SOURCE")")
+
+if [[ -z "$1" ]]; then
+ parallel=1
+else
+ parallel=$1
+fi
+
+if [[ -z "$2" ]]; then
+ output=$(pwd)
+else
+ output=$2
+fi
+
+if [[ -z "$3" ]]; then
+ source=$(pwd)
+else
+ source=$3
+fi
+
+echo "copying directory structure from $source to $output"
+mkdir -p $output
+rsync -am --include '*/' --include '*.v' --exclude '*' $source/ $output/
+
+echo "executing $parallel runs in parallel"
+cat $scriptsdir/../benchmarks/polybench-syn/benchmark-list-master | \
+ xargs --max-procs=$parallel --replace=% \
+ $scriptsdir/synth-ssh0.sh % $output