Use age matrices to manage entries in a queue's subqueues
By using subqueue hierarchy and age matrix to manage queue projects in electronic devices, the power and complexity problems caused by disordered removal are solved, and more efficient power and computing resource utilization is achieved.
Patent Information
- Application Number
- CN202080090713.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-12-28
- Filing Date
- 2020-12-27
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2040-12-27
AI Technical Summary
In existing electronic devices, the use of a queue of disorderly removal of items results in large shift operations and power consumption, and the increase in metadata circuit complexity and power consumption, especially in large queues.
The subqueue hierarchy and age matrix are adopted to manage items in the queue, track the relative age of items through the age matrix, and shift items from the higher subqueue to fill in vacancies when the items are removed by the lowest subqueue, reducing the complexity of shift operations and metadata circuitry.
More efficient power usage and computing resource utilization are achieved, shift operations and complexity of metadata circuits in large queues are reduced, and the efficiency of electronic devices is improved.
Smart Images

Figure CN114930284B_ABST
Abstract
Description
Background Art
[0001] Related fields
[0002] Some electronic devices use storage circuits (such as queues and buffers) to temporarily store items being processed by the electronic device. For example, some network devices (e.g., switches, routers, etc.) include queues for temporarily buffering network transactions, packets, messages, or other communications awaiting processing or transmission to downstream network devices via the network. As another example, a processor (such as a central processing unit (CPU) or a graphics processing unit (GPU)) may include a queue in which instructions, threads, or work items are temporarily stored awaiting processing or processing by the processor. Such storage circuits (referred to herein as "queues") have multiple benefits, including hiding delays from transmitting functional blocks and devices, conversions between clock domains, etc.
[0003] In some electronic devices, items can be removed from a queue for out-of-order processing. In other words, in such electronic devices, items do not need to be removed in strict first-in-first-out (FIFO) or age order, but rather can be removed in any convenient order, at least to some extent. For example, a queue in a network device may store older transactions (or packets, messages, etc.) destined for a first downstream network device and more recent transactions destined for a second downstream network device. If strict age-ordered removal is required, transactions destined for the first downstream network device will need to be removed (and processed) first. In contrast, when out-of-order removal is permitted, transactions destined for the second downstream network device may be removed first, even though they are newer. This can be useful because, when the second downstream network device becomes available, the network device can make progress in removing transactions from the queue, even though the first downstream network device is busy.
[0004] While allowing out-of-order removal of items from a queue can be beneficial, electronic devices that support out-of-order removal must also include mechanisms for managing gaps in the queue caused by out-of-order removal. Some electronic devices handle such gaps by simply shifting the remaining items in the queue, filling the gap and leaving a gap at the "end" of the queue for the next item to be added. This technique is simple and maintains the age order of items in the queue, but it results in a large number of shift operations (especially in larger queues) because removing any item from the queue involves shifting up to all remaining items in the queue. Electronic devices that use this technique to handle items in the queue therefore consume a relatively large amount of power to operate the queue. Other electronic devices use metadata (such as pointers, age information, or lists associated with items or entries in the queue) to keep track of the relative ages of items in the queue. While using metadata to keep track of the relative ages of items in the queue allows items to be stored in any position and age order in the queue, the metadata must be stored in the queue or elsewhere, and a lookup must be performed to determine the relative age and / or position of items in the queue. The overhead in terms of metadata circuitry and lookup complexity increases with the size of the queue. For queues above a certain size, the metadata circuitry may consume a quota amount of circuit area and / or the lookup process may consume undesirably high levels of power. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] Figure 1 A block diagram illustrating an electronic device according to some embodiments is presented.
[0006] Figure 2 A block diagram illustrating a queue according to some embodiments is presented.
[0007] Figure 3 A block diagram illustrating an age matrix according to some embodiments is presented.
[0008] Figure 4 A block diagram illustrating a simplified form of an age matrix according to some embodiments is presented.
[0009] Figure 5 A block diagram illustrating a process for using an age matrix to keep track of the relative ages of items in a sub-queue is presented according to some embodiments.
[0010] Figure 6 A block diagram illustrating the removal of items from a lowest subqueue in a hierarchy of subqueues and the subsequent shifting of items from higher subqueues in the hierarchy to fill vacancies in the lowest subqueue is presented in accordance with some embodiments.
[0011] Figure 7A flowchart illustrating a process for using an age matrix to keep track of the relative ages of items stored in a sub-queue is presented according to some embodiments.
[0012] Figure 8 A flowchart illustrating a process for shifting items in subqueues in a hierarchy of subqueues to fill a vacancy in a lowest subqueue and updating an age matrix for the subqueues according to some embodiments is presented.
[0013] Like reference numerals refer to like figure elements throughout the drawings and description. DETAILED DESCRIPTION
[0014] The following description is presented to enable any person skilled in the art to make and use the described embodiments, and is provided in the context of a specific application and its requirements. Various modifications to the described embodiments will be apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications. Therefore, the described embodiments are not limited to those shown, but are to be accorded the widest scope consistent with the principles and features disclosed herein.
[0015] the term
[0016] In the following description, various terms are used to describe the embodiments. The following is a simplified and general description of one of these terms. It should be noted that this term may have important additional aspects that are not listed herein for the sake of clarity and brevity, and therefore the description is not intended to limit this term.
[0017] Functional Block: A functional block refers to a group, set, and / or collection of one or more interrelated circuit elements (such as integrated circuits, discrete circuits, etc.). Circuit elements are "interrelated" because the circuit elements share at least one property. For example, the interrelated circuit elements may be included in, manufactured on, or otherwise coupled to a particular integrated circuit chip, substrate, circuit board, or portion thereof, may be involved in the performance of a given function (computational or processing function, memory function, etc.), may be controlled by a common control element and / or a common clock, etc. A functional block may include any number of circuit elements, from a single circuit element (e.g., a single integrated circuit logic gate or discrete circuit element) to millions or billions of circuit elements (e.g., integrated circuit memory).
[0018] Overview
[0019] In the described embodiments, the electronic device includes a queue for storing items to be disposed of in the electronic device. For example, in some embodiments, the networking subsystem in the electronic device includes a network transaction queue, which is used to store network transactions (e.g., packets, requests, etc.) waiting for disposal (e.g., forwarding, processing, etc.). As another example, in some embodiments, the processing subsystem in the electronic device includes a queue for storing work items (e.g., instructions, threads, interrupts, etc.) waiting for disposal (e.g., scheduling, processing, etc.). The queue includes a set of multiple separate subqueues, each subqueue including a different subset of the set of entries of the queue. For example, a queue may include N entries (where N is 64, 100, or other numbers), which are divided into M subqueues (where M is 2, 5, or other numbers). The subqueues are included in a logical hierarchy in which the subqueues are organized from the lowest subqueue to the highest subqueue.
[0020] In some embodiments, when items are stored in a queue, the items are first stored in the lowest subqueue in the hierarchy until the lowest subqueue is full, and then items are stored in successively higher subqueues in the hierarchy as each successively higher subqueue becomes full. In other words, as each subqueue is full of stored items, subsequent incoming items are stored in the next higher subqueue in the hierarchy. In some embodiments, because items are stored in individual subqueues, items can be stored in any available entry in that subqueue, so that items do not have to be stored in a particular order among the entries in that subqueue.
[0021] In some embodiments, a separate age matrix is used to keep track of the relative ages of the items stored in each subqueue. Each age matrix includes a plurality of elements arranged in rows and columns, wherein each row and each column is associated with a different entry in the corresponding subqueue. Each row and each column includes information about the relative ages of the items in the associated entry stored in the subqueue compared to the items in some or all other entries in the subqueue. More specifically, each element in the age matrix is used to store a value indicating whether the entry associated with the row in the corresponding subqueue is older than the entry associated with the column in the corresponding subqueue—or vice versa. In some embodiments, a single bit is used to store the value in each element of the age matrix. In some of these embodiments, when a bit in an element in a column of the age matrix is set to 0, the item in the entry associated with the column of the age matrix is older (i.e., less recently added to the entry) than the item in the entry associated with the row. When a bit in an element in a column of the age matrix is set to 0, the opposite is true. In some embodiments, the columns and / or rows in the age matrix include validity information (e.g., one or more validity bits, etc.) or are associated with validity information. In these embodiments, when an entry in the corresponding subqueue does not currently store an item, the validity information is set to indicate that the column and / or row is invalid and should not be used for relative age determination. In some embodiments, the validity information is included in metadata in the entry itself, but is used to handle information in the age matrix.
[0022] In some embodiments, as items are stored in entries in a subqueue, the associated age matrix is updated to reflect the latest relative ages of the items stored in the subqueue. For an update operation, specified elements in columns and / or rows are set or updated. For example, in some embodiments, elements in columns of the age matrix associated with entries in the subqueue are set to values such as 1, and elements in rows of the age matrix associated with entries in the subqueue are set to values such as 0.
[0023] In some embodiments, items previously stored in the queue are removed from the queue by being removed from the lowest subqueue in the hierarchy—and only from the lowest subqueue. In some embodiments, any item that is ready to be removed may be removed from the lowest subqueue, including an item for which there are one or more older items in the lowest subqueue. In other words, when an item is ready to be removed, it may be removed from the lowest subqueue out of order relative to the other items in the subqueue. For example, when the queue is a network transaction queue, an item (e.g., a transaction, such as a packet or request) destined for a first downstream device may be removed from the queue and forwarded to the first downstream device when the first downstream device is available, while one or more older items destined for a second downstream device may be waiting in the queue for forwarding when the second downstream device is busy.
[0024] In some embodiments, when removing an item from the lowest subqueue, a vacancy is generated in the lowest subqueue—that is, the entry storing the item in the subqueue is vacated for storing another item. Then the item (assuming such item exists) from the higher subqueue in the hierarchy is shifted to fill the vacancy in the lowest subqueue. For this operation, starting from the lowest subqueue and advancing through the subqueues in the hierarchy, for each subqueue, when the next higher subqueue in the hierarchy exists and stores at least one item, the controller in the electronic device uses the age matrix associated with the next higher subqueue to determine the entry where the oldest item in the next higher subqueue is stored. For example, in some embodiments, the controller finds the column that best meets the standard of the value in the column in the age matrix associated with the next higher subqueue, such as the column where the element stores the least number of 1s or the most 0s. The controller then identifies the entry storing the oldest item in the next higher subqueue based on the specific column in the age matrix—that is, the column is matched with the associated entry in the next higher subqueue. The controller then moves the oldest item from the entry in the next higher subqueue to the subqueue. In this way, the controller moves / shifts the oldest item from each higher sub-queue down to the next lower sub-queue in sequence to fill the gap in each sub-queue.
[0025] In some embodiments, multiple items ready for removal can be removed from the lowest subqueue in a single remove operation, including multiple items for which there are one or more older items in the lowest subqueue. In other words, in these embodiments, when an item is ready for removal, two or more items can be removed from the lowest subqueue at once and in no particular order. As with removing a single item from the lowest subqueue, a corresponding number of items (assuming such items exist) from higher subqueues in the hierarchy are shifted to fill the vacancy in the lowest subqueue.
[0026] By using a hierarchy of subqueues and an age matrix to manage items in the subqueues, the described embodiments can implement larger queues without the drawbacks of other queue implementations. More specifically, by using a hierarchy of subqueues, the described embodiments can avoid the large number of shift operations typically performed in queues that use shift operations to sort entries by age, and can avoid the complex and power-hungry age metadata circuitry typically used for larger, out-of-order queues. Consequently, the electronic device in the described embodiments uses power and computing resources more efficiently, which results in higher user satisfaction with the electronic device.
[0027] electronic devices
[0028] Figure 1 A block diagram illustrating an electronic device 100 according to some embodiments is presented. Figure 1 As can be seen, electronic device 100 includes a processing subsystem 102, a graphics processing subsystem 104, a memory subsystem 106, and a networking subsystem 108. Typically, processing subsystem 102, graphics processing subsystem 104, memory subsystem 106, and networking subsystem 108 are functional blocks implemented in hardware (i.e., using various circuits, circuit elements, and devices). For example, processing subsystem 102, graphics processing subsystem 104, memory subsystem 106, and networking subsystem 108 may be entirely fabricated on one or more semiconductor chips (including fabricated on one or more separate semiconductor chips), may be fabricated from a semiconductor chip in combination with discrete circuit elements, may be fabricated from separate circuit elements, etc. As described herein, some or all of processing subsystem 102, graphics processing subsystem 104, memory subsystem 106, and networking subsystem 108 may perform operations for managing items in a queue, including separate sub-queues, using corresponding age matrices.
[0029] The processing subsystem 102 is a functional block that performs computations and other operations (e.g., control operations, configuration operations, etc.) in the electronic device 100. For example, the processing subsystem 102 may be or include one or more microprocessors, central processing unit (CPU) cores, and / or other processing mechanisms. In some embodiments, the processing subsystem 102 includes a queue having multiple subqueues in which items (such as threads, instructions, etc.) may be stored and managed using an age matrix as described herein.
[0030] The graphics processing subsystem 104 is a functional block that performs computations and other operations (e.g., control operations, configuration operations, etc.) associated with graphics processing (e.g., rendering, etc.) and / or general computing operations in the electronic device 100. For example, the processing subsystem 102 may be or include one or more general-purpose graphics processing unit (GPGPU) cores and / or other graphics processing mechanisms. In some embodiments, the graphics processing subsystem 104 includes a queue having multiple subqueues in which items (such as threads, instructions, etc.) may be stored and managed using an age matrix as described herein.
[0031] The memory subsystem 106 is a functional block that performs memory (e.g., "main" memory) operations. The memory subsystem 106 includes volatile and / or non-volatile memory circuits, such as fourth-generation double data rate synchronous DRAM (DDR4 SDRAM) and / or other types of memory circuits, for storing data and instructions to be used by other functional blocks in the electronic device 100; and control circuitry for handling access to the data and instructions stored in the memory circuits and for performing other control or configuration operations. In some embodiments, the memory subsystem 106 includes a queue having multiple subqueues in which items (such as memory access requests) can be stored and managed using an age matrix as described herein.
[0032] The networking subsystem 108 is a functional block that performs operations for searching, connecting, configuring, and communicating on a wired and / or wireless electronic communication network. The networking subsystem 108 includes a transceiver, a controller, a processor, and / or other circuitry for communicating on a wired and / or wireless network. In some embodiments, the networking subsystem 108 includes a queue having multiple subqueues in which items, such as network transactions (e.g., packets, requests, messages, etc.), can be stored and managed using an age matrix as described herein.
[0033] For illustrative purposes, the electronic device 100 is simplified. However, in some embodiments, the electronic device 100 includes additional or different functional blocks, subsystems, elements, and / or communication paths. For example, the electronic device 100 may include an input-output (I / O) subsystem, a display subsystem, a human-machine interface subsystem, etc. The electronic device 100 generally includes sufficient functional blocks to perform the operations described herein.
[0034] The electronic device 100 may be or may be included in any device that performs the operations described herein. For example, the electronic device 100 may be or may be included in a desktop computer, a laptop computer, a wearable computing device, a tablet computer, a virtual or augmented reality device, a smartphone, an artificial intelligence (AI) or machine learning device, a server, a network device, a toy, an audiovisual device, a home appliance, a vehicle, etc., and / or combinations thereof.
[0035] queue
[0036] In the described embodiments, a queue is used to store items. For example, in some embodiments, the queue is a network queue in networking subsystem 108, in which network transactions (i.e., "items") are temporarily buffered before being removed and processed, forwarded, or otherwise handled by networking subsystem 108. As another example, in some embodiments, the queue is a processing queue in processing subsystem 102, in which processing tasks or threads (i.e., "items") are temporarily stored before being removed and processed or otherwise handled by processing subsystem 102. Figure 2 A block diagram illustrating a queue 200 according to some embodiments is presented. Figure 2 As can be seen, queue 200 includes a set of 24 entries 202. Each entry 202 includes a memory circuit (e.g., a flip-flop, a latch, an SRAM memory circuit, etc.) that can be used to store an item. For example, in some embodiments, each entry includes a memory circuit for storing a set of item bits that is up to T bytes in length (e.g., 6, 20, or another number of bytes). In some embodiments, each entry 202 also includes a memory circuit for storing metadata (such as validity information used to handle or identify the information (or lack of information) in the entry 202). For example, in some embodiments, the validity information is used to control when the corresponding row or column is used to determine the age of the item stored in the entry 202 as described herein.
[0037] The entries 202 in the queue 200 are arranged in a logical hierarchy of subqueues 220, which includes, in order from the highest subqueue to the lowest subqueue in the hierarchy, a highest subqueue 204, a middle subqueue 206, and a lowest subqueue 208 (collectively referred to as "subqueues"). Each subqueue thus includes a different subset of the entries 202 - this is in Figure 2, each subqueue includes a different set of 8 entries out of the 24 entries 202. As used herein, "logical hierarchy" indicates that the subqueues are treated as part of a hierarchy by the controller 210 (and possibly other functional blocks in the electronic device 100) for operations such as storing and removing items from the queues, shifting items among the subqueues, etc. For example, in some embodiments, items are removed only from the lowest subqueue 208 in the queue 200 (and not from other subqueues); items are shifted in a downward direction through the hierarchy of subqueues until removed from the lowest subqueue 208; items are stored in the lowest subqueue in the queue 200 in which a vacant entry 202 is currently available, etc.
[0038] The queue 200 also includes a controller 210. The controller 210 is a functional block that performs operations for handling items in the queue 200. The controller 210 includes logic 218, which is a functional block having circuitry for performing operations for handling items in the queue 200. For example, in some embodiments, the logic 218 performs operations for storing items in the queue 200 (i.e., in a subqueue), removing items from the queue 200, receiving items from other functional blocks in the electronic device 100 (e.g., the processing subsystem 102, etc.), transmitting items to other functional blocks in the electronic device 100, etc. When storing an item in the queue 200, the logic 218 receives the item, determines the lowest subqueue in the hierarchy in which an entry is available to store the item, and stores the item in an available entry in the determined subqueue. When removing an item from the queue 200, the logic 218 determines that the item is ready to be removed in the lowest subqueue 208, retrieves the item from an entry in the lowest subqueue 208, and provides the item to a receiving functional block (or another entity) in the electronic device 100. After removing an item from the lowest subqueue 208, logic 218 shifts the item down in the hierarchy of subqueues (assuming such an item exists) to fill the vacancy in the lowest subqueue 208. The operations performed by controller 210 / logic 218 for handling items in queue 200 are described in more detail below.
[0039] Controller 210 includes age matrices 212-216. Each of age matrices 212-216 is a functional block that includes memory circuitry (e.g., flip-flops, latches, SRAM memory circuitry, etc.) for storing an age matrix for a corresponding subqueue in the subqueues. Generally, each age matrix includes an arrangement (e.g., an array or portion thereof, a table, a list, etc.) of data that can be used to identify the relative ages of items in entries stored in the associated subqueue. Figure 3 A block diagram illustrating an age matrix 300 according to some embodiments is presented. Figure 3As can be seen, the age matrix 300 includes a plurality of elements 302 arranged in rows 304 and columns 306. The elements 302 in each row 304 and each column 306 are associated with a different entry in the corresponding sub-queue and are used to store age information for the associated entry (i.e., for the item stored in the associated entry). For example, the bottom-most row 304 and left-most column 306 in the age matrix 300 are associated with entry_0 in the sub-queue 308. Thus, the bottom-most row 304 and left-most column 306 in the age matrix 300 store age information related to the item stored in entry_0. It should be noted that in the age matrix 300, the diagonal rows are shown in black, which will hold values representing the relative ages of the items in the same entry stored in the associated sub-queue - because such values have little use and are not retained in some embodiments (and are shown only for clarity). Figure 3 (presented in ).
[0040] In some embodiments, age information is stored in each element 302 using a specified number of bits. For example, in some embodiments, age information is stored in each element 302 in the age matrix 300 using a single bit. In these embodiments, the value of the bit in each element 302 is determined in advance and set according to the relative age indication / representation of the item in the entry stored in the associated subqueue. For example, in some embodiments, 0 represents a newer item and 1 represents an older item. As another example, in some embodiments, 1 represents a newer item and 0 represents an older item. For Figure 3 In the example, M and K are used as placeholders for illustration purposes but have no specific meaning. The interpretation of the bit values and relative age information in the age matrix 300 is described in more detail below.
[0041] like Figure 3 The illustrated age matrix 300 is an example of a particular arrangement of data for an age matrix, but the age matrices 212-216 may store data in one or more different arrangements, including arrangements that are not easily readable (e.g., lists, tables, etc.) but are otherwise represented. Figure 3 The arrangement of the content shown. For example, Figure 4 A block diagram illustrating a simplified form of an age matrix 400 according to some embodiments is presented. Like the age matrix 300, the age matrix 400 includes elements 402 arranged in rows 404 and columns 406. However, unlike the age matrix 300, the age matrix 400 lacks elements 402 in rows 404 and columns 406 above the reflection (REF) line 408. This is because the values to be stored in elements 402 of the age matrix 400 can be determined by reflecting and swapping the values present in such elements 402 in the matrix 400 (for this example, M is the swap term of K, and vice versa). This is in Figure 4 300 are shown using dashed lines and italic letters whose values are similar to those in the corresponding elements 302 of the age matrix 300. In other words, given the information in the element 402 on one side of the reflection line 408, the value to be stored in the element 402 on the other side of the reflection line can be calculated. To this end, in some embodiments, the simplified age matrix 400 is used instead of the age matrix 300.
[0042] It should be noted that although queue 200 is presented as having a particular number of entries and an arrangement of subqueues, in some embodiments, queue 200 includes an arrangement of different numbers of entries and / or subqueues. For example, in some embodiments, queue 200 includes different numbers of entries in some or all of the highest subqueue 204, the middle subqueue 206, and the lowest subqueue 208. In other words, in these embodiments, some or all of the subqueues have a different number of entries than one or more other queues in the subqueues. As another example, in some embodiments, queue 200 includes four or more subqueues. Generally, in the described embodiments, queue 200 includes sufficient subqueues and entries (and other circuitry) therein to perform the operations described herein.
[0043] Use an age matrix to track the relative ages of items in a subqueue
[0044] In the described embodiment, an age matrix is used to keep track of the relative ages of items in entries stored in a sub-queue in an electronic device. Figure 5 A block diagram illustrating a process for keeping track of the relative ages of items in a sub-queue using an age matrix according to some embodiments is presented. Note that Figure 5 The operations shown are presented as general examples of operations performed by some embodiments. Operations performed by other embodiments include different operations, operations performed in a different order, and / or operations performed by different functional blocks. Additionally, in some embodiments, the subqueues have different numbers of entries and the age matrix has different numbers and / or arrangements of elements.
[0045] exist Figure 5 In , the status of the sub-cohorts is shown on the left, the corresponding status of the age matrix is shown in the center, and arrows indicating the time progression are shown on the right. Figure 5 In FIG, at five separate times (i.e., times 500-508), four items (i.e., items_0-item_3) are stored in the subqueue and one item is removed (i.e., item_2), where the illustrated changes are made in the age matrix. Additionally, at Figure 5In FIG, elements of the age matrix that are written because items have been stored in entries of the subqueue are shown using a diagonally shaded background, elements that are updated because items have been stored in or removed from entries of the subqueue are shown with a stippled / dotted background, and unchanged elements are shown with a white background. (Recall that the elements on the center diagonal line in the age matrix are shown in black because those elements are not used in some embodiments.) Also, for illustration purposes, the "new" (N) and "old" (O) pointers are shown in FIG. Figure 5 is shown to illustrate the columns of the age matrix identifying the entries of the most recent and oldest items in the storage subqueue, although in some embodiments the recent and old pointers may not be present / used.
[0046] for Figure 5 In the example in FIG, times 500-508 are illustrated. Individually, these times can be any absolute or relative times. With respect to the overall time flow, times 500-508 and their Figure 5 The positions in the figures are not intended to indicate any relationship between the times, and are not drawn to a particular scale. Thus, the times 500-508 may exist within a few milliseconds, a few seconds, etc., with a different number of milliseconds, seconds, etc. between each of the times 500-508.
[0047] In some embodiments, when no item is currently stored in an entry in the associated subqueue, a validity flag / register (not shown) associated with a column in the age matrix (which may be or include validity information in metadata in the entry itself) is set to indicate that the corresponding column in the age matrix is invalid and therefore should not be used in age determination operations. Figure 5 , using an X in an element in such a column, although in some embodiments, an element in such a column may store other values, including 0 or 1—and the validity flag / register value controls whether the controller (e.g., controller 210) uses the value in the element. Figure 5 In the example, although not shown for clarity, it is assumed that the subqueue is initially empty and therefore the age matrix has validity flags / register values set to indicate that all columns are invalid - and therefore the elements in all columns will initially be shown as Xs (as can be seen, three columns remain invalid at time 500).
[0048] for Figure 5In the operation in
[0055] , a particular pattern of 0s and 1s in the columns of the age matrix is used to determine the entry in the subqueue in which the oldest of the elements in the subqueue is stored. More specifically, the entry in the subqueue that includes the oldest item is determined based on a column that does not include 1s (and may be all 0s). Typically, for this pattern, the column in the age matrix associated with the entry in the subqueue in which the oldest item is stored does not include 1s (and therefore only has 0s). Although this pattern is used Figure 5 , but in some embodiments, a different pattern is used. For example, the attributes associated with 0 and 1 can be reversed so that the column with the most 1s is used to determine the entry in the subqueue in which the oldest element is stored. As another example, the rows of elements in the age matrix can be used instead of the values in the columns - with the updates of the age matrix described below being adjusted accordingly. In addition, although the age matrix with a particular arrangement of rows and columns is used Figure 5 , but in some embodiments, an age matrix with a different arrangement of rows and / or columns is used. For example, in some embodiments, Figure 4 The simplified age matrix or some representation thereof is shown. Generally, in the described embodiments, any arrangement of values may be stored in an age matrix having a corresponding set of rows and columns (or equivalent) and used to determine the relative ages of entries in a subqueue.
[0049] Now turn Figure 5 At time 500, the controller receives item_0, determines that item_0 is to be stored in entry 1 of the subqueue (because incoming items are allowed to be stored in any available entry in the subqueue), and stores item_0 in entry 1 of the subqueue. The controller also updates the recent age matrix to indicate that the most recent item in the subqueue is stored in entry 1 of the subqueue. For the update, the controller sets the element in the column associated with entry 1 to equal 1. This can be seen in the age matrix because the elements of column 1 have a diagonally shaded background—and are set to 1. Because the other columns in the age matrix are invalid at time 500 (and therefore contain X invalid values), no changes are made to the row. However, in some embodiments, the element in row 1 will be set to 0, even though the column is invalid.
[0050] Because only the column associated with entry 1 of the age matrix has a valid value at time 500, both the recent pointer and the old pointer indicate the column associated with entry 1. If the controller uses the age matrix at time 500 to determine the entry in the subqueue that stores the oldest element, the controller will identify entry 1 of the subqueue based on the values in the elements of the age matrix. For example, in some embodiments, when ignoring the values in the elements in invalid rows (i.e., rows for which the associated entry in the subqueue does not currently store an item), the controller finds a valid column that does not include a 1. In other words, when masking the row using corresponding validity information (e.g., a valid bit in the metadata for the associated entry in the subqueue), the controller determines that there are no valid columns in the age matrix that do not have a 1. Because the three rows of 1s in column 1 are ignored (and column 1 is the only valid column), the controller identifies column 1 as not including a 1. The controller also determines that entry 1 of the subqueue associated with column 1 stores the oldest item.
[0051] At time 502, the controller receives item_1, determines that item_1 is to be stored in entry 2 of the subqueue, and stores item_1 in entry 2 of the subqueue. The controller also updates the age matrix to indicate that the most recent item in the subqueue is stored in entry 2 of the subqueue. For the update, the controller sets the elements in the column associated with entry 2 to 1. This can be seen in the age matrix because the elements in column 2 have a diagonally shaded background—and are set to 1. The controller also sets all valid elements in the row associated with entry 2 to 0. This can be seen in the age matrix because the elements in row 2 have a stippled / dotted background—and are set to 0. Note that only the elements in column 1 of row 2 are set to 0—because the other columns in the age matrix are invalid at time 502, no changes are made to these elements in row 2.
[0052] At time 502, two columns of the age matrix include age information. Figure 5In the illustrated embodiment, the entry storing the more recent item includes more 1s in the column (the columns are arranged in this manner, as described above). Because the column associated with entry 2 has more 1s (i.e., three 1s) at time 502, the recent pointer indicates the column associated with entry 2. On the other hand, the column associated with entry 1 has fewer 1s (i.e., two 1s) at time 502 due to the arrangement of 0s in row 2, and therefore the old pointer still indicates the column associated with entry 1 (the entry storing the oldest item in the subqueue). If the controller uses the age matrix at time 502 to determine the entry in the subqueue storing the oldest element, the controller will identify entry 1 of the subqueue based on the relative number of 1s stored in the columns of the age matrix. For example, in some embodiments, when ignoring the values in the elements in invalid rows (i.e., rows for which the associated entry in the subqueue does not currently store an item), the controller finds valid columns that do not include 1s. In other words, when masking the rows using the corresponding validity information, the controller determines that there are valid columns in the age matrix that do not have 1s. Because rows 1 and 2 are both valid (and rows 0 and 3 are invalid), the controller only considers the values in the elements in the center four-element square of the age matrix. Therefore, the controller identifies column 1 as a column that does not include 1s. The controller also determines that entry 1 of the subqueue associated with column 1 stores the oldest item. For example, in some embodiments, the controller includes an arrangement of logic gates (e.g., NAND, NOR, etc. logic gates) that the controller uses to determine which column has the most 1s (or 0s).
[0053] At time 504, the controller receives item_2, determines that item_2 is to be stored in entry 0 of the subqueue, and stores item_2 in entry 0 of the subqueue. The controller also updates the age matrix to indicate that the most recent item in the subqueue is stored in entry 0 of the subqueue. For the update, the controller sets the element in the column associated with entry 0 to 1. This can be seen in the age matrix because the element in column 0 has a diagonally shaded background—and is set to 1. The controller also sets all valid elements in the row associated with entry 0 to 0. This can be seen in the age matrix because the element in row 0 has a stippled / dotted background—and is set to 0. The elements in columns 1 and 2 of row 0 are set to 0—because column 3 is invalid at time 504, no changes are made to this element in row 0.
[0054] At time 504, three columns of the age matrix include age information. Because the column associated with entry 0 has the most 1s (i.e., three 1s) at time 504, the recent pointer indicates the column associated with entry 0. On the other hand, the columns associated with each of entries 1 and 2 have fewer 1s at time 504 due to the placement of 0s in row 0. The column with the most 0s is the column associated with entry 1, and therefore the old pointer still indicates the column associated with entry 1 (which is still the entry storing the oldest item in the subqueue). If the controller uses the age matrix at time 504 to determine the entry in the subqueue storing the oldest element, the controller will identify entry 1 of the subqueue based on the relative number of 1s stored in the columns of the age matrix. For example, in some embodiments, when ignoring the values in elements in invalid rows (i.e., rows for which the associated entry in the subqueue currently does not store an item), the controller finds valid columns that do not include 1s. In other words, when masking rows using corresponding validity information, the controller determines that there are no valid columns in the age matrix that do not have 1s. Because rows 0, 1, and 2 are all valid (and row 3 is invalid), the controller only considers the values in the elements in the lower left nine-element block within the age matrix. Therefore, the controller identifies column 1 as a column that does not include 1. The controller also determines that entry 1 of the subqueue associated with column 1 stores the oldest item.
[0055] At time 506, the controller receives item_3, determines that item_3 is to be stored in entry 3 of the subqueue, and stores item_3 in entry 3 of the subqueue. The controller also updates the age matrix to indicate that the most recent item in the subqueue is stored in entry 3 of the subqueue. For the update, the controller sets the element in the column associated with entry 3 to 1. This can be seen in the age matrix because the element in column 3 has a diagonally shaded background and is set to 1. The controller also sets all valid elements in the row associated with entry 3 to 0. This can be seen in the age matrix because the element in row 0 has a stippled / dotted background and is set to 0.
[0056] At time 506, all four columns of the age matrix include age information. Because the column associated with entry 3 has the most 1s (i.e., three 1s) at time 506, the recent pointer indicates the column associated with entry 3. On the other hand, the columns associated with each of entries 0, 1, and 2 have fewer 1s at time 506 due to the placement of 0s in row 3. The column with the most 0s is the column associated with entry 1, and therefore the old pointer still indicates the column associated with entry 1 (which is still the entry storing the oldest item in the subqueue). If the controller uses the age matrix at time 506 to determine the entry in the subqueue storing the oldest element, the controller will identify entry 1 of the subqueue based on the relative number of 1s stored in the columns of the age matrix. For example, in some embodiments, when ignoring the values in the elements in invalid rows (i.e., rows for which the associated entry in the subqueue currently does not store an item), the controller finds valid columns that do not include 1s. Because all rows of the age matrix are valid, the controller considers the values in all elements in the age matrix. Therefore, the controller identifies column 1 as a column that does not include 1s. The controller also determines that entry 1 of the subqueue, associated with column 1, stores the oldest item.
[0057] At time 508, the controller removes item_2 from entry 0 in the subqueue. This removal is out of order with respect to the age of the items in the subqueue. In some embodiments, this is permitted when a newer item is "ready" to be removed before an older item in the subqueue. For example, when the item is a processing task in the processing subsystem 102, item_2 may require a first processing resource (e.g., an execution unit, an interrupt handler, etc.) that is different and available from item_0 and item_1, which are waiting for a busy second processing resource. The controller also updates the age matrix to indicate that item_2 is removed from the subqueue. For the update, the controller sets the validity flag / register value for the column associated with entry 0 to indicate that the column is invalid. As described above, this can be seen in the age matrix because the elements of column 0 have a stippled / dotted background - and are set to X.
[0058] At time 508, three columns of the age matrix include valid age information. Because the column associated with entry 3 has the most 1s (i.e., three 1s) at time 508, the recent pointer indicates the column associated with entry 3. On the other hand, the column associated with each of entries 1 and 2 has fewer 1s at time 508. The column with the most 0s is the column associated with entry 1, and therefore the old pointer still indicates the column associated with entry 1 (which is still the entry storing the oldest item in the subqueue). If the controller uses the age matrix at time 508 to determine the entry in the subqueue storing the oldest element, the controller will identify entry 1 of the subqueue based on the relative number of 1s stored in the columns of the age matrix. For example, in some embodiments, when ignoring the values in the elements in invalid rows (i.e., rows for which the associated entry in the subqueue does not currently store an item), the controller finds valid columns that do not include 1s. In other words, when masking rows using corresponding validity information, the controller determines that there are no valid columns in the age matrix that do not have 1s. Because rows 1, 2, and 3 are all valid (and row 0 is invalid), the controller only considers the values in the elements in the upper right nine-element block within the age matrix. Therefore, the controller identifies column 1 as a column that does not include a 1. The controller also determines that entry 1 of the subqueue associated with column 1 stores the oldest item.
[0059] if Figure 5 The illustrated operation will continue at an additional time after time 508, where the item in entry 1 of the subqueue is removed (not shown), and the controller will set the validity flag / register value for the column associated with entry 1 to indicate that the column is invalid. At this point, using the age matrix to determine the oldest item present in the subqueue will return column 2, which will not have a 1 in the upper right quadrant of the element in the age matrix used for the determination. On the other hand, if the new item is to be stored in the vacant entry 0, the controller will again write 1s in the corresponding column in the age matrix and write 0s in the corresponding row—i.e., operations similar to those described above.
[0060] Shift items between subqueues
[0061] In the described embodiment, as an item is removed from a lowest subqueue in a hierarchy of two or more subqueues, a vacancy is created in the lowest subqueue. The controller shifts items from higher subqueues in the hierarchy (when such items exist) downward to fill the vacancy in the lowest subqueue. Figure 6 A block diagram illustrating the removal of items from a lowest subqueue in a hierarchy of subqueues and the subsequent shifting of items from higher subqueues in the hierarchy to fill vacancies in the lowest subqueue is presented according to some embodiments. Figure 6The operations shown are presented as general examples of operations performed by some embodiments. Operations performed by other embodiments include different operations, operations performed in different orders, and / or operations performed by different functional blocks. Additionally, in some embodiments, different numbers of subqueues are used and / or some or all of the subqueues have different numbers of entries.
[0062] for Figure 6 In the example shown in FIG. 6 , queue 600 includes three subqueues 602-606, each of which has a capacity for storing four items. Figure 6 The left side of shows that the controller has stored items in all entries in all three sub-queues 602-606. Although the age matrix is Figure 6 6. It is not shown in FIG. 6, but for clarity, it is assumed that there is a separate age matrix for each of the sub-queues 602-606. It is further assumed that each of the age matrices has been updated (e.g., as described above for Figure 5 described), and thus saves the current relative age information of the associated sub-queue.
[0063] As mentioned above, for Figure 6 , subqueues 602-606 initially each hold four items. The controller then removes item_2 from subqueue 602 (i.e., the lowest subqueue in the hierarchy of subqueues). For this operation, the controller determines that item_2 is ready to be removed, reads item_2 from subqueue 602 (and may provide item_2 to another functional block), and invalidates and / or clears the entry in subqueue 602. The controller also updates the age matrix for subqueue 602 to reflect the change in items stored in subqueue 602. It will be recalled that in some embodiments, items are allowed to be removed from the lowest subqueue in the hierarchy of subqueues in any order, depending on which items are ready to be removed. Therefore, it is possible that one or more items (e.g., item_0, etc.) that are truly newer than item_2 are still stored in the lowest subqueue—this will be reflected in the relative age information in the age matrix associated with subqueue 602 after the update.
[0064] After removing item_2 from subqueue 602, the controller shifts an item from the next higher subqueue (i.e., subqueue 604) to fill the vacancy in subqueue 602. For this operation, the controller determines the oldest item in subqueue 604 by determining the particular column (or row) in the age matrix associated with subqueue 604 that best meets a specified criterion for the values in the column (e.g., including at most 0s). The controller then identifies the entry in subqueue 604 that stores the oldest item based on the particular column in the age matrix. Figure 6, assume that the oldest item in subqueue 604 is item_4, and therefore the controller identifies the entry storing item_4 based on the value in the element in the corresponding column in the age matrix for subqueue 604. The controller then reads item_4 from subqueue 604, invalidates and / or clears the entry in subqueue 604, and stores item_4 in the vacant entry in subqueue 602. The controller also updates the corresponding age matrices for both subqueues 602 and 604 to reflect the changes to the items stored in subqueues 602 and 604. Alternatively, the controller may not update the age matrix for each of the subqueues until all data moves affecting a given subqueue have occurred—and thus may leave the age matrix associated with subqueue 604 unchanged until the final move occurs.
[0065] After shifting item_4 from subqueue 604 to subqueue 602, the controller shifts an item from the next higher subqueue (i.e., subqueue 606) to fill the hole in subqueue 604. For this operation, the controller uses the associated age matrix to determine the oldest item in subqueue 606 (similar to what was described above for subqueue 602). Figure 6 In the example of FIG, assume that the oldest item in subqueue 606 is item_8, and therefore the controller identifies the entry storing item_8 based on the value in the element in the corresponding column in the age matrix for subqueue 606. The controller then reads item_8 from subqueue 606, invalidates and / or clears the entry in subqueue 606, and stores item_8 in the vacant entry in subqueue 604. The controller also updates the corresponding age matrices for both subqueues 604 and 606 to reflect the changes to the items stored in subqueues 604 and 606.
[0066] exist Figure 6 At the end of the illustrated operation, subqueue 606 has an entry available for storing an item, i.e., a vacancy. Figure 6 Not shown, but in subsequent operations, a recent item (e.g., received from another functional block) may be stored in an available entry in subqueue 606. As with other operations that change the items stored in an entry in a subqueue, after storing the recent item in subqueue 606, the controller will update the age matrix for subqueue 606 to indicate the relative ages of the items stored therein.
[0067] Used to keep track of items in subqueues stored in a hierarchy of subqueues using an age matrix Relative age process
[0068] The described embodiment uses an age matrix to keep track of the relative ages of items in sub-queues stored in a hierarchy of sub-queues. Figure 7A flow chart illustrating a process for storing items in a sub-queue and updating an age matrix for the sub-queue is presented according to some embodiments. Figure 7 , assume that a controller (e.g., controller 210) in a networking subsystem (e.g., networking subsystem 108) stores an item in an entry in a subqueue (e.g., middle subqueue 206, lowest subqueue 208, etc.) from a hierarchy of subqueues in a queue (e.g., queue 200) in the networking subsystem. Also assume that the subqueues are associated with an age matrix (e.g., age matrix 300) for keeping track of the relative ages of the items in the entries stored in the subqueues. Note that Figure 7 The operations shown are presented as general examples of operations performed by some embodiments. The operations performed by other embodiments include different operations, operations performed in a different order, and / or operations performed by different functional blocks.
[0069] Figure 7 The process begins when a controller receives an item to be stored in a queue comprising a plurality of sub-queues (step 700). For this operation, the networking subsystem (or another functional block or entity) provides the controller with an item identifying a network transaction, such as a packet to be sent or forwarded to a downstream electronic device via the network, a control or configuration value to be transmitted to a downstream electronic device via the network, a message to be subsequently processed in the networking subsystem, etc. The item may include a plurality of bits or bytes organized into a designated field or portion that identifies, characterizes, and / or represents the network transaction.
[0070] The controller then determines the subqueue (step 702) to be stored therein. For this operation, the controller determines that the lowest subqueue in which a vacant entry in the hierarchy of the subqueue can be used for storing an item. For example, the controller can maintain a pointer to the lowest queue in which one or more entries in the hierarchy are available, can keep the count of the items currently stored in all subqueues, can be about some or all of the query subqueues or entries such as availability, and can determine the lowest subqueue on this basis. In this way, the controller stores the item in the lowest subqueue until the lowest subqueue becomes full, and then as each next higher subqueue becomes full, the item is stored in the next higher subqueue in the hierarchy in turn. As part of this operation, the controller also determines the specific entry in the subqueue to be stored. In some embodiments, the item is allowed to be stored in the entry in the subqueue in any order (that is, not limited to being stored in the entry in an order such as first-in, first-out) and can be removed in an unordered manner, so whenever the item is stored in the subqueue, the controller determines the specific entry.
[0071] The controller then stores the item in the subqueue (step 704). For this operation, the controller writes the item, or the bits or bytes it represents, to the memory circuit into a determined entry in the subqueue. Continuing with the above example, this operation involves writing information about the network transaction into an entry in the subqueue.
[0072] The controller then updates the age matrix associated with the subqueue (step 706). For this operation, the controller updates the age matrix to indicate that the entry in the subqueue stores the latest item from among the entries in the subqueue. For example, assuming that the age matrix is as follows Figure 5 In the embodiment shown for performing updates, the controller sets the elements in the age matrix columns associated with entries in the subqueues to 1, and sets the elements in the age matrix rows associated with entries in a given subqueue to 0. After this operation, the age matrix columns associated with entries in the subqueues store all 1s, thereby indicating that the entry stores the newest item in the subqueue.
[0073] Figure 8 A flow chart illustrating a process for shifting items in a subqueue in a hierarchy of subqueues to fill a vacancy in the lowest subqueue and updating an age matrix for the subqueues according to some embodiments is presented. Figure 8 , assume that a controller (e.g., controller 210) in a networking subsystem (e.g., networking subsystem 108) removes an item from an entry in a lowest subqueue (e.g., lowest subqueue 208, etc.) from a hierarchy of subqueues in a queue (e.g., queue 200) in the networking subsystem. Assume further that each of the subqueues in the hierarchy of subqueues is associated with a separate age matrix (e.g., age matrix 300) for keeping track of the relative ages of the items in the entries stored in the subqueues. Note that Figure 8 The operations shown are presented as general examples of operations performed by some embodiments. The operations performed by other embodiments include different operations, operations performed in a different order, and / or operations performed by different functional blocks.
[0074] Figure 8The process in begins when the controller removes the item that is ready to be removed from the entry in the lowest sub-queue (step 800). For this operation, the controller determines that the item is ready to be removed from the lowest sub-queue based on the metadata of the item itself or the entry in which the item is stored, the operating state of the functional block in the electronic device, the busyness or idleness of the communication link in the downstream network device or network, etc. For example, the controller may determine that the communication link to be used to transmit the packet (i.e., item) to the downstream network device is or has become available. The controller then removes the item from the entry in the lowest sub-queue and disposes of the item (e.g., forwarding the packet to the downstream network device, etc.). It should be noted that, as described above, the item that is ready to be removed may be newer than other items in the sub-queue, but can still be removed from the sub-queue out of order relative to the older items in the sub-queue. In other words, the controller can remove the item from the lowest sub-queue without considering the age of the item, so that items newer than the oldest item in the lowest sub-queue are removed before the oldest item is removed from the lowest sub-queue.
[0075] After removing the item from the lowest subqueue, the controller shifts the item from the higher subqueue to the lower subqueue to fill the vacancy in the entry in the lowest subqueue (step 802). For this operation, the controller typically shifts the item downward in the hierarchy of the subqueues, such as for Figure 6 As described. In other words, starting with the lowest subqueue and proceeding sequentially through the subqueues in the hierarchy, for each subqueue, the controller performs the following operations. When the next higher subqueue in the hierarchy (i.e., the controller has not yet reached the top subqueue in the hierarchy) and the next higher subqueue stores at least one item (i.e., is not empty and therefore shifts an item), the controller uses the age matrix associated with the next higher subqueue to determine the entry in which the oldest item in the next higher subqueue is stored. In some embodiments, for this operation, the controller determines the column (or row) in the age matrix associated with the next higher subqueue that best meets the specified criteria for the values in the column (e.g., as for Figure 5 As described), and then uses the column to identify the entry in the next higher sub-queue where the oldest item is stored. The controller then moves the oldest item from the entry in the next higher sub-queue into the sub-queue.
[0076] The controller then updates the age matrices associated with the lowest subqueue and the subqueue from which the item in the hierarchy is shifted (step 804). For this operation, the controller updates the age matrix for each subqueue that experiences a change in the items stored in the subqueue by causing a recent item to be moved in from a higher subqueue, or causing an item to be moved out to a lower subqueue and not replaced (as with the highest subqueue or an intermediate subqueue that has only an empty higher subqueue). For example, assuming an age matrix such as Figure 5In the embodiment shown for updating, the controller, when updating the age matrix for each subqueue into which an item is shifted / stored, sets the element in the age matrix column associated with the shifted / recently added entry in the subqueue to 1 and sets the element in the age matrix row associated with the shifted / recently added entry in the subqueue to 0. As another example, when updating the age matrix for a subqueue from which an item is shifted (an entry is vacated) and into which no additional item is shifted, sets the invalid flag / register of the age matrix column associated with the vacated entry in the subqueue.
[0077] Remove multiple items from a subqueue in a remove operation
[0078] In the above-mentioned example in this description, remove single item from the lowest subqueue, and then make single item be displaced in the hierarchy of subqueue to fill the vacancy in the lowest subqueue.Yet, only removing single item is not essential.In some embodiments, can remove (that is, can together / remove as group) two or more items that are ready to remove from the lowest subqueue in a single removal operation, comprise that in the lowest subqueue, there are a plurality of items of one or more older items.In other words, in these embodiments, when item is ready to remove, can once and disorderly remove two or more items from the lowest subqueue.The same as removing single item from the lowest subqueue, make the item (assuming there is such item) of the corresponding quantity from the higher subqueue in the hierarchy be displaced to fill the vacancy in the lowest subqueue.
[0079] In some embodiments, at least one electronic device (e.g., electronic device 100) uses code and / or data stored on a non-transitory computer-readable storage medium to perform some or all of the operations described herein. More specifically, when performing the described operations, at least one electronic device reads code and / or data from a computer-readable storage medium and executes the code and / or uses the data. A computer-readable storage medium can be any device, medium, or combination thereof that stores code and / or data for use by an electronic device. For example, a computer-readable storage medium may include, but is not limited to, volatile and / or non-volatile memory, including flash memory, random access memory (e.g., eDRAM, RAM, SRAM, DRAM, DDR4 SDRAM, etc.), non-volatile RAM (e.g., phase change memory, ferroelectric random access memory, spin transfer torque random access memory, magnetoresistive random access memory, etc.), read-only memory (ROM), and / or magnetic or optical storage media (e.g., disk drives, tapes, CDs, DVDs, etc.).
[0080] In some embodiments, one or more hardware modules perform the operations described herein. For example, a hardware module may include, but is not limited to, one or more central processing units (CPUs) / CPU cores, graphics processing units (GPUs) / GPU cores, application specific integrated circuits (ASIC) chips, field programmable gate arrays (FPGAs), compressors or encoders, computing units, embedded processors, accelerated processing units (APUs), controllers, neural network processors, and / or other functional blocks. When a circuit (e.g., an integrated circuit element, a discrete circuit element, etc.) in such a hardware module is activated, the circuit performs some or all of the operations. In some embodiments, a hardware module includes general-purpose circuits such as execution pipelines, computing or processing units, etc., which perform operations when executing instructions (program code, firmware, etc.). In some embodiments, a hardware module includes a specific purpose or dedicated circuit for performing an operation, which may include a circuit that performs some or all of the operations in "hardware" and does not execute instructions.
[0081] In some embodiments, a data structure representing some or all of the functional blocks and circuit elements described herein (e.g., electronic device 100 or a portion thereof) is stored on a non-transitory computer-readable storage medium, including a database or other data structure, that can be read by an electronic device and used directly or indirectly to manufacture hardware including the functional blocks and circuit elements. For example, the data structure can be a behavioral-level description or a register-transfer-level (RTL) description of hardware functionality in a high-level design language (HDL) such as Verilog or VHDL. The description can be read by a synthesis tool, which can synthesize the description from a synthesis library representing the hardware functionality including the functional blocks and circuit elements to generate a netlist including a list of transistors / circuit elements. The netlist can then be placed and routed to produce a data set describing the geometry to be applied to a mask. The mask can then be used in various semiconductor manufacturing steps to produce one or more semiconductor circuits (e.g., integrated circuits) corresponding to the functional blocks and circuit elements. Alternatively, the database on the computer-accessible storage medium can be a netlist (with or without a synthesis library) or a data set (as needed), or Graphic Data System (GDS) II data.
[0082] In this description, variables or unspecified values (i.e., general descriptions of values without specific value instances) are represented by letters such as N, M, and X. As used herein, although similar letters may be used in different places in this description, the variables and unspecified values are not necessarily the same in each case, that is, there may be different amounts and values of variables intended for some or all of the general variables and unspecified values. In other words, in this description, the specific instances of N and any other letters used to represent variables and unspecified values are not necessarily related to each other.
[0083] As used herein, the expression "et cetera" or "etc." is intended to present one and / or instances, i.e., the equivalent of "at least one" of the elements in the list associated with "et cetera." For example, in the sentence "the electronic device performs a first operation, a second operation, etc.", the electronic device performs at least one of the first operation, the second operation, and the other operation. Additionally, the elements in the list associated with "et cetera" are merely examples from a set of examples—and at least some of the examples may not appear in some embodiments.
[0084] The foregoing description of the embodiments has been presented for purposes of illustration and description only. The foregoing description is not intended to be exhaustive or to limit the embodiments to the disclosed form. Accordingly, many modifications and variations will be apparent to those skilled in the art. Furthermore, the foregoing disclosure is not intended to limit the embodiments. The scope of the embodiments is defined by the appended claims.
Claims
1. An electronic device comprising: a queue comprising two or more subqueues, each of the two or more subqueues comprising a separate subset of the set of entries of the queue, the subqueues being arranged in a logical hierarchy from a lowest subqueue to a highest subqueue; a memory associated with each of the two or more subqueues, each of the memories storing an age matrix for the associated subqueue, each age matrix comprising only elements located on a first side of a reflection line, values of the elements being usable to determine values of elements located on a second side of the reflection line, the values in the elements of each age matrix identifying relative ages of items in entries stored in the associated subqueue; as well as A controller configured to: storing items in the queue by storing items in the lowest subqueue until the lowest subqueue becomes full, and then storing items in the next successively higher subqueue in the hierarchy as each next higher subqueue becomes full; removing items from the queue by removing the items ready for removal from the entries in the lowest subqueue; and Shifting items stored in the subqueues in the hierarchy to fill the entries in the lowest subqueue by, for each subqueue, starting with the lowest subqueue and progressing through the subqueues in the hierarchy: When a next higher subqueue in the hierarchy exists and stores at least one item, using the age matrix associated with the next higher subqueue to determine an entry in which the oldest item in the next higher subqueue is stored; and The oldest item is moved from the entry in the next higher subqueue into the subqueue.
2. The electronic device according to claim 1, wherein: The elements in each age matrix are arranged in rows and columns; The elements in each row and column are associated with different entries in the corresponding subqueue; and Each element is configured to store a value indicating whether the entry in the corresponding subqueue associated with the row is older than the entry in the corresponding subqueue associated with the column.
3. The electronic device according to claim 2, wherein: When using the age matrix associated with a given sub-queue to determine the entry in which the oldest item in the given sub-queue is stored, the controller is configured to: using the values of the elements in the rows and columns of the age matrix located on the first side of the reflection line of the age matrix to determine the values of the elements in the rows and columns located on the second side of the reflection line; determining a particular column in the age matrix associated with the given sub-cohort that best satisfies specified criteria for the values in the column; and The entry in the given sub-queue in which the oldest item is stored is identified based on the particular column in the age matrix.
4. The electronic device according to claim 2, wherein: When storing an item in a given subqueue, the controller is configured to: storing an item in an available entry in the given subqueue; and Updating the age matrix associated with the given sub-cohort, the updating comprising: setting an element in a column of the age matrix associated with the entry in the given subqueue on the first side of the reflection line to a first value; as well as The element in the row of the age matrix that is on the first side of the reflection line and is associated with the entry in the given subqueue is set to a second value.
5. The electronic device according to claim 4, wherein: When a particular entry in a given subqueue does not currently store an item, the controller is configured to: A valid indicator for the element in the column of the age matrix associated with the particular entry is set to indicate that the element in the column is invalid and therefore not used.
6. The electronic device according to claim 4, wherein: When storing an item in a given subqueue, the controller is configured to: An item is stored in any available entry in the given subqueue without regard to the age of items stored in other entries in the given subqueue. 7 . The electronic device of claim 2 , wherein some or all of the sub-queues in the hierarchy have a different number of entries than other sub-queues in the hierarchy.
8. The electronic device according to claim 2, wherein: When using the age matrix associated with a given sub-queue to determine the entry in which the oldest item in the given sub-queue is stored, the controller is configured to: using the values of the elements in the rows and columns of the age matrix located on the first side of the reflection line of the age matrix to determine the values of the elements in the rows and columns located on the second side of the reflection line; determining a particular row in the age matrix associated with the given sub-cohort that best meets specified criteria for the value in the column; and The entry in the given sub-queue in which the oldest item is stored is identified based on the particular row in the age matrix.
9. The electronic device according to claim 2, wherein: When storing an item in a given subqueue, the controller is configured to: storing an item in an available entry in the given subqueue; and Updating the age matrix associated with the given sub-cohort, the updating comprising: setting an element in the age matrix in a row associated with the entry in the given subqueue on the first side of the reflection line to a first value; as well as The element in the column of the age matrix that is on the first side of the reflection line and is associated with the entry in the given subqueue is set to a second value.
10. The electronic device according to claim 9, wherein: When a particular entry in a given subqueue does not currently store an item, the controller is configured to: A valid indicator for the element in the row associated with the particular entry in the age matrix is set to indicate that the element in the row is invalid and therefore not used.
11. The electronic device according to claim 1, wherein: When removing the item ready for removal from the entry in the lowest subqueue, the controller is configured to: The items are removed from the lowest sub-queue without regard to the age of the items, such that the items newer than the oldest item can be removed out of order relative to the oldest item in the lowest sub-queue.
12. The electronic device of claim 1 , wherein the controller is further configured to: removing one or more other items from the queue when removing the item from the queue, such that at least two items are removed from the queue in the same remove operation, the removing comprising removing one or more other items ready for removal from one or more other entries in the lowest subqueue; and While the item is being shifted for use in filling the entry in the lowest sub-queue, other items in the sub-queue are shifted to fill the one or more other entries in the lowest sub-queue.
13. The electronic device of claim 1, wherein items are removed only from the lowest sub-queue of the queue.
14. A method for handling items in an electronic device, the electronic device having: a queue comprising two or more subqueues, each of the two or more subqueues comprising a separate subset of a set of entries of the queue, and the subqueues being arranged in a logical hierarchy from a lowest subqueue to a highest subqueue; a memory circuit associated with each of the two or more subqueues, each memory circuit storing an age matrix for the associated subqueue, each age matrix comprising only elements located on a first side of a reflective line, the values of the elements being capable of being used to determine the values of elements located on a second side of the reflective line, the values in the elements of each age matrix identifying relative ages of items in entries stored in the associated subqueue; and a controller, the method comprising: storing, by the controller, items in the queue by storing items in the lowest subqueue until the lowest subqueue becomes full, and then storing items in the next successively higher subqueue in the hierarchy as each next higher subqueue becomes full; removing, by the controller, items from the queue by removing items ready for removal from entries in the lowest sub-queue; and Shifting, by the controller, items stored in the subqueues in the hierarchy to fill the entries in the lowest subqueue by, for each subqueue, starting with the lowest subqueue and proceeding through the subqueues in the hierarchy: When a next higher subqueue in the hierarchy exists and stores at least one item, using the age matrix associated with the next higher subqueue to determine an entry in which the oldest item in the next higher subqueue is stored; and The oldest item is moved from the entry in the next higher subqueue into the subqueue.
15. The method of claim 14, wherein: The elements in each age matrix are arranged in rows and columns; The elements in each row and column are associated with different entries in the corresponding subqueue; and Each element is configured to store a value indicating whether the entry in the corresponding subqueue associated with the row is older than the entry in the corresponding subqueue associated with the column.
16. The method of claim 15, wherein using an age matrix associated with a given sub-queue to determine an entry in which the oldest item in the given sub-queue is stored comprises: determining, by the controller, values of the elements in the rows and columns of the age matrix located on the first side of the reflection line of the age matrix and values of the elements in the rows and columns located on the second side of the reflection line; determining, by the controller, a particular column in the age matrix associated with the given sub-cohort that best satisfies specified criteria for the values in the column; as well as The entry in the given sub-queue in which the oldest item is stored is identified by the controller based on the particular column in the age matrix.
17. The method of claim 15, wherein storing an item in a given subqueue comprises: storing, by the controller, an item in an available entry in the given subqueue; as well as Updating, by the controller, the age matrix associated with the given sub-cohort, the updating comprising: setting an element in a column of the age matrix associated with the entry in the given subqueue on the first side of the reflection line to a first value; as well as The element in the row of the age matrix that is on the first side of the reflection line and is associated with the entry in the given subqueue is set to a second value.
18. The method of claim 17, wherein: When a particular entry in a given subqueue currently does not store an item, a valid indicator for the element in a column associated with the particular entry in the age matrix is set by the controller to indicate that the element in the column is invalid and therefore not used.
19. The method of claim 17, wherein storing an item in a given subqueue comprises: An item is stored in any available entry in the given subqueue without regard to the age of items stored in other entries in the given subqueue.
20. The method of claim 15, wherein some or all of the subqueues in the hierarchy have a different number of entries than other subqueues in the hierarchy.
21. The method of claim 15, wherein using an age matrix associated with a given sub-queue to determine an entry in which the oldest item in the given sub-queue is stored comprises: determining, by the controller, values of the elements in the rows and columns of the age matrix located on the first side of the reflection line of the age matrix and values of the elements in the rows and columns located on the second side of the reflection line; determining, by the controller, a particular row in the age matrix associated with the given sub-cohort that best satisfies specified criteria for the value in the column; and The entry in the given sub-queue in which the oldest item is stored is identified by the controller based on the particular row in the age matrix.
22. The method of claim 15, wherein storing an item in a given subqueue comprises: storing, by the controller, an item in an available entry in the given subqueue; as well as Updating, by the controller, the age matrix associated with the given sub-cohort, the updating comprising: setting an element in the age matrix in a row associated with the entry in the given subqueue on the first side of the reflection line to a first value; as well as The element in the column of the age matrix that is on the first side of the reflection line and is associated with the entry in the given subqueue is set to a second value.
23. The method of claim 22, wherein: When a particular entry in a given subqueue currently does not store an item, a valid indicator for the element in the row associated with the particular entry in the age matrix is set by the controller to indicate that the element in the column is invalid and therefore not used.
24. The method of claim 14, wherein removing the item ready for removal from the entry in the lowest subqueue comprises: The items are removed by the controller from the lowest sub-queue without regard to the age of the items, such that the items newer than the oldest item can be removed out of order relative to the oldest item in the lowest sub-queue.
25. The method of claim 14, wherein the method further comprises: removing, by the controller, one or more other items from the queue when removing the item from the queue such that at least two items are removed from the queue in the same removal operation, the removal comprising removing the one or more other items ready for removal from one or more other entries in the lowest subqueue; as well as The controller shifts other items in the subqueue to fill the one or more other entries in the lowest subqueue when shifting the entry to fill the entry in the lowest subqueue.
26. The method of claim 14, wherein items are removed only from the lowest subqueue of the queue.
Citation Information
Patent Citations
Processing data using dynamic partitioning
CN108475212A
Low Latency First-In-First-Out (FIFO) Buffer
US20120079144A1