From fd7b64d83c8b3fd58414b1e6798b4022e2fe4c29 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 18 Jan 2019 11:45:25 -0800 Subject: [PATCH] CPLD: Add files for making bitstreams via Makefile. --- firmware/cpld/sgpio_if/Makefile | 47 +++++++++++++++++++++++++++++++ firmware/cpld/sgpio_if/batch_svf | 7 +++++ firmware/cpld/sgpio_if/batch_xsvf | 7 +++++ 3 files changed, 61 insertions(+) create mode 100644 firmware/cpld/sgpio_if/Makefile create mode 100755 firmware/cpld/sgpio_if/batch_svf create mode 100755 firmware/cpld/sgpio_if/batch_xsvf diff --git a/firmware/cpld/sgpio_if/Makefile b/firmware/cpld/sgpio_if/Makefile new file mode 100644 index 00000000..5187c5a8 --- /dev/null +++ b/firmware/cpld/sgpio_if/Makefile @@ -0,0 +1,47 @@ +# xst -intstyle ise -ifn top.xst -ofn top.syr +# ngdbuild -intstyle ise -dd _ngo -uc top.ucf -p xc2c64a-VQ100-7 top.ngc top.ngd +# cpldfit -intstyle ise -p xc2c64a-7-VQ100 -ofmt vhdl -optimize density -loc on -slew slow -init low -inputs 32 -pterms 28 -unused pullup -terminate float -iostd LVCMOS33 top.ngd +# tsim -intstyle ise top top.nga +# taengine -intstyle ise -f top -l top.tim -e {taengine.err} +# hprep6 -s IEEE1149 -i top +# vhdtdtfi -prj sgpio_if -o top.vhi -module top -template /opt/Xilinx/14.7/ISE_DS/ISE/data/vhdlinst.tft -deleteonerror -lib work top.vhd + +DESIGN=top + +DEVICE=xc2c64a +DEVICE_SPEED=7 +DEVICE_PACKAGE=VQ100 + +OUTFILES_XST=$(DESIGN).ngc $(DESIGN).syr $(DESIGN).ngr $(DESIGN)_xst.xrpt $(DESIGN).lso _xmsgs/xst.xmsgs +OUTFILES_NGDBUILD=$(DESIGN).ngd $(DESIGN).bld $(DESIGN)_ngdbuild.xrpt _xmsgs/ngdbuild.xmsgs _ngo/netlist.lst xlnx_auto_0_xdb/cst.xbcd +OUTFILES_CPLDFIT=$(DESIGN).vm6 $(DESIGN).tspec t6.phd t6.dat t55.phd t55.dat t1.phd t1.dat $(DESIGN).log $(DESIGN).chk $(DESIGN).rpt $(DESIGN).xml $(DESIGN)_build.xml $(DESIGN).pad $(DESIGN)_pad.csv $(DESIGN).pnx $(DESIGN).mfd $(DESIGN).cxt $(DESIGN).gyd _xmsgs/cpldfit.xmsgs +OUTFILES_HPREP6=$(DESIGN).jed tmperr.err _xmsgs/hprep6.xmsgs +OUTFILES_IMPACT_SVF=default.svf _impactbatch.log +OUTFILES_IMPACT_XSVF=default.xsvf _impactbatch.log + +all: default.svf default.xsvf + +$(DESIGN).ngc: $(DESIGN).xst $(DESIGN).prj + mkdir -p xst/projnav.tmp + xst -intstyle ise -ifn $(DESIGN).xst -ofn $(DESIGN).syr + +$(DESIGN).ngd: $(DESIGN).ngc $(DESIGN).ucf + ngdbuild -intstyle ise -dd _ngo -uc $(DESIGN).ucf -p $(DEVICE)-$(DEVICE_PACKAGE)-$(DEVICE_SPEED) $(DESIGN).ngc $(DESIGN).ngd + +$(DESIGN).vm6: $(DESIGN).ngd + cpldfit -intstyle ise -p $(DEVICE)-$(DEVICE_SPEED)-$(DEVICE_PACKAGE) -ofmt vhdl -optimize density -loc on -slew slow -init low -inputs 32 -pterms 28 -unused pullup -terminate float -iostd LVCMOS33 $(DESIGN).ngd + +$(DESIGN).jed: $(DESIGN).vm6 + hprep6 -s IEEE1149 -i $(DESIGN).vm6 + +default.svf: $(DESIGN).jed batch_svf + impact -batch batch_svf + +default.xsvf: $(DESIGN).jed batch_xsvf + impact -batch batch_xsvf + +.PHONY: clean + +clean: + rm -f $(OUTFILES_XST) $(OUTFILES_NGDBUILD) $(OUTFILES_CPLDFIT) $(OUTFILES_HPREP6) $(OUTFILES_IMPACT_SVF) $(OUTFILES_IMPACT_XSVF) + rm -rf xlnx_auto_0_xdb/ _ngo/ _xmsgs/ xst/ diff --git a/firmware/cpld/sgpio_if/batch_svf b/firmware/cpld/sgpio_if/batch_svf new file mode 100755 index 00000000..35f57ccc --- /dev/null +++ b/firmware/cpld/sgpio_if/batch_svf @@ -0,0 +1,7 @@ +setMode -bscan +setCable -port svf -file default.svf +addDevice -p 1 -file top.jed +Erase -p 1 +Program -p 1 -e -v +Verify -p 1 +quit diff --git a/firmware/cpld/sgpio_if/batch_xsvf b/firmware/cpld/sgpio_if/batch_xsvf new file mode 100755 index 00000000..70612016 --- /dev/null +++ b/firmware/cpld/sgpio_if/batch_xsvf @@ -0,0 +1,7 @@ +setMode -bscan +setCable -port xsvf -file default.xsvf +addDevice -p 1 -file top.jed +Erase -p 1 +Program -p 1 -e -v +Verify -p 1 +quit