Cache structure, chip, electronic device and request sending method
By using a request processing queue to manage the state transitions and sending order of access requests when read/write operations at the target address are completed in the cache design, the problem of access request blocking is solved, thereby improving cache performance and device efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2026-04-07
AI Technical Summary
In cache design, due to the spatial and temporal locality of access requests, a large number of access requests are blocked. Existing technologies reduce cache performance by resending unprocessed access requests.
When the read/write operation corresponding to the target address is completed, the access request is resent through the request processing queue to avoid continuously sending a large number of access requests to the address label processing unit. The state management mechanism of the storage unit in the request processing queue is used to optimize the sending order and state transition of access requests.
It improves caching performance, avoids blocking access requests, reduces device power consumption, and increases the efficiency of access request processing and the probability of being accepted.
Smart Images

Figure CN120994577B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of caching technology, specifically relating to a cache structure, chip, electronic device, and request sending method. Background Technology
[0002] Cache design can be used to improve data access efficiency, and its theoretical basis is the spatial and temporal locality of access requests. Spatial locality means that if a piece of data is accessed, it is likely to be accessed again in a short period of time; temporal locality means that if a piece of data is accessed, its adjacent data is likely to be accessed soon.
[0003] Due to the spatial and temporal locality of access requests, within a certain period or while processing a task, a large number of access requests may access the same cache line or a specific cache line within the same group. This causes many access requests to be delayed, waiting for previous requests to complete before being processed. Currently, caching designs typically resend unprocessed access requests. However, resending a large number of access requests can block other normal access requests, thus degrading caching performance. Summary of the Invention
[0004] Therefore, the purpose of this application is to provide a cache structure, chip, electronic device and request sending method to improve cache performance.
[0005] The embodiments of this application are implemented as follows:
[0006] In a first aspect, embodiments of this application provide a cache structure, which includes: an address tag processing unit for sending operation completion information; the operation completion information is used to indicate that a read / write operation on a target address has been completed; a request processing queue connected to the address tag processing unit for storing at least one access request, and based on the target address, matching a first access request whose access address matches the target address from the at least one access request, and sending the first access request to the address tag processing unit; the access address is the address to be accessed by the first access request, and the first access request is an access request waiting to be retransmitted.
[0007] Based on the caching structure described in the first aspect, when the read / write operation corresponding to the target address is completed, resending the access request to that target address to the address tag processing unit avoids continuously resending all access requests to the address tag processing unit. This prevents a large number of resent requests from blocking other normal access requests, allowing access requests to be processed in a timely manner, thereby improving caching performance. Furthermore, resending the access request to that target address after the read / write operation is completed increases the probability that the access request will be accepted by the address tag processing unit, thus avoiding frequent resending of the access request and reducing device power consumption.
[0008] In one possible implementation, the request processing queue includes a storage array, which includes at least one storage unit. A first storage unit in the at least one storage unit is used to store the first access request. Specifically, the request processing queue is used to: determine, based on the target address, the first access request whose address tag matches the target address and is in a retransmission waiting state; the address tag indicates the address to be accessed by the access request, and the retransmission waiting state indicates that the first access request is waiting to be retransmitted; change the state of the first storage unit from the retransmission waiting state to the retransmission valid state, and send the first access request to the address tag processing unit; the retransmission valid state indicates that the first access request should be retransmitted. Thus, the request processing queue can indicate the specific operation on the first access request, such as whether to send the first access request to the address tag processing unit, by changing the current state of the first storage unit, thereby enabling the retransmission of the first access request based on operation completion information.
[0009] In one possible implementation, the request processing queue further includes: a retransmission activation control unit, configured to determine, based on the target address, the first access request among the at least one access requests whose address tag matches the target address and is in a retransmission waiting state, and send first control information; the first control information is used to instruct the state of the first storage unit to be changed to a retransmission valid state; a request status unit, connected to the retransmission activation control unit, configured to store the status information of each storage unit among the at least one storage unit, and based on the first control information, change the state of the first storage unit from a retransmission waiting state to the retransmission valid state; the status information is used to indicate the current state of the storage unit; and a request arbitration unit, connected to the request status unit and the storage array, configured to send the first access request to the address tag processing unit when the state of the first storage unit is a retransmission valid state. Thus, the retransmission activation control unit, the request status unit, and the request arbitration unit can be used to send the first access request based on operation completion information.
[0010] In one possible implementation, the request processing queue is further configured to change the state of the first storage unit from the retransmission valid state to the request processing state after sending the first access request to the address tag processing unit; the request processing state indicates that the first access request has been sent to the address tag processing unit. It is understood that the first storage unit being in the request processing state indicates that the first access request has been sent to the address tag processing unit, but the address tag processing unit has not yet received a response regarding the first access request. This avoids repeatedly sending the first access request before receiving a response from the address tag processing unit.
[0011] In one possible implementation, the request processing queue further includes: a request arbitration unit connected to the storage array, configured to send second control information after sending the first access request to the address tag processing unit; the second control information instructs the state of the first storage unit to be changed to the request processing state; and a request state unit connected to the request arbitration unit, configured to store the state information of each storage unit in the at least one storage unit, and based on the second control information, change the state of the first storage unit from the retransmission valid state to the request processing state. Thus, the state change after the first access request is retransmitted can be achieved through the request arbitration unit and the request state unit.
[0012] In one possible implementation, the address tag processing unit is further configured to receive the first access request and send a first message; the request processing queue is further configured to, based on the first message indicating that the first access request has not been accepted, change the state of the first storage unit from the request valid state to the retransmission waiting state. Thus, when the first access request has not been accepted, the state of the first storage unit can be changed to make the first access request wait for retransmission.
[0013] In one possible implementation, the request processing queue further includes: a request acceptance status unit, configured to send third control information based on the first message; the third control information is used to instruct the state of the first storage unit to be changed to the retransmission waiting state; and a request status unit, connected to the request acceptance status unit, configured to store the status information of each storage unit in the at least one storage unit, and to change the state of the first storage unit from the request processing state to the retransmission waiting state based on the third control information; the status information is used to indicate the current state of the storage unit. Thus, the state of the first storage unit can be changed through the request acceptance status unit and the request status unit, so that the retransmission waiting state of the first storage unit indicates that the first access request is waiting to be retransmitted.
[0014] In one possible implementation, the address tag processing unit is further configured to receive the first access request and send a first message; the request processing queue is further configured to, upon the first message indicating that the first access request has been accepted, change the state of the first storage unit from the request processing state to a request invalid state based on the first message; the request invalid state is used to indicate that no access request is stored in the first storage unit. Thus, when the first access request is accepted, the state of the first storage unit can be changed, making the first storage unit usable for storing access requests from users.
[0015] In one possible implementation, the request processing queue further includes: a request acceptance status unit, configured to send fourth control information based on the first message; the fourth control information is configured to instruct the status of the first storage unit to be changed to the request invalid status; and a request status unit, connected to the request acceptance status unit, configured to store the status information of each storage unit in the at least one storage unit, and to change the request processing status of the first storage unit to the request invalid status based on the fourth control information; the status information is configured to indicate the current status of the storage unit. Thus, the status of the first storage unit can be changed through the request acceptance status unit and the request status unit, so that the request invalid status of the first storage unit indicates that the first storage unit can be used to store access requests from users.
[0016] In one possible implementation, the request processing queue is further configured to send the first access request before receiving the operation completion information; the address tag processing unit is further configured to receive the first access request and send a second message; the second message is configured to indicate that the first access request has not been accepted; the request processing queue is further configured to change the state of the first storage unit from the request processing state to the retransmission waiting state based on the second message; the request processing state is configured to indicate that the first access request has been sent to the address tag processing unit. Thus, when the first access request is not accepted, the first access request can be made to wait for retransmission by changing the state of the first storage unit to the retransmission waiting state.
[0017] In one possible implementation, the request processing queue further includes: a request acceptance status unit, configured to send fifth control information based on the second message; the fifth control information is used to instruct the state of the first storage unit to be changed to the retransmission waiting state; and a request status unit, connected to the request acceptance status unit, configured to store the status information of each storage unit in the at least one storage unit, and to change the request processing state of the first storage unit to the retransmission waiting state based on the fifth control information; the status information is used to indicate the current state of the storage unit. Thus, by using the request acceptance status unit and the request status unit, when the first access request is not accepted, the state of the first storage unit can be changed to the retransmission waiting state.
[0018] In one possible implementation, the request processing queue is further configured to receive the first access request from the user before receiving the second message; store the first access request in the first storage unit and change the state of the first storage unit from an invalid request state to a valid request state; send the first access request to the address tag processing unit and change the state of the first storage unit from the valid request state to the request processing state; the invalid request state indicates that no access request is stored in the first storage unit, and the valid request state indicates that the first access request stored in the first storage unit can be sent for the first time. Thus, after receiving the first access request from the user, the first access request can be stored and sent based on the state of the first storage unit.
[0019] In one possible implementation, the request processing queue further includes: a request receiving control unit, configured to receive the first access request from the user, store the first access request in the first storage unit, and send sixth control information; the sixth control information is used to instruct the state of the first storage unit to be changed to the request valid state; a request status unit, connected to the request receiving control unit, configured to store the status information of each storage unit in the at least one storage unit, and based on the sixth control information, change the state of the first storage unit from the request invalid state to the request valid state; the status information is used to indicate the current state of the storage unit; and a request arbitration unit, connected to the request status and address tag, and the storage array, configured to send the first access request to the address tag processing unit and send seventh control information when the first storage unit is in the request valid state; the seventh control information is used to instruct the state of the first storage unit to be changed to the request processing state; the request status unit is also used to change the state of the first storage unit from the request valid state to the request processing state based on the seventh control information. Thus, the storage and transmission of the first access request can be achieved through the request receiving control unit, the request status unit, and the request arbitration unit.
[0020] In one possible implementation, the address tag processing unit is further configured to send a third message; the third message indicates that a second access request has been accepted, the second access request belonging to the at least one access request, and the second access request being the first access request sent to the address tag processing unit; the request processing queue is further configured to, based on the third message, change the state of a second storage unit in the at least one storage unit from a request processing state to a request invalid state; the second storage unit is used to store the second access request, the request processing state indicating that the second access request has been sent to the address tag processing unit, and the request invalid state indicating that no access request is stored in the second storage unit. Thus, when a second access request is accepted, by changing the state of the second storage unit, the second storage unit can be used to store access requests from users.
[0021] In one possible implementation, the request processing queue further includes: a request acceptance status unit, used to send eighth control information based on the third message; the eighth control information is used to instruct the status of the second storage unit to be changed to the request invalid status; and a request status unit, connected to the request acceptance status unit, used to store the status information of each storage unit in the at least one storage unit, and to change the request processing status of the second storage unit to the request invalid status based on the eighth control information; the status information is used to indicate the current status of the storage unit. Thus, the status of the second storage unit can be changed through the request acceptance status unit and the request status unit, so that the request invalid status of the second storage unit indicates that the second storage unit can be used to store access requests from users.
[0022] In one possible implementation, the request arbitration unit is configured to prioritize sending access requests from the storage units in the retransmission valid state when the at least one storage unit includes storage units in a request valid state and storage units in a retransmission valid state. This reduces the latency of retransmission requests.
[0023] Secondly, embodiments of this application also provide a chip including a cache structure as described in the first aspect embodiments and / or any possible implementation in combination with the first aspect embodiments.
[0024] Thirdly, embodiments of this application also provide an electronic device, including a body and a cache structure as described in any possible implementation of the first aspect embodiment and / or in combination with the first aspect embodiment, or a chip as described in the second aspect embodiment.
[0025] Fourthly, embodiments of this application also provide a request sending method applied to a cache structure as described in the first aspect embodiment and / or any possible implementation in conjunction with the first aspect embodiment. The method includes: receiving operation completion information; the operation completion information indicating that a read / write operation on a target address has been completed; based on the operation completion information, matching a first access request whose access address matches the target address from at least one access request, and sending the first access request to an address tag processing unit, wherein the access address is the address to be accessed by the first access request; the first access request is an access request awaiting retransmission, and the address tag processing unit is used to process the first access request.
[0026] Furthermore, the technical effects of the method described in the fourth aspect can also refer to the technical effects of the cache structure described in the first aspect, and will not be repeated here. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A schematic diagram of the cache structure provided in the embodiments of this application. Figure 1 .
[0029] Figure 2 This is a schematic diagram of the reactivation control unit provided in an embodiment of this application.
[0030] Figure 3 This is a schematic diagram of each cache line in the 8 groups of 4-way caches provided in the embodiments of this application.
[0031] Figure 4 This is a schematic diagram of a request acceptance status unit provided in an embodiment of this application.
[0032] Figure 5 This is a schematic diagram of a request receiving control unit provided in an embodiment of this application.
[0033] Figure 6 A schematic diagram of the cache structure provided in the embodiments of this application. Figure 2 .
[0034] Figure 7 This is a schematic diagram illustrating the state changes of access request #a provided in an embodiment of this application.
[0035] Figure 8 This is a flowchart illustrating the request sending method provided in an embodiment of this application. Detailed Implementation
[0036] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. The following embodiments are provided as examples to more clearly illustrate the technical solutions of this application, and should not be used to limit the scope of protection of this application. Those skilled in the art will understand that, without conflict, the following embodiments and features can be combined with each other.
[0037] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., in the description of this application are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.
[0038] Furthermore, the term "and / or" in this application is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0039] In the description of the embodiments of this application, unless otherwise expressly specified and limited, the technical term "connection" can be a direct connection or an indirect connection through an intermediate medium.
[0040] In cache design, due to the spatial and temporal locality of access requests, a large number of access requests may access the same cache line in a group or a specific cache line in the same group within a certain period or while processing a task. This can cause many access requests to be unable to be processed immediately and require them to be sent to the previous level unit for retransmission. That is, when the previous level unit has access requests that need to be retransmitted, it will continuously send the stored access requests to the next level unit. However, retransmitting a large number of access requests can block other normal access requests, thereby reducing cache performance. To address this, this application proposes that when the read / write operation corresponding to the target address is completed, the request processing queue retransmits the access request to the address label processing unit. This avoids continuously sending a large number of access requests to the address label processing unit, thereby preventing a large number of retransmitted requests from blocking other normal access requests and improving cache performance.
[0041] The following is combined Figure 1 The cache structure provided in this application embodiment will be described below. The cache structure includes an address tag processing (TP) unit and a request processing queue (RPQ). The address tag processing unit is connected to the request processing queue. This will be described in detail below.
[0042] The address tag processing unit is used to send operation completion information.
[0043] The operation completion information indicates that a read / write operation on the target address has been completed. This information may include the target address's address information, which can be the target address's address tag. The read / write operation can be either a data read or write operation; there are no restrictions.
[0044] In this embodiment of the application, after the cached external storage unit completes the read or write operation of the target address, it can send an indication message to the address tag processing unit to indicate that the read or write operation of the target address is complete. After receiving the indication message, the address tag processing unit can send operation completion information to the request processing queue.
[0045] A request processing queue is used to store at least one access request. Based on the target address, the first access request whose access address matches the target address is matched from the at least one access request, and the first access request is sent to the address tag processing unit.
[0046] At least one access request may include a retransmission request, which may include an access request awaiting retransmission, and / or an access request that has been retransmitted but for which acceptance information has not yet been received. The at least one access request may also include an access request from a user, which may include an access request awaiting initial transmission, and / or an access request that has been initially transmitted but for which acceptance information has not yet been received. That is, the request processing queue may store retransmission requests and access requests from users. It is understood that "retransmission" in this embodiment can be interpreted as sending again or retransmitting, i.e., not sending for the first time.
[0047] The access address is the address that the first access request seeks to access. The access address and the target address being the same can be understood as the access address and the target address being identical.
[0048] The first access request is an access request awaiting retransmission; in other words, the first access request is a retransmission request. The first access request can be either a read request or a write request. When the first access request is a read request, it may include the address label and address offset information of the accessed address. When the first access request is a write request, it may include the address label, address offset information, and the data to be written.
[0049] The address label of the aforementioned access address can be at least a portion of the access address information; or, in other words, the access address label can be a specific portion of the access address information. For example, the access address is K bits based on 2... n Group / 2 m The cache structure of the path has a group address, and the size of the cache line data block is 2. BThe access address is ADDR[K-1:0], the cache set address is ADDR[N+B-1:B], and the address label is ADDR[K-1:N+B]. For example, for a 16-bit (K=16) access address, if an 8-set / 4-way cache structure is used, each cache line stores 256 data units, i.e., N=3, B=8, and the address label is ADDR[15:11]. It should be understood that the above address label setting method is only one example; for different cache structures, address labels can be set in other ways without restriction.
[0050] The above address offset information can be related to the address offset of the access address, and this address offset information can be used to obtain the complete access address. For the specific implementation principle, please refer to the existing technology, which will not be elaborated here.
[0051] When the first access request is a read request or a write request, it may also include at least one of the following information: process ID, user information, data length information, and cache operation attribute information. The process ID can be used to indicate the process corresponding to the first access request. The user information can be used to indicate the user who sent the first access request. The data length information can be used to indicate the length of data to be read. The cache operation attribute information can be used to indicate how the cache operation corresponding to the first access request applies to the cache. For example, if the cache operation is a read operation and the operation attribute is CACHABLE, the data read from the external storage unit is returned to the user, and the data is stored in the cache; if the operation attribute is another attribute (e.g., BYPASS), the read data is directly returned to the user, and it is not necessary to store the data in the cache. Of course, the first access request may also include other information, which can be flexibly set according to the actual situation without restriction.
[0052] After receiving the operation completion information from the address tag processing unit, the request processing queue can determine the first access request to be retransmitted based on the target address indicated by the operation completion information, and send the first access request to the address tag processing unit.
[0053] In summary, in this embodiment, resending the access request to the target address to the address tag processing unit when the read / write operation corresponding to the target address is completed avoids the request processing queue from continuously resending a large number of access requests to the address tag processing unit. This prevents a large number of access requests from blocking other normal access requests, allowing access requests to be processed in a timely manner and thus improving cache performance. Furthermore, resending the access request to the target address when the read / write operation corresponding to the target address is completed increases the probability that the access request will be accepted by the address tag processing unit, thereby avoiding frequent resending of the access request and reducing device power consumption.
[0054] Optionally, in conjunction with the above embodiments, the request processing queue includes a storage array, the storage array includes at least one storage unit, and a first storage unit in the at least one storage unit is used to store a first access request; the request processing queue is specifically used to: determine, based on the target address, a first access request in at least one access request whose address label matches the target address and is in a retransmission waiting state; the address label is used to indicate the address to be accessed by the access request, and the retransmission waiting state is used to indicate that the first access request is waiting to be sent again; change the state of the first storage unit from the retransmission waiting state to the retransmission valid state, and send the first access request to the address label processing unit; the retransmission valid state is used to indicate that the first access request is retransmitted.
[0055] The size of the storage array is related to the latency of data returned from external storage units to the cache. If this latency is high, the storage array can be set to a larger size, meaning more storage units can be configured in the array to store more access requests; if the latency is low, the storage array can be set to a smaller size. Thus, even when the latency of data returned from external storage units to the cache is high, setting a larger storage array allows for the sequential return of results for subsequent access requests, thereby improving cache performance.
[0056] At least one storage unit is used to store access requests. At least one storage unit includes a first storage unit. That is, the request processing queue can store retransmission requests and access requests from users through at least one storage unit.
[0057] In at least one access request, each access request is stored in a different storage unit of at least one storage unit. For example, at least one access request consists of 5 access requests, namely access request #a1 to access request #a5, and at least one storage unit includes 10 storage units, namely storage units #a1 to storage units #a10; access request #a1 is stored in storage unit #a7, access request #a2 is stored in storage unit #a4, access request #a3 is stored in storage unit #a10, access request #a4 is stored in storage unit #a6, and access request #a5 is stored in storage unit #a2.
[0058] At least one access request carries an address tag corresponding to that access request. This address tag indicates the access address corresponding to the access request. The address tag can be stored within the access request itself, meaning the request processing queue can compare the target address (i.e., the address information of the target address) with the address tags in each access request. Alternatively, the address tag can be stored outside the access request. In this case, the address tag can be associated with the storage unit used to store the access request, meaning the request processing queue can compare the target address (i.e., the address information of the target address) based on the address tag associated with the storage unit. The specific method of setting the address tag can be flexibly set according to the actual situation and is not restricted. It can be understood that the address tag in the access request is similar to the address tag of the access address in the aforementioned first access request; please refer to the relevant descriptions above for understanding, which will not be repeated here.
[0059] Matching an address label with a target address can be understood as the access address indicated by the address label being the same as the target address. The request processing queue can then match the address information of the address label with the target address to identify at least one access request whose address label matches the target address, such as the first access request.
[0060] A first access request in a retransmission waiting state can be understood as a request waiting to be sent again or retransmitted. The state of the first access request can be determined based on the state of the first storage unit; that is, the state of the first storage unit being in a retransmission waiting state indicates that the first access request is in a retransmission waiting state. In other words, the state of the first storage unit being in a retransmission waiting state indicates that the first access request is in a retransmission waiting state. It is understood that, in this embodiment, the state of the storage unit used to store the access request can represent the state of the access request.
[0061] In this embodiment of the application, after receiving the operation completion information, the request processing queue can, based on the address information of the target address in the operation completion information, determine the first access request whose address label matches the target address and is in a retransmission waiting state from at least one access request. For example, the request processing queue can first determine the access request whose address label matches the target address from at least one access request (denoted as access request #1), and then determine the access request in a retransmission waiting state from access request #1 (denoted as access request #2), so as to determine the first access request based on access request #2. Or, for example, the request processing queue can first determine the access request in a retransmission waiting state from at least one access request (denoted as access request #3), and then determine the access request whose address label matches the target address from access request #3 (denoted as access request #4), so as to determine the first access request based on access request #4.
[0062] After identifying the first access request, the request processing queue can change the state of the first storage unit to a retransmission valid state, and based on this state, send the first access request to the address tag processing unit. In this way, the request processing queue can indicate the specific operation for the first access request by changing the current state of the first storage unit, such as whether to send the first access request to the address tag processing unit, thereby enabling the retransmission of the first access request based on operation completion information.
[0063] In a first possible implementation, the request processing queue further includes: a retransmission activation control unit, a request status unit, and a request arbitration unit; wherein the request status unit is connected to the retransmission activation control unit, and the request arbitration unit is connected to the request status unit and the storage array.
[0064] The retransmission activation control unit is used to determine, based on the target address, at least one first access request whose address tag matches the target address and is in a retransmission waiting state, and send first control information; the first control information is used to instruct the state of the first storage unit to be changed to a retransmission valid state.
[0065] like Figure 2 As shown, the retransmission activation control unit may include an operation completion information decoder and an address comparison controller. Specifically, the retransmission activation control unit can receive operation completion information from the address tag processing unit, and decode the operation completion information using the operation completion information decoder to obtain the address information of the target address in the operation completion information. After obtaining the address information, the retransmission activation control unit can specifically compare the address tags of each access request in at least one access request with the address information using the address comparison controller, obtaining at least one first access request whose address tag matches the address information and is in a retransmission waiting state; and change the state of the first storage unit to a retransmission valid state by sending first control information to the request status unit.
[0066] In some possible implementations, the retransmission activation control unit can also be used to ignore the operation completion information when it is determined that there is no access request in at least one access request whose address tag matches the target address (i.e., the address information of the target address); or, when it is determined that there is an access request in at least one access request whose address tag matches the target address, but there is no access request in the retransmission waiting state, the operation completion information can be ignored.
[0067] Furthermore, the first access request in the above-mentioned at least one access request, whose address label matches the target address and is in a retransmission waiting state, can be understood as: at least one storage unit has a first storage unit whose address label matches the target address and is in a retransmission waiting state.
[0068] A request status unit is used to store the status information of each storage unit in at least one storage unit. Based on the first control information, the status of the first storage unit is changed from the retransmission waiting state to the retransmission valid state. The status information is used to indicate the current status of the storage unit.
[0069] The request state unit can be specifically used to store a state machine associated with each of the at least one storage units. The state machine can be used to record the current state of the access request stored in the storage unit (i.e., the aforementioned state information), such as retransmission waiting state, retransmission valid state, etc.
[0070] Furthermore, the request status unit can also be used to store corresponding address tags for each storage unit in at least one storage unit. These address tags are the tags carried by the access address stored in that storage unit; for example, the address tag corresponding to the first storage unit is the address tag of the access address in the first access request. In this case, the address tags and status information corresponding to the storage units can be stored in the same location. And when comparing the address tags of each access request in at least one access request with the address information of the target address, the address tags corresponding to each storage unit in at least one storage unit can be compared with that address information.
[0071] For example, if the target address in the operation completion information is 0x1000, and the address tags corresponding to the 2nd, 4th, and 8th storage units in the storage array are also 0x1000, comparing the target address with the address tags corresponding to each storage unit in the storage array will reveal the 2nd, 4th, and 8th storage units. Furthermore, if the 8th storage unit is in a request-valid state, while the 2nd and 4th storage units are both in a retransmission-waiting state, then the states of the 2nd and 4th storage units can be changed to retransmission-valid state, meaning the access requests from the 2nd and 4th storage units can be sent to the address tag processing unit.
[0072] The arbitration request unit is configured to send a first access request to the address tag processing unit when the state of the first storage unit is in the retransmission valid state. Specifically, the arbitration request unit may be configured to obtain the first access request from the storage array and send the first access request to the address tag processing unit when the state of the first storage unit is in the retransmission valid state.
[0073] In some possible implementations, the request arbitration unit can also be used to arbitrate access requests that meet the sending conditions. That is, when there are multiple access requests that meet the sending conditions, the request arbitration unit can select one access request from these multiple access requests and send the access request to the address tag processing unit. The aforementioned sending conditions are: the access request is in a retransmission valid state or the access request is in a request valid state. The retransmission valid state indicates that the access request waiting to be retransmitted can be retransmitted, that is, the access request in the retransmission valid state can be sent again. The request valid state indicates that the access request from the user can be sent, that is, the access request in the request valid state can be sent for the first time. It can be understood that, in this embodiment of the application, after receiving the access request from the user, the request processing queue can set the access request to a request valid state, such as changing the state of the storage unit storing the access request to a request valid state.
[0074] Furthermore, the request arbitration unit can also be used to select a storage unit from the plurality of storage units in the case where at least one storage unit includes a plurality of storage units in the request valid state, or in the case where at least one storage unit includes a plurality of storage units in the retransmission valid state, such as by selecting a storage unit from the plurality of storage units through a fair round-robin algorithm or other random method, and send the access request in that storage unit.
[0075] Furthermore, the request arbitration unit can also be used to prioritize sending access requests from storage units in the retransmission valid state when at least one storage unit includes a storage unit in a request valid state and a storage unit in a retransmission valid state. The storage unit in the request valid state can indicate that the access request in that storage unit is in a request valid state; the storage unit in the retransmission valid state can indicate that the access request in that storage unit is in a retransmission active state. In other words, the request arbitration unit can also be used to prioritize sending access requests in the retransmission valid state when at least one access request includes an access request in a request valid state and an access request in a retransmission valid state. This reduces the latency of retransmission requests.
[0076] Furthermore, the request arbitration unit can be specifically used to select a storage unit #1 from the storage units in the request valid state and a storage unit #2 from the storage units in the retransmission valid state when at least one storage unit includes a storage unit in the request valid state and a storage unit in the retransmission valid state, and first send the access request in storage unit #2 to the address tag processing unit, and then send the access request in storage unit #1 to the address tag processing unit.
[0077] In this embodiment of the application, the retransmission activation control unit in the request processing queue instructs the request status unit to change the status of the first storage unit through operation completion information, and the request arbitration unit sends a first access request based on the changed retransmission valid status of the first storage unit, which enables the sending of a first access request to the address tag processing unit based on operation completion information.
[0078] In the second possible implementation, the request processing queue is also used to change the state of the first storage unit from the retransmission valid state to the request processing state after the first access request is sent to the address tag processing unit. The request processing state is used to indicate that the first access request has been sent to the address tag processing unit.
[0079] The first storage unit being in the request processing state can be understood as the first access request being in the request processing state, that is, the first access request has been sent to the address tag processing unit, and the address tag processing unit has not yet received the acceptance result for the first access request.
[0080] In this embodiment, after sending the first access request, the request processing queue changes the state of the first storage unit to the request processing state, indicating that the first access request has been sent to the address tag processing unit, but the acceptance result of the address tag processing unit for the first access request has not yet been received. This avoids resending the first access request before receiving the acceptance result of the address tag processing unit for the first access request.
[0081] In a second possible implementation, the request processing queue further includes a request arbitration unit and a request status unit. The request arbitration unit and the request status unit are connected.
[0082] The arbitration request unit is used to send a second control message after sending a first access request to the address tag processing unit; the second control message is used to instruct the state of the first storage unit to be changed to the request processing state.
[0083] The request status unit is used to store the status information of each storage unit in the at least one storage unit, and to change the status of the first storage unit from the retransmission valid status to the request processing status based on the second control information.
[0084] It is understood that the above-mentioned introduction can be referenced for the request arbitration unit and request status unit, and will not be repeated here.
[0085] In this embodiment, after sending the first access request, the request arbitration unit can instruct the request status unit to change the status of the first storage unit to the request processing status via the second control information. Thus, the request arbitration unit and the request status unit can achieve the status change after the first access request is resent.
[0086] Furthermore, after the request processing queue sends the first access request to the address tag processing unit, it can receive the processing result of the address tag processing unit on the first access request, i.e., whether the address tag processing unit accepted the first access request, and change the status of the first access request based on the processing result. The following sections will describe different scenarios.
[0087] Case 1.1: The address tag processing unit did not accept the first access request.
[0088] The address tag processing unit is also used to receive the first access request and send the first message; the request processing queue is also used to change the state of the first storage unit from the request processing state to the retransmission waiting state based on the first message if the first message indicates that the first access request has not been accepted.
[0089] The address tag processing unit is specifically used to receive the first access request, determine whether to accept the first access request based on the address tag in the first access request, and send the first message to the request processing queue. The following uses an access request as an example to illustrate the specific operation of the address tag processing unit in determining whether to accept the access request.
[0090] The address label processing unit can be used to store the address labels of cache lines and the cache line status. The address label of a cache line indicates the address of the cache line, and this address label can be at least a portion of the cache line's address information. The cache line status indicates the current state of the cache line, such as: invalid state, consistent state, processing state, modified state, shared state, etc. An invalid state indicates that the cache line is not being processed, i.e., the cache line is idle. A consistent state indicates that the cache line is consistent with the external storage unit of the cache. A processing state indicates that the cache line is undergoing a read or write operation. A modified state indicates that the cache line is inconsistent with the external storage unit of the cache. A shared state indicates that the data in the cache line is stored by multiple cache lines. For example, such as... Figure 3 As shown, the address tag processing unit stores the address tags and cache line status (i.e., ...) of each cache line in eight groups of four-way caches. Figure 3 (Status information in the data).
[0091] The address tag processing unit can compare the address tag in the access request with the address tags of each cache line after receiving an access request from the request processing queue. If the current status of a successfully matched cache line is not in a processing state, it indicates that the access request has been hit, and the address tag processing unit accepts the access request. If no address tag matches the address tag in the access request, it indicates that the access request has not been hit, and the address tag processing unit accepts the access request. If the current status of a successfully matched cache line is in a processing state, it indicates that the access request needs to be resent, and the address tag processing unit does not accept the access request.
[0092] The address tag processing unit can also be used to send a message to the request processing queue indicating that the access request has been accepted when the access request is successful or unsuccessful. This message may include the address information of the storage unit where the access request is located and acceptance information. The acceptance information may be used to indicate that the access request in the storage unit corresponding to the address information has been accepted by the address tag processing unit; alternatively, the message may include the address information of the storage unit where the access request is located and information indicating that the access request has been accepted.
[0093] Furthermore, for scenarios where an access request hits, the address tag processing unit can be used to read data from the cache and return it to the upstream when the access request is a read request; and to write data to the currently hit cache line when the access request is a write request. For scenarios where an access request misses, the address tag processing unit can be used to send the read request to the cache's external storage unit when the access request is a read request, read data from the external storage unit, and cache the data in the corresponding cache line; and to allocate a cache line to store the currently written data when the access request is a write request.
[0094] The address tag processing unit can also be used to send a message to the request processing queue indicating that the access request has not been accepted, such as the first message mentioned above, when the access request needs to be retransmitted. This message may include the address information of the storage unit where the access request is located, and may not include acceptance information; that is, by omitting acceptance information, the message indicates that the access request in the storage unit corresponding to that address information has not been accepted by the address tag processing unit. Alternatively, the message may include the address information of the storage unit where the access request is located and information indicating that the access request has not been accepted.
[0095] In this embodiment, the address tag processing unit can be specifically used to compare the address tag in the first access request with the address tags of each cache line; determine the cache line that matches the address tag in the first access request, the current state of which is "processing"; and send the aforementioned first message. The first message may include the address information of the first storage unit, and may not include acceptance information. The address information of the first storage unit can be used to indicate the location of the first storage unit in the storage array. Alternatively, the first message may include the address information of the first storage unit and information indicating that the first access request has not been accepted.
[0096] The request processing queue can be specifically used to determine that the first access request has not been accepted based on the fact that the first message does not carry acceptance information, or that the first access request carries information indicating that the first access request has not been accepted, and to change the state of the first storage unit from the request processing state to the retransmission waiting state.
[0097] In this embodiment, after the request processing queue retransmits the first access request, and the address tag processing unit does not accept the first access request, the address tag processing unit indicates to the request processing unit via a first message that the first access request has not been accepted. This causes the request processing queue to change the state of the first storage unit to a retransmission waiting state, so that the first access request can wait to be retransmitted again. Thus, even when the first access request has not been accepted, changing the state of the first storage unit can make the first access request wait to be retransmitted.
[0098] In scenario 1.1, the request processing queue may further include: a request acceptance status unit and a request status unit. The request acceptance status unit and the request status unit are connected.
[0099] The request acceptance status unit is used to send third control information based on the first message; the third control information is used to instruct the status of the first storage unit to be changed to the retransmission waiting status.
[0100] The request acceptance status unit can be specifically used to determine that the first access request has not been accepted based on the fact that the first message does not carry acceptance information, or that the first access request carries information indicating that the first access request has not been accepted, and in the case that the first access request has not been accepted, to send third control information to the request status unit to change the status of the first storage unit to a retransmission waiting status.
[0101] like Figure 4 As shown, the request acceptance status unit may include a request acceptance information decoder. The request acceptance status unit may be specifically used to receive a first message, decode the first message through the request acceptance information decoder, and obtain the address information of the first storage unit and the enable signal in the first message. The enable signal is used to indicate that the first access request has not been accepted.
[0102] The request status unit stores the status information of each storage unit in at least one storage unit. Based on the third control information, it changes the status of the first storage unit from the request processing status to the retransmission waiting status. This status information is used to indicate the current status of the storage unit. It is understood that the request status unit can be understood from the aforementioned related descriptions, and will not be repeated here.
[0103] In this embodiment, the request acceptance status unit can, based on the situation where the first access request is not accepted, instruct the request status unit to change the status of the first storage unit to a retransmission waiting status via third control information. Thus, the request acceptance status unit and the request status unit can be used to change the status of the first storage unit, so that the retransmission waiting status of the first storage unit indicates that the first access request is waiting to be retransmitted.
[0104] Case 1.2: The address tag processing unit accepts the first access request.
[0105] The address tag processing unit is also used to receive a first access request and send a first message; the request processing queue is also used to change the state of the first storage unit from the request processing state to the request invalid state based on the first message when the first message indicates that the first access request has been accepted; the request invalid state is used to indicate that no access request is stored in the first storage unit.
[0106] The first message may include the address information of the first storage unit and acceptance information, wherein the acceptance information is used to indicate that the access request (i.e., the first access request) in the storage unit corresponding to the address information is accepted. Alternatively, the first message may include the address information of the first storage unit and information indicating that the first access request is accepted.
[0107] The invalid request status can also be used to indicate that the first access request has been sent and accepted, meaning that the first access request does not need to wait for resending.
[0108] The address label processing unit can be specifically used to compare the address label in the first access request with the address labels of each cache line; determine the corresponding cache line that matches the request address label, where the current state of the cache line is not in a processing state, or there is no cache line address label that matches the address label in the first access request; and send the aforementioned first message. This address label processing unit can be understood with reference to the relevant description in section 1.1 above, and will not be repeated here.
[0109] The request processing queue can be specifically used to determine that the first access request has been accepted based on the acceptance information (or information indicating that the first access request has been accepted) carried in the first message, and to change the state of the first storage unit from the request processing state to the request invalid state.
[0110] In this embodiment, after the request processing queue retransmits the first access request and the address tag processing unit accepts the first access request, the address tag processing unit indicates to the request processing unit via a first message that the first access request has been accepted, causing the request processing queue to change the state of the first storage unit to an invalid request state. Thus, by changing the state of the first storage unit when the first access request is accepted, the first storage unit can be used to store access requests from users.
[0111] In scenario 1.2, the request processing queue may further include: a request acceptance status unit and a request status unit. The request acceptance status unit and the request status unit are connected.
[0112] The request acceptance status unit is used to send fourth control information based on the first message; the fourth control information is used to instruct the status of the first storage unit to be changed to the request invalid status.
[0113] The request acceptance status unit can be specifically used to determine that the first access request has been accepted based on the acceptance information (or information used to indicate that the first access request has been accepted) carried in the first message, and if the first access request has been accepted, to send fourth control information to the request status unit to change the status of the first storage unit to the request invalid status.
[0114] like Figure 4 As shown, the request acceptance status unit may include a request acceptance information decoder. The request acceptance status unit may be specifically used to receive a first message, decode the first message through the request acceptance information decoder, and obtain the address information of the first storage unit and the enable signal in the first message. The enable signal is used to indicate that the first access request has been accepted.
[0115] The request status unit stores the status information of each storage unit in at least one storage unit. Based on the fourth control information, it changes the request processing status of the first storage unit to a request invalid status. This status information is used to indicate the current status of the storage unit. It is understood that the request status unit can be understood from the aforementioned related descriptions, and will not be repeated here.
[0116] In this embodiment, the request acceptance status unit can, based on the acceptance of the first access request, instruct the request status unit to change the status of the first storage unit to an invalid request status via fourth control information. Thus, the request acceptance status unit and the request status unit can be used to change the status of the first storage unit, indicating that the first storage unit can be used to store access requests from users, and that the first access request has been accepted, through the invalid request status of the first storage unit.
[0117] In a third possible implementation, the request processing queue is further configured to send a first access request before receiving operation completion information; the address tag processing unit is further configured to receive the first access request and send a second message; the second message is configured to indicate that the first access request has not been accepted; the request processing queue is further configured to change the state of the first storage unit from the request processing state to the retransmission waiting state based on the second message; the request processing state is configured to indicate that the first access request has been sent to the address tag processing unit.
[0118] Sending the first access request before receiving the operation completion information can be understood as: after receiving the first access request from the user, sending the first access request to the address tag processing unit for the first time. And after sending the first access request to the address tag processing unit for the first time, the state of the first storage unit is the request processing state.
[0119] The second message may include the address information of the first storage unit; or, the second message may include the address information of the first storage unit and information indicating that the first access request was not accepted. It is understood that the second message is similar to the first message in the aforementioned case 1.1, except that the address tag processing unit sends the first and second messages at different times. The second message is sent by the address tag processing unit to the request processing queue when it first receives the first access request, while the first message is sent by the address tag processing unit to the request processing queue when it receives the first access request on subsequent occasions (such as the second, third, etc.). The second message can be understood by referring to the relevant content of the aforementioned first message, and will not be repeated here. The specific implementation of the address tag processing unit in determining whether to accept the first access request can be referred to the relevant description in the aforementioned case 1.1, and will not be repeated here.
[0120] In this embodiment, after the request processing queue sends a first access request to the request processing queue for the first time, and if the address tag processing unit does not accept the first access request, the address tag processing unit indicates to the request processing unit via a second message that the first access request has not been accepted. This causes the request processing queue to change the state of the first storage unit from the request processing state to the retransmission waiting state, so that the first access request can wait for retransmission again. Thus, even if the first access request is not accepted, changing the state of the first storage unit to the retransmission waiting state can make the first access request wait for retransmission.
[0121] In a third possible implementation, the request processing queue may further include: a request acceptance status unit and a request status unit. The request acceptance status unit and the request status unit are connected.
[0122] The request acceptance status unit is used to send fifth control information based on the second message; the fifth control information is used to instruct the state of the first storage unit to be changed to a retransmission waiting state. The request acceptance status unit can be referred to the relevant description in Case 1.1 above, and will not be repeated here.
[0123] The request status unit is used to store the status information of each storage unit in at least one storage unit. Based on the fifth control information, the request processing status of the first storage unit is changed to the retransmission waiting status. The status information is used to indicate the current status of the storage unit.
[0124] The specific implementation of changing the request processing status of the first storage unit to the retransmission waiting status is similar to the specific implementation of changing the status of the first storage unit from the request processing status to the retransmission waiting status in the aforementioned case 1.1. The difference is that in the third possible implementation, the request processing queue sends the first access request to the address tag processing unit for the first time, that is, the address tag processing unit does not accept the first access request for the first time. In other words, the status of the first storage unit before the status change is the request processing status. In the aforementioned case 1.1, the request processing queue retransmits the first access request (i.e., not the first time) to the address tag processing unit, that is, the address tag processing unit does not refuse the first access request for the first time. The similarities can be referred to each other, and will not be repeated here.
[0125] In a third possible implementation, the request processing queue can also be used to receive a first access request from the user before receiving the second message; store the first access request in a first storage unit and change the state of the first storage unit from an invalid request state to a valid request state; send the first access request to the address tag processing unit and change the state of the first storage unit from a valid request state to a request processing state.
[0126] The invalid request status is used to indicate that no access request is stored in the first storage unit, that is, the access request previously stored in the first storage unit has been accepted by the address tag processing unit.
[0127] The request valid status is used to indicate that the first access request stored in the first storage unit can be sent for the first time.
[0128] In this embodiment of the application, after receiving a first access request from a user, the request processing queue can store and send the first access request, and change the state of the first storage unit at different stages to indicate the state of the first access request through the state of the first storage unit.
[0129] Furthermore, the request processing queue may also include: a request receiving control unit, a request status unit, and a request arbitration unit. The request receiving control unit and the request status unit are connected to the storage array. The request arbitration unit is connected to the request status unit and the storage array.
[0130] The request receiving control unit is configured to receive a first access request from a user, store the first access request in a first storage unit, and send a sixth control message; the sixth control message is configured to instruct the state of the first storage unit to be changed to a request valid state.
[0131] Specifically, the request receiving control unit can be used to determine a first storage cell in the storage array that is in an invalid request state, and store the first access request from the user into the first storage cell. In other words, after receiving an access request from the user, the request receiving control unit can be used to determine a free storage cell (i.e., a storage cell in an invalid request state) in the storage array and store the access request. Furthermore, the request receiving control unit can use a fair round-robin algorithm or other random methods to determine the free storage cell. In addition, the request receiving control unit can also be used to back-push the access request from the user when there is no free storage cell in the storage array, and to store the access request into the free storage cell when a free storage cell exists in the storage array.
[0132] For example, such as Figure 5 As shown, the request receiving control unit includes an idle location detector and an access request storage queue, which stores access requests from users (i.e., Figure 5 The system inputs an access request into the access request queue and inputs the status information of each storage unit into the idle location detector. The idle location detector decodes the status information of each storage unit and determines whether there are any storage units in an invalid request state. If there are any storage units in an invalid request state, it outputs an idle storage unit enable signal to the access request queue. If there is an access request in the access request queue, it outputs the access request (i.e., ...) to the idle location detector. Figure 5 The system sends an access request and the address information of an available storage unit to the storage array, and sends the status information of the storage unit to the request status unit. The address information is used to indicate the location of the storage unit in the storage array.
[0133] The request status unit is used to store the status information of each storage unit in at least one storage unit. Based on the sixth control information, the status of the first storage unit is changed from the request invalid status to the request valid status. The status information is used to indicate the current status of the storage unit.
[0134] The arbitration request unit is used to send a first access request to the address tag processing unit and send a seventh control information when the first storage unit is in the request valid state; the seventh control information is used to instruct the state of the first storage unit to be changed to the request processing state.
[0135] In some possible implementations, the request arbitration unit can also be used to prioritize sending access requests from storage units in the retransmission valid state when at least one storage unit includes storage units in the request valid state and storage units in the retransmission valid state.
[0136] It is understandable that the requesting arbitration unit can refer to the relevant introduction in the first possible implementation mentioned above, which will not be repeated here.
[0137] The aforementioned request status unit is also used to change the status of the first storage unit from a request valid state to a request processing state based on the seventh control information. It is understood that the request status unit can be understood by referring to the aforementioned related descriptions, and will not be repeated here.
[0138] In this embodiment, the request receiving control unit stores the first access request in a first storage unit that is in an invalid request state, and the request status unit changes the status of the first storage unit to a valid request state. This enables the request arbitration unit to send the first access request from the first storage unit based on the valid request state. After sending the first access request, the request status unit changes the status of the first storage unit to a request processing state, indicating the current status of the first access request. Thus, the storage and transmission of the first access request can be achieved through the request receiving control unit, the request status unit, and the request arbitration unit.
[0139] In a fourth possible implementation, the address tag processing unit is further configured to send a third message indicating that a second access request has been accepted, the second access request being at least one access request and being the first access request sent to the address tag processing unit; the request processing queue is further configured to, based on the third message, change the state of a second storage unit in at least one storage unit from a request processing state to a request invalid state, the second storage unit being used to store the second access request, the request processing state being used to indicate that a second access request has been sent to the address tag processing unit, and the request invalid state being used to indicate that no access request is stored in the second storage unit.
[0140] The third message may include the address information of the second storage unit and acceptance information, which indicates that the access request (i.e., the second access request) in the storage unit corresponding to the address information has been accepted. Alternatively, the third message may include the address information of the second storage unit and information indicating that the second access request has been accepted. The third message is similar to the first message in the aforementioned case 1.2, and the similarities can be referred to each other, so they will not be repeated here. The address tag processing unit may be specifically used to compare the address tag in the second access request with the address tags of each cache line; determine the cache line corresponding to the request address tag, the current state of the cache line is not in a processing state, or there is no cache line address tag that matches the request address tag, and send the aforementioned third message. The address tag processing unit can be understood with reference to the relevant introduction in the aforementioned case 1.1, so it will not be repeated here.
[0141] The request processing queue can be specifically used to determine that a second access request has been accepted based on acceptance information carried in a third message (or information indicating that a second access request has been accepted), and to change the state of the second storage unit from the request processing state to the request invalid state.
[0142] Furthermore, the specific implementation of changing the state of the second storage unit from the request processing state to the request invalid state when the second access request is accepted is similar to the specific implementation of changing the state of the first storage unit from the resend valid state to the request invalid state when the first access request is accepted in the aforementioned situation 1.2. The similarities can be referred to each other, and will not be repeated here.
[0143] In this embodiment, after the request processing queue sends the second access request for the first time, and the address tag processing unit accepts the second access request, the address tag processing unit indicates to the request processing unit via a third message that the second access request has been accepted, causing the request processing queue to change the state of the second storage unit to an invalid request state. Thus, by changing the state of the second storage unit when the second access request is accepted, the second storage unit can be used to store access requests from users.
[0144] In a fourth possible implementation, the request processing queue may further include: a request acceptance status unit and a request status unit. The request acceptance status unit and the request status unit are connected.
[0145] The request acceptance status unit is used to send an eighth control message based on a third message, which instructs the status of the second storage unit to be changed to a request invalid status.
[0146] The request acceptance status unit can be specifically used to determine that the second access request has been accepted based on the acceptance information (or information used to indicate that the second access request has been accepted) carried in the third message, and if the second access request has been accepted, to send the eighth control information to the request status unit to change the status of the second storage unit to the request invalid status.
[0147] The request status unit is used to store the status information of each storage unit in at least one storage unit. Based on the eighth control information, the request processing status of the second storage unit is changed to the request invalid status. This status information is used to indicate the current status of the storage unit.
[0148] It is understood that the request acceptance status unit and the request status unit can be referred to in the aforementioned relevant introduction, and will not be repeated here.
[0149] In this embodiment, the request acceptance status unit can, based on the acceptance of the second access request, instruct the request status unit to change the status of the second storage unit to a request invalid status via the eighth control information. Thus, the request acceptance status unit and the request status unit can be used to change the status of the second storage unit, indicating that the second storage unit can be used to store access requests from users, and that the second access request has been accepted, through the request invalid status of the second storage unit.
[0150] Furthermore, in this embodiment, the request processing queue can also be used to receive a second access request from the user before receiving the third message; store the second access request in a second storage unit and change the state of the second storage unit from an invalid request state to a valid request state; send a first access request to the address tag processing unit and change the state of the first storage unit from a valid request state to a request processing state. It is understood that the specific implementation of storing and sending the second access request in the request processing queue is similar to the specific implementation of storing and sending the first access request in the third possible implementation described above, and can be understood by referring to the aforementioned related descriptions, which will not be repeated here.
[0151] Optionally, in conjunction with the above embodiments, such as Figure 6 As shown, the above cache structure may further include: a request operation queue (ROQ), an external memory write-read control (EXTWR_CTRL) unit, and a cache data processing (DP) unit. The request operation queue is connected to the address tag processing unit, the external memory write-read control unit, and the cache data processing unit.
[0152] The request processing status queue stores the request processing results sent by the address tag processing unit, and generates corresponding status signals based on these results to control the tasks that each access request needs to complete at each stage. This request processing result information can include whether the access request was successful, whether a cache line of data needs to be evicted, etc.
[0153] For example, the address tag processing unit receives write request #1 and determines that write request #1 has missed. In this case, it needs to find an empty location in the cache to store the data to be written in write request #1. If there is no empty location in the cache, the data of a cache line needs to be evicted to the external storage unit, and the cache line is used to write the data to be written. At this time, the address tag processing unit can send the information of the cache line whose data needs to be evicted and the data to be written to the request processing status queue. After receiving the information and the data to be written, the request processing status queue can generate a corresponding status signal to evict the data from the cache line and write the data to be written to the cache line.
[0154] The external storage unit read / write control unit is used to control the read and write operations of the cached external storage units. For example, it sends a read signal to the external storage unit or sends a write signal to write data to the external storage unit. After the external storage unit completes the corresponding operation, the external storage unit read / write control unit can send a read / write completion signal to the request processing status queue. Upon receiving the read / write completion signal, the request processing status queue can either write the data read from the external storage unit to the static random-access memory (SRAM) in the cached data processing unit, or send a corresponding write return control signal.
[0155] The cached data processing unit receives read / write control information from the request processing status queue and performs corresponding read / write operations based on this information. The cached data processing unit may include SRAM for storing cached data and a read / write controller for controlling the SRAM. The request processing status queue can send read / write internal SRAM control information to the cached data processing unit, which can then write data to or read data from the SRAM according to this information.
[0156] It is understood that, in the embodiments of this application, the various possible implementations described above can be combined arbitrarily. To better illustrate the state changes of the first storage unit (i.e., the first access request), the following is combined with... Figure 7 Taking access request #a as an example, we will use a specific example to illustrate the state changes of access request #a.
[0157] The user sends an access request #a to the request receiving control unit. After receiving the access request #a, the request receiving control unit can determine a storage unit (denoted as storage unit #a) that is in an invalid request state based on the status information of the storage units in at least one storage unit; store the access request #a in storage unit #a; and instruct the request status unit to change the status of storage unit #a from an invalid request state to a valid request state.
[0158] Based on the fact that storage unit #a is in a valid request state, the arbitration request unit sends the access request #a in storage unit #a to the address tag processing unit and instructs the request status unit to change the status of storage unit #a from the valid request state to the request processing state.
[0159] Upon receiving access request #a, the address tag processing unit can determine whether to accept the access request #a based on the actual situation. The following describes the scenarios where the address tag processing unit accepts access request #a and the scenarios where it does not accept access request #a.
[0160] Case 2.1: The address tag processing unit accepts access request #a.
[0161] In this scenario, the address tag processing unit sends message #1 to the request acceptance status unit. Message #1 includes the address information of storage unit #a in the storage array and acceptance information. Upon receiving message #1, the request acceptance status unit can determine, based on message #1, that the access request #a has been accepted by the address tag processing unit. At this point, the request acceptance status unit can instruct the request status unit to change the status of storage unit #a from the request processing status to the request invalid status.
[0162] Case 2.2: The address tag processing unit did not accept the access request #a.
[0163] In this scenario, the address tag processing unit sends message #2 to the request acceptance status unit. Message #2 includes the address information of storage unit #a in the storage array, but does not include acceptance information. Upon receiving message #2, the request acceptance status unit can determine that the access request #a has not been accepted by the address tag processing unit based on the absence of acceptance information in message #2. At this point, the request acceptance status unit can instruct the request status unit to change the status of storage unit #a from the request processing status to the retransmission waiting status.
[0164] After the state of storage unit #a is changed to retransmission waiting state, the address tag processing unit sends operation completion information #1 to the retransmission activation control unit. This operation completion information #1 indicates that the read / write operation of address #1 has been completed. Upon receiving the operation completion information #1, the retransmission activation control unit can compare the address tags corresponding to each storage unit in at least one storage unit with the address information of address #1 to determine that the access request #a, whose address tag matches that of address #1 and is in the retransmission waiting state, is in the retransmission waiting state. At this time, the retransmission activation control unit can instruct the request status unit to change the state of storage unit #a from the retransmission waiting state to the retransmission valid state.
[0165] Based on the fact that storage unit #a is in the retransmission valid state, the arbitration request unit resends the access request #a in storage unit #a to the address tag processing unit, and instructs the request status unit to change the status of storage unit #a from the retransmission valid state to the request processing state.
[0166] After receiving access request #a, the address tag processing unit can determine whether to accept the access request #a based on the actual situation.
[0167] If the address tag processing unit accepts access request #a, it can send message #3 to the request acceptance status unit. Message #3 includes the address information of storage unit #a in the storage array and acceptance information. After receiving message #3, the request acceptance status unit can determine that access request #a has been accepted by the address tag processing unit based on message #3. At this time, the request acceptance status unit can instruct the request status unit to change the status of storage unit #a from the request processing status to the request invalid status.
[0168] If the address tag processing unit does not accept access request #a, it can send message #4 to the request acceptance status unit. Message #4 includes the address information of storage unit #a in the storage array, but does not include acceptance information. Upon receiving message #4, the request acceptance status unit can determine that access request #a was not accepted by the address tag processing unit based on the absence of acceptance information in message #4. In this case, the request acceptance status unit can instruct the request status unit to change the status of storage unit #a from the request processing status to the retransmission waiting status, awaiting retransmission. It can be understood that the subsequent process for storage unit #a waiting for retransmission is the same as the process for retransmitting access request #a described above; please refer to the relevant content above for details, which will not be repeated here.
[0169] Based on the same inventive concept, this application also provides a chip including the cache structure described above. This chip includes, but is not limited to, a general-purpose computing on graphics processing units (GPGPU) chip, a central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), an accelerated processing unit (accelerated processing unit), a multimedia application processor (MAP), a microprocessor, etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0170] It is understood that in the embodiments of this application, the external storage unit can be located inside or outside the chip, and can be flexibly set according to the actual situation without limitation.
[0171] The cache structure provided in this application chip embodiment has the same implementation principle and technical effect as the aforementioned cache structure embodiment. For the sake of brevity, any parts not mentioned in the chip embodiment can be referred to the corresponding content in the aforementioned cache structure embodiment.
[0172] Based on the same inventive concept, embodiments of this application also provide an electronic device, including a body (i.e., a device body) and a cache structure as described above, or a chip as described above. This electronic device can be a mobile phone, computer, autonomous driving equipment for automobiles, artificial intelligence inference training equipment, etc.
[0173] It is understood that in the embodiments of this application, when the electronic device includes the body and the chip as described above, the external storage unit can be disposed within the chip, or the external storage unit can be disposed within the electronic device outside the chip. The specific configuration can be flexibly set according to the actual situation and is not limited.
[0174] The cache structure or chip provided in the electronic device embodiment of this application has the same implementation principle and technical effect as the aforementioned cache structure embodiment or chip embodiment. For the sake of brevity, any parts not mentioned in the electronic device embodiment can be referred to the corresponding content in the aforementioned cache structure embodiment or chip embodiment.
[0175] Based on the same inventive concept, this application also provides a request sending method, which can be applied to the above-described cache structure. The cache structure can be referred to the relevant descriptions in the foregoing cache structure embodiments, and will not be repeated here.
[0176] like Figure 8 As shown, the above request sending method includes:
[0177] S801, receive operation completion information.
[0178] Operation completion information indicates that read / write operations on the target address have been completed.
[0179] It is understood that in the aforementioned cache structure embodiment, the address tag processing unit sends the operation completion information to the request processing queue. The address tag processing unit and the request processing unit are different units within the cache structure. The cache structure receives operation completion information from external storage units.
[0180] S802, based on the operation completion information, a first access request whose access address matches the target address is matched from at least one access request, and the first access request is sent to the address tag processing unit.
[0181] The access address is the address requested in the first access request. The first access request is a resentment request awaiting retransmission. The address label processing unit is used to process the first access request.
[0182] Optionally, the above-mentioned matching of the first access request whose access address matches the target address from at least one access request based on operation completion information and sending the first access request to the address tag processing unit may specifically include: determining, based on the target address, a first access request whose address tag matches the target address and is in a retransmission waiting state among at least one access request; the address tag is used to indicate the address to be accessed by the access request, and the retransmission waiting state is used to indicate that the first access request is waiting to be sent again; changing the state of the first storage unit from the retransmission waiting state to the retransmission valid state, and sending the first access request to the address tag processing unit; the retransmission valid state is used to indicate that the first access request is retransmitted.
[0183] Optionally, the above method may further include: after sending the first access request to the address tag processing unit, changing the state of the first storage unit from a retransmission valid state to a request processing state; the request processing state is used to indicate that the first access request has been sent to the address tag processing unit.
[0184] Furthermore, the above method may also include: receiving a first access request and sending a first message; if the first message indicates that the first access request has not been accepted, changing the state of the first storage unit from the request processing state to the retransmission waiting state based on the first message.
[0185] Furthermore, the above method may also include: receiving a first access request and sending a first message; if the first message indicates that the first access request has been accepted, changing the state of the first storage unit from a request processing state to a request invalid state based on the first message; the request invalid state is used to indicate that no access request is stored in the first storage unit.
[0186] The request sending method provided in this application embodiment, its implementation principle and the resulting technical effects are the same as those described above. Figure 1 The cache structure embodiments shown are the same. For the sake of brevity, any parts not mentioned in the method embodiment can be referred to the corresponding content in the aforementioned cache structure embodiments, and will not be repeated here.
[0187] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0188] The above detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0189] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0190] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0191] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A cache structure, characterized in that, The cache structure includes: The address tag processing unit is used to send operation completion information; the operation completion information is used to indicate that the read / write operation of the target address has been completed. A request processing queue, connected to the address tag processing unit, is used to store at least one access request. Based on the target address, a first access request whose access address matches the target address is matched from the at least one access request, and the first access request is sent to the address tag processing unit. The access address is the address to be accessed by the first access request, and the first access request is an access request waiting to be resent. The request processing queue includes: A storage array, the storage array including at least one storage unit, wherein a first storage unit of the at least one storage unit is used to store the first access request; A retransmission activation control unit is configured to determine, based on the target address, the first access request in the at least one access request whose address tag matches the target address and is in a retransmission waiting state, and send first control information; the first control information is configured to instruct the state of the first storage unit to be changed to a retransmission valid state; A request status unit, connected to the retransmission activation control unit, is used to store the status information of each storage unit in the at least one storage unit, and based on the first control information, changes the status of the first storage unit from the retransmission waiting state to the retransmission valid state; the status information is used to indicate the current status of the storage unit; The arbitration request unit, connected to the request status unit and the storage array, is used to send the first access request to the address tag processing unit when the status of the first storage unit is a retransmission valid state.
2. The cache structure according to claim 1, characterized in that, The request processing queue is also used to change the state of the first storage unit from the retransmission valid state to the request processing state after sending the first access request to the address tag processing unit; the request processing state is used to indicate that the first access request has been sent to the address tag processing unit.
3. The cache structure according to claim 2, characterized in that... The request arbitration unit is further configured to send second control information after sending the first access request to the address tag processing unit; the second control information is configured to instruct the state of the first storage unit to be changed to the request processing state; The request status unit is also used to store the status information of each storage unit in the at least one storage unit, and based on the second control information, to change the status of the first storage unit from the retransmission valid status to the request processing status.
4. The cache structure according to claim 2, characterized in that, The address tag processing unit is also used to receive the first access request and send a first message; The request processing queue is also used to change the state of the first storage unit from the request processing state to the retransmission waiting state based on the first message, when the first message indicates that the first access request has not been accepted.
5. The cache structure according to claim 4, characterized in that, The request processing queue also includes: A request acceptance status unit is used to send third control information based on the first message; the third control information is used to instruct the state of the first storage unit to be changed to the retransmission waiting state. The request status unit, connected to the request acceptance status unit, is also used to store the status information of each storage unit in the at least one storage unit, and to change the status of the first storage unit from the request processing status to the retransmission waiting status based on the third control information; the status information is used to indicate the current status of the storage unit.
6. The cache structure according to claim 2, characterized in that, The address tag processing unit is also used to receive the first access request and send a first message; The request processing queue is further configured to, upon the first message indicating that the first access request has been accepted, change the state of the first storage unit from the request processing state to the request invalid state based on the first message; the request invalid state is used to indicate that no access request is stored in the first storage unit.
7. The cache structure according to claim 6, characterized in that, The request processing queue also includes: The request acceptance status unit is used to send fourth control information based on the first message; the fourth control information is used to instruct the status of the first storage unit to be changed to the request invalid status; The request status unit, connected to the request acceptance status unit, is also used to store the status information of each storage unit in the at least one storage unit, and to change the request processing status of the first storage unit to the request invalid status based on the fourth control information; the status information is used to indicate the current status of the storage unit.
8. The cache structure according to claim 1, characterized in that, The request processing queue is also used to send the first access request before receiving the operation completion information; The address tag processing unit is further configured to receive the first access request and send a second message; the second message is configured to indicate that the first access request has not been accepted. The request processing queue is also used to change the state of the first storage unit from the request processing state to the retransmission waiting state based on the second message; The request processing status is used to indicate that the first access request has been sent to the address tag processing unit.
9. The cache structure according to claim 8, characterized in that, The request processing queue also includes: The request acceptance status unit is used to send fifth control information based on the second message; the fifth control information is used to instruct the state of the first storage unit to be changed to the retransmission waiting state; The request status unit, connected to the request acceptance status unit, is also used to store the status information of each storage unit in the at least one storage unit, and to change the request processing status of the first storage unit to the retransmission waiting status based on the fifth control information; the status information is used to indicate the current status of the storage unit.
10. The cache structure according to claim 8, characterized in that, The request processing queue is further configured to receive the first access request from the user before receiving the second message; store the first access request in the first storage unit and change the state of the first storage unit from the request invalid state to the request valid state; send the first access request to the address tag processing unit and change the state of the first storage unit from the request valid state to the request processing state; The invalid request status indicates that no access request is stored in the first storage unit, while the valid request status indicates that the first access request stored in the first storage unit can be sent for the first time.
11. The cache structure according to claim 10, characterized in that, The request processing queue also includes: A request receiving control unit is configured to receive the first access request from the user, store the first access request in the first storage unit, and send sixth control information; the sixth control information is configured to instruct the state of the first storage unit to be changed to the request valid state. The request status unit is connected to the request receiving control unit and is also used to store the status information of each storage unit in the at least one storage unit. Based on the sixth control information, the status of the first storage unit is changed from the request invalid status to the request valid status. The status information is used to indicate the current status of the storage unit. The request arbitration unit is further configured to send the first access request to the address tag processing unit and send seventh control information when the first storage unit is in the request valid state; the seventh control information is used to instruct the state of the first storage unit to be changed to the request processing state. The request status unit is further configured to change the status of the first storage unit from the request valid status to the request processing status based on the seventh control information.
12. The cache structure according to claim 1, characterized in that, The address tag processing unit is also used to send a third message; the third message indicates that a second access request has been accepted, the second access request belongs to the at least one access request, and the second access request is the first access request sent to the address tag processing unit; The request processing queue is also used to change the state of the second storage unit in the at least one storage unit from the request processing state to the request invalid state based on the third message; the second storage unit is used to store the second access request, the request processing state is used to indicate that the second access request has been sent to the address tag processing unit, and the request invalid state is used to indicate that no access request is stored in the second storage unit.
13. The cache structure according to claim 12, characterized in that, The request processing queue also includes: The request acceptance status unit is used to send eighth control information based on the third message; the eighth control information is used to instruct the status of the second storage unit to be changed to the request invalid status; The request status unit, connected to the request acceptance status unit, is also used to store the status information of each storage unit in the at least one storage unit, and to change the request processing status of the second storage unit to the request invalid status based on the eighth control information; the status information is used to indicate the current status of the storage unit.
14. The cache structure according to claim 1, 3, or 11, characterized in that, The request arbitration unit is further configured to, when the at least one storage unit includes a storage unit in a request valid state and a storage unit in a retransmission valid state, prioritize sending the access request from the storage unit in the retransmission valid state.
15. A chip, characterized in that, It includes a cache structure as described in any one of claims 1-14.
16. An electronic device, characterized in that, It includes the body and the cache structure as described in any one of claims 1-14, or the chip as described in claim 15.
17. A request sending method, characterized in that, Applied to the cache structure as described in any one of claims 1-14, the method comprises: Receive operation completion information; the operation completion information is used to indicate that the read / write operation of the target address has been completed; Based on the operation completion information, a first access request whose access address matches the target address is matched from at least one access request, and the first access request is sent to the address tag processing unit. The access address is the address that the first access request wants to access. The first access request is an access request waiting to be resent, and the address tag processing unit is used to process the first access request.
Citation Information
Patent Citations
Cache retry request queue
US20020078302A1
Methods and apparatus for detecting an address conflict
US20040153611A1