Skip to content

Commit

Permalink
Deleted obsolute master_makefile and started changing makefile instru…
Browse files Browse the repository at this point in the history
…ctions

Signed-off-by: Joshua Fife <jpfife17@gmail.com>
  • Loading branch information
WhiteNinjaZ committed Oct 19, 2021
1 parent 8764d05 commit d22d9a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 115 deletions.
58 changes: 9 additions & 49 deletions docs/customizing-makefiles.rst
Expand Up @@ -13,63 +13,23 @@ commands used by the Makefile to build and compile designs take a look at the
Example
-------

Every example design in Symbiflow has its own Makefile. For example
`counter test <https://github.com/SymbiFlow/symbiflow-examples/blob/master/xc7/counter_test/Makefile>`_,
`Linux Litex demo <https://github.com/SymbiFlow/symbiflow-examples/blob/master/xc7/linux_litex_demo/Makefile>`_,
and `PicoSoC demo <https://github.com/SymbiFlow/symbiflow-examples/blob/master/xc7/picosoc_demo/Makefile>`_
all have there own unique Makefiles for compiling and building respective designs. To understand
how to set up a Makefile in Symbiflow, lets take a look at a simple Makefile. The following code
is based on the Makefile within `counter test <https://github.com/SymbiFlow/symbiflow-examples/blob/master/xc7/counter_test/Makefile>`_
and has been modified slightly for simplicity. Highlighted lines within the code below are of
particular interest and will change depending on your specific design elements and hardware.
Lines that are not highlighted do not change from design to design and can be copy and pasted
into your own Makefile.

.. code-block:: bash
:name: makefile-example
:emphasize-lines: 3, 4, 5, 6, 9, 10, 22, 25, 28, 31
:linenos:
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
TOP := top
VERILOG := ${current_dir}/counter.v
DEVICE := xc7a50t_test
BITSTREAM_DEVICE := artix7
BUILDDIR := build
PARTNAME := xc7a35tcpg236-1
XDC := ${current_dir}/basys3.xdc
BOARD_BUILDDIR := ${BUILDDIR}/basys3
By including Symbiflow's provided makefiles in your designs, running the commands necessary for building
your personal projects is incredibly simple. All you have to do is run a few simple commands and set
a few variables and you are done.

Run the following command inside of the directory where you are storing your design files:

.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
.. code-block:: bash
${BOARD_BUILDDIR}/${TOP}.net: ${BOARD_BUILDDIR}/${TOP}.eblif
cd ${BOARD_BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE} 2>&1 > /dev/null
wget
${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}
.. code-block:: bash
:name: makefile-example
:linenos:
${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:
rm -rf ${BUILDDIR}
Adding HDL files to your design
Expand Down
66 changes: 0 additions & 66 deletions docs/master_makefile/Makefile

This file was deleted.

0 comments on commit d22d9a2

Please sign in to comment.