spi/tests/run_mode.makefile

25 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-07-21 02:37:22 -04:00
# (c) Peter McGoron 2022
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v.2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
TESTBENCH_BASE=mode${MODE}
AUXFILES=../spi_master.v ../spi_slave.v
CPP_TESTBENCH=${TESTBENCH_BASE}.cpp
WAVEFILE=${TESTBENCH_BASE}.vcd
FILES=${TESTBENCH_BASE}.v ${AUXFILES} ${CPP_TESTBENCH}
2022-07-21 13:00:09 -04:00
${WAVEFILE}: obj_dir/V${TESTBENCH_BASE}
2022-07-21 03:01:58 -04:00
./obj_dir/V${TESTBENCH_BASE}
2022-07-21 02:37:22 -04:00
obj_dir/V${TESTBENCH_BASE}.mk: ${FILES}
verilator -CFLAGS -Wall -Wno-unused -Wpedantic --trace --cc --exe ${FILES} --top ${TESTBENCH_BASE}
obj_dir/V${TESTBENCH_BASE}: obj_dir/V${TESTBENCH_BASE}.mk
make -C obj_dir -f V${TESTBENCH_BASE}.mk
2022-07-21 13:00:09 -04:00
${TESTBENCH_BASE}.v: mode_template.v
sed "s/@PHASE@/`echo ${MODE} | cut -c 2`/g; s/@POLARITY@/`echo ${MODE} | cut -c 1`/g; s/@MODE@/${MODE}/g" mode_template.v > ${TESTBENCH_BASE}.v
${TESTBENCH_BASE}.cpp: mode_template.cpp
sed "s/@PHASE@/`echo ${MODE} | cut -c 2`/g; s/@POLARITY@/`echo ${MODE} | cut -c 1`/g; s/@MODE@/${MODE}/g" mode_template.cpp > ${TESTBENCH_BASE}.cpp