aboutsummaryrefslogtreecommitdiffstats
path: root/tests/aiger/run-test.sh
blob: 8e932b091a201d3718909000a6b475b39358d07f (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

set -e

OPTIND=1
abcprog="../../yosys-abc"    # default to built-in version of abc
while getopts "A:" opt
do
    case "$opt" in
	A) abcprog="$OPTARG" ;;
    esac
done
shift "$((OPTIND-1))"

# NB: *.aag and *.aig must contain a symbol table naming the primary
#     inputs and outputs, otherwise ABC and Yosys will name them
#     arbitrarily (and inconsistently with each other).

for aag in *.aag; do
    # Since ABC cannot read *.aag, read the *.aig instead
    # (which would have been created by the reference aig2aig utility,
    #  available from http://fmv.jku.at/aiger/)
    echo "Checking $aag."
    $abcprog -q "read -c ${aag%.*}.aig; write ${aag%.*}_ref.v"
    ../../yosys -qp "
read_verilog ${aag%.*}_ref.v
prep
design -stash gold
read_aiger -clk_name clock $aag
prep
design -stash gate
design -import gold -as gold
design -import gate -as gate
miter -equiv -flatten -make_assert -make_outputs gold gate miter
sat -verify -prove-asserts -show-ports -seq 16 miter
" -l ${aag}.log
done

for aig in *.aig; do
    echo "Checking $aig."
    $abcprog -q "read -c $aig; write ${aig%.*}_ref.v"
    ../../yosys -qp "
read_verilog ${aig%.*}_ref.v
prep
design -stash gold
read_aiger -clk_name clock $aig
prep
design -stash gate
design -import gold -as gold
design -import gate -as gate
miter -equiv -flatten -make_assert -make_outputs gold gate miter
sat -verify -prove-asserts -show-ports -seq 16 miter
" -l ${aig}.log
done