Platform Add-Ons
Adding Kernel Interrupt Support
You can provide kernel interrupt support by adding an AXI interrupt
controller to the base hardware design and connecting the output of the interrupt
controller to the input of the processor block interrupt. The interrupt inputs of
the AXI interrupt controller are initialized to a de-asserted state by wiring them
to ground. When the v++ linker adds acceleration
kernels to the base hardware design, the dynamic_postlink.tcl script is used to wire the interrupt output of
the kernel to the AXI interrupt controller.
The following steps include obtaining and using the dynamic_postlink.tcl. If you want to add kernel interrupts, add the following IP to the IP integrator block diagram prior to writing the XSA. To use the dynamic_postlink.tcl script, the hierarchy, IP names, and net names within the block diagram must match the script.
- Re-customize the Zynq UltraScale+ MPSoC IP block and enable the
M_AXI_HPM0_LPDinterface for use by the base hardware design.- In the block diagram, double-click the Zynq UltraScale+ MPSoC block.
- Select .
- Select the
AXI HPM0 LPDcheck box.
Observe that
M_AXI_HPM0_LPDandmaxihpm0_lpd_aclkports were added. - Connect
maxihpm0_lpd_aclkto/clk_wiz_0/clk_out3. - Delete any existing xlconcat blocks connected to the processor so that your IP instances names correspond with the dynamic_postlink.tcl script.
- Add Concat IP:
- Right-click the IP block diagram and select Add IP.
- Search for
concat. - With Concat selected, press the Enter key.
- Re-customize Concat IP:
- Double-click the Concat block to open the Re-Customize IP dialog box.
- Set the number of ports to
32. - Click OK.
- Add the Constant IP block:
- Right-click the IP block diagram and select Add IP.
- Search for
constant. - With Constant selected, press the Enter key.
- Re-customize Constant IP:
- Double-click the Constant block to open the Re-Customize IP dialog box.
- Set Const Width =
1. - Set Const Val =
0. - Click OK.
- Connect the
xlconstant_0 dout[0:0]output to all 32 inputs ofxlconcat_0:- Ctrl-click on each
xlconcat_0input pin to select them. - Right-click one of the selected
xlconcat_0input pins and select Make Connection. - In the Make Connection dialog box, scroll to and select
the
xlconstant_0 doutpin. - Click OK.
- Ctrl-click on each
- Rename the
xlconstant_0andxlconcat_0IP instance names to match the dynamic_postlink.tcl script.- Select the
xconstant_0IP block. - In the Block Properties, General dialog box, change the name to xlconstant_gnd.
- Select the xlconcat_0 IP block.
- In the Block Properties, General dialog box, change the name to xlconcat_interrupt_0.
- Select the
- Make a hierarchical sub-block from the
xlconstant_gndandxlconcat_interrupt_0blocks. Ensure that the net connecting thexlconstant_gndand thexlconcat_interrupt_0blocks is namedxlconstant_gnd_doutin order to match the dynamic_postlink.tcl script.- Select the
xlconstant_gndandxcloncat_interrupt_0blocks. - Right-click your selection and select Create Hierarchy.
- In the Create Hierarchy dialog box, set the Cell name to
interrupt_concat. - Click OK.
- Select the
- Click (+) to expand the
interrupt_concatblock and create a port from thedoutsignal bus.- Select the
dout[31:0]pin on thexlconcat_interrupt_0block. - Right-click your selection and select Create Port.
- Leave the default settings and click OK.
- Remove the external port connection wire and port name from the top-level IP diagram.
- Select the
- Add the AXI Interrupt Controller IP block:
- Right-click
IP block diagramand select Add IP. - Search for
intc, and with the AXI Interrupt Controller selected, press the Enter key.
- Right-click
- Re-customize the AXI Interrupt Controller IP block:
- Double-click the AXI Interrupt Controller block to open the Re-Customize IP dialog box.
- Set the Interrupts type to Level by changing the button to Manual and entering 0x0 text field.
- Set the Level type to High by changing the button to Manual and entering
0xFFFFFFFF. - Set the Interrupt Output Connection to Single.
- Click OK.
- Use Run Connection Automation to connect the AXI Interrupt
Controller
s_axibus to the Zynq UltraScale+ MPSoCM_AXI_HPM0_LPDport.- Leave the default values for Master interface and Bridge IP.
- Master interface default is
/zynq_ultra_ps_e_0/M_AXI_HPM0_LPD. - Bridge IP default is New AXI interconnect.
- Master interface default is
- For the clock source for driving Bridge IP, select
/clk_wiz_0/clk_out3. This is the default acceleration kernel clock. - For the clock source for Slave interface, select
/clk_wiz_0/clk_out3. - Notice that the clock source for Master interface
default is
/clk_wiz_0/clk_out3because we wired it to the PS block earlier. - Click OK.
- Leave the default values for Master interface and Bridge IP.
- Connect the AXI Interrupt Controller interrupt input by wiring
the
interrupt_concat/dout[31:0]to theaxi_intc_0/intr[0:0]input. - Connect the AXI Interrupt Controller interrupt output by wiring
the
axi_intc_0/irqoutput to the Zynq UltraScale+ MPSoCpl_ps_irq0[0:0]input.The following block diagram shows the completed system wired with the interrupt controller.
- Set the platform design intent properties. These properties can
also be
queried.
set_property platform.design_intent.embedded true [current_project] set_property platform.design_intent.server_managed false [current_project] set_property platform.design_intent.external_host false [current_project] set_property platform.design_intent.datacenter false [current_project] get_property platform.design_intent.embedded [current_project] get_property platform.design_intent.server_managed [current_project] get_property platform.design_intent.external_host [current_project] get_property platform.design_intent.datacenter [current_project] - Set the platform default output type
property.
set_property platform.default_output_type "sd_card" [current_project] get_property platform.default_output_type [current_project] - Get dynamic_postlink.tcl
script from the Xilinx Run Time (XRT)
repository:
- In a Web browser, navigate to https://github.com/Xilinx/XRT/tree/master/src/platform/zcu102_base.
- Save the dynamic_postlink.tcl file in the directory containing your Vivado project.
- Edit the dynamic_postlink.tcl script you just saved in the Vivado project to ensure that the script and IP diagram processor names match. To do this, change the two instances of ps_* to zynq_ultra_ps_*.
- Add the platform property to use dynamic_postlink.tcl during the
v++link:set_property platform.post_sys_link_tcl_hook ./dynamic_postlink.tcl [current_project] - Ensure that
M_AXI_HPM0_LPDis disabled for use by thev++linker because it is being used in the base hardware design:- Select
M_AXI_HPM0_LPDin the Window > Platform Interfaces view. - Right-click your selection and select Disable.
- Select
- Right-click and select Validate Design on IP integrator diagram.
- Select the Zynq UltraScale+ MPSoC IP block and set
SELECTED_SIM_MODELtotlmin the Block Properties view. - Save the block design.
- Right-click design_1.bd in the Block Design, Sources view and select Generate Output Products.
- Create the HDL wrapper:
- Right-click design_1.bd in the Block Design, Sources view and select Create HDL Wrapper.
- Select Let Vivado manage wrapper and auto-update.
- Click OK.
- In the Flow Navigator view, generate the bitstream:
- Click .
- Click Yes to launch synthesis and implementation.
- In the Launch Runs dialog box, leave the defaults and click OK.
- Create the
XSA:
write_hw_platform -include_bit -force zcu102_min.xsa - Validate the XSA:
validate_hw_platform ./zcu102_min.xsa