advent-of-code/2020/day2/vhdl/run.sh

23 lines
586 B
Bash
Raw Normal View History

2020-12-02 11:09:36 +01:00
#!/usr/bin/env sh
set -eu
2020-12-06 12:02:35 +01:00
INPUT=$1
GHDLFLAGS="--std=08 --workdir=workdir"
2020-12-02 11:09:36 +01:00
mkdir -p workdir
ghdl remove $GHDLFLAGS
ghdl analyze $GHDLFLAGS parser.vhd verifier.vhd top.vhd sim.vhd
2020-12-06 12:02:35 +01:00
ghdl elab-run $GHDLFLAGS sim -gSTEP=1 < "$INPUT"
ghdl elab-run $GHDLFLAGS sim -gSTEP=2 < "$INPUT"
echo "Synthesized: "
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
ghdl analyze $GHDLFLAGS top_syn.vhd sim.vhd
2020-12-06 12:02:35 +01:00
ghdl elab-run $GHDLFLAGS sim -gSTEP="$step" --ieee-asserts=disable < "$INPUT"
done