-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (29 loc) · 1.01 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
TARGET=taptempo
TOP=$(TARGET)
OBJS = $(PWD)/../../hdl/vhdl/taptempo_pkg.vhd\
$(PWD)/../../hdl/vhdl/$(TOP).vhd\
$(PWD)/../../hdl/vhdl/debounce.vhd\
$(PWD)/../../hdl/vhdl/per2bpm.vhd\
$(PWD)/../../hdl/vhdl/percount.vhd\
$(PWD)/../../hdl/vhdl/pwmgen.vhd\
$(PWD)/../../hdl/vhdl/rstgen.vhd\
$(PWD)/../../hdl/vhdl/timepulse.vhd
TRELLIS=/usr/local/share/trellis
all: ${TARGET}.bit
# Convert design in Verilog
$(TARGET).v : $(OBJS)
yosys -m ghdl -p 'ghdl --std=08 $(OBJS) -e $(TOP); write_verilog $(TARGET).v'
# VHDL synthesis !
$(TARGET).json: $(OBJS)
yosys -m ghdl -p 'ghdl --std=08 $(OBJS) -e $(TOP); synth_ecp5 -json $(TOP).json;'
$(TARGET)_out.config: $(TARGET).json
nextpnr-ecp5 --25k --package CABGA256 --speed 6\
--json $< --textcfg $@ --lpf $(TARGET).lpf --freq 25 #--force
$(TARGET).bit: $(TARGET)_out.config
ecppack --svf ${TARGET}.svf $< $@
${TARGET}.svf : ${TARGET}.bit
prog: ${TARGET}.svf
openFPGALoader -c digilent_hs2 $(TARGET).bit
clean:
rm -f *.svf *.bit *.config *.json *.ys
.PHONY: prog clean