0% found this document useful (0 votes)
63 views3 pages

ZYBO Board Embedded System Tutorial

This document provides a tutorial on designing an embedded system using the Zynq SoC that controls LEDs on the ZYBO or ZYBO Z7-10 boards. It describes: 1) Creating a block design in Vivado that instantiates the Zynq PS and AXI GPIO peripheral to control LEDs. 2) Developing a software application in SDK that blinks the LEDs by writing to peripheral registers. 3) Downloading the bitstream and software application to the board and observing the LEDs blinking as programmed.

Uploaded by

zagarzusem
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views3 pages

ZYBO Board Embedded System Tutorial

This document provides a tutorial on designing an embedded system using the Zynq SoC that controls LEDs on the ZYBO or ZYBO Z7-10 boards. It describes: 1) Creating a block design in Vivado that instantiates the Zynq PS and AXI GPIO peripheral to control LEDs. 2) Developing a software application in SDK that blinks the LEDs by writing to peripheral registers. 3) Downloading the bitstream and software application to the board and observing the LEDs blinking as programmed.

Uploaded by

zagarzusem
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY

Tutorial: Embedded System Design for ZynqTM SoC RECRLAB@OU

Introduction to Hardware/Software Co-Design on


Zynq SoC
OBJECTIVES
▪ Create a Hardware/Software System using the ZYBO Board or the ZYBO Z7-10 Board.
▪ Create a Block Based Design in Vivado 2019.1.
▪ Use of the AXI GPIO peripheral to control LEDs via software.
▪ Creating a software application in SDK.

REQUIRED FILES (ZYBO, ZYBO Z7-10)


▪ For ZYBO and ZYBO Z7-10 Boards: [Link].
Definition files:
▪ (old manual method) for ZYBO Board: ZYBO_zynq_def.xml.
XDC files: ▪ ZYBO (ZYBO_Master.xdc), ZYBO Z7-10 ([Link])
Software file ▪ LED_test_tut_1Cp.c

BOARD SETUP FOR HARDWARE/SOFTWARE CO-DESIGN IN VIVADO (ZYBO, ZYBO Z7-10)


▪ Every board includes different interfaces and components (e.g.: slide switches, push buttons, LEDs, USB-UART, etc.) the
Zynq-7000 PS and PL interact with. This information is specified in .xml definition files. Vivado already includes this
information for a large set of boards, except for the ZYBO or ZYBO Z7-10. To set this up:
✓ Load .xml file into PS (old, only tested for ZYBO Board): For the ZYBO Board, we can load the ZYBO_zynq_def.xml
file into a project (when configuring the PS). However, this needs to be done for every project.
✓ Files installed in Vivado: Preferred, one-time set-up procedure. You need to place the definition files (available in
[Link]) for the ZYBO and ZYBO Z7-10 boards into the Vivado installation directory:
▪ Vivado 2019.1: Go to {Vivado installation folder}\2019.1\data\boards\board_files\ and paste
the folders \zybo and \zybo-z7-10 contained in [Link]. Restart Vivado if it was open.

FIRST HARDWARE/SOFTWARE DESIGN IN VIVADO


▪ This experiment is taken from the Zynq Book Tutorial → Exercise 1 (A, B, C). Refer to that material for step-by-step
instructions. Here, we provide abridged instructions for two approaches:
✓ 1.A. Load .xml file into PS: We manually indicate the Zynq-7000 device, the LED ports, and the Processing System (PS)
.xml definition file. A few changes were made to the procedure in the Zynq Book Tutorial.
✓ 1.B. Files installed in Vivado: A few extra details are provided. It works for the ZYBO or ZYBO Z7-10 Board.
▪ To create a hardware/software design in Vivado, we will create a ‘Block Design Project’ where we can instantiate and
interconnect reconfigurable hardware components and the hard-wired Processing System (PS).

