vhdl-flac-decode/verif/input_fifo_tb/run.sh

38 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2023-10-08 20:36:53 +02:00
#!/bin/bash
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPT_DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
projdir=`readlink -f -n "$SCRIPT_DIR/../../"`
workdir=`mktemp -d`
echo "Using tempdir: $workdir"
toplevel="flacdec_input_fifo"
filelist=("rtl/flacdec_double_mem_fifo.vhd" "rtl/mem/flacdec_64x08_memory.vhd" "rtl/flacdec_input_fifo.vhd")
cd "$SCRIPT_DIR"
for file in ${filelist[@]}; do
echo "Importing $file"
ghdl -i --workdir="$workdir" "$projdir/$file"
done
echo "Building design..."
ghdl -m --workdir="$workdir" $toplevel
export LIBPYTHON_LOC=`cocotb-config --libpython`
export MODULE=tb.tests
ghdl -r --workdir="$workdir" "$toplevel" --vpi=$(cocotb-config --lib-name-path vpi ghdl)
cd "$projdir"
rm -rf "$rundir"