f4pga-examples/xc7/counter_test
Chandler Jearls 8c67e280e1 added Nexys4DDR to the documentation
Signed-off-by: Chandler Jearls <cjearls@vt.edu>
2021-04-21 17:48:13 +00:00
..
Makefile added support for Nexys4DDR board in counter_test 2021-04-21 16:34:26 +00:00
README.rst added Nexys4DDR to the documentation 2021-04-21 17:48:13 +00:00
arty.xdc counter_test: fixed typos in IOSTANDARD constraints 2020-12-21 11:44:03 +01:00
basys3.xdc counter_test: fixed typos in IOSTANDARD constraints 2020-12-21 11:44:03 +01:00
counter.v xc7: add zynq counter test 2020-12-15 11:39:23 +01:00
counter_zynq.v xc7: add zynq counter test 2020-12-15 11:39:23 +01:00
nexys4ddr.xdc added support for Nexys4DDR board in counter_test 2021-04-21 16:34:26 +00:00
nexys_video.xdc readme: Add a200T package installation 2021-01-17 22:08:58 +01:00
zybo.xdc xc7: add zynq counter test 2020-12-15 11:39:23 +01:00

README.rst

Counter test
~~~~~~~~~~~~

This example design features a simple 4-bit counter driving LEDs. To build the
counter example, depending on your hardware, run:

.. code-block:: bash
   :name: example-counter-a35t-group

   TARGET="arty_35" make -C counter_test


.. code-block:: bash
   :name: example-counter-a100t-group

   TARGET="arty_100" make -C counter_test


.. code-block:: bash
   :name: example-counter-nexys4ddr-group

   TARGET="nexys4ddr" make -C counter_test

.. code-block:: bash
   :name: example-counter-basys3-group

   TARGET="basys3" make -C counter_test


.. code-block:: bash
   :name: example-counter-nexys_video-group

   TARGET="nexys_video" make -C counter_test


.. code-block:: bash
   :name: example-counter-zybo-group

   TARGET="zybo" make -C counter_test


At completion, the bitstreams are located in the build directory:

.. code-block:: bash

   cd counter_test/build/<board>

Now, for **Arty and Basys3**, you can upload the design with:

.. code-block:: bash

   openocd -f ${INSTALL_DIR}/${FPGA_FAM}/conda/envs/${FPGA_FAM}/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 top.bit; exit"


The result should be as follows:

.. image:: ../../docs/images/counter-example-arty.gif
   :align: center
   :width: 50%

For **Zybo**, please follow the `guide on how to load a bitstream from U-boot <https://symbiflow-examples.readthedocs.io/en/latest/running-examples.html#load-bitstream-from-u-boot>`_.


Once the bitstream is loaded, the result should be as follows:

.. image:: ../../docs/images/counter-example-zyboz7.gif
   :align: center
   :width: 50%

On the picocom terminal, you can control the counter behaviour to stop it, or let it count backwards, by toggling values of the EMIO pins of the ARM Processing System (PS).

You can control the counter enable signal with:

.. code-block:: bash

   gpio set 54
   gpio clear 54

If GPIO 54 is set, the counter is disabled. It is enabled if the GPIO 54 is cleared. The result should be as follows:

.. image:: ../../docs/images/counter-example-zyboz7-clken.gif
   :align: center
   :width: 50%

You can control the counter direction with:

.. code-block:: bash

   gpio set 55
   gpio clear 55

If GPIO 55 is set, the counter goes backwards. It goes forwared if the GPIO 54 is cleared. The result should be as follows:

.. image:: ../../docs/images/counter-example-zyboz7-reverse.gif
   :align: center
   :width: 50%