Merge pull request #329 from antmicro/umarcor/openFPGALoader

Use openFPGALoader instead of openocd
This commit is contained in:
Karol Gugala 2022-07-13 10:13:56 +02:00 committed by GitHub
commit 6b0e7b8a75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 20 deletions

View File

@ -9,26 +9,32 @@ ifeq ($(TARGET),arty_35)
DEVICE := xc7a50t_test
BITSTREAM_DEVICE := artix7
PARTNAME := xc7a35tcsg324-1
OFL_BOARD := arty_a7_35t
else ifeq ($(TARGET),arty_100)
DEVICE := xc7a100t_test
BITSTREAM_DEVICE := artix7
PARTNAME := xc7a100tcsg324-1
OFL_BOARD := arty_a7_100t
else ifeq ($(TARGET),nexys4ddr)
DEVICE := xc7a100t_test
BITSTREAM_DEVICE := artix7
PARTNAME := xc7a100tcsg324-1
OFL_BOARD := unsupported
else ifeq ($(TARGET),zybo)
DEVICE := xc7z010_test
BITSTREAM_DEVICE := zynq7
PARTNAME := xc7z010clg400-1
OFL_BOARD := zybo_z7_10
else ifeq ($(TARGET),nexys_video)
DEVICE := xc7a200t_test
BITSTREAM_DEVICE := artix7
PARTNAME := xc7a200tsbg484-1
OFL_BOARD := nexysVideo
else ifeq ($(TARGET),basys3)
DEVICE := xc7a50t_test
BITSTREAM_DEVICE := artix7
PARTNAME := xc7a35tcpg236-1
OFL_BOARD := $(TARGET)
else
$(error Unsupported board type)
endif
@ -76,17 +82,11 @@ ${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
download: ${BOARD_BUILDDIR}/${TOP}.bit
if [ $(TARGET)='arty_35' ]; then \
openocd -f ${INSTALL_DIR}/xc7/conda/envs/xc7/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 ${BOARD_BUILDDIR}/${TOP}.bit; exit"; \
elif [ $(TARGET)='arty_100' ]; then \
openocd -f ${INSTALL_DIR}/xc7/conda/envs/xc7/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 ${BOARD_BUILDDIR}/${TOP}.bit; exit"; \
elif [ $(TARGET)='basys3' ]; then \
openocd -f ${INSTALL_DIR}/xc7/conda/envs/xc7/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 ${BOARD_BUILDDIR}/${TOP}.bit; exit"; \
else \
if [ $(TARGET)='unsupported' ]; then \
echo "The commands needed to download the bitstreams to the board type specified are not currently supported by the F4PGA makefiles. \
Please see documentation for more information."; \
fi
openFPGALoader -b ${OFL_BOARD} ${BOARD_BUILDDIR}/${TOP}.bit
clean:
rm -rf ${BUILDDIR}

View File

@ -120,24 +120,24 @@ name you used for your top level module:
.. code-block:: bash
openocd -f ${F4PGA_INSTALL_DIR}/${FPGA_FAM}/conda/envs/${FPGA_FAM}/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 top.bit; exit"
openFPGALoader -b arty_a7_35t top.bit
.. tip::
Many of the commands needed to build a project are run multiple times with little to no
variation. You might consider adding a few aliases or even a few bash functions to your
.bashrc file to save yourself some typing or repeated copy/paste. For example, instead of
using the somewhat cumbersome command used to upload the bitstream to Xilinx 7 series FPGA
every time, you could just add the following lines to your .bashrc file:
using the command used to upload the bitstream to Xilinx 7 series FPGA every time, you
could just add the following lines to your .bashrc file:
.. code-block:: bash
:name: bash-functions
symbi_bit() {
f4pga_bit() {
#Creates and downloads the bitstream to Xilinx 7 series FPGA:
openocd -f <Your install directory>/xc7/conda/envs/xc7/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 top.bit; exit"
openFPGALoader -b $OFL_BOARD top.bit
}
Now whenever you need to download a bitstream to the Xilinx-7 series you can simply type
``symbi_bit`` into the terminal and hit enter.
e.g. ``OFL_BOARD=basys3 f4pga_bit`` into the terminal and hit enter.

View File

@ -175,12 +175,12 @@ family instead of the fabric as in the write_fasm step.
.. warning::
If you change the name of the output for your bitstream to something other than top.bit then the
openocd command used in the examples would need to change too. For example if I used
``-b my_module_top`` in symbiflow_write_bitstream then my openocd command would change to:
openFPGALoader command used in the examples would need to change too. For example if I used
``-b my_module_top`` in symbiflow_write_bitstream then my openFPGALoader command would change to:
.. code-block:: bash
openocd -f <Your install directory>/xc7/conda/envs/xc7/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 my_module_top.bit; exit"
openFPGALoader -b $OFL_BOARD my_module_top.bit
Note that the only part of the command that changes is "<top module name>.bit;"

View File

@ -30,7 +30,7 @@ Now, you can upload the design with:
.. code-block:: bash
openocd -f ${F4PGA_INSTALL_DIR}/${FPGA_FAM}/conda/envs/${FPGA_FAM}/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 top.bit; exit"
openFPGALoader -b basys3 top.bit
The following is an example of the debouncer in action:

View File

@ -2,7 +2,7 @@ name: xc7
channels:
- litex-hub
dependencies:
- litex-hub::openocd=0.10.0_1514_ga8edbd020=20201119_154304
- litex-hub::openfpgaloader==0.8.0_114_g057ce93=20220706_155948
- litex-hub::prjxray-tools=0.1_2986_g5937733d=20220512_085338
- litex-hub::gcc-riscv64-elf-newlib=9.2.0=20201119_154229
- litex-hub::prjxray-db=0.0_257_g0a0adde=20220512_085338

View File

@ -52,7 +52,7 @@ Now you can upload the design with:
.. code-block:: bash
openocd -f ${F4PGA_INSTALL_DIR}/${FPGA_FAM}/conda/envs/${FPGA_FAM}/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 top.bit; exit"
openFPGALoader -b arty_a7_100t top.bit
.. note::