2020-12-06 16:32:23 +01:00
|
|
|
#!/usr/bin/bash
|
2020-12-02 11:09:36 +01:00
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2020-12-06 16:32:23 +01:00
|
|
|
INPUT=$(readlink --canonicalize-existing "$1")
|
2020-12-06 12:12:15 +01:00
|
|
|
MODE=${2:-}
|
2020-12-02 21:19:33 +01:00
|
|
|
GHDLFLAGS="--std=08 --workdir=workdir"
|
|
|
|
|
2020-12-06 16:32:23 +01:00
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
|
2020-12-02 11:09:36 +01:00
|
|
|
mkdir -p workdir
|
|
|
|
|
2020-12-06 12:12:15 +01:00
|
|
|
if [[ $MODE = "--synth" ]]; then
|
|
|
|
for step in 1 2; do
|
|
|
|
ghdl remove $GHDLFLAGS
|
|
|
|
ghdl synth $GHDLFLAGS -gCOUNTER_WIDTH=12 -gSTEP="$step" parser.vhd verifier.vhd top.vhd -e top > top_syn.vhd 2>/dev/null
|
|
|
|
ghdl analyze $GHDLFLAGS top_syn.vhd sim.vhd
|
|
|
|
ghdl elab-run $GHDLFLAGS sim -gSTEP="$step" --ieee-asserts=disable < "$INPUT"
|
|
|
|
done
|
|
|
|
else
|
2020-12-02 21:19:33 +01:00
|
|
|
ghdl remove $GHDLFLAGS
|
2020-12-06 12:12:15 +01:00
|
|
|
ghdl analyze $GHDLFLAGS parser.vhd verifier.vhd top.vhd sim.vhd
|
|
|
|
ghdl elab-run $GHDLFLAGS sim -gSTEP=1 < "$INPUT"
|
|
|
|
ghdl elab-run $GHDLFLAGS sim -gSTEP=2 < "$INPUT"
|
|
|
|
fi
|