diff options
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 31 |
1 files changed, 4 insertions, 27 deletions
| @@ -1,38 +1,15 @@ | |||
| 1 | VERILOG := $(wildcard **.sv) | 1 | SOURCES := $(wildcard **.sv **.cpp) |
| 2 | HEADERS := $(wildcard **.svh) | 2 | COLLATERAL := $(wildcard **.hex **.svh) |
| 3 | CPPSRCS := $(wildcard **.cpp) | ||
| 4 | COLLATERAL := $(wildcard **.hex) | ||
| 5 | 3 | ||
| 6 | OPTS ?= | 4 | OPTS ?= |
| 7 | 5 | ||
| 8 | QUARTUS ?= /opt/quartus-lite/20.1.1.720/ | ||
| 9 | |||
| 10 | QUARTUS_SH := $(QUARTUS)/quartus/bin/quartus_sh | ||
| 11 | |||
| 12 | sim: build/Vtop | 6 | sim: build/Vtop |
| 13 | $< | 7 | $< |
| 14 | .PHONY: sim | 8 | .PHONY: sim |
| 15 | 9 | ||
| 16 | gui: build/toycpu.qpf | 10 | build/Vtop: $(SOURCES) $(COLLATERAL) |
| 17 | cd build; $(QUARTUS_SH) --gui toycpu | ||
| 18 | .PHONY: gui | ||
| 19 | |||
| 20 | qpf: build/toycpu.qpf | ||
| 21 | .PHONY: qpf | ||
| 22 | |||
| 23 | pof: build/toycpu.pof | ||
| 24 | .PHONY: pof | ||
| 25 | |||
| 26 | build/Vtop: $(VERILOG) $(HEADERS) $(CPPSRCS) $(COLLATERAL) | ||
| 27 | @mkdir -p build | ||
| 28 | verilator +1800-2017ext+sv -Wall -Wno-BLKSEQ -O3 $(OPTS) --Mdir build --trace --cc --build --exe --top-module top $(VERILOG) $(CPPSRCS) | ||
| 29 | |||
| 30 | build/toycpu.pof: build/toycpu.qpf $(VERILOG) $(COLLATERAL) | ||
| 31 | cd build; $(QUARTUS_SH) --flow compile toycpu | ||
| 32 | |||
| 33 | build/toycpu.qpf: init.tcl | ||
| 34 | @mkdir -p build | 11 | @mkdir -p build |
| 35 | cd build; $(QUARTUS_SH) -t ../$< $(addprefix $(PWD),$(VERILOG)) | 12 | verilator +1800-2017ext+sv -Wall -Wno-BLKSEQ -O3 $(OPTS) --Mdir build --trace --cc --build --exe --top-module top $(SOURCES) |
| 36 | 13 | ||
| 37 | clean: | 14 | clean: |
| 38 | rm -rf build | 15 | rm -rf build |