1A. CREATING A BLOCK DESIGN PROJECT IN VIVADO - ZYBO BOARD (LOAD .XML FILE INTO PS)
▪ Create a new Vivado project first_zynq_design.
✓ Make sure the default language is VHDL, so that the system wrapper is created in VHDL.
✓ At Default Part, go to Parts and select the ZYNQ XC7Z010-1CLG400 device.
▪ Once created, add the ZYBO_Master.xdc file into the project (paste it in /first_zynq_design and add to project)
▪ Click on Create Block Design.
▪ Instantiate the Zynq PS and the AXI GPIO peripheral (right click on the canvas and select Add IP).
▪ Click on Run Block Automation. This will create the external connections for the DDR and FIXED_IO interfaces.
▪ Configure AXI_GPIO: Double-click on it, select All Outputs, and set GPIO Width to 4.
▪ Click on Run Connection Automation. Check both S_AXI and GPIO.
▪ Double click on ZYNQ PS:
✓ Look at the I/O Peripherals list and Flash Memory Interfaces in the Zynq Block Design figure. Those are all the peripherals
the Zynq-7000 chip can interface with. However, the ZYBO Board only contains a handful of them.
✓ Load the ZYBO_zynq_def.xml file (Import XPS Settings). This will indicate the peripherals and interfaces the ZYBO
Board can interface with. Note that a ✓ appears next to the available ones (Fig. 1). If this file is not loaded, the software
application might not work as expected when using a certain peripheral (e.g. UART).
▪ Create the VHDL wrapper (Sources Window → right-click on the top-level system design → Create HDL Wrapper)
▪ We now need to manually indicate our 4 output ports:
✓ Open the VHDL wrapper and modify the name of the 4-bit output port (usually it is gpio_rtl_tri_o) to led. Do the
same in the port map statement.

1 Daniel Llamocca
ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY
Tutorial: Embedded System Design for ZynqTM SoC RECRLAB@OU

✓ Open the XDC file and uncomment the lines for the LEDs. The port name is already led and it matches (as it must) the
name provided in the top VHDL wrapper file.

▪ Synthesize your design. The first time, Vivado might undo your modifications to the VHDL wrapper file (this is a software
bug). If it does, modify it for a second time and Synthesize again.
▪ Implement and generate the bitstream.
▪ Export hardware (include bitstream) and launch SDK (Software Development Kit).

1.B. CREATING A BLOCK DESIGN PROJECT IN VIVADO - ZYBO OR ZYBO Z7-10 BOARD (INSTALLED IN VIVADO)
▪ Create a new Vivado project: first_zynq_design.
✓ Make sure the default language in VHDL, so that the system wrapper is created in VHDL.
✓ At Default Part, go to Boards, and select the Zybo (or Zybo Z7-10) board.
▪ Once project is created, add the ZYBO_Master.xdc (or the [Link]) file into the project: paste it in
/first_zynq_design and add to project.
▪ Click on Create Block Design.
▪ Instantiate the Zynq PS (right click on the canvas and select Add IP).
✓ Click on Run Block Automation. This will create the external connections for the DDR and FIXED_IO interfaces.
▪ Instantiate the AXI GPIO peripheral (right click on the canvas and select ‘Add IP’).
✓ Click on Run Connection Automation. Check both S_AXI and GPIO. On GPIO option → Select Board Part Interface, select
leds_4bits.
▪ Double click on ZYNQ PS:
✓ Look at the I/O Peripherals list and Flash Memory interfaces in the Zynq Block Design (Fig. 1). The ZYBO Board can only
interface with a handful of them (and they are marked by a ✓).

Figure 1. Zynq Block Design showing the I/O peripherals and FLASH Memory Interfaces supported by the ZYBO Board
(marked with ✓)
▪ Create the VHDL wrapper (Sources Window → right-click on the top-level system design → Create HDL Wrapper)
▪ We included 4 output ports (leds_4bits), which now we need to manually indicate in the .xdc file:
✓ Open the VHDL wrapper. You will see that the name of the 4-bit output port is leds_4bits_tri_io.
✓ Open the XDC file and uncomment the lines for the 4 LEDs. Then, rename the 4 ports as leds_4bits_tri_io[3..0].
The name of the LED ports must match the name given in the top VHDL wrapper file.

▪ Synthesize your design.


▪ Implement and generate the bitstream.
▪ Export hardware (include bitstream) and launch SDK (Software Development Kit).

2 Daniel Llamocca
ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY
Tutorial: Embedded System Design for ZynqTM SoC RECRLAB@OU

2. SOFTWARE APPLICATION IN SDK


▪ Create a new software project:
✓ Select File → New → Application project.
✓ Enter LED_test in the Project Name field. Keep Target Software → Language → C.
✓ Select Empty Application.

▪ Load the software application:


✓ Copy the LED_test_tut_1Cp.c (obtained from the Zynq Book Tutorials) on the folder: first_zynq_design/
first_zynq_design.sdk/LED_test/src
✓ Right-click on the LED_test project and select Refresh to update the files.

▪ The software routine controls the LEDs using software instructions by writing on a particular peripheral register (refer to the
Zynq Book Tutorials for a comprehensive explanation).

▪ Build the software application. By default, SDK will build the software project automatically and create an output .elf file.
This is the file to be loaded into the instruction memory.

