2021-07-05 18:37:40 -04:00
|
|
|
# This Makefile can be add to your design to compile projects using Verilog as an HDL,
|
|
|
|
# and an XDC as a constraint. You can also make changes to this file to build more specialized designs.
|
2021-06-08 14:12:42 -04:00
|
|
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
|
|
|
TOP := top
|
|
|
|
VERILOG := ${current_dir}/*.v
|
|
|
|
DEVICE := xc7a50t_test
|
|
|
|
BITSTREAM_DEVICE := artix7
|
2021-07-05 13:52:12 -04:00
|
|
|
BUILDDIR := build
|
2021-06-08 14:12:42 -04:00
|
|
|
|
|
|
|
ifeq ($(TARGET),arty_35)
|
|
|
|
PARTNAME := xc7a35tcsg324-1
|
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
|
|
|
else ifeq ($(TARGET),arty_100)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a100tcsg324-1
|
|
|
|
DEVICE := xc7a100t_test
|
2021-06-08 14:12:42 -04:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
|
|
|
else ifeq ($(TARGET),nexys4ddr)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a100tcsg324-1
|
|
|
|
DEVICE := xc7a100t_test
|
2021-06-08 14:12:42 -04:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/nexys4ddr
|
|
|
|
else ifeq ($(TARGET),zybo)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7z010clg400-1
|
|
|
|
DEVICE := xc7z010_test
|
|
|
|
BITSTREAM_DEVICE := zynq7
|
2021-06-08 14:12:42 -04:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/zybo
|
2021-07-05 13:52:12 -04:00
|
|
|
VERILOG := ${current_dir}/*.v
|
2021-06-08 14:12:42 -04:00
|
|
|
else ifeq ($(TARGET),nexys_video)
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a200tsbg484-1
|
|
|
|
DEVICE := xc7a200t_test
|
2021-06-08 14:12:42 -04:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/nexys_video
|
|
|
|
else
|
2021-07-05 13:52:12 -04:00
|
|
|
PARTNAME := xc7a35tcpg236-1
|
2021-06-08 14:12:42 -04:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/basys3
|
|
|
|
endif
|
|
|
|
|
|
|
|
XDC:=${current_dir}/*.xdc
|
|
|
|
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
|
|
|
|
|
|
|
all: ${BOARD_BUILDDIR}/${TOP}.bit
|
|
|
|
|
|
|
|
${BOARD_BUILDDIR}:
|
|
|
|
mkdir -p ${BOARD_BUILDDIR}
|
|
|
|
|
|
|
|
${BOARD_BUILDDIR}/${TOP}.eblif: | ${BOARD_BUILDDIR}
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_synth -t ${TOP} -v ${VERILOG} -d ${BITSTREAM_DEVICE} -p ${PARTNAME} -x ${XDC} 2>&1 > /dev/null
|
|
|
|
|
|
|
|
${BOARD_BUILDDIR}/${TOP}.net: ${BOARD_BUILDDIR}/${TOP}.eblif
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE} 2>&1 > /dev/null
|
|
|
|
|
|
|
|
${BOARD_BUILDDIR}/${TOP}.place: ${BOARD_BUILDDIR}/${TOP}.net
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_place -e ${TOP}.eblif -d ${DEVICE} -n ${TOP}.net -P ${PARTNAME} 2>&1 > /dev/null
|
|
|
|
|
|
|
|
${BOARD_BUILDDIR}/${TOP}.route: ${BOARD_BUILDDIR}/${TOP}.place
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_route -e ${TOP}.eblif -d ${DEVICE} 2>&1 > /dev/null
|
|
|
|
|
|
|
|
${BOARD_BUILDDIR}/${TOP}.fasm: ${BOARD_BUILDDIR}/${TOP}.route
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_write_fasm -e ${TOP}.eblif -d ${DEVICE}
|
|
|
|
|
|
|
|
${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
|
|
|
|
|
|
|
|
clean:
|
2021-08-20 15:26:26 -04:00
|
|
|
rm -rf ${BUILDDIR}
|