Intel® High Level Synthesis Compiler Pro Edition: Best Practices Guide

ID 683152
Date 4/01/2024
Public
Document Table of Contents

4. Interface Best Practices

With the Intel® High Level Synthesis Compiler, your component can have a variety of interfaces: from basic wires to the Avalon Streaming and Avalon Memory-Mapped Host interfaces. Review the interface best practices to help you choose and configure the right interface for your component.

Each interface type supported by the Intel® HLS Compiler Pro Edition has different benefits. However, the system that surrounds your component might limit your choices. Keep your requirements in mind when determining the optimal interface for your component.

Demonstrating Interface Best Practices

The Intel® HLS Compiler Pro Edition comes with a number of tutorials that illustrate important Intel® HLS Compiler concepts and demonstrate good coding practices.

Review the following tutorials to learn about different interfaces as well as best practices that might apply to your design:
Tutorial Description
You can find these tutorials in the following location on your Quartus® Prime system:
<quartus_installdir>/hls/examples/tutorials
interfaces/ overview Demonstrates the effects on quality-of-results (QoR) of choosing different component interfaces even when the component algorithm remains the same.
best_practices/ const_global

Demonstrates the performance and resource utilization improvements of using const qualified global variables. Also demonstrates the type of interface created when you access global variables.

best_practices/ parameter_aliasing

Demonstrates the use of the __restrict keyword on component arguments

best_practices/ lsu_control Demonstrates the effects of controlling the type of LSUs instantiated for variable-latency Avalon® Memory Mapped Host interfaces
interfaces/ explicit_streams_buffer

Demonstrates how to use explicit stream_in and stream_out interfaces in the component and testbench.

interfaces/ explicit_streams_packets_empty Demonstrates how to use the usesPackets, usesEmpty, and firstSymbolInHighOrderBits stream template parameters.
interfaces/explicit_streams_packets_ready_valid Demonstrates how to use the usesPackets, usesValid, and usesReady stream template parameters.
interfaces/ mm_host_testbench_operators Demonstrates how to invoke a component at different indicies of an Avalon Memory Mapped (MM) Host (mm_host class) interface.
interfaces/ mm_agents Demonstrates how to create Avalon-MM Agent interfaces (agent registers and agent memories).
interfaces/ mm_agents_csr_volatile Demonstrates the effect of using volatile keyword to allow concurrent agent memory accesses while your component is running.
interfaces/ mm_agents_double_buffering Demonstrates the effect of using the hls_readwrite_mode macro to control how memory hosts access the agent memories
interfaces/ multiple_stream_call_sites Demonstrates the tradeoffs of using multiple stream call sites.
interfaces/ pointer_mm_host Demonstrates how to create Avalon-MM Host interfaces and control their parameters.
interfaces/ stable_arguments Demonstrates how to use the stable attribute for unchanging arguments to improve resource utilization.