-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_random.sh
executable file
·34 lines (27 loc) · 945 Bytes
/
run_random.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
################################################################################
# Executes command with a timeout
# Params:
# $1 timeout in seconds
# $2 command
# Returns 1 if timed out 0 otherwise
timeout() {
time=$1
# start the command in a subshell to avoid problem with pipes
# (spawn accepts one command)
command="/bin/sh -c \"$2\""
expect -c "set echo \"-noecho\"; set timeout $time; spawn -noecho $command; expect timeout { exit 1 } eof { exit 0 }"
if [ $? = 1 ] ; then
echo "Timeout after ${time} seconds"
fi
}
echo -e "use random vtrees 0"
echo "------------------------------------------------------------------"
echo -e "Benchmarks\tInputs\tOutputs\tWires\tNode Count\tRuntime (s)"
test_cases_file="./benchmarks/test_cases_random_vtree"
program="./src/sfdd"
cat $test_cases_file | while read verilog_and_vtree_
do
timeout 1800 "$program $verilog_and_vtree_"
done
exit 0