External Memory Interfaces Agilex™ 7 M-Series FPGA IP User Guide

ID 772538
Date 11/18/2024
Public
Document Table of Contents

12.2.1. Example 1: Reading IP_TYPE and IP_INSTANCE_ID of All the Interfaces in the IO96B Using Mailbox

This example provides instructions for reading the IP_TYPE and IP_INSTANCE_ID of all the interfaces in the IO96B using the mailbox.

The values shown below are for illustrative purposes and are obtained from an EMIF example design using DDR4 x32 + ECC implemented on the Agilex™ 7 FPGA E-Series 065B Development Kit - Premium. This configuration uses the Primary MC of the Primary IO96B.

Base address for mailbox=0x500_0000

Address for each mailbox register = Base address + offset of each register

The following table shows the addresses for the mailbox registers.

Table 210.  Addresses for Mailbox Registers
Register Name Byte Offset (Decimal) Byte Offset (Hex) Address (Hex)
STATUS 1024 0x400 0x5000400
CMD_PARAM_6 1056 0x420 0x5000420
CMD_PARAM_5 1060 0x424 0x5000424
CMD_PARAM_4 1064 0x428 0x5000428
CMD_PARAM_3 1068 0x42C 0x500042c
CMD_PARAM_2 1072 0x430 0x5000430
CMD_PARAM_1 1076 0x434 0x5000434
CMD_PARAM_0 1080 0x438 0x5000438
CMD_REQ 1084 0x43c 0x500043c
CMD_RESPONSE_DATA_2 1104 0x450 0x5000450
CMD_RESPONSE_DATA_1 1108 0x454 0x5000454
CMD_RESPONSE_DATA_0 1112 0x458 0x5000458
CMD_RESPONSE_STATUS 1116 0x45c 0x500045c

The table below illustrates the construction of the data to be written to the CMD_REQ register for this request:

CMD_REQ [31:29]:

CMD_TARGET_IP_TYPE

CMD_REQ [28:24]:

CMD_TARGET_IP_INSTANCE_ID

CMD_REQ [23:16]:

CMD_TYPE

CMD_REQ [15:0]:

CMD_OPCODE

CMD_REQ [31:0]:

0x0 (not used)

0x0 (not used)

0x01 (CMD_GET_SYS_INFO) 0x0001(GET_MEM_INTF_INFO)

0x0001_0001

Follow these steps to send the Command using the JAMB/AXI-Lite interface for the interface:

  1. It is not required to write to the CMD_PARAM_* register as this OPCODE does not require any cmd_param .
  2. Write to the CMD_REQ(address=0x500_043c) with write_data=0x0001_0001 .
  3. Read from CMD_RESPONSE_STATUS(address=0x500_045c) until you get the STATUS_COMMAND_RESPONSE_READY (Bit 0 of CMD_RESPONSE_STATUS register) equals to 1 .

    The expected read data=0x0001_0001, where:

    The first 1 indicates that CMD_RESPONSE_DATA_SHORT[1:0]=1 , indicating that only one memory interface is instantiated in this IO96B.

    The second 1 is STATUS_CMD_RESPONSE_READY.

  4. Read from CMD_RESPONSE_DATA_0(address=0x500_0458).

    The expected read_data=0x2000_0000.

    IP_TYPE for interface 0 = CMD_RESPONSE_DATA_0 [31:29]= 0x1 , indicating interface 0 is using Primary MC of Primary IO96B.

    IP_INSTANCE_ID for interface 0 = CMD_RESPONSE_DATA_0 [38:24]= 0x0 .

  5. Read from CMD_RESPONSE_DATA_1(address=0x500_0454).

    Expected read_data=0x0000_0000.

    IP_TYPE for interface 1 = CMD_RESPONSE_DATA_1 [31:29]= 0x0 , indicating interface 1 does not exist.

    IP_INSTANCE_ID for interface 1 = CMD_RESPONSE_DATA_1 [38:24]= 0x0.

  6. Clear the STATUS_COMMAND_RESPONSE_READY (Bit 0 of CMD_RESPONSE_STATUS register). Perform a Read-Modify-Write operation:
    1. Read from CMD_RESPONSE_STATUS register.
    2. Write_Data = Data in (a) & 0xffff_fffe (Change only bit 0).
    3. Write to address = 0x500_045c data= write_data from (b).