aboutsummaryrefslogtreecommitdiffstats
path: root/tests/run_mode.makefile
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2022-07-21 02:37:22 -0400
committerGravatar Peter McGoron 2022-07-21 02:37:22 -0400
commit4a683b8f654f3ecb6f2408dad3a9cfa60f3b39e6 (patch)
treea6c324803c18ad9a6dbcd65d54b80984d39f58d0 /tests/run_mode.makefile
parentcleanup, add ready pin to slave (diff)
move tests
Diffstat (limited to 'tests/run_mode.makefile')
-rw-r--r--tests/run_mode.makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/run_mode.makefile b/tests/run_mode.makefile
new file mode 100644
index 0000000..31b6644
--- /dev/null
+++ b/tests/run_mode.makefile
@@ -0,0 +1,25 @@
+# (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}
+
+all: obj_dir/V${TESTBENCH_BASE}
+ ./obj_dir/V${TESTBENCH_BASE} && gtkwave ${WAVEFILE}
+
+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
+
+run:
+ ./obj_dir/V${TESTBENCH_CASE}
+clean:
+ $(RM) obj_dir/*