2020-04-22 06:58:52 -04:00
|
|
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
|
|
|
TOP := top
|
|
|
|
VERILOG := ${current_dir}/baselitex_arty.v \
|
|
|
|
${current_dir}/VexRiscv_Linux.v
|
|
|
|
MEM_INIT := ${current_dir}/mem.init \
|
|
|
|
${current_dir}/mem_1.init \
|
|
|
|
${current_dir}/mem_2.init
|
|
|
|
BITSTREAM_DEVICE := artix7
|
|
|
|
PCF := ${current_dir}/arty.pcf
|
2020-04-23 06:59:27 -04:00
|
|
|
SDC := ${current_dir}/arty.sdc
|
2020-05-02 08:17:47 -04:00
|
|
|
XDC := ${current_dir}/arty.xdc
|
2020-11-30 05:08:09 -05:00
|
|
|
BUILDDIR := build
|
2020-09-18 00:32:54 -04:00
|
|
|
|
|
|
|
ifeq ($(TARGET),arty_100)
|
|
|
|
PARTNAME := xc7a100tcsg324-1
|
|
|
|
DEVICE := xc7a100t_test
|
2020-12-21 08:36:24 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
2020-09-18 00:32:54 -04:00
|
|
|
else
|
|
|
|
PARTNAME := xc7a35tcsg324-1
|
|
|
|
DEVICE := xc7a50t_test
|
2020-12-21 08:36:24 -05:00
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
2020-09-18 00:32:54 -04:00
|
|
|
endif
|
2020-04-22 06:58:52 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
all: ${BOARD_BUILDDIR}/${TOP}.bit
|
2020-04-22 06:58:52 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}:
|
|
|
|
mkdir -p ${BOARD_BUILDDIR}
|
|
|
|
ln -s ${MEM_INIT} ${BOARD_BUILDDIR}
|
2020-04-22 06:58:52 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${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
|
2020-04-22 06:58:52 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.net: ${BOARD_BUILDDIR}/${TOP}.eblif
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 2>&1 > /dev/null
|
2020-04-22 06:58:52 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.place: ${BOARD_BUILDDIR}/${TOP}.net
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_place -e ${TOP}.eblif -d ${DEVICE} -p ${PCF} -n ${TOP}.net -P ${PARTNAME} -s ${SDC} 2>&1 > /dev/null
|
2020-04-22 06:58:52 -04:00
|
|
|
|
2020-11-30 05:08:09 -05:00
|
|
|
${BOARD_BUILDDIR}/${TOP}.route: ${BOARD_BUILDDIR}/${TOP}.place
|
|
|
|
cd ${BOARD_BUILDDIR} && symbiflow_route -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 2>&1 > /dev/null
|
2020-04-22 06:58:52 -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-22 06:58:52 -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-22 06:58:52 -04:00
|
|
|
|
|
|
|
clean:
|
2020-11-30 05:08:09 -05:00
|
|
|
rm -rf ${BUILDDIR}
|