summaryrefslogtreecommitdiff
path: root/tests/vloghtb/test_share.sh
blob: 52b5a1428954bae3846e3a120ac901864fce3ef9 (plain)
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
#!/bin/bash

set -e
mkdir -p log_test_share
source common.sh

f=$1
n=$(basename ${f%.v})

rm -f log_test_share/$n.txt
rm -f log_test_share/$n.err

if ! ../../yosys -q -l log_test_share/$n.out - 2> /dev/null <<- EOT
	read_verilog $f
	proc;;

	copy $n gold
	rename $n work

	cd work
	share -aggressive
	cd ..

	miter -equiv -ignore_gold_x -make_outputs -make_outcmp gold work miter
	flatten miter
	sat -verify -prove trigger 0 -show-inputs -show-outputs miter
EOT
then
	log_fail test_share $n
	mv log_test_share/$n.out log_test_share/$n.err
	exit 1
fi

log_pass test_share $n
mv log_test_share/$n.out log_test_share/$n.txt
exit 0