Created
May 31, 2021 16:33
-
-
Save nihirash/3ee42edb2ff98079f76a624efaa18ae6 to your computer and use it in GitHub Desktop.
Makefile for Lattice ECP5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d)) | |
| SOURCES=$(call rwildcard,rtl,*.v) | |
| RESULT=hardware | |
| TOP=top | |
| NEXTPNRPARAMS=--25k --package CABGA256 --speed 6 | |
| LPF=icesugar_pro | |
| all: $(RESULT).bin | |
| $(RESULT).bin: $(RESULT).cfg | |
| ecppack --svf ${RESULT}.svf $(RESULT).cfg $(RESULT).bin | |
| $(RESULT).cfg: $(RESULT).json | |
| nextpnr-ecp5 $(NEXTPNRPARAMS) --json $(RESULT).json --lpf $(LPF).lpf --textcfg $(RESULT).cfg | |
| $(RESULT).json: $(SOURCES) $(LPF).lpf $(MEMORY_DUMPS) $(ROM).rom | |
| yosys -p 'synth_ecp5 -top $(TOP) -json $(RESULT).json' $(SOURCES) | |
| clean: | |
| rm *.cfg *.svf *.bin *.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment