Video Beginner Series 18: Create a Video Crop IP using HLS (part 2)
This Video Beginner Series 18 is a continuation of the Video Beginner Series 17. In this series we will test the Video Crop IP generated with Vivado HLS in RTL simulation with Vivado. We will use the test pattern generator as input stimuli and we will write the output to an image file.
In the tcl console, cd into the unzipped directory (cd <path>/XVES_0018)
In the tcl console, source the script tcl (source ./create_proj.tcl)
Note: A valid license for the Test Pattern Generator is required to build the design.
The design is based on the Xilinx Video Series 5.
Add the HLS IP to test to the design
Right-click on the BD design and click on Add IP
Search for crop and add the Video_crop IP
Note: The IP generated by HLS was extracted in the src/ip_repo directory and this directory has been added to the repository in Vivado. Refer to section Test the IP in Vivado Simulation of the Xilinx Video series 16 for information on these steps.
If we double click on the video crop IP to open its configuration GUI, we can see that there is not parameter we can configure
Connect the TPG’s AXI4 master interface to the Video_crop’s AXI4 slave interface.
Connect the ap_clk, ap_reset_n, hsize_in and vsize in of the Video_crop IP to the BD’s inputs aclk_50MHz, areset_n_0, hsize and vsize.
Expend the video_crop ap_ctrl interface and connect the pin ap_start to the BD’s input ap_start
Expend the m_axis_video interface of the video crop and connect the pins TVALID, TREADY, TDATA, TLAST, TUSER and TVALID to the corresponding BD’s port.
Validate the BD, you should get no error. Save the BD
Validate the IP in RTL simulation
Launch the behavioral simulation and run it for 7ms
The simulation will stop after 6.23ms with the following messages
Configured and output resolution match, test succeeded
This looks promising as the output size is as expected
We can start by looking at the image image_out_1.ppm created in /proj_1/proj_1.sim/sim_1/behav/xsim with GIMP
We can see that we get a nice pattern and that the image size is 320x480. In the test bench, the TPG was configured to output 640x480 thus everything looks correct.
We can now have a final inspection by looking at the waveform
We can see from the TDATA and TVALID output signals from the TPG and from the Video Crop that the video crop seems to correctly output only half of the image. Thus, everything looks also good.
We can notice that the IP keeps sending the tdata and tlast signals for the second half of the image. This is correct according to the AXI4-Stream specification. As tvalid is low, the other signals are not “transmitted” (thus they can take any value).
Close the simulation and close Vivado
Do you have issues/questions following this Vivado Beginner Series?