Search

US-20260127050-A1 - HARDWARE COUNTERS

US20260127050A1US 20260127050 A1US20260127050 A1US 20260127050A1US-20260127050-A1

Abstract

An apparatus comprises a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values, and histogram control circuitry to perform an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising an input value. Responsive to a histogram range update trigger, adding circuitry adds a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges, and the histogram control circuitry updates a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values.

Inventors

  • Mark Underwood

Assignees

  • ARM LIMITED

Dates

Publication Date
20260507
Application Date
20241107

Claims (20)

  1. 1 . An apparatus, comprising: a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values; and histogram control circuitry responsive to an input value to perform an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising the input value; wherein, responsive to a histogram range update trigger: adding circuitry is configured to add a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges; and the histogram control circuitry is configured to perform an indexing operation update to update a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values.
  2. 2 . The apparatus according to claim 1 , wherein the histogram control circuitry is configured to perform the indexing operation update such that the updated indexing operation and the previous indexing operation identify the same hardware counter in response to an input value lying in a range other than the one or more first sub-ranges and one or more newly defined sub-ranges.
  3. 3 . The apparatus according to claim 2 , wherein the plurality of hardware counters other than the one or more first hardware counters and the second hardware counter are configured to remain unchanged in response to the histogram range update trigger.
  4. 4 . The apparatus according to claim 1 , wherein the one or more first hardware counters correspond to a lowest value portion of the contiguous range of target values.
  5. 5 . The apparatus according to claim 1 , wherein the histogram control circuitry is configured to provide the newly defined sub-range to represent a highest value portion of the contiguous range of target values.
  6. 6 . The apparatus according to claim 1 , wherein the indexing operation is configured to identify the selected hardware counter based on a bit position of the most significant bit in a binary representation of the target value.
  7. 7 . The apparatus according to claim 6 , wherein the updated indexing operation and the previous indexing operation identify the selected hardware counter based on a different base bit position relative to which the bit position is determined.
  8. 8 . The apparatus according to claim 1 , comprising update trigger circuitry configured to issue the histogram range update trigger in response to a determination that a distribution of counts provided by the plurality of hardware counters meets a skewed distribution condition.
  9. 9 . The apparatus according to claim 1 , comprising update trigger circuitry configured to issue the histogram range update trigger in response to identifying more than a threshold number of input values lying outside the contiguous range of target values.
  10. 10 . The apparatus according to claim 1 , wherein the histogram control circuitry is configured to perform the indexing operation update such that the updated indexing operation identifies the second hardware counter in response to an input value lying within the one or more first sub-ranges or the second sub-range.
  11. 11 . The apparatus according to claim 1 , wherein the histogram control circuitry is responsive to a histogram output event signal to defer the effects of the histogram range update trigger.
  12. 12 . The apparatus according to claim 1 , wherein the histogram control circuitry is configured to provide an output indicating a degree to which the indexing operation has been updated relative to an initial indexing operation, the output enabling a consumer to determine a sub-range corresponding to each of the plurality of hardware counters.
  13. 13 . The apparatus according to claim 1 , wherein the adding circuitry is configured to reset count values of the one or more first hardware counters in response to the count values being added to the second hardware counter.
  14. 14 . The apparatus according to claim 1 , comprising scaling circuitry configured to apply a scaling factor to reduce the magnitude of a source value contributing to the input value.
  15. 15 . The apparatus according to claim 14 , comprising cache replacement circuitry configured to store one or more age indications each associated with a corresponding cache line; wherein the cache replacement circuitry is configured to provide the input value based on the age indication of a given cache line; and the scaling circuitry is configured to reduce the magnitude of an age update value used to update the age indication.
  16. 16 . The apparatus according to claim 14 , wherein the histogram control circuitry is configured to update the scaling factor in response to the histogram range update trigger.
  17. 17 . A system comprising: the apparatus of claim 1 , implemented in at least one packaged chip; at least one system component; and a board, wherein the at least one packaged chip and the at least one system component are assembled on the board.
  18. 18 . A chip-containing product comprising the system of claim 17 , wherein the system is assembled on a further board with at least one other product component.
  19. 19 . A method, comprising: providing a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values; responsive to an input value, performing an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising the input value; and responsive to a histogram range update trigger: adding a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges; and performing an indexing operation update to update a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values.
  20. 20 . A non-transitory computer-readable medium storing computer-readable code for fabrication of an apparatus, comprising: a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values; and histogram control circuitry responsive to an input value to perform an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising the input value; wherein responsive to a histogram range update trigger: adding circuitry is configured to add a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges; and the histogram control circuitry is configured to perform an indexing operation update to update a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values.

Description

BACKGROUND Technical Field The present technique relates to the field of data processing. In particular, it relates to the use of hardware counters for providing a histogram. Technical Background Histograms can provide information regarding the distribution of values of an input. Histograms may be implemented in the hardware of a data processing apparatus for monitoring various values within the processing apparatus. SUMMARY At least some examples of the present technique provide an apparatus, comprising: a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values; andhistogram control circuitry responsive to an input value to perform an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising the input value;wherein, responsive to a histogram range update trigger: adding circuitry is configured to add a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges; andthe histogram control circuitry is configured to perform an indexing operation update to update a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values. At least some examples provide a method, comprising: providing a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values;responsive to an input value, performing an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising the input value; andresponsive to a histogram range update trigger: adding a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges; and performing an indexing operation update to update a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values. At least some examples provide a non-transitory computer-readable medium storing computer-readable code for fabrication of an apparatus, comprising: a plurality of hardware counters each corresponding to a separate sub-range of a contiguous range of target values; andhistogram control circuitry responsive to an input value to perform an indexing operation to identify and increment a selected hardware counter corresponding to a selected sub-range comprising the input value;wherein responsive to a histogram range update trigger: adding circuitry is configured to add a count value of one or more first hardware counters corresponding to one or more first sub-ranges to a second hardware counter corresponding to a second sub-range neighbouring the one or more first sub-ranges; and the histogram control circuitry is configured to perform an indexing operation update to update a previous indexing operation to an updated indexing operation, wherein the updated indexing operation identifies one of the one or more first hardware counters in response to an input value lying within a newly defined sub-range of the contiguous range of target values. Further aspects, features and advantages of the present technique will be apparent from the following description of examples, which is to be read in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 schematically illustrates circuitry for providing a histogram in hardware. FIG. 2 schematically illustrates an example of adding circuitry. FIG. 3 schematically illustrates three examples of sub-ranges corresponding to a set of four hardware counters labelled #0 to #3. FIG. 4 is a table providing several example input values and the identified hardware counters for those input values when the base index is 1. FIG. 5 schematically illustrates an example implementation of a histogram. FIG. 6 is a flow diagram illustrating a method of updating sub-ranges corresponding to a plurality of hardware counters. FIG. 7 illustrates a system and a chip-containing product. DESCRIPTION OF EXAMPLES An apparatus comprises a plurality of counters implemented in hardware. Each counter is configured to store a count value indicating a number of times a particular event has occurred. Each hardware counter corresponds to a separate sub-range of a contiguous range of target values, such that each target value in the contiguous range of target values corresponds to one of the hardware counters. The contigu