Created
October 24, 2018 19:50
-
-
Save fcayci/e2c5fe3d6b3ce179bdb63de4e5208055 to your computer and use it in GitHub Desktop.
ghdl makefile
This file contains hidden or 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
| # Make sure ghdl and gtkwave is in your PATH | |
| SRCS = design.vhd | |
| TB = design_tb.vhd | |
| CC = ghdl | |
| SIM = gtkwave | |
| ARCHNAME=$(shell grep architecture $(TB) | cut -f 4 -d ' ') | |
| SIMNAME = wave.vcd | |
| all: check analyze | |
| @echo "Done..." | |
| check: | |
| @echo "Checking the design..." | |
| @$(CC) -s $(SRCS) $(TB) | |
| analyze: | |
| @echo "Analyzing the design..." | |
| @$(CC) -a $(SRCS) $(TB) | |
| simulate: | |
| @echo "Simulating the design..." | |
| @$(CC) -e $(ARCHNAME) | |
| @$(CC) -r $(ARCHNAME) --vcd=$(SIMNAME) | |
| @$(SIM) $(SIMNAME) 2> /dev/null | |
| clean: | |
| @echo "WARNING: Cleaning..." | |
| @rm -f $(ARCHNAME) | |
| @rm -f *.o | |
| @rm -f *.cf | |
| @rm -f $(SIMNAME) | |
| .PHONY: all check analyze simulate clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment