Created
May 31, 2021 16:27
-
-
Save nihirash/fbd743e52a192268d2fdb1fc4b64e2c8 to your computer and use it in GitHub Desktop.
Building ice40 projects :-)
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=--up5k --package sg48 | |
| PCF=top | |
| all: $(RESULT).bin | |
| $(RESULT).bin: $(RESULT).asc | |
| icepack $(RESULT).asc $(RESULT).bin | |
| $(RESULT).asc: $(RESULT).json | |
| nextpnr-ice40 $(NEXTPNRPARAMS) --json $(RESULT).json --pcf $(PCF).pcf --asc $(RESULT).asc | |
| $(RESULT).json: $(SOURCES) $(TOP).pcf vga.hex | |
| yosys -p 'synth_ice40 -top $(TOP) -json $(RESULT).json' $(SOURCES) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment