Initial commit
This commit is contained in:
30
testbench/Makefile
Normal file
30
testbench/Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
VC = iverilog
|
||||
VI = vvp
|
||||
|
||||
SOURCES = ../rtl/mcp3201.sv ../rtl/spi_sclk_gen.sv
|
||||
|
||||
VFLAGS = -g2012
|
||||
|
||||
TBS = $(wildcard tb_*.sv)
|
||||
DEFINES = -D TESTBENCH
|
||||
VCDDEPS = $(TBS:.sv=.vcd)
|
||||
BINDEPS = $(TBS:.sv=.bin)
|
||||
|
||||
all: $(VCDDEPS)
|
||||
|
||||
.SECONDARY:
|
||||
#.SILENT: $(VCDDEPS) $(BINDEPS) clean
|
||||
|
||||
%.vcd: %.bin
|
||||
@echo "Simulate :" $(<:.bin=.sv)
|
||||
$(VI) $< #> $(<:.bin=.out)
|
||||
|
||||
%.bin: %.sv $(SOURCES)
|
||||
@echo "Compile :" $(@:.bin=.sv)
|
||||
$(VC) $(VFLAGS) $(DEFINES) -D DUMPFILE=\"$(@:.bin=.vcd)\" -o $@ $< $(SOURCES)
|
||||
|
||||
clean:
|
||||
@echo "Remove *.bin, *.vcd, *.out"
|
||||
rm -rf *.bin
|
||||
rm -rf *.out
|
||||
rm -rf *.vcd
|
||||
Reference in New Issue
Block a user