# $Id: Makefile.xflow_cpld 311 2010-06-30 17:52:37Z mueller $
|
# $Id: Makefile.xflow_cpld 311 2010-06-30 17:52:37Z mueller $
|
#
|
#
|
# Revision History:
|
# Revision History:
|
# Date Rev Version Comment
|
# Date Rev Version Comment
|
# 2010-03-13 268 1.0 Initial version, cloned from .xflow Rev 252
|
# 2010-03-13 268 1.0 Initial version, cloned from .xflow Rev 252
|
#---
|
#---
|
#
|
#
|
# setup default device
|
# setup default device
|
#
|
#
|
ifndef ISE_PATH
|
ifndef ISE_PATH
|
ISE_PATH = xc2c64a-7-vq44
|
ISE_PATH = xc2c64a-7-vq44
|
endif
|
endif
|
#
|
#
|
# setup defaults for xflow option files for synthesis and implementation
|
# setup defaults for xflow option files for synthesis and implementation
|
#
|
#
|
ifndef XFLOWOPT_SYN
|
ifndef XFLOWOPT_SYN
|
XFLOWOPT_SYN = xst_vhdl.opt
|
XFLOWOPT_SYN = xst_vhdl.opt
|
endif
|
endif
|
#
|
#
|
ifndef XFLOWOPT_IMP
|
ifndef XFLOWOPT_IMP
|
XFLOWOPT_IMP = balanced.opt
|
XFLOWOPT_IMP = balanced.opt
|
endif
|
endif
|
#
|
#
|
XFLOW = xflow -p ${ISE_PATH}
|
XFLOW = xflow -p ${ISE_PATH}
|
#
|
#
|
# $@ first target
|
# $@ first target
|
# $< first dependency
|
# $< first dependency
|
# $* stem in rule match
|
# $* stem in rule match
|
#
|
#
|
# when chaining, don't delete 'expensive' intermediate files:
|
# when chaining, don't delete 'expensive' intermediate files:
|
.SECONDARY :
|
.SECONDARY :
|
#
|
#
|
# Synthesize (xst)
|
# Synthesize (xst)
|
# input: %.prj project file
|
# input: %.prj project file
|
# output: %.ngc
|
# output: %.ngc
|
# %_xst.log xst log file
|
# %_xst.log xst log file
|
#
|
#
|
# Note: removed "cp ${RETROBASE}/vlib/${XFLOWOPT_SYN} ./ise" option
|
# Note: removed "cp ${RETROBASE}/vlib/${XFLOWOPT_SYN} ./ise" option
|
#
|
#
|
%.ngc: %.vbom
|
%.ngc: %.vbom
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
(cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
|
(cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
|
(cd ./ise; touch $*.xcf)
|
(cd ./ise; touch $*.xcf)
|
if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi
|
if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi
|
if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
|
if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
|
${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj
|
${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj
|
(cd ./ise; chmod -x *.* )
|
(cd ./ise; chmod -x *.* )
|
if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
|
if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
|
if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
|
if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
|
@ echo "==============================================================="
|
@ echo "==============================================================="
|
@ echo "* Makefile.xflow: XST Diagnostic Summary *"
|
@ echo "* Makefile.xflow: XST Diagnostic Summary *"
|
@ echo "==============================================================="
|
@ echo "==============================================================="
|
@ grep -i -A 1 ":.*:" $*_xst.log
|
@ grep -i -A 1 ":.*:" $*_xst.log
|
@ echo "==============================================================="
|
@ echo "==============================================================="
|
#
|
#
|
# the following rule needed to generate an %_*sim.vhd in a ./tb sub-directory
|
# the following rule needed to generate an %_*sim.vhd in a ./tb sub-directory
|
# it will look for a matching vbom in the parent directory
|
# it will look for a matching vbom in the parent directory
|
%.ngc: ../%.vbom
|
%.ngc: ../%.vbom
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
(cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
|
(cd ./ise; vbomconv --xst_prj ../$< > $*.prj)
|
(cd ./ise; touch $*.xcf)
|
(cd ./ise; touch $*.xcf)
|
if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi
|
if [ -r $*.xcf ]; then cp $*.xcf ./ise; fi
|
if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
|
if [ -r ${XFLOWOPT_SYN} ]; then cp ${XFLOWOPT_SYN} ./ise; fi
|
${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj
|
${XFLOW} -wd ise -synth ${XFLOWOPT_SYN} $*.prj
|
(cd ./ise; chmod -x *.* )
|
(cd ./ise; chmod -x *.* )
|
if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
|
if [ -r ./ise/$*.ngc ]; then cp -p ./ise/$*.ngc .; fi
|
if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
|
if [ -r ./ise/$*_xst.log ]; then cp -p ./ise/$*_xst.log .; fi
|
@ echo "==============================================================="
|
@ echo "==============================================================="
|
@ echo "* Makefile.xflow: XST Diagnostic Summary *"
|
@ echo "* Makefile.xflow: XST Diagnostic Summary *"
|
@ echo "==============================================================="
|
@ echo "==============================================================="
|
@ grep -i -A 1 ":.*:" $*_xst.log
|
@ grep -i -A 1 ":.*:" $*_xst.log
|
@ echo "==============================================================="
|
@ echo "==============================================================="
|
#
|
#
|
# Fit (map + cpldfit +
|
# Fit (map + cpldfit +
|
# input: %.ngc project file
|
# input: %.ngc project file
|
# output: %.ncd
|
# output: %.ncd
|
# %.jed
|
# %.jed
|
# %_tra.log translate (ngdbuild) log file (renamed %.bld)
|
# %_tra.log translate (ngdbuild) log file (renamed %.bld)
|
# %_fit.log cpldfit log file (renamed %.rpt)
|
# %_fit.log cpldfit log file (renamed %.rpt)
|
# %_tim.log timing analyser log file (renamed %.tim)
|
# %_tim.log timing analyser log file (renamed %.tim)
|
# %_pad.log pad file (renamed %.pad)
|
# %_pad.log pad file (renamed %.pad)
|
#
|
#
|
# Note: removed "cp ${RETROBASE}/vlib/balanced.opt" option
|
# Note: removed "cp ${RETROBASE}/vlib/balanced.opt" option
|
# currently ise 'density.opt' as steering file
|
# currently ise 'density.opt' as steering file
|
#
|
#
|
%.ncd %.jed: %.ngc
|
%.ncd %.jed: %.ngc
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
if [ ! -d ./ise ]; then mkdir ./ise; fi
|
if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi
|
if [ -r $*.ngc ]; then cp -p $*.ngc ./ise; fi
|
if [ -r $*.ucf ]; then cp -p $*.ucf ./ise; fi
|
if [ -r $*.ucf ]; then cp -p $*.ucf ./ise; fi
|
if [ -r ${XFLOWOPT_IMP} ]; then cp -p ${XFLOWOPT_IMP} ./ise; fi
|
if [ -r ${XFLOWOPT_IMP} ]; then cp -p ${XFLOWOPT_IMP} ./ise; fi
|
${XFLOW} -wd ise -fit ${XFLOWOPT_IMP} $<
|
${XFLOW} -wd ise -fit ${XFLOWOPT_IMP} $<
|
(cd ./ise; chmod -x *.* )
|
(cd ./ise; chmod -x *.* )
|
if [ -r ./ise/$*.ncd ]; then cp -p ./ise/$*.ncd .; fi
|
if [ -r ./ise/$*.ncd ]; then cp -p ./ise/$*.ncd .; fi
|
if [ -r ./ise/$*.jed ]; then cp -p ./ise/$*.jed .; fi
|
if [ -r ./ise/$*.jed ]; then cp -p ./ise/$*.jed .; fi
|
if [ -r ./ise/$*.bld ]; then cp -p ./ise/$*.bld ./$*_tra.log; fi
|
if [ -r ./ise/$*.bld ]; then cp -p ./ise/$*.bld ./$*_tra.log; fi
|
if [ -r ./ise/$*.rpt ]; then cp -p ./ise/$*.rpt ./$*_fit.log; fi
|
if [ -r ./ise/$*.rpt ]; then cp -p ./ise/$*.rpt ./$*_fit.log; fi
|
if [ -r ./ise/$*.tim ]; then cp -p ./ise/$*.tim ./$*_tim.log; fi
|
if [ -r ./ise/$*.tim ]; then cp -p ./ise/$*.tim ./$*_tim.log; fi
|
if [ -r ./ise/$*.pad ]; then cp -p ./ise/$*.pad ./$*_pad.log; fi
|
if [ -r ./ise/$*.pad ]; then cp -p ./ise/$*.pad ./$*_pad.log; fi
|
#
|
#
|
# generate dep_xst files from vbom
|
# generate dep_xst files from vbom
|
#
|
#
|
%.dep_xst: %.vbom
|
%.dep_xst: %.vbom
|
vbomconv --dep_xst $< > $@
|
vbomconv --dep_xst $< > $@
|
#
|
#
|
# generate cpp'ed ucf files from ucf_cpp
|
# generate cpp'ed ucf files from ucf_cpp
|
#
|
#
|
%.ucf : %.ucf_cpp
|
%.ucf : %.ucf_cpp
|
cpp $*.ucf_cpp $*.ucf
|
cpp $*.ucf_cpp $*.ucf
|
#
|
#
|
# generate nested dependency rules for cpp'ed ucf files from ucf_cpp
|
# generate nested dependency rules for cpp'ed ucf files from ucf_cpp
|
#
|
#
|
%.dep_ucf_cpp : %.ucf_cpp
|
%.dep_ucf_cpp : %.ucf_cpp
|
cpp -MM $*.ucf_cpp | sed 's/\.o:/\.ucf:/' > $*.dep_ucf_cpp
|
cpp -MM $*.ucf_cpp | sed 's/\.o:/\.ucf:/' > $*.dep_ucf_cpp
|
#
|
#
|
.phony : ise_clean ise_tmp_clean
|
.phony : ise_clean ise_tmp_clean
|
#
|
#
|
ise_clean: ise_tmp_clean
|
ise_clean: ise_tmp_clean
|
rm -rf *.ngc
|
rm -rf *.ngc
|
rm -rf *.ncd
|
rm -rf *.ncd
|
rm -rf *.jed
|
rm -rf *.jed
|
rm -rf *_xst.log
|
rm -rf *_xst.log
|
rm -rf *_tra.log
|
rm -rf *_tra.log
|
rm -rf *_fit.log
|
rm -rf *_fit.log
|
rm -rf *_tim.log
|
rm -rf *_tim.log
|
rm -rf *_pad.log
|
rm -rf *_pad.log
|
#
|
#
|
ise_tmp_clean:
|
ise_tmp_clean:
|
rm -rf ./ise
|
rm -rf ./ise
|
#
|
#
|
|
|