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.
|You can find these tutorials in the following location on your Intel® Quartus® Prime system:
|interfaces/ overview||Demonstrates the effects on quality-of-results (QoR) of choosing different component interfaces even when the component algorithm remains the same.|
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.
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|
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.|