2020-04-20 11:02:06 -04:00
|
|
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
2021-07-05 13:52:12 -04:00
|
|
|
TOP := top
|
|
|
|
VERILOG := ${current_dir}/counter.v
|
|
|
|
DEVICE := xc7a50t_test
|
2020-04-20 11:02:06 -04:00
|
|
|
BITSTREAM_DEVICE := artix7
|
2021-07-05 13:52:12 -04:00
|
|
|
BUILDDIR := build
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-10-13 19:21:28 -04:00
|
|
|
ifeq ($(TARGET),arty_35)
|
2020-06-10 04:03:21 -04:00
|
|
|
PARTNAME := xc7a35tcsg324-1
|
2021-07-05 13:52:12 -04:00
|
|
|
XDC := ${current_dir}/arty.xdc
|
2020-11-30 05:08:09 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
2020-07-15 08:27:45 -04:00
|
|
|
else ifeq ($(TARGET),arty_100)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a100tcsg324-1
|
|
|
|
XDC := ${current_dir}/arty.xdc
|
|
|
|
DEVICE := xc7a100t_test
|
2020-11-30 05:08:09 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
2021-04-21 12:34:26 -04:00
|
|
|
else ifeq ($(TARGET),nexys4ddr)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a100tcsg324-1
|
|
|
|
XDC := ${current_dir}/nexys4ddr.xdc
|
|
|
|
DEVICE := xc7a100t_test
|
2021-04-21 12:34:26 -04:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/nexys4ddr
|
2020-12-09 11:35:15 -05:00
|
|
|
else ifeq ($(TARGET),zybo)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7z010clg400-1
|
|
|
|
XDC := ${current_dir}/zybo.xdc
|
|
|
|
DEVICE := xc7z010_test
|
|
|
|
BITSTREAM_DEVICE := zynq7
|
2020-12-09 11:35:15 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/zybo
|
|
|
|
VERILOG:=${current_dir}/counter_zynq.v
|
2020-11-30 05:46:40 -05:00
|
|
|
else ifeq ($(TARGET),nexys_video)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a200tsbg484-1
|
|
|
|
XDC := ${current_dir}/nexys_video.xdc
|
|
|
|
DEVICE := xc7a200t_test
|
2020-11-30 05:46:40 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/nexys_video
|
2020-06-10 04:03:21 -04:00
|
|
|
else
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a35tcpg236-1
|
|
|
|
XDC := ${current_dir}/basys3.xdc
|
2020-11-30 05:08:09 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/basys3
|
2020-06-10 04:03:21 -04:00
|
|
|
endif
|
|
|
|
|
2021-01-25 17:57:00 -05:00
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
all: ${BOARD_BUILDDIR}/${TOP}.bit
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}:
|
|
|
|
mkdir -p ${BOARD_BUILDDIR}
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.eblif: | ${BOARD_BUILDDIR}
|
2020-12-09 11:35:15 -05:00
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_synth -t ${TOP} -v ${VERILOG} -d ${BITSTREAM_DEVICE} -p ${PARTNAME} -x ${XDC} 2>&1 > /dev/null
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.net: ${BOARD_BUILDDIR}/${TOP}.eblif
|
2020-12-09 11:35:15 -05:00
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE} 2>&1 > /dev/null
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.place: ${BOARD_BUILDDIR}/${TOP}.net
|
2020-12-09 11:35:15 -05:00
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_place -e ${TOP}.eblif -d ${DEVICE} -n ${TOP}.net -P ${PARTNAME} 2>&1 > /dev/null
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.route: ${BOARD_BUILDDIR}/${TOP}.place
|
2020-12-09 11:35:15 -05:00
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_route -e ${TOP}.eblif -d ${DEVICE} 2>&1 > /dev/null
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.fasm: ${BOARD_BUILDDIR}/${TOP}.route
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_write_fasm -e ${TOP}.eblif -d ${DEVICE}
|
2020-04-20 11:02:06 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.bit: ${BOARD_BUILDDIR}/${TOP}.fasm
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_write_bitstream -d ${BITSTREAM_DEVICE} -f ${TOP}.fasm -p ${PARTNAME} -b ${TOP}.bit
|
2020-04-20 11:02:06 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf ${BUILDDIR}
|