f4pga-examples/xc7/counter_test
Alessandro Comodi 1dd36fe587 zynq: add counter docs addition and zynq programming
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
2020-12-18 12:14:42 +01:00
..
Makefile xc7: add zynq counter test 2020-12-15 11:39:23 +01:00
README.rst zynq: add counter docs addition and zynq programming 2020-12-18 12:14:42 +01:00
arty.xdc xc7: add zynq counter test 2020-12-15 11:39:23 +01:00
basys3.xdc xc7: add zynq counter test 2020-12-15 11:39:23 +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
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-basys3-group

   TARGET="basys3" make -C counter_test


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

   TARGET="zybo" make -C counter_test


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

.. code-block:: bash

   openocd -f ${INSTALL_DIR}/conda/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%