The Performance Metrics analysis tab can help identify if the lock stall needs to be analyzed. The following steps show how you can analyze a lock stall starting in the Vitis IDE:
- Select the Trace view.
- Select the Lock Stalls view.Tip: The Stalls view is available with the Trace view, Graph view, and Array view.Figure 1. Lock Stall in Trace ViewEach stall has the following information associated with it:
- NAME
- The name of the lock stall is LS_<NUM>. The number is unique across all types of stalls. The earlier the stall happens, the smaller the number.
- Stalled Tile
- The AI Engine tile that contains the stalled kernel.
- Stalled Kernel
- The stalled kernel. It is named
<Kernel_function_name>.<Schedule_ID>.<Graph_instance_name>. If it displays as_main, you need to cross-probe to find the real kernel function. - Start (ps)
- The start time of the stall.
- Duration (ps)
- The duration of the stall.
- PC
- Program counter when the stall happens.
- Type
- The stalled kernel tries to read or write the buffer.
- Buffer
- The buffer that the stalled kernel tries to read or write.
- Stalled Port
- The port of the stalled kernel that tries to read or write the buffer.
- Lock Holder
- The source that is holding the lock of the buffer.
- Related Stall
- Other stalls that can cause a stall. Tip: The items in green can be cross-probed with other views.
- Select one row of the stall. It goes to the start of the stall in
Trace view. You
can optionally filter all the signals that relate to the stall by right-clicking
the stall and choosing Filter Trace. The
Trace view
displays the signals that relate to the stall.Note: The Trace view hides unrelated signals. Exploring the trace is easier when the design is large.Tip: Filter Trace might not show signals related to the related stalls.
- You can use Trace
view to view the lock stall in a timeline. You can see it for a specific lock
stall when the write lock and read lock are allocated. You can analyze the
reason for the stall from the position of the stall and events before and after
the stall.
For example, write lock is already allocated and the lock type is Read. This indicates that the buffer has not been released by the producer. The consumer is waiting for it to be readable. The Lock Holder contains the producer.
- To clear the previously filtered trace, right-click and choose Clear All Filters.
- It is usually helpful to have an overview of the stall path in
Graph view. Select
Graph view and
then select Tile View from the drop-down
list in the view. Tile
view of Graph view
shows graph in AI Engine tiles.
- If the Stalls view is not visible, select Lock Stalls from the drop-down list and choose the stall you want to analyze. The tool highlights the related paths in the Tile view of the Graph view.
- The red path shows where the stall occurs. The white path shows the source to where the stall occurs.
- Click the PC value. The source code opens and shows the line where the
stall happens.
The following table lists scenarios that can cause a lock stall and possible solutions.
| Source | Target | Destination | Stall Type | Possible Solution |
|---|---|---|---|---|
| AI Engine kernel | Lock of sync window | AI Engine kernel | Lock stall |
|
| AI Engine kernel | Lock of async window (window_acquire and
window_release API) |
AI Engine kernel | Lock stall |
|
| PL interface | Lock of window | AI Engine kernel | Lock stall |
|
| AI Engine | Lock of window | PL interface | Lock stall |
|
Note: DMA lock stall is not included in the
Vitis IDE lock stall analysis.