VERILOG := $(wildcard **.sv) HEADERS := $(wildcard **.svh) CPPSRCS := $(wildcard **.cpp) COLLATERAL := $(wildcard **.hex) OPTS ?= QUARTUS ?= /opt/quartus-lite/20.1.1.720/ QUARTUS_SH := $(QUARTUS)/quartus/bin/quartus_sh sim: build/Vtop $< .PHONY: sim gui: build/toycpu.qpf cd build; $(QUARTUS_SH) --gui toycpu .PHONY: gui qpf: build/toycpu.qpf .PHONY: qpf pof: build/toycpu.pof .PHONY: pof build/Vtop: $(VERILOG) $(HEADERS) $(CPPSRCS) $(COLLATERAL) @mkdir -p build verilator +1800-2017ext+sv -Wall -Wno-BLKSEQ -O3 $(OPTS) --Mdir build --trace --cc --build --exe --top-module top $(VERILOG) $(CPPSRCS) build/toycpu.pof: build/toycpu.qpf $(VERILOG) $(COLLATERAL) cd build; $(QUARTUS_SH) --flow compile toycpu build/toycpu.qpf: init.tcl @mkdir -p build cd build; $(QUARTUS_SH) -t ../$< $(addprefix $(PWD),$(VERILOG)) clean: rm -rf build .PHONY: clean