Programming FPGA Systems: Code Conversion

June 7, 2004
Code Conversion On the left side below is the ANSI-C software code that makes the call to the C Hough function. The input to the Hough function is the image to be processed (TileIn). The output of the Hough...
Code Conversion On the left side below is the ANSI-C software code that makes the call to the C Hough function.

The input to the Hough function is the image to be processed (TileIn). The output of the Hough function is the location of the most predominant line in the image (HoughMax, RhoMax, ThetaMax). The column on the left shows the corresponding Handel-C code to call the Handle-C Hough function.

The single call to the Hough function is replaced with NUM_PAR_HOUGH Hough calls (each doing a part of the overall processing) done in parallel. This will perform the Hough processing NUM_PAR_HOUGH times faster—at the cost of more internal FPGA memory being used. Software cannot do this kind of true parallel processing. Note that TileIn is a multi-port memory, allowing simultaneous reads and a write in a single clock cycle. A new input is required to tell the Hough function which part of the processing to do (iCnt).

To process in parallel, NUM_PAR_HOUGH duplicate copies of the input image are required, as we need to do NUM_PAR_HOUGH concurrent reads of the input image. The preprocessing takes a few thousand clock cycles to do for each input image, but saves hundreds of thousands (or more depending on the size of NUM_PAR_HOUGH of clock cycles due to the parallel Hough processing. So it’s well worth it! Note this preprocessing is pipelined and has one clock cycle of latency.

Because the parallel Hough processing returns NUM_PAR_HOUGH predominant lines (one for each parallel process), we must find the most predominant line of these in a post-processing step. This post-processing takes only NUM_PAR_HOUGH clock cycles, adding almost no time to the overall processing time.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!