If improving loop latency by reducing the trip count was not sufficient, look at ways to reduce the initiation interval (II).
The loop II is the count of clock cycles between the start of two loop iterations. The Vitis HLS compiler will always try to pipeline loops, minimize the II, and start loop iterations as early as possible, ideally starting a new iteration each clock cycle (II=1).
There are two main factors that can limit the II:
- I/O contentions
- Loop-carried dependencies
The HLS Schedule Viewer automatically highlights loop dependencies limiting the II. It is a very useful visualization tool to use when working to improve the II of a loop.