1 # TOP - Name of the top-level module
2 # DEVICE - Name of the FPGA device (device-package-speed)
3 # PRJ - Name of .prj file with names of all source files. See XST manual.
4 # BMM - If design contains initialized memories, softcore MCU, etc., this
5 # file describes mapping of .elf file to these memories. Only one
6 # .bmm file can be used.
7 # ELF - File containing initialization data of memories described by
8 # previously defined .bmm file. Format can be .elf or .mem.
9 # SEARCH_DIRS - Directories to search when searching for netlists (.ngc, ...).
10 # See NGDBUILD manual.
11 # JTAG_POS - Position of device in JTAG chain. Used when downloading bit stream.
12 # INTSTYLE - Style of screen output. (ise | xflow | silent)
16 DEVICE = xc2s100-pq208
25 NGDBUILG_FLAGS = -aul # Allow Unmatched LOCs
31 # NOTICE: Impact when using in batch mode won't download bitfile to the
32 # FPGA. Solution I found is to call 'program -p 1' at the end of the
33 # procedure. See 'download' target.
35 ifneq (${strip ${BMM}},)
36 BITFILE = ${TOP}_rp.bit
41 #===============================================================================
43 .PHONY: all synth ngdbuild map implement download clean
49 #===============================================================================
51 synth ${TOP}.ngc: ${PRJ}
54 ${addprefix -ifn ,${PRJ}} \
65 ngdbuild ${TOP}.ngd: ${TOP}.ngc ${BMM} ${TOP}.ucf
67 ${addprefix -bm ,${BMM}} \
68 -intstyle ${INTSTYLE} \
72 ${addprefix -sd ,${SEARCH_DIRS}} \
77 map ${TOP}.ncd: ${TOP}.ngd
80 -intstyle ${INTSTYLE} \
85 -intstyle ${INTSTYLE} \
90 ${TOP}.bit: ${TOP}.ncd
91 bitgen -w ${TOP}.ncd ${TOP}.bit ${TOP}.pcf
93 ${TOP}_rp.bit: ${TOP}.bit ${ELF}
94 data2mem -bm ${basename ${BMM}}_bd.bmm -bd ${ELF} -bt ${TOP}.bit -o b ${TOP}_rp.bit
100 setCable -port auto \n\
102 assignFile -p ${JTAG_POS} -file ${BITFILE} \n\
103 program -p ${JTAG_POS} \n\
105 exit" | impact -batch
107 #===============================================================================
110 rm -f _impactbatch.log
111 rm -f ${basename ${BMM}}_bd.bmm
131 rm -f ${TOP}_summary.xml
132 rm -f ${TOP}.unroutes
133 rm -f ${TOP}_usage.xml
137 #===============================================================================
141 -e 's/[ \t][ \t]*/ /g' \
143 -e 's/^ //' -e 's/ $$//' \
144 -e 's|\(.*\) \(.*\) \(.*\)|$<: \3|' \
150 include ${PRJ:.prj=.d}