run.sh 2.97 KB
Newer Older
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
#!/bin/bash

set -x
test -d $1
test -f scripts/$2.ys

rm -rf $1/work_$2
mkdir $1/work_$2
cd $1/work_$2

touch .start



	expected_string=""
	expected="1"
	if [ "$1" = "yosys" ]; then
		expected_string="yosys -- Yosys Open SYnthesis Suite"
	elif [ "$1" = "yosys_help" ]; then
		expected_string="print the help message for the specified command"
	elif [ "$1" = "yosys_no_banner" ]; then
		expected_string="yosys -- Yosys Open SYnthesis Suite"
		expected="0"
	elif [ "$1" = "yosys_no_footer" ]; then
		expected_string="End of script. Logfile hash:"
		expected="0"
	elif [ "$1" = "yosys_quiet" ]; then
		expected_string="yosys"
		expected="0"
	elif [ "$1" = "yosys_headers" ]; then
		expected_string="yosys"
		expected="0"
	elif [ "$1" = "yosys_time" ]; then
		expected_string="\[00000.000000\]"
	elif [ "$1" = "yosys_detailed_timing" ]; then
		expected_string=" calls"
	elif [ "$1" = "yosys_log_file" ]; then
		expected_string="yosys -- Yosys Open SYnthesis Suite"
	elif [ "$1" = "yosys_log_file_lb_mode" ]; then
		expected_string="yosys -- Yosys Open SYnthesis Suite"
	elif [ "$1" = "yosys_write_des_to_file" ]; then
		expected_string="Generated by Yosys"
	elif [ "$1" = "yosys_backends" ]; then
		expected_string="Generated by Yosys"
	elif [ "$1" = "yosys_frontends" ]; then
		expected_string="Parsing \`../top.v' using frontend \`verilog'"
	elif [ "$1" = "yosys_command_list" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_help_for_command" ]; then
		expected_string="abc \[options\] \[selection\]"
	elif [ "$1" = "yosys_script" ]; then
		expected_string="Executing script file \`../run_script.ys'"
	elif [ "$1" = "yosys_tcl_script" ]; then
		expected_string="Run tcl script!"
	elif [ "$1" = "yosys_exec_command" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_enable_tracing" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_randomize_alloc_point_addr" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_abort" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_macro" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_header" ]; then
		expected_string=" Parsing \`../top.v' using frontend \`verilog'"
	elif [ "$1" = "yosys_regexp" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_regexp_w" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_regexp_e" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_dependencies" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_globally_en_log_mes" ]; then
		expected_string="abc"
	elif [ "$1" = "yosys_version" ]; then
		expected_string="Yosys "
	elif [ "$1" = "yosys_synth" ]; then
		expected_string="Running command \`synth'"
	fi

	../run_yosys.sh
	if [ "$1"! = "yosys_abort" ]; then
		if [ $? != 0 ] ; then
			echo FAIL > ${1}_${2}.status
			touch .stamp
			exit 0
		fi
	fi
	if grep "$expected_string" yosys.log; then
		if [ $expected = "1" ]; then
			echo PASS > ${1}_${2}.status
		else
			echo FAIL > ${1}_${2}.status
		fi
	else
		if [ $expected = "1" ]; then
			echo FAIL > ${1}_${2}.status
		else
			echo PASS > ${1}_${2}.status
		fi
	fi


touch .stamp