# US 12,231,124 B2 · Hierarchical statisically multiplexed counters and a method thereof

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,231,124 B2
- Document ID: US12231124B2
- Status: Granted
- Kind: B2
- Application number: 18/500,091
- Filed: 2023-11-01
- Published: 2024-02-22
- Granted: 2025-02-18
- Earliest claimed: 2014-06-11
- Assignees: Marvell Asia Pte Ltd
- Applicants: Marvell Asia Pte, Ltd.
- Inventors: Weihuang Wang; Gerald Schmidt; Srinath Atluri; Weinan Ma; Shrikant Sundaram Lnu
- Web page: https://patentgrep.com/patent/US12231124B2

## CPC

- H03K 21/026: {comprising logic circuits}
- H03K 23/64: with a base or radix other than a power of two (H03K23/40 - H03K23/62 take precedence)
- H04L 47/62: characterised by scheduling criteria
- H04L 49/9084: {Reactions to storage capacity overflow}
- H03K 21/00: Details of pulse counters or frequency dividers
- H03K 21/10: comprising logic circuits
- H03K 23/00: Pulse counters comprising counting chains; Frequency dividers comprising counting chains (H03K29/00 takes precedence)
- H03K 23/004: {Counters counting in a non-natural counting order, e.g. random counters}
- H03K 23/005: {using minimum change code, e.g. Gray Code}
- H03K: PULSE TECHNIQUE (measuring pulse characteristics G01R; modulating sinusoidal oscillations with pulses H03C; transmission of digital information H04L; discriminator circuits detecting phase difference between two signals by counting or integrating cycles of oscillation H03D3/04; automatic control, starting, synchronisation or stabilisation of generators of electronic oscillations or pulses where the type of generator is irrelevant or unspecified H03L; coding, decoding or code conversion, in general H03M)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Embodiments of the present invention relate to an architecture that uses hierarchical statistically multiplexed counters to extend counter life by orders of magnitude. Each level includes statistically multiplexed counters. The statistically multiplexed counters includes P base counters and S subcounters, wherein the S subcounters are dynamically concatenated with the P base counters. When a row overflow in a level occurs, counters in a next level above are used to extend counter life. The hierarchical statistically multiplexed counters can be used with an overflow FIFO to further extend counter life.

## Claims

### Claim 1

A counter architecture implemented in a network device, the counter architecture comprising:
a mirrored shift logic; and
a hierarchy of levels of statistically multiplexed counters, wherein each level of the hierarchy of levels includes N counters arranged in rows having P base counters, and further wherein the mirrored shift logic extends the P base counters to a full width such that a full range of shifting is reduced.

### Claim 2 (depends on 1)

The network device of claim 1, wherein counters in the same row in one level of the hierarchy of levels are shuffled into different rows in a next level above of the hierarchy of levels.

### Claim 3 (depends on 2)

The network device of claim 2, wherein a randomization of the shuffle is a bit reverse of a counter identifier of a counter, a hash function or a bit arrangement in another order.

### Claim 4 (depends on 1)

The network device of claim 1, wherein the counter architecture is configured to update a counter by:
determining whether a corresponding row of the counter in a current level of the hierarchy of levels overflows;
based on the determination that the corresponding row in the current level does not overflow, processing each level below the current level by using a first routine and processing the current level by using a second routine; and
based on the determination that the corresponding row in the current level does overflow, determining whether a corresponding row of the counter in a next level above overflows;
based on the determination that the corresponding row of the counter in the next level above does not overflow, processing each level below the next level above by using the first routine and processing the next level above by using the second routine; and
based on the determination that the corresponding row of the counter in the next level above does overflow, when the next level above is not the highest level in the hierarchy of levels, returning to the step of determining whether a corresponding row of the counter in a next level above overflows, and when the next level above is the highest level in the hierarchy of levels, processing the next level above and each level below the next level above by using the first routine and updating an overflow queue.

### Claim 5 (depends on 4)

The network device of claim 4, wherein the first routine includes incrementing the counter in the corresponding level and shrinking the counter in the corresponding level.

### Claim 6 (depends on 4)

The network device of claim 4, wherein the second routine includes incrementing the counter in the corresponding level.

### Claim 7 (depends on 6)

The network device of claim 6, wherein the incrementing the counter includes expanding a size of the counter in the corresponding level.

### Claim 8 (depends on 4)

The network device of claim 4, wherein updating the overflow queue includes pushing a counter identifier of the counter and an overflow width into the overflow queue.

### Claim 9 (depends on 4)

The network device of claim 4, wherein the overflow queue is shared by the N counters in the highest level in the hierarchy of levels.

### Claim 10 (depends on 1)

The network device of claim 1, wherein the N counters are stored in an on-chip SRAM memory, using the common memory pool.

### Claim 11

A non-transitory computer-readable medium storing a mirrored shift logic and a hierarchy of levels of statistically multiplexed counters, wherein each level of the hierarchy of levels includes N counters arranged in rows having P base counters, and further wherein the mirrored shift logic extends the P base counters to a full width such that a full range of shifting is reduced.

### Claim 12 (depends on 11)

The medium of claim 11, wherein counters in the same row in one level of the hierarchy of levels are shuffled into different rows in a next level above of the hierarchy of levels.

### Claim 13 (depends on 12)

The medium of claim 12, wherein a randomization of the shuffle is a bit reverse of a counter identifier of a counter, a hash function or a bit arrangement in another order.

### Claim 14 (depends on 11)

The medium of claim 11, wherein the counter architecture is configured to update a counter by:
determining whether a corresponding row of the counter in a current level of the hierarchy of levels overflows;
based on the determination that the corresponding row in the current level does not overflow, processing each level below the current level by using a first routine and processing the current level by using a second routine; and
based on the determination that the corresponding row in the current level does overflow, determining whether a corresponding row of the counter in a next level above overflows;
based on the determination that the corresponding row of the counter in the next level above does not overflow, processing each level below the next level above by using the first routine and processing the next level above by using the second routine; and
based on the determination that the corresponding row of the counter in the next level above does overflow, when the next level above is not the highest level in the hierarchy of levels, returning to the step of determining whether a corresponding row of the counter in a next level above overflows, and when the next level above is the highest level in the hierarchy of levels, processing the next level above and each level below the next level above by using the first routine and updating an overflow queue.

### Claim 15 (depends on 14)

The medium of claim 14, wherein the first routine includes incrementing the counter in the corresponding level and shrinking the counter in the corresponding level.

### Claim 16 (depends on 14)

The medium of claim 14, wherein the second routine includes incrementing the counter in the corresponding level.

### Claim 17 (depends on 16)

The medium of claim 16, wherein the incrementing the counter includes expanding a size of the counter in the corresponding level.

### Claim 18 (depends on 14)

The medium of claim 14, wherein updating the overflow queue includes pushing a counter identifier of the counter and an overflow width into the overflow queue.

### Claim 19 (depends on 14)

The medium of claim 14, wherein the overflow queue is shared by the N counters in the highest level in the hierarchy of levels.

### Claim 20 (depends on 11)

The medium of claim 11, wherein the medium includes a static random access memory (SRAM) and the N counters are stored in the SRAM.
