Last active
October 18, 2018 14:31
-
-
Save ZipCPU/2115f0c33859f9a8639241ca1a5144d7 to your computer and use it in GitHub Desktop.
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
.PHONY: all | |
all: blinky | |
VERILATOR := verilator | |
VERILATOR_ROOT ?= $(shell bash -c 'verilator -V|grep VERILATOR_ROOT | head -1 | sed -e "s/^.*=\s*//"') | |
VINC := $(VERILATOR_ROOT)/include | |
obj_dir/Vblinky.cpp: blinky.v | |
$(VERILATOR) -GWIDTH=12 --trace -Wall -cc blinky.v | |
obj_dir/Vblinky__ALL.a: obj_dir/Vblinky.cpp | |
make --no-print-directory -C obj_dir -f Vblinky.mk | |
blinky: blinky.cpp obj_dir/Vblinky__ALL.a | |
g++ -I$(VINC) -I obj_dir \ | |
$(VINC)/verilated.cpp \ | |
$(VINC)/verilated_vcd_c.cpp \ | |
blinky.cpp obj_dir/Vblinky__ALL.a \ | |
-o blinky | |
.PHONY: clean | |
clean: | |
rm -rf obj_dir/ blinky blinkytrace.vcd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment