2020-04-22 06:58:21 -04:00
|
|
|
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
|
|
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
2020-12-08 07:06:54 -05:00
|
|
|
TOP := top
|
|
|
|
VERILOG := ${current_dir}/picosoc_noflash.v \
|
2020-04-22 06:58:21 -04:00
|
|
|
${current_dir}/picorv32.v \
|
|
|
|
${current_dir}/simpleuart.v \
|
|
|
|
${current_dir}/progmem.v
|
|
|
|
PARTNAME := xc7a35tcpg236-1
|
|
|
|
DEVICE := xc7a50t_test
|
|
|
|
BITSTREAM_DEVICE := artix7
|
|
|
|
PCF := ${current_dir}/basys3.pcf
|
2020-12-08 07:06:54 -05:00
|
|
|
SDC := ${current_dir}/picosoc.sdc
|
2020-04-22 06:58:21 -04:00
|
|
|
BUILDDIR := build
|
|
|
|
|
2020-12-08 07:06:54 -05:00
|
|
|
ifeq ($(TARGET),arty_35)
|
|
|
|
VERILOG += ${current_dir}/arty.v
|
|
|
|
PARTNAME := xc7a35tcsg324-1
|
|
|
|
PCF :=${current_dir}/arty.pcf
|
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
|
|
|
else ifeq ($(TARGET),arty_100)
|
|
|
|
VERILOG += ${current_dir}/arty.v
|
|
|
|
PARTNAME := xc7a100tcsg324-1
|
|
|
|
PCF:=${current_dir}/arty.pcf
|
|
|
|
DEVICE := xc7a100t_test
|
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
|
|
|
else
|
|
|
|
VERILOG += ${current_dir}/basys3.v
|
|
|
|
PARTNAME := xc7a35tcpg236-1
|
|
|
|
PCF := ${current_dir}/basys3.pcf
|
|
|
|
BOARD_BUILDDIR := ${BUILDDIR}/basys3
|
|
|
|
endif
|
|
|
|
|
2020-04-22 06:58:21 -04:00
|
|
|
all: ${BUILDDIR}/${TOP}.bit
|
|
|
|
|
|
|
|
${BUILDDIR}:
|
|
|
|
mkdir ${BUILDDIR}
|
|
|
|
|
|
|
|
${BUILDDIR}/${TOP}.eblif: | ${BUILDDIR}
|
2020-07-15 04:46:24 -04:00
|
|
|
cd ${BUILDDIR} && symbiflow_synth -t ${TOP} -v ${VERILOG} -d ${BITSTREAM_DEVICE} -p ${PARTNAME} 2>&1 > /dev/null
|
2020-04-22 06:58:21 -04:00
|
|
|
|
|
|
|
${BUILDDIR}/${TOP}.net: ${BUILDDIR}/${TOP}.eblif
|
2020-07-15 04:46:24 -04:00
|
|
|
cd ${BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 2>&1 > /dev/null
|
2020-04-22 06:58:21 -04:00
|
|
|
|
|
|
|
${BUILDDIR}/${TOP}.place: ${BUILDDIR}/${TOP}.net
|
2020-07-15 04:46:24 -04:00
|
|
|
cd ${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:21 -04:00
|
|
|
|
|
|
|
${BUILDDIR}/${TOP}.route: ${BUILDDIR}/${TOP}.place
|
2020-07-15 04:46:24 -04:00
|
|
|
cd ${BUILDDIR} && symbiflow_route -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 2>&1 > /dev/null
|
2020-04-22 06:58:21 -04:00
|
|
|
|
|
|
|
${BUILDDIR}/${TOP}.fasm: ${BUILDDIR}/${TOP}.route
|
2020-07-15 04:46:24 -04:00
|
|
|
cd ${BUILDDIR} && symbiflow_write_fasm -e ${TOP}.eblif -d ${DEVICE}
|
2020-04-22 06:58:21 -04:00
|
|
|
|
|
|
|
${BUILDDIR}/${TOP}.bit: ${BUILDDIR}/${TOP}.fasm
|
2020-07-15 04:46:24 -04:00
|
|
|
cd ${BUILDDIR} && symbiflow_write_bitstream -d ${BITSTREAM_DEVICE} -f ${TOP}.fasm -p ${PARTNAME} -b ${TOP}.bit
|
2020-04-22 06:58:21 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf ${BUILDDIR}
|
|
|
|
|