Performance Measurement Using the AXI Performance Monitor
The AXI Performance Monitor (APM) module is used to monitor basic information about data transfers between the PS Arm® cores and the hardware in the PL. It captures statistics such as number of read/write transactions, throughput, and latency for the AXI transactions on the busses in the system.
This section demonstrates how to insert an APM core into the system, monitor the instrumented system, and view the performance data produced.
Create a Standalone Project and Implementing APM
- Open the SDSoC™ environment, and create a new SDSoC project/workspace using any platform or operating system selection. Select the Matrix Multiplication and Addition template.
- In Application Project Settings, select Insert AXI
Performance Monitor.
Enabling this option and building the project adds the APM IP core to your hardware system. The APM IP uses a small amount of resources in the programmable logic. The SDSoC environment connects the APM to the hardware/software interface ports, which are the general purpose (GP) and high performance (HP) ports.
- Select the
mmult
andmadd
functions to be implemented in hardware. Clean and build the project using the Debug configuration (selected by default).
Monitor the Standalone Instrumented System
To monitor the system, do the following:
- After the build completes, connect the board to your computer, and power up the board.
- Click the button to open the window.
- Select Xilinx SDx Application Debugger in the Debug configurations tree.
- Click New Launch Configuration to create a new SDx Application Debugger configuration.
- For Debug Type, select Standalone Application Debug.
- For Connection, select Local.
- Select the Performance
Analysis check box in the Main tab.
After you select Performance Analysis, the performance analysis options are populated automatically in the Main tab.
- Click Apply, and then
click Debug.
If prompted to switch perspectives, click Yes.
- After the Debug Perspective opens, click Performance Analysis in the Open Perspective dialog, and click OK. , and select
- To resume the application, select the Debug tab, and click
Resume.
If prompted to switch perspectives, click No to stay on the Performance Analysis perspective.
Create a Linux Project and Implement APM
- Open the SDSoC environment, and create a new project/workspace using any platform or operating system selection. Select the Matrix Multiplication and Addition Template.
- In SDx Application Project
Settings, select Insert AXI Performance
Monitor.
Enabling this option, and building the project adds the APM IP core to your hardware system. The APM IP uses a small amount of resources in the programmable logic. The SDSoC environment connects the APM to the hardware/software interface ports, which are the GP and HP.
- Select the
mmult
andmadd
functions to be implemented in hardware. - Clean and build the project using the Debug configuration, which is selected by default.
The following figure shows the APM Counter:
Monitor the Linux Instrumented System
- With the completed build, copy the contents of the sd_card directory onto a SD card, and boot Linux on the board.
- Connect the board to your computer using both UART and JTAG cables.
- Set up the Linux TCF agent target connection with the IP address of the board. See the SDK Help topic on TCF for more information.
- Click the Debug Configurations. menu to open
- Select Xilinx Sdx Application Debugger in the Debug configuration tree.
- Click New Launch Configuration to create a new Application Debugger configuration.
- For Debug Type, select Linux Application Debug.
- For Connection, select Local.
- Select the Performance
Analysis check box.
After the Performance Analysis check box is selected, all the performance analysis options is populated automatically in the Main tab.
- Click Apply.
- Click Debug.
If prompted to switch perspective to Debug, click Yes.
- After Debug Perspective is displayed, click Performance Analysis in the Open Perspective dialog. , and then select
- Click OK.
- Select the Debug tab,
and click on Resume to resume the
application.
If prompted to switch perspectives, click No to stay on the Performance Analysis perspective.
- After your program completes execution, click the Stop Analysis button.
If prompted by the Confirm Perspective Switch dialog box to stay in the Performance Analysis perspective, click No.
- Scroll through the analysis plots in the lower portion of the perspective to view different performance statistics.
- Click in any plot area to show a bigger version in the middle of the
perspective.
The orange box allows you to focus on a particular time slice of data.
Analyzing the Performance
In this system, the APM is connected to the one port in use between the PS, PL, and the GP port.
The multiplier and adder accelerator cores are both connected to the accelerator coherency port (ACP) for data input and output.
The GP port is used to issue control commands and get the status of the accelerator cores only, not for data transfer. The blue Slot 0 is connected to the GP port, and the green Slot 1 is connect to the ACP.
The APM is configured in Profile mode with two monitoring slots for each port (ACP and GP). Profile mode provides event counting functionality for each slot. The type of statistics computed by the APM for both reading and writing include:
- Transaction Count
- Total number of requests that occur on the bus.
- Byte Counter
- Total number of bytes sent (used for write throughput calculation).
- Latency
- Time between the start of the address issuance and the last element sent.
The latency and byte counter statistics are used by the APM to automatically compute the throughput (in MB/s). The latency and throughput values shown are for the 50 ms time interval.
Minimum, maximum, and averages also display for latency and throughput statistics.