summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJulian Blake Kongslie2021-03-23 12:22:38 -0700
committerJulian Blake Kongslie2021-03-23 12:22:38 -0700
commit5d95607192380be5cc62592efac52814a0e090df (patch)
tree656bc3ec79180a89f355681e454808ebce6eb6d9 /Makefile
downloadtoycpu-5d95607192380be5cc62592efac52814a0e090df.tar.xz
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d270ffb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
1VERILOG := $(wildcard **.sv)
2HEADERS := $(wildcard **.svh)
3CPPSRCS := $(wildcard **.cpp)
4COLLATERAL := $(wildcard **.hex)
5
6QUARTUS ?= /opt/quartus-lite/20.1.1.720/
7
8QUARTUS_SH := $(QUARTUS)/quartus/bin/quartus_sh
9
10sim: build/Vtop
11 $<
12.PHONY: sim
13
14gui: build/toycpu.qpf
15 cd build; $(QUARTUS_SH) --gui toycpu
16.PHONY: gui
17
18qpf: build/toycpu.qpf
19.PHONY: qpf
20
21pof: build/toycpu.pof
22.PHONY: pof
23
24build/Vtop: $(VERILOG) $(HEADERS) $(CPPSRCS) $(COLLATERAL)
25 @mkdir -p build
26 verilator +1800-2017ext+sv -Wall -Wno-BLKSEQ -O3 --Mdir build --trace --cc --build --exe --top-module top $(VERILOG) $(CPPSRCS)
27
28build/toycpu.pof: build/toycpu.qpf $(VERILOG) $(COLLATERAL)
29 cd build; $(QUARTUS_SH) --flow compile toycpu
30
31build/toycpu.qpf: init.tcl
32 @mkdir -p build
33 cd build; $(QUARTUS_SH) -t ../$< $(addprefix $(PWD),$(VERILOG))
34
35clean:
36 rm -rf build
37.PHONY: clean