Created
October 4, 2023 09:47
-
-
Save moriglia/b703a8cbd295c37c5bd0c109d43bf477 to your computer and use it in GitHub Desktop.
Makefile for running verilog testbenches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OUTDIR ?= build | |
IPROOT ?= ../.. | |
IPPATT ?= $(foreach dir,$(wildcard $(IPROOT)/*/hdl),-y$(dir)) | |
.PHONY: setup default | |
default: $(OUTDIR)/$(subst .v,.vcd,$(shell find . -name "tb_*.v" -printf "%P\n")) | |
setup: build | |
build: | |
rm -rf build | |
ln -s -n $(shell mktemp -d /tmp/icarus-session-XXXXXX) build | |
$(OUTDIR)/tb_%.vvp : tb_%.v ../hdl/%.v build | |
iverilog -o $@ $< $(IPPATT) | |
$(OUTDIR)/tb_%.vcd: $(OUTDIR)/tb_%.vvp | |
vvp $< -dumpfile=$@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment