Common Makefile v2 and changed all examples
Signed-off-by: Joshua Fife <jpfife17@gmail.com>
This commit is contained in:
parent
37db02b726
commit
5d1de90055
|
@ -1,54 +1,15 @@
|
||||||
BUILDDIR := ${current_dir}/build
|
BUILDDIR := ${current_dir}/build
|
||||||
|
BOARD_BUILDDIR := ${BUILDDIR}/${TARGET}
|
||||||
# Set board properties based on TARGET variable
|
|
||||||
ifeq ($(TARGET),arty_35)
|
|
||||||
DEVICE := xc7a50t_test
|
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PARTNAME := xc7a35tcsg324-1
|
|
||||||
CONSTRAINT_PATH := ${current_dir}/arty
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
|
||||||
else ifeq ($(TARGET),arty_100)
|
|
||||||
DEVICE := xc7a100t_test
|
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PARTNAME := xc7a100tcsg324-1
|
|
||||||
CONSTRAINT_PATH := ${current_dir}/arty
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
|
||||||
else ifeq ($(TARGET),nexys4ddr)
|
|
||||||
DEVICE := xc7a100t_test
|
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PARTNAME := xc7a100tcsg324-1
|
|
||||||
CONSTRAINT_PATH := ${current_dir}/nexys4ddr
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/nexys4ddr
|
|
||||||
else ifeq ($(TARGET),zybo)
|
|
||||||
DEVICE := xc7z010_test
|
|
||||||
BITSTREAM_DEVICE := zynq7
|
|
||||||
PARTNAME := xc7z010clg400-1
|
|
||||||
CONSTRAINT_PATH := ${current_dir}/zybo
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/zybo
|
|
||||||
SOURCES := ${current_dir}/counter_zynq.v
|
|
||||||
else ifeq ($(TARGET),nexys_video)
|
|
||||||
DEVICE := xc7a200t_test
|
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PARTNAME := xc7a200tsbg484-1
|
|
||||||
CONSTRAINT_PATH := ${current_dir}/nexys_video
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/nexys_video
|
|
||||||
else
|
|
||||||
DEVICE := xc7a50t_test
|
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PARTNAME := xc7a35tcpg236-1
|
|
||||||
CONSTRAINT_PATH := ${current_dir}/basys3
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/basys3
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Determine the type of constraint being used
|
# Determine the type of constraint being used
|
||||||
ifneq ($(wildcard ${CONSTRAINT_PATH}.xdc),)
|
ifneq (${XDC},)
|
||||||
XDC_CMD := -x ${CONSTRAINT_PATH}.xdc
|
XDC_CMD := -x ${XDC}
|
||||||
endif
|
endif
|
||||||
ifneq ($(wildcard ${CONSTRAINT_PATH}.sdc),)
|
ifneq (${SDC},)
|
||||||
SDC_CMD := -s ${CONSTRAINT_PATH}.sdc
|
SDC_CMD := -s ${SDC}
|
||||||
endif
|
endif
|
||||||
ifneq ($(wildcard ${CONSTRAINT_PATH}.pcf),)
|
ifneq (${PCF},)
|
||||||
PCF_CMD := -p ${CONSTRAINT_PATH}.pcf
|
PCF_CMD := -p ${PCF}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
|
|
|
@ -1,12 +1,44 @@
|
||||||
export mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
current_dir := ${CURDIR}
|
||||||
export current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
TOP := top
|
||||||
|
SOURCES := ${current_dir}/counter.v
|
||||||
|
|
||||||
export TOP := top
|
ifeq ($(TARGET),arty_35)
|
||||||
export SOURCES := ${current_dir}/counter.v
|
DEVICE := xc7a50t_test
|
||||||
|
BITSTREAM_DEVICE := artix7
|
||||||
|
PARTNAME := xc7a35tcsg324-1
|
||||||
|
XDC := ${current_dir}/arty.xdc
|
||||||
|
else ifeq ($(TARGET),arty_100)
|
||||||
|
DEVICE := xc7a100t_test
|
||||||
|
BITSTREAM_DEVICE := artix7
|
||||||
|
PARTNAME := xc7a100tcsg324-1
|
||||||
|
XDC := ${current_dir}/arty.xdc
|
||||||
|
else ifeq ($(TARGET),nexys4ddr)
|
||||||
|
DEVICE := xc7a100t_test
|
||||||
|
BITSTREAM_DEVICE := artix7
|
||||||
|
PARTNAME := xc7a100tcsg324-1
|
||||||
|
XDC := ${current_dir}/nexys4ddr.xdc
|
||||||
|
else ifeq ($(TARGET),zybo)
|
||||||
|
DEVICE := xc7z010_test
|
||||||
|
BITSTREAM_DEVICE := zynq7
|
||||||
|
PARTNAME := xc7z010clg400-1
|
||||||
|
XDC := ${current_dir}/zybo.xdc
|
||||||
|
SOURCES:=${current_dir}/counter_zynq.v
|
||||||
|
else ifeq ($(TARGET),nexys_video)
|
||||||
|
DEVICE := xc7a200t_test
|
||||||
|
BITSTREAM_DEVICE := artix7
|
||||||
|
PARTNAME := xc7a200tsbg484-1
|
||||||
|
XDC := ${current_dir}/nexys_video.xdc
|
||||||
|
else
|
||||||
|
DEVICE := xc7a50t_test
|
||||||
|
BITSTREAM_DEVICE := artix7
|
||||||
|
PARTNAME := xc7a35tcpg236-1
|
||||||
|
XDC := ${current_dir}/basys3.xdc
|
||||||
|
endif
|
||||||
|
|
||||||
|
export
|
||||||
|
|
||||||
all:
|
all:
|
||||||
cd ../../common && $(MAKE)
|
cd ../../common && $(MAKE)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cd ../../common && $(MAKE) clean
|
cd ../../common && $(MAKE) clean
|
||||||
|
|
||||||
|
|
|
@ -1,53 +1,29 @@
|
||||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
current_dir := ${CURDIR}
|
||||||
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
|
||||||
TOP := top
|
TOP := top
|
||||||
VERILOG := ${current_dir}/baselitex_arty.v \
|
SOURCES := ${current_dir}/baselitex_arty.v \
|
||||||
${current_dir}/VexRiscv_Linux.v
|
${current_dir}/VexRiscv_Linux.v
|
||||||
MEM_INIT := ${current_dir}/mem.init \
|
MEM_INIT := ${current_dir}/mem.init \
|
||||||
${current_dir}/mem_1.init \
|
${current_dir}/mem_1.init \
|
||||||
${current_dir}/mem_2.init
|
${current_dir}/mem_2.init
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PCF := ${current_dir}/arty.pcf
|
PCF := ${current_dir}/arty.pcf
|
||||||
SDC := ${current_dir}/arty.sdc
|
SDC := ${current_dir}/arty.sdc
|
||||||
XDC := ${current_dir}/arty.xdc
|
XDC := ${current_dir}/arty.xdc
|
||||||
BUILDDIR := build
|
|
||||||
|
|
||||||
|
BITSTREAM_DEVICE := artix7
|
||||||
|
|
||||||
ifeq ($(TARGET),arty_100)
|
ifeq ($(TARGET),arty_100)
|
||||||
PARTNAME := xc7a100tcsg324-1
|
PARTNAME := xc7a100tcsg324-1
|
||||||
DEVICE := xc7a100t_test
|
DEVICE := xc7a100t_test
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
|
||||||
else
|
else
|
||||||
PARTNAME := xc7a35tcsg324-1
|
PARTNAME := xc7a35tcsg324-1
|
||||||
DEVICE := xc7a50t_test
|
DEVICE := xc7a50t_test
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.DELETE_ON_ERROR:
|
export
|
||||||
|
|
||||||
|
all:
|
||||||
all: ${BOARD_BUILDDIR}/${TOP}.bit
|
cd ../../common && $(MAKE)
|
||||||
|
|
||||||
${BOARD_BUILDDIR}:
|
|
||||||
mkdir -p ${BOARD_BUILDDIR}
|
|
||||||
ln -s ${MEM_INIT} ${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} -s ${SDC} 2>&1 > /dev/null
|
|
||||||
|
|
||||||
${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
|
|
||||||
|
|
||||||
${BOARD_BUILDDIR}/${TOP}.route: ${BOARD_BUILDDIR}/${TOP}.place
|
|
||||||
cd ${BOARD_BUILDDIR} && symbiflow_route -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 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:
|
clean:
|
||||||
rm -rf ${BUILDDIR}
|
cd ../../common && $(MAKE) clean
|
|
@ -1,66 +1,39 @@
|
||||||
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
current_dir := ${CURDIR}
|
||||||
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
|
|
||||||
TOP := top
|
TOP := top
|
||||||
VERILOG := ${current_dir}/picosoc_noflash.v \
|
SOURCES := ${current_dir}/picosoc_noflash.v \
|
||||||
${current_dir}/picorv32.v \
|
${current_dir}/picorv32.v \
|
||||||
${current_dir}/simpleuart.v \
|
${current_dir}/simpleuart.v \
|
||||||
${current_dir}/progmem.v
|
${current_dir}/progmem.v
|
||||||
PARTNAME := xc7a35tcpg236-1
|
|
||||||
DEVICE := xc7a50t_test
|
|
||||||
BITSTREAM_DEVICE := artix7
|
|
||||||
PCF := ${current_dir}/basys3.pcf
|
|
||||||
SDC := ${current_dir}/picosoc.sdc
|
SDC := ${current_dir}/picosoc.sdc
|
||||||
BUILDDIR := build
|
BITSTREAM_DEVICE := artix7
|
||||||
|
|
||||||
ifeq ($(TARGET),arty_35)
|
ifeq ($(TARGET),arty_35)
|
||||||
VERILOG += ${current_dir}/arty.v
|
DEVICE := xc7a50t_test
|
||||||
|
SOURCES += ${current_dir}/arty.v
|
||||||
PARTNAME := xc7a35tcsg324-1
|
PARTNAME := xc7a35tcsg324-1
|
||||||
PCF := ${current_dir}/arty.pcf
|
PCF := ${current_dir}/arty.pcf
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/arty_35
|
|
||||||
else ifeq ($(TARGET),arty_100)
|
else ifeq ($(TARGET),arty_100)
|
||||||
VERILOG += ${current_dir}/arty.v
|
DEVICE := xc7a100t_test
|
||||||
|
SOURCES += ${current_dir}/arty.v
|
||||||
PARTNAME := xc7a100tcsg324-1
|
PARTNAME := xc7a100tcsg324-1
|
||||||
PCF := ${current_dir}/arty.pcf
|
PCF := ${current_dir}/arty.pcf
|
||||||
DEVICE := xc7a100t_test
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/arty_100
|
|
||||||
else ifeq ($(TARGET),nexys4ddr)
|
else ifeq ($(TARGET),nexys4ddr)
|
||||||
VERILOG += ${current_dir}/nexys4ddr.v
|
DEVICE := xc7a100t_test
|
||||||
|
SOURCES += ${current_dir}/nexys4ddr.v
|
||||||
PARTNAME := xc7a100tcsg324-1
|
PARTNAME := xc7a100tcsg324-1
|
||||||
PCF := ${current_dir}/nexys4ddr.pcf
|
PCF := ${current_dir}/nexys4ddr.pcf
|
||||||
DEVICE := xc7a100t_test
|
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/nexys4ddr
|
|
||||||
else
|
else
|
||||||
VERILOG += ${current_dir}/basys3.v
|
DEVICE := xc7a50t_test
|
||||||
|
SOURCES += ${current_dir}/basys3.v
|
||||||
PARTNAME := xc7a35tcpg236-1
|
PARTNAME := xc7a35tcpg236-1
|
||||||
PCF := ${current_dir}/basys3.pcf
|
PCF := ${current_dir}/basys3.pcf
|
||||||
BOARD_BUILDDIR := ${BUILDDIR}/basys3
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.DELETE_ON_ERROR:
|
export
|
||||||
|
|
||||||
|
all:
|
||||||
all: ${BOARD_BUILDDIR}/${TOP}.bit
|
cd ../../common && $(MAKE)
|
||||||
|
|
||||||
${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} 2>&1 > /dev/null
|
|
||||||
|
|
||||||
${BOARD_BUILDDIR}/${TOP}.net: ${BOARD_BUILDDIR}/${TOP}.eblif
|
|
||||||
cd ${BOARD_BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 2>&1 > /dev/null
|
|
||||||
|
|
||||||
${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
|
|
||||||
|
|
||||||
${BOARD_BUILDDIR}/${TOP}.route: ${BOARD_BUILDDIR}/${TOP}.place
|
|
||||||
cd ${BOARD_BUILDDIR} && symbiflow_route -e ${TOP}.eblif -d ${DEVICE} -s ${SDC} 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:
|
clean:
|
||||||
rm -rf ${BUILDDIR}
|
cd ../../common && $(MAKE) clean
|
Loading…
Reference in New Issue