Intel® High Level Synthesis Compiler Standard Edition: Best Practices Guide
                    
                        ID
                        683259
                    
                
                
                    Date
                    12/18/2019
                
                
                    Public
                
            
                
                    
                    
                        1. Intel® HLS Compiler Standard Edition Best Practices Guide
                    
                
                    
                    
                        2. Best Practices for Coding and Compiling Your Component
                    
                
                    
                        3. Interface Best Practices
                    
                    
                
                    
                        4. Loop Best Practices
                    
                    
                
                    
                        5. Memory Architecture Best Practices
                    
                    
                
                    
                        6. Datatype Best Practices
                    
                    
                
                    
                        7. Advanced Troubleshooting
                    
                    
                
                    
                    
                        A. Intel® HLS Compiler Standard Edition Best Practices Guide Archives
                    
                
                    
                    
                        B. Document Revision History for Intel® HLS Compiler Standard Edition Best Practices Guide
                    
                
            
        5.3. Merge Memories to Reduce Area
In some cases, you can save FPGA memory blocks by merging your component memories so that they consume fewer memory blocks, reducing the FPGA area your component uses. Use the hls_merge attribute to force the Intel® HLS Compiler Standard Edition to implement different variables in the same memory system.
When you merge memories, multiple component variables share the same memory block. You can merge memories by width (width-wise merge) or depth (depth-wise merge). You can merge memories where the data in the memories have different datatypes.
   Figure 12. Overview of width-wise merge and depth-wise merge
    
     
  
 
 The following diagram shows how four memories can be merged width-wise and depth-wise.