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

Highly Integrated 20A Digital Power Module for High Current Applications

March 20, 2024
Renesas latest power module delivers the highest efficiency (up to 94% peak) and fast time-to-market solution in an extremely small footprint. The RRM12120 is ideal for space...

Empowering Innovation: Your Power Partner for Tomorrow's Challenges

March 20, 2024
Discover how innovation, quality, and reliability are embedded into every aspect of Renesas' power products.

Article: Meeting the challenges of power conversion in e-bikes

March 18, 2024
Managing electrical noise in a compact and lightweight vehicle is a perpetual obstacle

Power modules provide high-efficiency conversion between 400V and 800V systems for electric vehicles

March 18, 2024
Porsche, Hyundai and GMC all are converting 400 – 800V today in very different ways. Learn more about how power modules stack up to these discrete designs.

Comments

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