Skip to content

Instantly share code, notes, and snippets.

@74hc595
Created August 23, 2022 15:30
Show Gist options
  • Save 74hc595/1aed83a79c56764c7fe49206e6ca16da to your computer and use it in GitHub Desktop.
Save 74hc595/1aed83a79c56764c7fe49206e6ca16da to your computer and use it in GitHub Desktop.
# Configure these directories for your machine
PRJBUREAU_PATH = ../../prjbureau
WINCUPL_WINE_PATH = c:\\Wincupl
FILENAME = foo
DEVICE = ATF1504AS
FITTERDEV = P1504CT44
# Compiled JED file
JED = $(FILENAME).jed
# Output SVF file (for programming)
SVF = $(FILENAME).svf
FITREPORT = $(FILENAME).fit
CUPL = wine $(WINCUPL_WINE_PATH)\\Shared\\cupl.exe
FITTER = wine $(WINCUPL_WINE_PATH)\\WinCupl\\Fitters\\fit1504.exe
CUPLFLAGS = -jlxd -kb -ks -m4
CUPLLIB = $(WINCUPL_WINE_PATH)\\Shared\\cupl.dl
FITTERFLAGS = -CUPL -dev $(FITTERDEV) -JTAG ON
.PHONY: all clean flash unlock
.KEEP: $(FILENAME).tt2 $(FILENAME).jed
all: $(SVF)
%.tt2: %.pld
$(CUPL) $(CUPLFLAGS) -u $(CUPLLIB) $<
%.jed: %.tt2
$(FITTER) -i $< -o $@ $(FITTERFLAGS)
@tail -n 22 $(FITREPORT)
%.svf: %.jed
PYTHONPATH=$(PRJBUREAU_PATH) python3 -m util.fuseconv -d $(DEVICE) $< $@
flash: $(SVF)
openocd -f atf1504as.cfg
clean:
rm -f $(SVF) $(ATMISP_LOGFILE) *.abs *.doc *.fit *.io *.jed *.lst *.pdf *.pin *.pla *.sim *.tt2 *.tt3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment