aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/testenv.sh
blob: e5775b518ceb4f8f2dbae4f4debc124ef81043b9 (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
# Testsuite environment

set -e

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

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

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

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

analyze ()
{
    echo "analyze $@"
    cmd "$GHDL" -a $GHDL_STD_FLAGS $GHDL_FLAGS $@
}

synth ()
{
    echo "synthesize $@"
    run_yosys -q -p "ghdl $@; synth_ice40 -blif out.blif"
}

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