Light Up ZC706 LEDs Using Push Buttons with VHDL

xilinx_logo_1

This post shows how to use VHDL to connect SW7, SW9 and SW8 to LCR PL GPIO LEDS using VHDL.

This post picks up right after [link].

Prerequisites

This post assumes Vivado 2018.2 and the Digilent cable drivers have been installed.

Push Buttons

push_buttons_2

buttons_diagram_3

buttons_chart_4

LEDs

leds_on_board_5

leds_diagram_6

leds_chart_7

Note: This table is correct. Table 1-28 on page 60 of the ZC706 Evaluation Board User Guide UG954 (v1.8) August 6, 2019 is not correct (GPIO_LED_CENTER’s I/O Standard is not right)

Steps

Step 1: Right-click Design Sources

design_sources_8

Step 2: Click Add Sources…

add_scources_9

Step 3: (A) Click Add or create design sources and (B) click Next >

add_or_create_design_sources_10

Step 4: Click Create File

click_create_file_11

Step 5: (A) Click the down arrow and click (B) VHDL

click_vhdl_12

Step 6: (A) Enter buttoned as the File name: and (B) click OK

enter_buttonled_filename_13

Step 7: Click Finish

finish_buttonled_filename_14

Step 8: Define the module

A)

Enter in:

GPIO_SW_LEFT

GPIO_SW_CENTER

GPIO_SW_RIGHT

…and

GPIO_LED_LEFT

GPIO_LED_CENTER

GPIO_LED_RIGHT

…and mark the Direction of the 3 GPIO_LED Port Names: out

B) Click OK

define_module_15

Step 9: Double click buttonled

double_click_buttonled_16

You should see:

buttonled_code_17

Step 10:

Enter the following between begin and end Behavioral;

GPIO_LED_LEFT <= GPIO_SW_LEFT; GPIO_LED_CENTER <= GPIO_SW_CENTER; GPIO_LED_RIGHT <= GPIO_SW_RIGHT;

buttonled.vhd should look like this:

add_behaviors_18

Step 11: Click save

save_changes_19

Step 12: Click Open Elaborated Design

open_elaborated_design_20

Step 13: Click OK

confirm_enter_elaborated_design_21

You should see pop-up status windows like:

status_window_22

…and then:

schematic_23

Step 14: (A) Click Window and (B) click I/O Ports

click_io_ports_24

Step 15: (A) Click I/O Ports, (B) fill in the Package Pin as listed and (C) set in the I/O Std to LVCMOS15 for the CENTER ports and LVCMOS25 for the other ports (as shown above):

change_io_std_25

Step 16: Click Run Synthesis

run_synthesis_26

Step 17: Click Save

save_project_27

Step 18: (A) Set File name: to constraints0 and (B) click OK

change_filename_to_constraints_28

Step 19: Accept the defaults and click OK

accept_defaults_29

You should see some status in the upper right corner:

running_synth_design_30

Step 20: Click OK to Run Implementation

run_implementation_31

Step 21: Accept defaults and click OK

accept_defaults_32

You should see the status of Implementation in the upper right corner:

implementation_33

Note: implementation will take longer than synthesis

Step 22: (A) Select Generate Bitstream and (B) click OK

select_generate_bitstream_34

Step 23: Accept defaults and click OK

accept_defaults_32

You will see the status of Generate Bitstream in the upper right corner

status_genetate_bitstream_35

Note: This will take a little bit of time to complete (not as much as Implementation)

Step 24: (A) Click Open Hardware Manager and (B) click OK

open_hardware_manager_36

Step 25:

Plug the power supply into the board:

plug_power_supply_into_board_37

Plug the Micro-B end of a Micro-B to Standard-A USB cable into the Digilent USB-to-JTAG interface:

plug_micro_b_into_board_38

Plug the Standard-A end of a Micro-B to Standard-A USB cable into the computer

plug_standard_a_into_computer_39

Power on the ZC706

power_on_zc706_40

Step 26: Click Open target

click_open_target_41

Step 27: Click Auto Connect

auto_connect_42

Step 28: Click Program device

program_device_43

Step 29: Click Program

click_program_44

You should see:

programming_device_45

Now when you press SW7, SW9 and SW 8, the PL LEDs will light up as seen here:

Extra

To see the constraints that get saved:

A) Click PROJECT MANAGEMENT

B) Expand Constraints (1)

C) Double click on constraints0.xdc (target)

D) Examine

check_constraints_saved_46

Here is the content of constraints0.xdc as text:

set_property PACKAGE_PIN G2 [get_ports GPIO_LED_CENTER] set_property PACKAGE_PIN Y21 [get_ports GPIO_LED_LEFT] set_property PACKAGE_PIN W21 [get_ports GPIO_LED_RIGHT] set_property PACKAGE_PIN K15 [get_ports GPIO_SW_CENTER] set_property PACKAGE_PIN AK25 [get_ports GPIO_SW_LEFT] set_property PACKAGE_PIN R27 [get_ports GPIO_SW_RIGHT] set_property IOSTANDARD LVCMOS15 [get_ports GPIO_LED_CENTER] set_property IOSTANDARD LVCMOS25 [get_ports GPIO_LED_LEFT] set_property IOSTANDARD LVCMOS25 [get_ports GPIO_LED_RIGHT] set_property IOSTANDARD LVCMOS15 [get_ports GPIO_SW_CENTER] set_property IOSTANDARD LVCMOS25 [get_ports GPIO_SW_LEFT] set_property IOSTANDARD LVCMOS25 [get_ports GPIO_SW_RIGHT]

References