Intel® High Level Synthesis Compiler Standard Edition: Reference Manual

ID 683310
Date 12/18/2019
Document Table of Contents

4.3.1. Memory-Mapped Master Testbench Constructor

For components that use an instance of the Avalon® Memory-Mapped (MM) Master class (mm_master<>) to describe their memory interfaces, you must create an mm_master<> object in the testbench for each mm_master argument.

To create an mm_master<> object, add the following constructor in your code:

ihc::mm_master<int, … > mm(void* ptr, int size, bool use_socket=false);

where the constructor arguments are as follows:

  • ptr is the underlying pointer to the memory in the testbench
  • size is the total size of the buffer in bytes
  • use_socket is the option you use to override the copying of the memory buffer and have all the memory accesses pass back to the testbench memory

    By default, the Intel® HLS Compiler copies the memory buffer over to the simulator and then copies it back after the component has run. In some cases, such as pointer-chasing in linked lists, copying the memory buffer back and forth is undesirable. You can override this behavior by setting use_socket to true.

    Note: When you set use_socket to true, only Avalon® MM Master interfaces with 64-bit wide addresses are supported. In addition, setting this option increases the run time of the simulation.