2022-05-02 14:26:36 +00:00
|
|
|
buildpath = build/
|
|
|
|
filename = uart_test
|
|
|
|
files = top.v
|
|
|
|
pcf_file = io.pcf
|
2022-05-03 17:37:22 +00:00
|
|
|
pdc_file = io.pdc
|
2022-05-02 14:26:36 +00:00
|
|
|
|
|
|
|
.PHONY: build prog prog_flash clean
|
|
|
|
|
2022-05-03 17:37:22 +00:00
|
|
|
build_ice40:
|
2022-05-02 14:26:36 +00:00
|
|
|
yosys -p "synth_ice40 -json $(buildpath)$(filename).json -top top" $(files)
|
|
|
|
nextpnr-ice40 --up5k --json $(buildpath)$(filename).json --pcf $(pcf_file) --asc $(buildpath)$(filename).asc
|
|
|
|
icepack $(buildpath)$(filename).asc $(buildpath)$(filename).bin
|
|
|
|
|
2022-05-03 17:37:22 +00:00
|
|
|
prog_ice40: build #for sram
|
2022-05-02 14:26:36 +00:00
|
|
|
iceprog -S $(buildpath)$(filename).bin
|
|
|
|
|
2022-05-03 17:37:22 +00:00
|
|
|
prog_flash_ice40: build
|
2022-05-02 14:26:36 +00:00
|
|
|
iceprog $(buildpath)$(filename).bin
|
|
|
|
|
2022-05-03 17:37:22 +00:00
|
|
|
build_nx:
|
|
|
|
yosys -p "synth_nexus -json $(buildpath)$(filename).json -top top" $(files)
|
|
|
|
nextpnr-nexus --device LIFCL-40-9BG400 --pdc $(pdc_file) --json $(buildpath)$(filename).json --fasm $(buildpath)$(filename).fasm
|
|
|
|
prjoxide pack $(buildpath)$(filename).fasm $(buildpath)$(filename).bit
|
|
|
|
|
|
|
|
prog_nx: #for sram
|
|
|
|
ecpprog -S $(buildpath)$(filename).bit
|
|
|
|
|
|
|
|
prog_flash_nx:
|
|
|
|
ecpprog $(buildpath)$(filename).bit
|
|
|
|
|
2022-05-02 14:26:36 +00:00
|
|
|
clean:
|
|
|
|
rm -rf $(buildpath)/*
|