Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 12/13/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

4.4.1. Memory-Mapped Host Testbench Constructor

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

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

ihc::mm_host<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 Host interfaces with 64-bit wide addresses are supported. In addition, setting this option increases the run time of the simulation.