Add FPGA tests to interface2 build workflow

This commit is contained in:
Andrew Kay
2021-10-07 20:55:16 -05:00
parent 680e5b108b
commit 4e235290ca
7 changed files with 50 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
# See https://github.com/halfmanhalftaco/fpga-docker/tree/master/Lattice_iCEcube2
ICECUBE2_WRAPPER = docker run -t --rm --volume $(RTL):/data --workdir /data --mac-address=$(shell cat .mac_address) icecube2:latest ./icecube2_env.sh
ICECUBE2_WRAPPER = docker run -t --rm --volume $(RTL):/data --workdir /data --mac-address=$(or $(ICECUBE2_MAC_ADDRESS),$(shell cat .mac_address)) $(or $(ICECUBE2_IMAGE),icecube2:latest) ./icecube2_env.sh
RTL = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
IMPLMNT = coax_Implmnt

View File

@@ -16,7 +16,7 @@ coax_tx_tb: coax_tx_tb.v $(RTL)/coax_tx.v $(RTL)/coax_tx_bit_timer.v
control_tb: control_tb.v $(RTL)/control.v $(RTL)/coax_buffered_tx.v $(RTL)/coax_tx.v $(RTL)/coax_tx_bit_timer.v $(RTL)/coax_buffer.v $(RTL)/third_party/*.v
test: $(TESTS)
$(foreach tb,$(TESTS),./run_test.sh $(tb);)
./run_tests.sh
clean:
rm -f *_tb *.vcd

View File

@@ -1,7 +1,7 @@
`define assert_equal(actual, expected, message) \
if ((actual) !== expected) \
begin \
$display("[ASSERTION FAILURE] %m (%s:%0d): %s", `__FILE__, `__LINE__, message); \
$display("[FAIL:ASSERTION] %m (%s:%0d): %s", `__FILE__, `__LINE__, message); \
$display("\tTime: %0t", $time); \
$display("\tExpected: %x", expected); \
$display("\tActual: %x", actual); \

View File

@@ -1,7 +0,0 @@
#!/bin/sh
VVP=vvp
echo "Running $1"
${VVP} -N $1

View File

@@ -0,0 +1,19 @@
#!/bin/bash
VVP=vvp
set -o pipefail
ANY_FAILURES=0
for TB in *_tb; do
echo "Running $TB"
${VVP} -n $TB | awk "BEGIN{f=0} /^\[FAIL:/{f=1} 1; END{exit(f)}"
if [ $? != 0 ]; then
ANY_FAILURES=1
fi
done
exit $ANY_FAILURES