This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Designing with Xilinx FPGAs Using Vivado > C-Based Design > Optimization Methodology

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

Optimization Methodology

FONT SIZE : AAA

Any methodology for creating an optimal RTL implementation ideally requires understanding what the requirements of the RTL implementation are. However, the following methodology assumes you wish to create the highest-performing design. If this is not the case, skip steps 4 and 5: 

1. Simulate the C design and ensure the results are checked in the testbench. 

2. Synthesize the C code to create a baseline design. This will be the default syn- thesis performed by HLS and provide you with a starting point for optimization. 

3. Apply the optimizations for interface synthesis. This ensures the interfaces are of the required type to integrate the design with the rest of the system. 

4. Apply pipeline directives. 

5. Address any structural issues which create bottlenecks and prevent pipelining achieving the desired II , such as partitioning arrays and unrolling loops. 

6. Use the optimization directives which control the allocation of resources to improve the area if this is required. 

7. Finally, if the latency is a performance requirement, specify any latency directives. 

Example design implementations.png

Fig. 10.10 Example design implementations

This methodology can be applied to the minmax_frame function to create three data points for design comparison. The clock frequency is specifi ed as 4 ns and a Kintex7 device is targeted. 

The performance and resources for the three examples are shown in Fig. 10.10 . Remember that this design example has eight input values and therefore the reported II is the number of cycles before another eight new inputs can be processed. 

Example 1: Small Design 

• Input array DataIn is specifi ed as a block RAM interface. 

• Both outputs are specifi ed with an output valid signal. 

• A block-level IO protocol is specifi ed. 

• The loop is left rolled. 

Leaving the loop rolled ensures the minimum amount of hardware; however, the latency and II are the highest because HLS creates logic to implement the body of Loop1 and then executes the same logic eight times sequentially (calculating each iteration of the loop before starting to calculate the next iteration). 

Example 2: Fastest Design 

• Input array DataIn is completely partitioned into eight separate ports. 

• Since the input array DataIn is read in sequential order, it is specifi ed as an AXI- Stream to reduce resources (no address generation logic) resulting in eight sepa- rate AXI-Stream interfaces. 

• Both outputs are specifi ed as AXI-Stream interfaces. 

• A block-level IO protocol is specifi ed. 

• The loop is fully unrolled. 

Unrolling the loop creates a design with the largest amount of hardware—eight copies of the logic required to implement the loop body—and partitioning the input ports allows parallel reads and writes. This creates the fastest design but also uses the greatest number of resource. If the clock frequency is reduced, this design can complete in a single clock cycle. 

Example 3: Pipelined Design 

• Since the input array DataIn is read in sequential order, it is specifi ed as an AXI- Stream to reduce resources. 

• Both outputs are also specifi ed as AXI-Stream interfaces. 

• A block-level IO protocol is specifi ed as an AXI-Lite interface. 

• Loop1 is pipelined. 

Pipelining the loop keeps the hardware to a minimum while still ensuring the design is able to process one sample per clock cycle ( II = 8: the design can process eight inputs in eight clock cycles). 

The ability to generate multiple RTL implementations from the same C code is a large productivity benefi t of using HLS. You are able to explore the design space to create the most optimum design implementation. 

  • XC3064A-7PG132I

    Manufacturer:Xilinx

  • FPGA XC3000 Family 4.5K Gates 224 Cells 113MHz 5V 132-Pin CPGA
  • Product Categories:

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XCV200E-6FG256I

    Manufacturer:Xilinx

  • FPGA Virtex-E Family 63.504K Gates 5292 Cells 357MHz 0.18um Technology 1.8V 256-Pin FBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

  • XC4028XL-3HQ240C

    Manufacturer:Xilinx

  • FPGA XC4000X Family 28K Gates 2432 Cells 0.35um Technology 3.3V 240-Pin HSPQFP EP
  • Product Categories: FPGAs

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC2V1500-6FFG896C

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 1.5M Gates 17280 Cells 820MHz 0.15um Technology 1.5V 896-Pin FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

  • XC4003A-5PC84I

    Manufacturer:Xilinx

  • Xilinx PLCC84
  • Product Categories:

    Lifecycle:Any -

    RoHS: -

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.