External Memory Interfaces (EMIF) IP User Guide: Agilex™ 5 FPGAs and SoCs

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

13.2.2. Example 2: Reading the Memory Clock Frequency for an Interface

This example illustrates the reading of the memory clock frequency for an interface in the IO96B using the mailbox.

The values in this example are for illustrative purposes and are obtained from an EMIF example design with DDR4 x32 + ECC running at 800MHz on the Agilex™ 5 FPGA E-Series 065B Development Kit - Premium. This configuration uses the Primary MC of the Primary IO96B.

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]:

0x1 (Primary MC on Primary IO96B)

0x0

0x02 (CMD_GET_MEM_INFO)

0x0003 (GET_MEMCLK_REQ_KHZ)

0x2002_0003

This OPCODE requires CMD_PARAM_0 to be specified. DDR4 supports only one memory clock frequency, set CMD_PARAM_0=0x4 to indicate that we will read the clock frequency for current frequency set point.

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

  1. Write to the CMD_PARAM_0(address=0x500_0438) with write_data=0x4.
  2. Write to the CMD_REQ(address=0x500_043c) with write_data=0x2002_0003.
  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.

    Expected read_data=0x0000_0001.

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

    Expected read_data=0x000c_3500.

  5. 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).