A newer version of this document is available. Customers should click here to go to the newest version.
Agent IP Component Kernels
SYCL* kernels generate an interface that can control the kernel and pass in the kernel arguments to the IP component.
By default, the Intel® oneAPI DPC++/C++ Compiler generates an Avalon agent interface to control the kernel and pass in the kernel arguments. The compiler also generates a header file that provides the addresses of various registers in the agent memory map. A top-level header named register_map_offsets.hpp is created for each device image that you can include if you are interfacing with the SYCL* device image.
An additional header is generated for each of your kernels within the .prj directory. The register_map_offsets.hpp header file includes these files, but contain the addresses and offsets for each of the kernels.
Example Register Map File
/* Status register contains all the control bits to control kernel execution */
/*****************************************************************************/
/* Memory Map Summary                                                        */
/*****************************************************************************/
/*
Address | Access | Register     | Argument              | Description
--------|--------|--------------|-----------------------|-------------------------------
    0x0 |    R/W |   reg0[63:0] |          Status[63:0] |   * Read/Write the status bits
        |        |              |                       |       that are described below
--------|--------|--------------|-----------------------|-------------------------------
    0x8 |    R/W |   reg1[31:0] |           Start[31:0] |        * Write 1 to initiate a
        |        |              |                       |                   kernel start
--------|--------|--------------|-----------------------|-------------------------------
   0x30 |      R |   reg6[31:0] |   FinishCounter[31:0] | * Read to get number of kernel
        |        |  reg6[63:32] |   FinishCounter[31:0] |       finishes, note that this
        |        |              |                       |    register will clear on read
--------|--------|--------------|-----------------------|-------------------------------
   0x80 |    W   |  reg16[63:0] |     arg_input_a[63:0] |
--------|--------|--------------|-----------------------|-------------------------------
   0x88 |    R/W |  reg17[63:0] |     arg_input_b[63:0] |
--------|--------|--------------|-----------------------|-------------------------------
   0x90 |    R/W |  reg18[63:0] |     arg_input_c[63:0] |
--------|--------|--------------|-----------------------|-------------------------------
   0x98 |    R/W |  reg19[31:0] |           arg_n[31:0] |
*/
/**************************************************************************/
/* Register Address Macros                                                */
/**************************************************************************/
/* Status Register Bit Offsets (Bits) */
/* Note: Bits In Status Registers Are Marked As Read-Only or Read-Write
   Please Do Not Write To Read-Only Bits */
#define KERNEL_REGISTER_MAP_DONE_OFFSET (1) // Read-only
#define KERNEL_REGISTER_MAP_BUSY_OFFSET (2) // Read-only
#define KERNEL_REGISTER_MAP_STALLED_OFFSET (3) // Read-only
#define KERNEL_REGISTER_MAP_UNSTALL_OFFSET (4) // Read-write
#define KERNEL_REGISTER_MAP_VALID_IN_OFFSET (14) // Read-only
#define KERNEL_REGISTER_MAP_STARTED_OFFSET (15) // Read-only
/* Status Register Bit Masks (Bits) */
#define KERNEL_REGISTER_MAP_DONE_MASK (0x2)
#define KERNEL_REGISTER_MAP_BUSY_MASK (0x4)
#define KERNEL_REGISTER_MAP_STALLED_MASK (0x8)
#define KERNEL_REGISTER_MAP_UNSTALL_MASK (0x10)
#define KERNEL_REGISTER_MAP_VALID_IN_MASK (0x4000)
#define KERNEL_REGISTER_MAP_STARTED_MASK (0x8000)While the default option for kernels are agent kernels, there is a register_map_interface macro to mark a function as an agent kernel. This is shown in the following example:
#include <sycl/ext/intel/prototype/interfaces.hpp>
using namespace sycl;
struct MyIP {
  int *input_a, *input_b, *input_c;
  int n;
  register_map_interface void operator()() const {
    for (int i = 0; i < n; i++) {
      input_c[i] = input_a[i] + input_b[i];
    }
  }
};