-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
127 lines (93 loc) · 2.95 KB
/
Makefile
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
ENGINE = docker
ICE40 = hx1k-tq144
ECP5 = 25k-CSFBGA285
BOARD = icestick
VHDLDIR = ../resources/vhdl
VLOGDIR = ../resources/verilog
CONSDIR = ../resources/constraints/$(BOARD)
test: all syn pnr bit
#
# Complete flow examples
#
all: all-ice40
all-ice40:
symbiflow all --oci-engine $(ENGINE) --part $(ICE40) \
--pcf $(CONSDIR)/clk.pcf --pcf $(CONSDIR)/led.pcf \
--top Blink -o build-ice40 --project ice40 $(VLOGDIR)/blink.v
#
# Synthesis examples
#
syn: \
vhdl-simple vhdl-complex vhdl-param vhdl-arch \
vlog-simple vlog-complex vlog-define vlog-include vlog-param \
syn-ice40 syn-ecp5
vhdl-simple:
symbiflow syn --oci-engine $(ENGINE) \
--top Blink -o build-$@ --project $@ $(VHDLDIR)/blink.vhdl
vhdl-complex:
symbiflow syn --oci-engine $(ENGINE) \
--top Top -o build-$@ --project $@ \
$(VHDLDIR)/blink.vhdl,blink_lib $(VHDLDIR)/blink_pkg.vhdl,blink_lib $(VHDLDIR)/top.vhdl
vhdl-param:
symbiflow syn --oci-engine $(ENGINE) \
--param BOO True --param INT 255 \
--top Params -o build-$@ --project $@ $(VHDLDIR)/generics.vhdl
vhdl-arch:
symbiflow syn --oci-engine $(ENGINE) \
--arch Second \
--top Arch -o build-$@ --project $@ $(VHDLDIR)/arch.vhdl
vlog-simple:
symbiflow syn --oci-engine $(ENGINE) \
--top Blink -o build-$@ --project $@ $(VLOGDIR)/blink.v
vlog-complex:
symbiflow syn --oci-engine $(ENGINE) \
--top Top -o build-$@ --project $@ $(VLOGDIR)/blink.v $(VLOGDIR)/top.v
vlog-define:
symbiflow syn --oci-engine $(ENGINE) \
--define DEFAULT_FREQ 10000000 --define DEFAULT_SECS 2 \
--top Defines -o build-$@ --project $@ $(VLOGDIR)/defines.v
vlog-include:
symbiflow syn --oci-engine $(ENGINE) \
--include $(VLOGDIR)/path1 --include $(VLOGDIR)/path2 \
--top Paths -o build-$@ --project $@ $(VLOGDIR)/paths.v
vlog-param:
symbiflow syn --oci-engine $(ENGINE) \
--param BOO 1 --param INT 255 --param LOG 1 \
--top Params -o build-$@ --project $@ $(VLOGDIR)/parameters.v
syn-ice40:
symbiflow syn --oci-engine $(ENGINE) --part $(ICE40) \
--top Blink -o build-ice40 --project ice40 $(VLOGDIR)/blink.v
syn-ecp5:
symbiflow syn --oci-engine $(ENGINE) --part $(ECP5) \
--top Blink -o build-ecp5 --project ecp5 $(VLOGDIR)/blink.v
#
# Place and Route examples
#
pnr: pnr-ice40 pnr-ecp5
pnr-ice40:
symbiflow pnr --oci-engine $(ENGINE) --part $(ICE40) \
--pcf $(CONSDIR)/clk.pcf --pcf $(CONSDIR)/led.pcf \
-o build-ice40 --project ice40
pnr-ecp5:
symbiflow pnr --oci-engine $(ENGINE) --part $(ECP5) \
-o build-ecp5 --project ecp5
#
# Bitstream generation examples
#
bit: bit-ice40 bit-ecp5
bit-ice40:
symbiflow bit --oci-engine $(ENGINE) --part $(ICE40) -o build-ice40 --project ice40
bit-ecp5:
symbiflow bit --oci-engine $(ENGINE) --part $(ECP5) -o build-ecp5 --project ecp5
#
# Programation examples
#
pgm-ice40:
symbiflow pgm --oci-engine $(ENGINE) --part $(ICE40) -o build-ice40 --project ice40
pgm-ecp5:
symbiflow pgm --oci-engine $(ENGINE) --part $(ECP5) -o build-ecp5 --project ecp5
#
# Clean
#
clean:
@rm -fr build-*