Programming Example - Read Byte Count on DDR Port 3

Zynq UltraScale+ Device Technical Reference Manual (UG1085)

Document ID
UG1085
Release Date
2023-12-21
Revision
2.4 English

This simple example lists the steps to program the APM_DDR to count the number of bytes read from the DDR memory by the DisplayPort controller. The DisplayPort controller accesses DDR memory using XPI port (slot) 3 as shown in This Figure. Additional programming examples are in the AXI Performance Monitor LogiCORE IP Product Guide (PG037) [Ref 22].

Note:   The DDR XPI port 3 is shared by the DisplayPort and the S_AXI_HP0_FPD interface from the PL. There is no way for the APM to select between the AXI traffic from the PL and the DisplayPort controller. So, this example will also count the bytes read by this PL AXI interface, if it is active.

APM metric counter 7 is used for this example. All programming registers are in the APM_DDR register set.

1.Configure metric counter 7 to the XPI port (slot) 3. Write 011b to the MSR_1 [MET_CT7_SLOT] bit field.

2.Select the read-byte count metric. Write 011b to the MSR_1 [MET_CT7_SEL] bit field.

3.Enable the metric counter. Write 1 to the CR [MET_CNT_EN] bit.

4.Configure the sample interval time. Write 32'h000 to the SIR [SMPL_INTRVL_SIR] bit field.

5.Load the sample interval time value into the APM counter. Write 1 to the SICR [LOAD] bit.

6.Disable the down counter. Write 0 to the SICR [ENABLE] bit.

7.Reset and enable the down counter. Write 9'h101 to SICR: [MET_CNT_RST] = 1, [LOAD] = 0, and [ENABLE] = 1.

8.Get the byte count from metric counter 7. Read MCR_7 [MET_CT].