Creating the Vivado project
Creating the project with the MPSOC
We first create an Vivado project with the MPSOC:
- Launch Vivado
- Select the menu option File->Project->New….
- For the project name, use
vmult_vivado. - In location, use the directory
hwdesign/vec_mult. The Vivado project will then be stored inhwdesign/vec_mult/vmult_vivado.
- For the project name, use
- Select RTL project.
- Leave Do not specify sources at this time checked.
- For Default part, select the
Boardstab and then selectZynq UltraScale+ RFSoC 4x2 Development Board. - The Vivado window should now open with a blank project.
Add and configure the Zynq Processor
- In the
Block Designwindow select theAdd IP (+)button. Add theZynq UltraScale+ MPSoC. This will add the MPSoC to the design. - Add the Slave AXI on the PS. Recall that this is the interface that will be used by the IP to access the DDR.
- Double click the
Zynq UltraScale+ MPSoCthat you just added. - On the
Page Navigatorpanel (left) selectSwitch to Advanced Mode. - Select
PS-PL connection->Slave Interface->AXI HP0 FPD. TheFPDstands for the full power domain which includes the ARM core, DDR controller, and high performance AXI ports. - Set the bit width to 32 since we will be using floating points.
- Double click the
- Run the
Connection automation. - Connect the
pclkto themaxihpm0_fpd_aclk,maxihpm1_fpd_aclk, andsaxihp0_fpd_aclkports. - Set the clock frequency for the PL to match what we synthesized the Vitis IP for.
- Double click the
Zynq UltraScale+ MPSoC - Select
Clock Configuration->Low Power Domain Clocks->PL Fabric Clocks. - Set the frequency to
PL0or whichever clock is used to 300 MHz, or some frequency less than what you valdidated the Vitis IP for.
- Double click the
Adding the Vitis IP to Vivado
- Go to
Tools->Settings->Project Settings->IP->Repository. Select the+sign inIP Repositories. Navigate to the directory with the adder component. In our case, this was at:hwdesign/vector_mult/vmult_vitis/vmult_hls/vec_mult/hls/impl/ip. - Select the
Add IPbutton (+) again. Add this IP. Now theVec_Multblock should show up as an option. If it doesn’t it is possible that you synthesized for the wrong FPGA part number. - You should see an Vitis IP block with ports
s_axi_control,interrupt,m_axi_gmemand some clocks. Select therun block automation. - Connect the
interrupton the Vitis IP to thepl_ps_irq0so that the PS can see the Vitis IP interrupt. - Select the
vect_multblock. In theBlock Propertiespanel, select theGeneraltab, and rename the block tovect_mult. This is the name that we will use when calling the function fromPYNQ. - Run the
Connection automation.- This will connect the
m_axi_gmemon the Vitis IP to theS_AXI_HP0_FPDwhich connects the master AXI on the IP to the DDR controller on the PS. Importantly, it may add aAXI Smart connectbetween the port to deal with address translation. Stupidly, Vivado lets you directly connectm_axi_gmemtoS_AXI_HP0_FPDeven if they are mis-matched.
- This will connect the
Creating the FPGA Bitstream and PYNQ Overlay
Follow the similar steps in Scalar adder demo to create the bitstream and the PYNQ overlay. If you want to skip this step, the overlay files are in hwdesign/vector_mult/overlay/.