aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/testenv.sh
blob: b736b91641b98658276373e65f836043b06978ba (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
55
56
57
58
59
# Testsuite environment

set -e

. ../../utils.sh

if [ x"$GHDL" = x ]; then
    GHDL=ghdl
fi

if [ x"$YOSYS" = x ]; then
    YOSYS="yosys -m ../../ghdl.so"
fi

if [ x"$SYMBIYOSYS" = x ]; then
    SYMBIYOSYS="sby"
fi

cmd ()
{
    echo $@"
    "$@"
}

run_yosys ()
{
    cmd $YOSYS "$@"
}

run_symbiyosys ()
{
    cmd $SYMBIYOSYS --yosys "$YOSYS" "$@"
}

analyze ()
{
    printf "${ANSI_BLUE}Analyze $@ $ANSI_NOCOLOR\n"
    cmd "$GHDL" -a $GHDL_STD_FLAGS $GHDL_FLAGS $@
}

synth ()
{
    travis_start "synth" "Synthesize $@"
    run_yosys -p "ghdl $@; synth_ice40 -blif out.blif"
    travis_finish "synth"
}

formal ()
{
    travis_start "formal" "Verify $@"
    run_symbiyosys -f -d work $@.sby
    travis_finish "formal"
}

clean ()
{
    "$GHDL" --remove $GHDL_STD_FLAGS
    rm -f out.blif
}