aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/examples/template.mk
blob: 8bdded3f591749009c543941d10a26413454caf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
include ../common.mk

.DELETE_ON_ERROR:
.PHONY: all debug clean

all: build/$(DESIGN).dcp

build:
	mkdir build

build/$(DESIGN).netlist: build/$(DESIGN).json
	/usr/bin/time -v python3 -mfpga_interchange.yosys_json \
		--schema_dir $(INTERCHANGE_PATH) \
		--device $(DEVICE) \
		--top $(DESIGN_TOP) \
		build/$(DESIGN).json \
		build/$(DESIGN).netlist

build/$(DESIGN)_netlist.yaml: build/$(DESIGN).netlist
	/usr/bin/time -v python3 -mfpga_interchange.convert \
		--schema_dir $(INTERCHANGE_PATH) \
		--schema logical \
		--input_format capnp \
		--output_format yaml \
		build/$(DESIGN).netlist \
		build/$(DESIGN)_netlist.yaml

build/$(DESIGN).phys: build/$(DESIGN).netlist
	$(NEXTPNR_BIN) \
		--chipdb $(BBA_PATH) \
		--xdc $(DESIGN).xdc \
		--netlist build/$(DESIGN).netlist \
		--phys build/$(DESIGN).phys \
		--package $(PACKAGE) \

build/$(DESIGN)_phys.yaml: build/$(DESIGN).phys
	/usr/bin/time -v python3 -mfpga_interchange.convert \
		--schema_dir $(INTERCHANGE_PATH) \
		--schema physical \
		--input_format capnp \
		--output_format yaml \
		build/$(DESIGN).phys \
		build/$(DESIGN)_phys.yaml

debug: build/$(DESIGN).netlist
	gdb --args $(NEXTPNR_BIN) \
		--chipdb $(BBA_PATH) \
		--xdc $(DESIGN).xdc \
		--netlist build/$(DESIGN).netlist \
		--phys build/$(DESIGN).phys \
		--package $(PACKAGE)

build/$(DESIGN).dcp: build/$(DESIGN).netlist build/$(DESIGN).phys $(DESIGN).xdc
	RAPIDWRIGHT_PATH=$(RAPIDWRIGHT_PATH) \
		$(RAPIDWRIGHT_PATH)/scripts/invoke_rapidwright.sh \
		com.xilinx.rapidwright.interchange.PhysicalNetlistToDcp \
		build/$(DESIGN).netlist build/$(DESIGN).phys $(DESIGN).xdc build/$(DESIGN).dcp

clean:
	rm -rf build