▪ Test the software application and the hardware design on the ZYBO Board or ZYBO Z7-10 Board:
✓ Connect your ZYBO Board to the USB port of your computer.
✓ Download the bitstream on the PL: Xilinx Tools → Program FPGA.
✓ Go to the SDK Terminal and click on Connect to a Serial Port. Configure the port with the same baud rate as the PS
(11500 by default) and the proper COM port (available after the PL is programmed). This will allow us to receive messages
from the ZYBO Board.
 UART: This peripheral is connected to the PS. We can use the xil_printf instruction to print out messages. Feel free
to modify the software by printing out messages. These messages will appear in the SDK Terminal.
✓ Select the project LED_test. Right click and select Run As → Launch on Hardware (GDB).
 You should see the LEDs blinking (0110  1001) and the message ECE5736: GPIO output test on the SDK Terminal.
 Sometimes, when trying the software for the first time, it might not work. Go to Run → Run Configurations:
[Link] and uncheck: Run ps7_nit, ps7_post_config. Then select run the software again.

3 Daniel Llamocca

Common questions

Powered by AI

When setting up a block design project in Vivado for the ZYBO board, considerations include selecting the correct board in Vivado, ensuring consistent naming conventions between VHDL wrapper files and XDC constraint files, and verifying GPIO configurations for port mapping. Attention must also be given to loading necessary XML files to ensure all interfaces and peripherals are available to the project. Properly configuring design tool settings, such as default languages and device parts, further ensures successful synthesis and implementation, minimizing configuration-related errors .

The design process in Vivado ensures that hardware components are correctly interfaced through defined ports by utilizing block automation to automatically configure connections for the DDR and FIXED_IO interfaces. This is followed by manually specifying ports in the VHDL wrapper and ensuring that names in the wrapper match those in the XDC (constraints) file. These steps guarantee that hardware signals are mapped correctly to corresponding logical signals, enabling accurate physical realization and interaction of hardware and software components during implementation .

To set up a block-based design for the ZYBO board in Vivado, first create a new project and ensure the default language is VHDL. After adding the necessary XDC file, create a block design and instantiate the Zynq PS and the AXI GPIO peripheral. The AXI GPIO peripheral is configured to control external devices like LEDs, with its GPIO width set to 4, highlighting its role in interfacing with hardware components through software .

The typical steps for implementing and testing a software application on the ZYBO or ZYBO Z7-10 board using the SDK include creating a new software project, importing the application code, and refreshing the project files. After building the software, the bitstream is downloaded to the board, and the correct serial port is configured in the SDK Terminal. Running the application on hardware involves launching it via the SDK interface, ensuring the code interacts correctly with the hardware, such as testing LED operations and using UART for output messages .

The configuration of the AXI GPIO peripheral directly impacts the functionality of a ZYBO board project by defining how the GPIO interacts with the hardware components, such as LEDs. Setting the GPIO width to 4, for example, specifies that the board will use a 4-bit wide data bus for LED control. This configuration ensures the correct mapping of signals and data flow between software and hardware, enabling efficient software-controlled hardware operations, such as LED blinking patterns in tests .

The SDK Terminal plays a crucial role in verifying software applications on the ZYBO board by providing a real-time interface to interact with and monitor the board's activities. By setting up a proper serial connection, messages can be transmitted to the terminal using functions like xil_printf, allowing developers to observe outputs, verify logic correctness, and detect potential issues. This visibility into the system's functioning provides an effective way to debug and ensure that applications, such as LED blinking or UART communications, are performing as expected .

Creating a VHDL wrapper in ZYBO board projects using Vivado is fundamental as it encapsulates the block design top-level functionality. It allows for the integration of custom hardware modules by defining HDL interfaces and connections. The wrapper reflects changes in block design, ensuring that port names in the design tool match those in the code, which is vital for successful synthesis and implementation processes. It also allows for modifications like mapping 4-bit output ports to hardware, thus facilitating customized hardware-software interactions .

Loading the .xml file into the PS is crucial during a ZYBO board project in Vivado as it indicates the specific peripherals and interfaces the board can interact with. This ensures that the software application functions correctly by aligning the hardware and software settings, such as using peripherals like UART. Without loading the .xml file, peripherals may not be recognized, leading to unexpected software performance .

Installing definition files directly in the Vivado installation directory offers several advantages. It provides a one-time setup that simplifies repeated project configurations, as Vivado will automatically recognize the ZYBO board specifics without manually loading settings for each project. This streamlines the process, reduces the risk of errors, and ensures consistency across projects, thus enhancing workflow efficiency for users handling multiple similar projects .

If a software application fails to work correctly on the ZYBO board initially, one debugging step involves reconfiguring the Run configurations by unchecking options such as ps7_nit and ps7_post_config before re-launching the software. This can resolve potential misconfigurations during the hardware setup phase. Ensuring that the UART settings, such as baud rate and COM port, are correctly matched to the hardware is also critical, as improper settings can lead to communication issues .

You might also like