Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| learn:programmable-logic:tutorials:vivado-hierarchical-blocks:start [2019/09/13 21:23] – Arthur Brown | learn:programmable-logic:tutorials:vivado-hierarchical-blocks:start [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Adding a Hierarchical Block to a Vivado IPI Design ====== | ====== Adding a Hierarchical Block to a Vivado IPI Design ====== | ||
| + | |||
| + | In Vivado, a // | ||
| ===== Inventory ===== | ===== Inventory ===== | ||
| * A Digilent FPGA development board. | * A Digilent FPGA development board. | ||
| * A computer with Vivado installed. | * A computer with Vivado installed. | ||
| - | * //Following | + | * //See the [[: |
| - | * //This guide was tested in Vivado 2019.2, other versions of Vivado can work, but support is not guaranteed.// | + | |
| * Familiarity with Vivado IP Integrator and a base block design to work from. | * Familiarity with Vivado IP Integrator and a base block design to work from. | ||
| - | * //Following the [[: | + | * //Following the [[: |
| ===== Guide ===== | ===== Guide ===== | ||
| + | ==== Setting Up Dependencies ==== | ||
| - | === 1. === | + | Check if vivado-library is already included in the Vivado project, if it is not, then it should be downloaded: |
| - | Download the [[https:// | + | {{https:// |
| + | |||
| + | Those familiar with git may want to clone the hierarchies | ||
| + | |||
| + | --> Using git to clone the hierarchies # | ||
| + | < | ||
| + | cd (somewhere memorable) | ||
| + | git clone https:// | ||
| + | </ | ||
| + | |||
| + | Otherwise (if vivado-library is included in the project), use git tools to check out the branch: | ||
| + | |||
| + | **Warning!** //If IP from the library are already included in the project, checking out a different branch may cause changes to them. Be careful!// | ||
| + | |||
| + | Note that the " | ||
| + | |||
| + | < | ||
| + | cd (path)/ | ||
| + | git checkout hierarchies | ||
| + | </ | ||
| + | <-- | ||
| ---- | ---- | ||
| - | === 2. === | + | ==== Adding a Hierarchical Block to a Hardware Design ==== |
| + | <WRAP GROUP> <WRAP COLUMN HALF> | ||
| + | === 1. === | ||
| + | Launch Vivado, then open the Vivado Project the hierarchical block is to be used in, and open the project' | ||
| - | Launch Vivado. | + | **Note**: //The design must contain 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' |
| + | |||
| + | Completing the [[: | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 3. === | ||
| - | Create or open the Vivado | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 2. === | ||
| + | In Vivado's TCL Console, enter the following command: < | ||
| + | When the script is finished running, the block design will contain a // | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 4. === | ||
| - | Create or open the project' | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 3. === | ||
| + | Check the README.txt file, which can be found in the hierarchical block' | ||
| + | - Connect all of the hierarchical block' | ||
| + | - Connect any interrupts the Hierarchy may have to the appropriate interrupt controller: an AXI Interrupt Controller IP (for Microblaze designs), the Zynq Processing System' | ||
| + | - 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). | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 5. === | ||
| - | In Vivado' | + | === 4. === |
| + | The next step, constraining | ||
| - | When the script is finished running, the block design will contain a *Hierarchical Block* with several IP inside of it. The IP will be connected to one another and to the block' | + | - If a board was selected when creating |
| + | - If a part was selected instead | ||
| ---- | ---- | ||
| - | === 6. === | + | == 4.1 - Creating an External Pmod Port == |
| + | Open the dropdown for the chosen Workflow, below, and follow the instructions. | ||
| - | 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' | + | **Note**: //This step is only required |
| - | ---- | + | --> Board Flow # |
| - | === 7. === | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | Go to Vivado' | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| + | <-- | ||
| - | 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: | + | --> Manual Constraint Flow # |
| - | - Connect all of the Hierarchy' | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| - | - Connect any interrupts | + | Select |
| - | | + | </ |
| + | {{ : | ||
| + | </ | ||
| + | <-- | ||
| ---- | ---- | ||
| - | === 8. === | + | == 4.2 - Validating the Design and Creating a Wrapper File == |
| + | <WRAP GROUP> <WRAP COLUMN HALF> | ||
| + | Regardless of the chosen workflow, validate the block design by clicking the Validate button ( {{: | ||
| + | Then create an HDL wrapper file, if one doesn' | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| + | ---- | ||
| + | == 4.3 - Constraining the Design | ||
| + | This step works a little differently depending on whether the peripheral targeted by the hierarchical block is a [[zmod: | ||
| - | The next step, constraining | + | --> Pmod# |
| + | <WRAP GROUP> <WRAP COLUMN HALF> | ||
| + | If the **Board Flow** was chosen, open the README.txt file in the hierarchical block' | ||
| - | If you selected | + | When the Hierarchy was created, |
| - | --> | + | Constraints required for the **Board Flow** are left uncommented by default. |
| - | - Go to Vivado' | + | If the **Manual Constraint Flow** was chosen, uncomment any commented out lines that start with "set_property", |
| - | - Make sure to validate your block design, save it, and create an HDL wrapper file. | + | |
| - | - Check the README.txt file in your Pmod's folder for additional instructions to determine whether any additional constraints are required. | + | |
| + | The text " | ||
| + | |||
| + | Two types of manually entered values are typical of constraint files in these Hierarchies: | ||
| + | |||
| + | Port Names: \\ | ||
| + | These %%FIXME%%s come after the text " | ||
| + | |||
| + | Location Constraints: | ||
| + | These %%FIXME%%s come after the text " | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| <-- | <-- | ||
| - | 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' | ||
| - | --> | + | --> |
| + | |||
| + | <WRAP GROUP> <WRAP COLUMN HALF> | ||
| + | When create_hier.tcl is run for a Zmod Hierarchical Block, a constraint file is imported which contains template constraints for each external port created by the script. The constraint file is named after the hierarchical block created by the script, followed by the name of the particular Zmod, for example: " | ||
| + | |||
| + | At time of writing, each Zmod Hierarchical Block provides template constraints for each of the Eclypse Z7's Zmod Ports. By default, the Zmod ADC is connected to the Eclypse Z7's Zmod Port A, and the Zmod DAC is connected to Zmod Port B. To connect to a different port, the user need only comment out the section of the xdc corresponding to the default port, and uncomment the section corresponding to the chosen port. | ||
| - | - Select the Pmod\_out port, then right click on it and select *Make External*. Select | + | For other boards, the user must replace |
| - | - Validate your design, and save it. If your block design doesn' | + | </ |
| - | - When the Hierarchy was created, a constraint file, named " | + | {{: |
| - | - The text " | + | </ |
| - | - 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). | + | |
| - | - Download the master XDC file for your board. Master XDC files for Digilent boards | + | |
| <-- | <-- | ||
| ---- | ---- | ||
| - | === 9. === | ||
| - | Generate | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 5. === | ||
| + | Click **Generate | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 10. === | + | ==== Baremetal Software |
| + | <WRAP round center important 660px> | ||
| + | Zmod Hierarchical Blocks are supported in software by the Zmod Library. If using a Zmod, see the [[zmod: | ||
| + | </ | ||
| - | Export | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 1. === | ||
| + | Export | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 11. === | ||
| - | Launch SDK. | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 2. === | ||
| + | Launch | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 12. === | ||
| - | Create a new Application Project | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 3. === | ||
| + | Create a new application project | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 13. === | ||
| - | Copy all of the files from your Pmod' | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 4. === | ||
| + | Copy all of the files from the selected hierarchical block' | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 14. === | ||
| - | Build All. | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| + | === 5. === | ||
| + | Make sure that the development board' | ||
| + | |||
| + | Connect the SDK Terminal to the port associated with the board. The **green button** in the Serial Terminal pane is used to launch the //Connect to a serial port// dialog. By default, the baud rate is 115200 for Zynq, and 9600 for Microblaze (when using the AXI Uartlite IP). If desired, other terminals, such as Tera Term or PuTTY, may be used instead. | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 15. === | ||
| - | Plug in your board. | ||
| - | ---- | + | <WRAP GROUP> <WRAP COLUMN HALF> |
| - | === 16. === | + | === 6. === |
| + | Program the FPGA by selecting **Xilinx -> Program FPGA** from the top menu bar in Xilinx SDK. | ||
| - | Xilinx | + | Once the FPGA is programmed, run the application project by right-clicking on the application project and selecting **Run -> Run on Hardware (System Debugger)**. |
| + | |||
| + | Messages printed by the demo application can be seen in the serial terminal. | ||
| + | </ | ||
| + | {{ : | ||
| + | </ | ||
| ---- | ---- | ||
| - | === 17. === | + | ===== Next Steps ===== |
| + | Now that the hierarchical block' | ||
| - | Run the application project. | + | The SDK sources provided with the hierarchical blocks are set up such that they can be easily included in any design using that block. The subfolder below sdk_sources contains all necessary drivers for the block. |
| + | |||
| + | For more reference materials and guides on the Digilent products being used, navigate to their resource centers, here on the [[start: | ||
| + | |||
| + | For technical support, please visit the [[https:// | ||
| - | ---- | ||
| {{tag> | {{tag> | ||

