cpu/lib/tb/Makefile

24 lines
430 B
Makefile
Raw Permalink Normal View History

all: verify
TESTBENCH_V = $(wildcard *_tb.sv)
SOURCE_V = $(wildcard ../*.v ../*.sv)
LOGS = $(TESTBENCH_V:.sv=.log)
# Hardware compilation
%.out: %.sv $(SOURCE_V)
2022-12-01 01:03:23 -07:00
iverilog -g2012 -o $@ $< -y ../ -Y .sv -I ../
# Run test
%.vcd %.log: %.out
./$< | tee $(patsubst %.out, %.log, $<)
verify: $(LOGS)
@! grep -q "ERROR" $^
@grep -q "SUCCESS" $^
clean:
rm -rf *.vcd *.log *.out
.SECONDARY: %.log %.vcd
.PHONY: all clean verify