SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
The statistics counters are implemented in 2KB memory which can hold a maximum of 512 32-bit counters. These counters can be made into 64-bit counters by specifying the number of 64-bit counters in the Counter Allocation Register (address offset 8h). The default register configuration is 256 64-bit counters and 512 32-bit counters. The 64-bit counters are all placed before the 32-bit counters. The index for 64-bit counters is always an even number and starts from 0. For example if Counter Allocation Register (address offset 8h) is configured to be 5, then statistics at index 0, 2, 4, 6 and 8 are 64-bit stats; index 10,11,12,13,…,511 are all 32-bit stats. All counters are cleared to “0” upon hardware reset or software reset ([31-0] TRIGGER).
To allow both sending of statistics packet to the host and stats update happen simultaneously, the module has a second statistics page and the engine can ping-pong between them. The ‘Active’ label in Figure 6-262 indicates which page is currently processing new stat bumps. The ping-pong approach allows the engine to get snapshot of the active page and send them based on certain events (timer expiration, an input packet with ‘send update’ command), while the other page resumes processing of new increments. In Figure 6-262 page A is initially the active page, and page B is the page that will become the active page when the engine goes into output phase.
After the output phase, there is a ‘merging’ between the two pages to ensure the new active page reflects the latest stats count and the bit masks. This process occurs as a background task and runs at slow interval (every 8 cycles) to minimize bandwidth impact. After the merging process is complete, the state machine resets the applied bit mask to all 1s and reset the counters in the non-active page to all 0s (reset phase). The engine then goes back to a steady state in which new bumps are handled in the active page and the stats in the non-active page are all zero.