How to profile an HDL Subsystem?

3 views (last 30 days)
I have a SIMULINK Model with a Subsytem which is running in PL. I would like to know its speed in terms of clock frequency or FramePerSecond (it is an image processing algorithm).
Any feedback or suggestion are accepted.
Thank you.

Accepted Answer

Bharath Venkataraman
Bharath Venkataraman on 21 Jan 2019
If you synthesize your HDL design in the appropriate HDL tool (example: Vivado), you will know what clock speed you can run the design at. Assuming you are processing one pixel per clock in the HDL, you should be able to calculate the frames per second.
Bharath Venkataraman
Bharath Venkataraman on 22 Jan 2019
There does not need to be any relationship between the Simulink sample time and HDL clock frequency. You can choose the sample time to whatever you Some people choose to have this correlation, in which case you can set the sample time in one of the sources so that your HDL subsystem runs at the pixel clock rate.
By default, HDL Coder will use one clock based on the base sample time in the HDL subsystem. You can then choose to put your constraint on that clock in the synthesis tool.
For the attached model, you can set the Desired sample time for the Video Source block to totalPixels=130248, which is 402*324, the total number of pixels: see Video Format section in this page). This sets the sample time of the pixel input to the HDL Algorithm subsystem to 1.
You can also set Desired sample time for the Video Source block to 1, which will change the sample time of the pixel input to HDL Algorithm subsystem to 7.6777e-6 (1/(402*324)).
In both cases, the HDL code generated will be the same. For 240p @ 60fps, you can hook up a clock of 7.814880 MHz, which is 402*324*60.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!