This is an old revision of the document!


Adding a Hierarchical Block to a Vivado IPI Design

Inventory

Guide

1.

Download the master ZIP archive for Digilent's vivado-hierarchies repository and extract it.


2.

Launch Vivado.


3.

Create or open the Vivado Project you wish to use the Hierarchy in.


4.

Create or open the project's Block Design.


5.

In Vivado's TCL Console, enter the following command:

source (path to cloned repo)/(Pmod of choice)/create_hier.tcl

When the script is finished running, the block design will contain a *Hierarchical Block*, named after the chosen Pmod, with several IP inside of it. The IP will be connected to one another and to the block's ports and pins.


6.

Make sure your design has a processor, and a peripheral that can be used for stdout. In the case of Microblaze, a UART IP must be connected to the board's USBUART interface. In the case of Zynq, the MIO UART is used, and does not need to be configured.


7.

Check the README.txt file, found in your Pmod's folder in this repo, to find additional information about how the ports of the Hierarchy must be connected to the rest of your design. With this information in mind:

  1. Connect all of the Hierarchy's AXI interfaces to the processor in your design by clicking on *Run Connection Automation*. and checking all appropriate boxes.
  2. Connect any interrupts the Hierarchy may have to the appropriate interrupt controller, an AXI INTC IP (for Microblaze designs), the Zynq Processing System's irq\_f2p port (for Zynq designs).
  3. Connect any additional clocks to clocks generated by a Memory Interface Generator or a Clocking Wizard (for Microblaze designs), or a Zynq Processing System (for Zynq designs).

8.

The next step, constraining the Hierarchy's Pmod\_out port, has two different workflows.

If you selected a board while creating your project, you can use the *Board Flow* for this step:

Board Flow
  1. Go to Vivado's *Board* tab and find the Pmod connector you wish to connect to the Hierarchy. Right click on the entry, typically named something like “Connector JA”, and select *Connect Board Component*. In the popup window, under *Connect to existing IP*, select the “Pmod\_out” interface of the Hierarchy's Pmod Bridge IP. Click *OK*.
  2. Make sure to validate your block design, save it, and create an HDL wrapper file.
  3. Check the README.txt file in your Pmod's folder for additional instructions to determine whether any additional constraints are required.

If you selected a part instead of a board, or otherwise do not wish to use the *Board Flow*, you will need to create a port to connect to the Hierarchy's Pmod\_out port and constrain it.

Manual Constraint Flow
  1. Select the Pmod\_out port, then right click on it and select *Make External*. Select the newly created external interface port (named something like “Pmod\_out\_0”) in the design, and give it a memorable name.
  2. Validate your design, and save it. If your block design doesn't a wrapper file, right click on the design in the sources pane and select *Create HDL Wrapper*.
  3. When the Hierarchy was created, a constraint file, named “(Default Hierarchy Name)\_Pmod\_out.xdc”, was imported into the project. This file contains the constraints required when not using the board flow. Uncomment each line starting with “set\_property” by removing the leading “#” symbol.
  4. The text “FIXME” appears in several places in the constraint file. These correspond to places where you will need to manually enter values specific to your board and design.
  5. Find the correct port names for your Pmod interface by reviewing the port map of the top module near the top of the HDL wrapper file. Enter these port names into the corresponding place in the constraint file (after get\_ports, near the end of each line).
  6. Download the master XDC file for your board. Master XDC files for Digilent boards can be found in the [digilent-xdc](https://github.com/Digilent/digilent-xdc) repository on Github. Find the LOC property values that correspond to the Pmod connector of your board that you wish to connect your Pmod to. Enter these values into the corresponding LOC fields in the hierarchy's constraint file.

9.

Generate a bitstream.


10.

Export Hardware to SDK.


11.

Launch SDK.


12.

Create a new Application Project using the “Empty Application” template. Make sure to check if the Pmod requires you to change any settings or add any libraries to the project. Any requirements are detailed in the README.txt file in the Pmod's sdk\_sources folder in this repo.


13.

Copy all of the files from your Pmod's sdk\_sources folder into the empty application's src folder.


14.

Build All.


15.

Plug in your board.


16.

Xilinx → Program FPGA.


17.

Run the application project.