Read request merging method and system
Patent Information
- Application Number
- CN202611000316.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2026-01-30
- Filing Date
- 2026-07-07
- Publication Date
- 2026-09-22
AI Technical Summary
在多线程数据预处理任务中,线程之间交织的访存行为还可能破坏程序原有的空间局部性,使缓存机制难以发挥应有的加速效果
所述生成子模块用于当所述读请求集合满足触发条件时,基于该读请求集合,生成突发传输请求,所述突发传输请求的起始地址对齐至所述地址区间的起始地址;
Smart Images

Figure CN122802586A_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202610142907.4, filed on January 30, 2026, entitled "Method and System for Combining Read Requests". Technical Field
[0002] This invention relates to the field of computer architecture technology, and more specifically, to a method and system for merging read requests. Background Technology In modern high-performance computing systems, especially in applications such as training and inference of large artificial intelligence models, the data access of computing cores (such as CPUs, GPUs, or dedicated acceleration units) to the storage subsystem exhibits high concurrency and high dynamism. This access characteristic places higher demands on the multi-level cache architecture commonly used in computer architecture, particularly posing a significant challenge to the efficiency of data interaction between the L1 cache and the L2 cache.
[0003] like Figure 1 As shown, a traditional data access architecture typically consists of three parts: a data access subject, a communication medium, and a data storage medium. The data storage medium may or may not include a data cache medium. In this architecture, the data access subject sends a memory access request, such as a read or write request, to the communication medium. The communication medium routes and forwards the request, sending it to the corresponding data storage medium. The data storage medium then performs the data update or read operation based on the request and returns the updated response or the read data to the corresponding data access subject via the communication medium.
[0004] In the traditional architecture described above, the array access speed of modern storage devices is typically much lower than the data transfer rate of the communication medium. Furthermore, the granularity of data stored in the storage medium is usually larger than the granularity of the data involved in the memory access request, resulting in higher time and power consumption costs during memory access, leading to lower overall memory access efficiency and higher access latency. For these reasons, existing storage architectures typically incorporate cache devices inside or before the data storage medium to accelerate data access by leveraging the fast access speed, low latency, and small capacity of cache devices.
[0005] In the case of a single data access subject, the aforementioned caching devices can effectively improve memory hit rate and thus enhance system access efficiency due to the generally good temporal and spatial locality characteristics of program execution. However, in modern multi-core processors or multi-chip systems with multiple access subjects, the concurrent access requests generated by multiple data access subjects can easily exceed the capacity of the caching devices. When cache misses or cache thrashing occur, not only is it necessary to frequently reload data from the underlying storage medium, but it also incurs higher power consumption and time latency, resulting in a significant degrade in overall system performance.
[0006] like Figure 2 As shown, the data access process under the condition of concurrent access by multiple access subjects and limited cache capacity is schematically illustrated. Figure 2 On the right are two access entities: from right to left, a communication medium, a caching device, and a data storage medium. The data storage medium is located below the data stream of the caching device. The storage granularity of the data storage medium is a fixed-size data block S, and the data storage address range of the data storage medium is N×S. The caching device uses the data block S as the smallest caching and replacement granularity to cache data from the lower-level data storage medium, assuming that the caching device is initially full.
[0007] In this example, access subject 1 continuously issues m memory access requests S01 to S0m, all of which access addresses fall within the same data block S0; access subject 2 continuously issues m memory access requests S11 to S1m, all of which access addresses fall within a different data block S1. After passing through the communication medium, the access order of these requests from different access subjects is shuffled and interleaved before being sent to the cache device. Since the cache device is full, when access subject 2's request (such as S11) arrives, the existing data block S0 in the cache needs to be replaced, and data block S1 needs to be read from the lower-level data storage medium to refill the cache, thus completing the execution of access subject 2's request. This process consumes 4t on the storage side.
[0008] Subsequently, when the next request from access subject 1 (such as S02) arrives, since data block S1 is already stored in the cache, data block S1 still needs to be replaced, and data block S0 needs to be read from the lower-level data storage medium again for backfilling, thus completing the execution of the request. This process also consumes 4t. The above replacement and backfilling process is repeated continuously between the requests of the two access subjects. For a total of 2m memory access requests, the time overhead for data block swapping in and out on the storage side alone reaches m×8t.
[0009] It can be seen that under conditions of multiple concurrent accesses and limited cache capacity, since the cache device uses a data block S as the smallest unit of operation, and a single memory access request often only involves a portion of the data in that data block, the interleaved accesses of different data blocks by different accesses will cause data blocks already loaded into the cache to be frequently replaced before being fully utilized. This process results in the same data block being repeatedly loaded and swapped out from the lower-level data storage medium in a short period of time. A significant amount of system time and energy is consumed in data movement operations rather than in actual data access and processing, forming a typical cache thrashing problem.
[0010] In existing technologies, L1 Cache and L2 Cache typically communicate via standardized on-chip bus protocols, such as the AXI protocol. To improve bus bandwidth utilization, these protocols introduce burst transfer mechanisms to support multiple accesses to contiguous address spaces being merged into a single transfer. However, burst transfer mechanisms have strict requirements on the continuity of accessed addresses. Under real-world high-concurrency application loads, memory access requests from multiple computing cores are highly interleaved in timing, and their access addresses often exhibit discrete spatial distribution characteristics. This makes it difficult to naturally meet the triggering conditions for burst transfers, thus rendering this efficient transfer mechanism ineffective in most cases.
[0011] The aforementioned issues lead to significant performance degradation in various typical application scenarios. For example, during AI model inference, different computing cores may simultaneously process data from different network layers. Due to limited cache capacity, it is difficult to accommodate all required model parameters at the same time, resulting in frequent replacement of parameter data in the cache. Computing units need to repeatedly wait for data to be reloaded from the downstream storage system. In GPU parallel computing scenarios, the parallel access of multiple streaming multiprocessors to different data slices also causes the limited shared cache to frequently switch between multiple data blocks, increasing access latency and reducing the effective utilization of memory bandwidth. In multithreaded data preprocessing tasks, the interleaved memory access behavior between threads may also disrupt the original spatial locality of the program, making it difficult for the caching mechanism to achieve its intended acceleration effect.
[0012] In summary, under the objective hardware constraints of limited cache capacity, the unoptimized memory access data flow in traditional multi-level caching architectures struggles to simultaneously satisfy both the address contiguousness requirement for efficient data transmission and the spatial locality requirement for caching mechanisms. As the number of accessing entities increases, this contradiction is further amplified, limiting overall system performance improvement and restricting scalability. Therefore, how to more rationally organize and schedule memory access behavior between cache levels without altering existing standard communication protocols and cache hardware structures, in order to improve effective bandwidth utilization and alleviate cache thrashing issues, has become a pressing technical challenge in related fields. Summary of the Invention
[0013] To facilitate understanding of the technical problem to be solved by this invention and its technical effects, Figure 3 The illustrations show two different request arrangement effects resulting from organizing memory access requests. For example... Figure 3 As shown, in this arrangement, the memory access requests of multiple access subjects that were originally intertwined and mixed in the communication medium are presented as a request sequence with high address continuity before being sent to the data cache medium. After being routed through the communication medium, the memory access requests from the same access subject maintain their internal access order continuously and are not disrupted, so that multiple requests accessing the same cache line or the same large address range are relatively concentrated in time.
[0014] It should be noted that, Figure 3 The requested arrangement shown is only intended to illustrate one possible access effect achievable by organizing memory access requests, and does not limit the specific request ordering method or communication routing behavior. Existing communication media typically lack the ability to organize memory access requests in this way. However, this invention introduces a read request merging and splitting mechanism into the communication path, enabling a near-perfect access effect without altering existing standard communication protocols and cache hardware structures. Figure 3 The request arrangement shown effectively alleviates issues such as... Figure 2 The cache thrashing issue shown.
[0015] Specifically, the present invention provides a read request merging method and system. The method is set in the communication path between the data access subject and the data storage medium. By parsing and classifying multiple read requests from the data access subject, read requests with access addresses in the same address range and with the same request attributes are grouped into the same read request set.
[0016] Building upon this foundation, this invention generates burst transfer requests carrying address masks from the categorized read request set, enabling centralized and continuous access to previously scattered, small-granular memory access requests on the lower-level data storage medium. Specifically, firstly, read requests belonging to the same address range and possessing the same request attributes are grouped into the same read request set based on their access address and request attributes. An address mask is generated and updated to identify the specific location accessed by the read request set within that range. When the read request set meets a triggering condition, the starting address of its address range is used as the starting position of the burst transfer request, generating a burst transfer request. Finally, the generated burst transfer request is sent to the data storage medium. Through this method, original read requests from multiple access subjects are logically aggregated, address-aligned, and accessed to the data storage medium in a continuous sequence at the hardware level. This effectively reduces alternating access between different data blocks, lowers cache thrashing, and improves cache hit rate and system memory access efficiency.
[0017] In a first aspect, the present invention provides a read request merging method, characterized in that the method includes: Receive multiple read requests from a data access subject, wherein the read requests contain at least an access address and request attributes; Based on the access address and request attributes, read requests whose access addresses are within the same address range and have the same request attributes are grouped into the same set of read requests. Based on the access address of each read request in the read request set, an address mask is generated and updated. The address mask is used to identify the address locations accessed by the read request set within the address range. When the set of read requests meets the triggering condition, a burst transmission request is generated based on the set of read requests, and the starting address of the burst transmission request is aligned to the starting address of the address range. The burst transmission request carrying the address mask and the new request identifier is sent to the data storage medium.
[0018] Secondly, the present invention also provides a read request merging system, characterized in that the system includes: a data access subject, a decoding unit, a request merging arbitration module and a data storage medium, wherein the decoding unit includes a receiving module, a classification module and a masking module, and the request merging arbitration module includes a generation submodule and a sending submodule; The receiving module is used to receive multiple read requests from the data access subject, and the read requests include at least an access address and request attributes; The classification module is used to classify read requests whose access addresses are in the same address range and have the same request attributes into the same set of read requests based on the access address and request attributes. The mask module is used to generate and update an address mask based on the access address of each read request in the read request set. The address mask is used to identify the address positions accessed by the read request set within the address range. The generation submodule is used to generate a burst transmission request based on the read request set when the read request set meets the triggering condition. The starting address of the burst transmission request is aligned to the starting address of the address range. The sending submodule is used to send the burst transmission request carrying the address mask to the data storage medium.
[0019] The read request merging method and system provided by this invention: First, without altering existing communication protocols and cache hardware structures, this invention effectively improves the address continuity of lower-level storage access. It introduces a read request merging mechanism between the data access subject and the data storage medium, aggregating multiple small-granularity read requests with the same address range and identical request attributes into a single read request set. Based on this set, a burst transmission request aligned to the starting address of the address range is generated. This transforms the previously interleaved and spatially discrete memory access requests into a sequential access sequence with contiguous addresses on the lower-level data storage medium, effectively triggering and utilizing the burst transmission mechanism supported by existing bus protocols, thereby improving bus bandwidth utilization.
[0020] Second, by using an address mask to represent the actual access address, the complete preservation of access semantics is achieved. This invention introduces an address mask while generating burst transmission requests to accurately identify the actual address location accessed by the read request set within the corresponding address range. Even if the original read requests in the read request set are discontinuously distributed within the address range, their access range can still be accurately expressed through the address mask. This allows for the combined access of multiple discrete read requests without introducing redundant data access, while maintaining the access semantics of each original read request.
[0021] Third, this invention significantly reduces the probability of cache thrashing in scenarios with multiple concurrent accesses. In scenarios with multiple concurrent accesses and limited cache capacity, traditional memory access methods easily lead to frequent replacement of different data blocks in the cache, causing cache thrashing. This invention merges multiple read requests within the same address range, making accesses to the same or adjacent data blocks more concentrated in time, reducing the number of alternating accesses between different data blocks, thereby reducing the probability of data blocks in the cache being replaced prematurely and effectively mitigating cache thrashing.
[0022] Fourth, this invention improves cache hit rate and reduces overall system memory access latency and energy consumption. Because access to lower-level data storage media is more concentrated and continuous, this invention reduces redundant loading and backfilling operations of data blocks between cache levels, lowering the time overhead and energy consumption caused by data movement. Under the same memory access load, it can effectively improve cache hit rate and shorten the average access latency on the memory access path, thereby improving the overall system memory access efficiency.
[0023] Fifth, this invention is applicable to typical application scenarios with high concurrency and discrete address distribution, possessing good versatility and scalability. This invention does not rely on a specific number of access subjects, specific application load, or specific cache structure, and can be applied to application scenarios with multiple access subjects and concurrency, such as multi-core processors, GPUs, and dedicated accelerators. By configuring the triggering conditions, address range size, and maintenance quantity of the read request set, it can flexibly balance access latency and bandwidth utilization under different system scales and load characteristics, possessing good versatility and scalability. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a traditional data access architecture diagram; Figure 2 This is a schematic diagram of the data flow in a traditional data access architecture under multiple access subjects; Figure 3 These are two diagrams illustrating the arrangement of memory access requests after being organized. Figure 4 This is a flowchart of the read request merging method provided in an embodiment of the present invention; Figure 5 This is a data access architecture diagram provided in an embodiment of the present invention; Figure 6 This is a block diagram of the read request merging system provided in an embodiment of the present invention. Detailed Implementation
[0026] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Invention Overview As mentioned above, the present invention provides a read request merging method and system, which classifies and merges multiple memory access requests from data access subjects according to access address and request attributes, and sends them to the data storage medium in a burst transmission manner, thereby improving memory access continuity, reducing cache thrashing and improving system memory access efficiency without changing the access semantics.
[0028] Exemplary methods Figure 4This is a flowchart of a read request merging method provided in an embodiment of the present invention. This method is applied between a data access subject and a data storage medium, and is particularly optimized for read requests originating from the data access subject. In this embodiment, the data access subject can be a Level 1 cache (L1 Cache), and correspondingly, the data storage medium includes a Level 2 cache (L2 Cache). It is understood that the method described in this invention is also applicable to other memory access architectures with similar hierarchical or master-slave relationships. For example, the data access subject can also be a CPU core, a Direct Memory Access Controller (DMAController), or a loading / storage unit of a graphics processing unit (GPU); correspondingly, the data storage medium can include lower-level caches (such as L3 Cache), memory controllers, or local memory of accelerators. The method improves overall memory access efficiency by optimizing the read request flow between the two.
[0029] This embodiment includes the following steps: S101: Receive multiple read requests (Single Request) from the data access subject.
[0030] The read request includes the access address, request attributes, and original request identifier.
[0031] After receiving the read request in S101, the method further includes a parsing step: Multiple read requests from the data access subject are parsed to obtain the access address, request attributes, and original request identifier of the read requests.
[0032] S102: Based on the access address and request attributes, read requests whose access addresses are in the same address range and have the same request attributes are grouped into the same set of read requests.
[0033] The size of the address range is one of 2KB, 1KB, 512B or 256B; The size of the address range can be a fixed value or it can be configured according to the merged quantity threshold (the maximum number of read requests in the read request set).
[0034] For example, the actual merged address range is jointly controlled by an address mode (addr_mode) signal and a maximum merge number (max_merge) signal. When addr_mode is configured to a first mode (e.g., 0), the merge operation is fixedly performed within a large address range (e.g., 2KB), and in this case, max_merge is only used to set the maximum number of requests allowed to be merged within this range. When addr_mode is configured to a second mode (e.g., 1), the address range of the merge operation is dynamically determined by the value of max_merge: for example, if max_merge is configured to 0, the address range is 2KB; if configured to 1, the address range is 1KB; if configured to 2, the address range is 512B; if configured to 3, the address range is 256B.
[0035] In conclusion, in the first mode (addr_mode is 0), merging is constrained within a fixed large address range (e.g., 2KB), and adjusting max_merge mainly affects the accumulated number of requests and waiting time within this range. This mode is suitable for improving the collection capability for scattered access requests by relaxing the merging range, thereby maximizing the merging ratio and bus bandwidth utilization. In the second mode (addr_mode is 1), the address range itself is dynamically mapped and determined by the value of max_merge (e.g., 0 corresponds to 2KB, 1 corresponds to 1KB, etc.), which realizes linked control of the merging range and the number of requests. This mode allows selecting a small range (e.g., 256B) when access locality is extremely high to strictly limit the merged data neighborhood, thereby avoiding reading invalid data, and may trigger transmission faster due to the reduced range, which is beneficial for reducing latency and power consumption.
[0036] In order to effectively manage read request sets, the method further comprises: maintaining a data structure (corresponding to an entry in hardware implementation) for each current read request set respectively, wherein the data structure stores including but not limited to the following information: Feature Identifier (Tag): configured to uniquely identify the read request set, the value of which is a combination of an address interval corresponding to the read request set (that is, a 2KB, 1KB, 512B or 256B aligned block to which access addresses of all read requests in the read request set belong) and request attributes of the read request set, so as to indicate the address interval range and request attribute conditions that all read requests processed by the current read request set must satisfy.
[0037] Address Mask (Addr Mask): for example, a bitmap, which specifically identifies which specific address sub-blocks (e.g., 128-byte sub-blocks) within the address interval to which the read request set belongs that the access addresses of the read requests in the read request set are located on.
[0038] Merge Number: A counter value that records the actual number of read requests that have been included in this read request set. For example, this number can range from 0 to 15, where 0 indicates that the read request set currently contains only 1 read request. In hardware implementations, a valid entry with only one read request and an invalid empty entry can be distinguished by a separate entry validity bit or a similar status flag.
[0039] The original request identifier for each read request: An identifier list (Original Request Identifier List) is used to store the original request identifiers (Original Request IDs, Original RIDs) of all read requests within the set, ordered from lowest to highest access address. In the hardware implementation, this list may correspond to a fixed number of slots (e.g., 16), with each slot storing one original request identifier. For a special set of multiple read requests that have the exact same access address and attributes, the identifier list is used to store the distinct original request identifiers of each read request in the order they are received.
[0040] Specifically, S102 can be implemented in the following way: compare the access address and request attributes of the new read request with the address range and request attributes of the current read request set; if they match, classify the new read request into the matching read request set; if they do not match, it indicates that the new read request belongs to a new address range or has new request attributes, and a new read request set needs to be created for it.
[0041] S103: While generating and maintaining the read request set, dynamically generate and update the address mask based on the access address of each read request in the read request set.
[0042] The address mask is used to identify the address locations visited by the set of read requests within the address range.
[0043] Preferably, the address mask is a bitmap, where each bit in the bitmap corresponds to an address sub-block (i.e., the smallest access unit) within the address range. The value of the bit (e.g., "1" or "0") indicates whether the corresponding address sub-block is accessed by any read request in the read request set. When an address sub-block is accessed by any read request, its corresponding mask bit is set.
[0044] For example, in one specific implementation, the size of the address sub-block is 128 bytes. The purpose of the address mask is to indicate which specific 128-byte sub-blocks within the address range the multiple merged read requests need to access.
[0045] To facilitate understanding, let's illustrate the address mask generation process with an example. Assume the address range is 2KB in size and each sub-block is 128 bytes. The address mask would then be a 16-bit bitmap (2KB / 128B = 16). Initially, all bits in the bitmap are "0". When the first read request accessing the third 128-byte sub-block (relative address 384 bytes) within this range is assigned to this set, the third bit (counting from bit 0) of the bitmap is set to "1". Subsequently, when another read request accessing the tenth sub-block within this range is assigned, the tenth bit of the bitmap is also set to "1". At this point, the address mask value indicates that the current read request set has already accessed the third and tenth sub-blocks within the 2KB range. This address mask will be dynamically updated as new read requests are added.
[0046] When processing burst transmission requests, downstream data storage media only needs to return a continuous stream of response data according to the protocol. On the data return path, the specific sub-blocks initially requested can be accurately extracted from the continuous response data stream based on this address mask. This invention overcomes the rigid constraint of address continuity imposed by traditional merging, significantly improving the transmission density of effective data and bus bandwidth utilization while ensuring protocol compatibility, and avoiding the additional latency and power consumption caused by reading and transmitting large amounts of invalid data.
[0047] S104: When the set of read requests meets the triggering condition, a burst request is generated based on the set of read requests. The starting address of the burst request is aligned to the starting address of the address range (e.g., 2KB, 1KB, 512B, etc.) to meet the requirement of the AXI bus protocol that burst transfers need to access consecutive addresses.
[0048] Setting the starting address of a burst transfer request to the starting address of its corresponding address range ensures strict mapping consistency with the bitmap definition of the address mask. Each bit in the address mask corresponds to a sub-block of addresses arranged sequentially starting from the starting address of the range. If the starting address of a burst transfer request is set to the smallest address within the read request set or another non-boundary address, the order of the returned response data stream will be offset from the predetermined bit order of the address mask. This requires additional dynamic calculations to realign the data and mask bits, increasing hardware complexity and processing latency. Using a fixed starting address of the address range as a baseline ensures that the mapping from address to mask bits and then to the returned data location is static and deterministic throughout the entire path from address classification, mask generation to data extraction, simplifying control logic and hardware implementation.
[0049] The protocol transfer length of this burst transfer request must be set to a value that covers the range of all set addresses in the address mask to ensure that the target data of all merged read requests can be accessed. For example, if the address mask of the read request set indicates that it needs to access discrete 1st, 3rd, and 5th 128-byte sub-blocks within a 2KB interval, then the starting address of the burst transfer request is the header of that 2KB interval, and its protocol transfer length must be set to at least 6 (to cover the continuous range from the 0th sub-block to the 5th sub-block).
[0050] The number of bits set in the address mask equals the actual number of valid read requests merged into the read request set. This number serves as the basis for internal management (such as determining trigger conditions). The protocol transmission length is a physical parameter calculated based on this mask to satisfy the requirements of continuous bus access. The ultimate function of the address mask is to accurately filter out specific data sub-blocks corresponding to these valid requests from the complete continuous data stream returned based on this length.
[0051] Specifically, S104 further includes allocating a new request identifier to the burst transmission request; associating and storing the correspondence between the original request identifiers (i.e., the original request identifier list) of each read request in the read request set and the address positions identified by the address mask with the new request identifier. More specifically, the above association and storage operation can be implemented through a hardware request identifier mapping table (RID Entry). The structure of the request identifier mapping table is defined by key parameters: the request identifier mapping table has 512 entries, corresponding to the allocation range of new request identifiers (RID Range, 0~511); the depth of each entry is 16, indicating that each entry can hold 16 original request identifiers; and / or the width of each entry is 11 bits, i.e., the bit width (ID Width) of the original request identifier.
[0052] To illustrate this more clearly, the structure of the request identifier mapping table is described as follows: It has a total depth of 512 entries, corresponding one-to-one with the allocation range (0~511) of the new request identifiers. When performing a lookup or write operation, the allocated new request identifier serves as an index address (Select) directly pointing to the corresponding entry. Each entry has a fixed width, for example, 11 bits, used to store one original request identifier. Simultaneously, each entry has the capacity to store multiple original request identifiers, with a depth of 16. This means that each entry can store a maximum of 16 original request identifiers, which corresponds precisely to the maximum number of read requests that a read request set can accommodate.
[0053] The writing rule is as follows: When a burst request and all possible bypass requests (i.e., requests that do not enter the read request set and need to be sent directly) are about to be sent, a new request identifier (New RID) is uniformly reassigned within the range of 0 to 511. Subsequently, using this new request identifier as the index address (Select), all the original request identifiers stored in the identifier list (Id List) of the read request set corresponding to the burst request are sequentially written into the table entry of the request identifier mapping table indexed by the new request identifier.
[0054] That is, using the new request identifier as an index, the original request identifier of each read request is stored in the request identifier mapping table.
[0055] As mentioned earlier, generating a burst transmission request requires meeting a triggering condition. The triggering condition is: First, the number of read requests in the read request set reaches a predetermined merging threshold, wherein the predetermined merging threshold is a configurable parameter, specifically 2, 4, 8, or 16; and / or Secondly, since the creation of the read request set, the waiting time of the read request set has reached a predetermined time threshold. Specifically, the implementation of this invention is to open an independent time window for each newly created read request set and start timing, for example, the initial duration of the time window can be configured to 16 clock cycles. By configuring different durations, a flexible trade-off can be made between merging efficiency (waiting for more read requests) and request latency (sending as soon as possible). If the timing expires, the read request set is immediately considered to have met the triggering condition. This timing function can be implemented by maintaining an independent counter for each read request set, which starts counting after the read request set is created, and its count value represents the waiting time.
[0056] In actual operation, multiple read request sets may simultaneously meet the triggering conditions. In this case, according to a predetermined selection strategy, one set of read requests that meets the triggering conditions is selected (arbitrated) (e.g., the oldest set in an age-based mode, or the set with the most requests in a read request-based mode). A burst transmission request is then generated and sent based on the selected set. Since hardware design typically only has one request sending port or channel, to avoid conflicts and ensure the deterministic sending order, only one burst transmission request can be processed and sent at a time. Therefore, arbitration is required to select the set with the highest priority.
[0057] The selection strategy can be determined based on the waiting time, age information, and / or the number of read requests contained in each read request set (Merge Number). For example, it can be configured to use either age information or the number of read requests as the primary priority criterion. This corresponds to a configurable priority mode in the hardware: when the priority mode is configured as 0 (prio_mode=0), the selection strategy is based on age information; when the priority mode is configured as 1 (prio_mode=1), the selection strategy is based on the number of read requests. Another example is to calculate a weighted score based on the waiting time, age information, and number of read requests for each read request set, and then use this score to determine which read request set to prioritize.
[0058] The age information is a dynamically managed value that reflects the timeliness of access or updates to each read request set. Maintaining the age information facilitates the identification of which read request sets have not been updated for a long time. The specific maintenance rules are as follows: When a read request set is assigned a new read request, its age information is reset to its initial value (e.g., 0). At the same time, the age information of all other read request sets whose original age information value is less than that of the original age information of the read request set is incremented by one.
[0059] For example, suppose there are three read request sets with age information values of A=2, B=1, and C=0 respectively (in this scenario, the larger the age value, the longer the set has not been assigned a new read request, i.e., the older it is). If a new request is assigned to read request set B, then according to the rules: the age information of set B is reset to 0; find all other read request sets whose original age information is less than the original age information (1) of set B, i.e., read request set C(0), and increment its age information by one to 1. Finally, the age information of the three read request sets is updated to A=2, B=0, and C=1. After the update, the order of the age information still correctly reflects the relative newness of the read request sets: B(0) is the newest, C(1) is the next newest, and A(2) is the oldest.
[0060] Incrementing only the set of read requests with smaller original age values by one essentially implements an efficient pseudo-Least Recently Used (LRU) or aging algorithm. Compared to the simple rule of incrementing all other read request sets by one, it offers significant technical advantages: this method stabilizes the age values within a finite range (e.g., 0 to N-1, where N is the total number of sets), making the age value directly and uniquely represent the set's rank in the global new / old sequence. Furthermore, the hardware can instantly identify the least accessed set (i.e., the one with the largest age value) with minimal overhead (e.g., simply by comparing values), enabling efficient and deterministic decisions when eviction or arbitration is required. This is crucial for achieving low-latency, high-throughput cache access control.
[0061] The present invention aligns the starting address to the starting address of the address range corresponding to the read request set, and identifies the address location actually accessed within the address range through an address mask. Thus, without changing the original read request access semantics, multiple scattered read requests can be sent to the data storage medium in a single aligned burst transmission form.
[0062] S105: Send the burst transmission request carrying the address mask to the data storage medium.
[0063] Specifically, in addition to carrying the address mask, the burst transmission request also carries the new request identifier, and the address mask and the new request identifier are sent together as a user-defined field (User Bit) attached to the burst transmission request.
[0064] After S105 sends the read request, the method also includes a corresponding data return and processing flow, the specific steps of which are as follows: The system receives a response data stream organized in burst mode from the data storage medium. This response data stream is a continuous data stream organized by the data storage medium according to the received burst transmission request, using the starting address and protocol transmission length of the corresponding burst transmission request. The response data stream carries the new request identifier. Based on the new request identifier, the system retrieves the stored list of original request identifiers and their correspondence with address locations from the request identifier mapping table (RID Entry). Based on the address mask, the system extracts the valid data portion from the response data stream. Based on the retrieved correspondence, each valid data portion is associated with the corresponding original request identifier. Specifically, the new request identifier in the response data stream is replaced with the corresponding original request identifier, thereby decomposing the received single burst transmission response data stream into multiple independent single data streams (independent transmissions conforming to the AXI bus protocol). Finally, based on the original request identifier, each valid data portion is returned to the data access subject that issued the corresponding read request.
[0065] More specifically, to comply with the bus protocol specifications and ensure the correctness of the processing order, the data in each part of the response data stream must arrive in strict order of their access addresses from low to high. Correspondingly, when reading the original request identifier from the request identifier mapping table for replacement, it must also be read in the same strict order of access addresses from low to high.
[0066] That is, according to the arrival order of the valid data parts, the following operations are performed on each valid data part in sequence: first, according to the correspondence, the valid data part is associated with the corresponding original request identifier; then, according to the original request identifier, the valid data part is returned to the data access subject that issued the corresponding read request.
[0067] In addition, the method also includes maintaining multiple sets of read requests, as follows: Maintain multiple read request sets (i.e., entries in the hardware), each read request set corresponds to a different address range, and the total number of read request sets that can be maintained at the same time has an upper limit, the maximum upper limit is 16, that is, it can support a maximum of 16 time windows to record read requests from 16 different address ranges at the same time. When the number of read request sets reaches the upper limit (e.g., 16), and a new read request is received whose access address does not belong to any address range corresponding to the current read request set, a resource needs to be released to accommodate the new read request. This process is called eviction. According to the predetermined selection strategy, select (arbitrate) a set of read requests from all current sets of read requests; Subsequently, burst transmission requests are immediately generated and sent based on the selected set of read requests (i.e., evict them), thereby releasing the resources occupied by the set of read requests; Finally, a new set of read requests is created for the new read request.
[0068] Furthermore, the present invention also takes into account the overall flow pressure, and the method further includes: The total number of read requests that have been categorized into the read request set but have not yet triggered the generation of a burst transfer request is dynamically counted. Specifically, the total number is incremented by 1 whenever a new read request is received; and the number of read requests contained in the burst transfer request is subtracted from the total number whenever a burst transfer request is issued.
[0069] When the total number exceeds a predetermined traffic pressure threshold (e.g., configurable to 20), in order to alleviate queue pressure and prevent congestion, a read request set is selected from all current read request sets according to a predetermined selection strategy, and a burst transmission request is immediately generated and sent based on the selected read request set (this operation is called Evict).
[0070] The method further includes special management of multiple read requests with identical access addresses and request attributes: creating a new read request set for multiple read requests with identical access addresses and request attributes; during the period before a burst transmission request is generated for the new read request set, subsequent read requests with the same access address and request attributes are classified into the new read request set; after a burst transmission request is generated for the new read request set, another new read request set is created for subsequent read requests with the same access address and request attributes.
[0071] Exemplary System Accordingly, embodiments of the present invention also provide a read request merging system. From a system architecture perspective, the core of the present invention lies in reconstructing the data access path. Compared to... Figure 1 The traditional data access architecture shown is as follows: Figure 5 As shown, the architecture of this invention adds a small packet request merger and a large packet data splitter on the data access side, and a large packet request splitter and a small packet data merger on the storage side. The small packet request merger is used to collect requests whose request addresses fall within the same data storage granularity, merge them into a single request, and send it to the storage side; the large packet data splitter is responsible for splitting the returned data into small packets and returning them to the data access subject.
[0072] Figure 6A specific hardware system embodiment for implementing the data access side function in the above architecture is provided. The system 100 provided in this embodiment includes: a data access subject 001, a decoding unit 002, a request information storage module 003, a request merging and arbitration module 004, a data storage medium 005, and a request identifier storage module 006. Specifically, the data access subject 001 can be a first-level cache (L1 cache), and correspondingly, the data storage medium 005 includes a second-level cache (L2 cache).
[0073] Figure 6 The decoding unit 002, the request information storage module 003, and the request merging arbitration module 004 together implement... Figure 5 The function of the small packet request merger; Figure 6 The request identifier storage module 006 in the middle implements Figure 5 The core function of the large-scale data splitter is to merge upstream discrete requests and accurately split downstream returned data through System 100.
[0074] The decoding unit 002 includes a receiving module, a classification module, and a masking module; the request merging arbitration module 004 includes a generation submodule and a sending submodule. The receiving module is used to receive multiple read requests from data access subject 001, and the read requests include at least an access address and request attributes; The classification module is used to classify read requests whose access addresses are in the same address range and have the same request attributes into the same set of read requests based on the access address and request attributes. The mask module is used to generate and update an address mask based on the access address of each read request in the read request set. The address mask is used to identify the address positions accessed by the read request set within the address range. The generation submodule is used to generate a burst transmission request based on the read request set when the read request set meets the triggering condition. The starting address of the burst transmission request is aligned to the starting address of the address range. The sending submodule is used to send the burst transmission request carrying the address mask to the data storage medium 005.
[0075] The read request also includes the original request identifier; The decoding unit 002 further includes: The parsing module is used to parse multiple read requests from data access subject 001 to obtain the access address, request attributes and original request identifier of the read requests.
[0076] The generation submodule also includes: A submodule used to assign a new request identifier to the burst transmission request; The request information storage module 003 further includes: The association submodule associates and stores the correspondence between the original request identifier of each read request in the read request set and the address location identified by the address mask with the new request identifier; The sending submodule is also used to send the burst transmission request carrying the address mask and the new request identifier to the data storage medium 005.
[0077] The request identifier storage module 006 further includes: A submodule for receiving the response data stream returned by the data storage medium 005, wherein the response data stream carries the new request identifier; A submodule used to retrieve the corresponding relationship based on the new request identifier; A submodule for extracting the valid data portion from the response data stream based on the address mask; A submodule used to associate each valid data part with the corresponding original request identifier according to the correspondence; A submodule used to return each valid data portion to the data access subject 001 that issued the corresponding read request, based on the original request identifier.
[0078] The triggering condition is: The number of read requests in the read request set reaches a predetermined merging threshold; and / or Since the creation of the read request set, the waiting time of the read request set has reached a predetermined time threshold.
[0079] The predetermined threshold for the number of merges is 2, 4, 8, or 16.
[0080] The address mask is a bitmap, where each bit in the bitmap corresponds to an address sub-block within the address range. The value of the bit is used to indicate whether the corresponding address sub-block is accessed by any read request in the read request set.
[0081] The address sub-block is 128 bytes in size.
[0082] The size of the address range is one of 2KB, 1KB, 512B or 256B; The size of the address range is a fixed value or configured according to a merging quantity threshold.
[0083] The request merging arbitration module 004 is further configured to, when multiple read request sets simultaneously meet the triggering condition, select one from the multiple read request sets according to a predetermined selection strategy, and generate and send a burst transmission request based on the selected read request set.
[0084] The request information storage module 003 is also used to maintain multiple read request sets, each read request set corresponding to a different address range, and the total number of read request sets that can be maintained at the same time has an upper limit. When the number of read request sets reaches the upper limit, and a new read request is received whose access address does not belong to any address range corresponding to the current read request set: The request merging arbitration module 004 is also used to select a read request set from all current read request sets according to a predetermined selection strategy, and immediately generate and send a burst transmission request based on the selected read request set; The classification module is also used to create a new set of read requests for the new read requests.
[0085] The maximum upper limit is 16.
[0086] The request information storage module 003 is also used to count the total number of all read requests that have been classified into the read request set and have not yet triggered the generation of burst transmission requests; The request merging arbitration module 004 is also used to select a read request set from all current read request sets according to a predetermined selection strategy when the total number exceeds a predetermined traffic pressure threshold, and immediately generate and send a burst transmission request based on the selected read request set.
[0087] The selection strategy is determined based on the waiting time, age information, and / or the number of read requests contained in each read request set; The maintenance rule for the age information is that when a read request set is assigned a new read request, its age information is reset to the initial value. At the same time, for all other read request sets whose original age information values are less than the original age information of the read request set, their age information is increased by one.
[0088] The associated submodule is also used to store the original request identifier of each read request in a request identifier mapping table, using the new request identifier as an index.
[0089] The request identifier mapping table has 512 entries; The depth of each entry is 16; and / or Each entry is 11 bits wide.
[0090] The data in each part of the response data stream arrives sequentially according to their access addresses; The request identifier storage module 006 is further configured to perform the following operations sequentially on each valid data portion according to the arrival order of the valid data portions: Based on the correspondence, associate the valid data portion with the corresponding original request identifier; Based on the original request identifier, the valid data portion is returned to the data access subject 001 that issued the corresponding read request.
[0091] The classification module also includes: A submodule used to create a new set of read requests for multiple read requests that have the same access address and request attributes; This is a submodule used to classify subsequent read requests with the same access address and request attributes into the new read request set during the period when no burst transmission requests are generated for the new read request set. A submodule used to create another new set of read requests for subsequent read requests with the same access address and request attributes after a burst transmission request is generated for the new set of read requests.
[0092] The data access subject 001 is a level-one cache; The data storage medium 005 includes a secondary cache.
[0093] The request information storage module 003 is also used to store the corresponding address range, request attributes, address mask, number of read requests, and original request identifier of each read request for each current read request set.
[0094] The classification module also includes: A submodule used to compare the access address and request attributes of a new read request with the address range and request attributes of the current read request set; If a match is found, the submodule used to categorize new read requests into the set of matching read requests; If there is no match, a submodule is used to create a new set of read requests for the new read request.
[0095] As an optional embodiment, such as Figure 6 As shown, the first-level cache (L1 Cache) 001, as an upstream module, is used to issue read requests.
[0096] The decoding unit 002 is configured to parse read requests from the first-level cache 001 to obtain the access address and request attributes of the current read request; and determine the address range to which it belongs based on the access address. The decoding unit 002 also compares the feature identifier (Tag, generated based on its address range and request attributes) of the current read request with the feature identifiers of all existing read request sets, and classifies the current read request into a matching read request set or creates a new read request set for it based on the comparison result.
[0097] The request information storage module 003 maintains multiple read request sets (corresponding to entries in the hardware). Each read request set stores information about multiple read requests under a specific address range and request attributes, including the feature identifier, address mask, number of read requests, and original request identifier list (Id List) for each read request. The request information storage module 003 merges read requests from different address ranges in different read request sets.
[0098] The request merge arbitration module 004 is configured to monitor the status of each read request set. When the number of read requests reaches the merge quantity threshold or the waiting time reaches the time threshold (i.e., the trigger condition is met), the merge of that set is determined to be complete (MergeDone). When multiple sets meet the conditions, the module arbitrates according to a preset selection strategy (based on age information and / or the number of read requests), selects one of the read request sets, and generates a burst transmission request from the merge result.
[0099] The L2 cache 005, as a downstream module, is used to receive the burst transmission request and return the corresponding response data stream.
[0100] The request identifier storage module 006 maintains a request identifier mapping table (RID Entry). Its configuration is as follows: before a burst transmission request is issued, the mapping relationship between the original request identifier and the new request identifier of each read request in the read request set is written into this table; when a burst response data stream carrying the new request identifier arrives from the second-level cache 005, the new request identifier in the response data stream is replaced with the corresponding original request identifier according to the mapping table, thereby decomposing the burst-form response data stream into multiple independent single data items, which are then returned to the first-level cache 001.
[0101] During runtime, read requests from the first-level cache 001 are sequentially decoded and categorized, stored and merged in aggregates, and arbitrated and generated as burst requests before being sent to the second-level cache 005. The request information storage module 003 synchronizes the original request identifier list (Id List) and other related information of each read request set to the request identifier storage module 006. The data return path is then precisely split and restored by the request identifier storage module 006. Through the collaboration of these modules, cache access efficiency is improved.
[0102] It should be noted that although the operations of the read request merging method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0103] Furthermore, although several devices, units, or modules of the read request merging system have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the invention, the features and functions of two or more modules described above can be embodied in a single module. Conversely, the features and functions of a single module described above can be further divided and embodied by multiple modules.
[0104] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
[0105] This invention provides: 1. A method for merging read requests, characterized in that the method includes: Receive multiple read requests from a data access subject, wherein the read requests contain at least an access address and request attributes; Based on the access address and the request attribute, read requests whose access addresses are in the same address range and have the same request attribute are classified into the same set of read requests. Based on the access address of each read request in the read request set, an address mask is generated and updated. The address mask is used to identify the address locations accessed by the read request set within the address range. When the set of read requests meets the triggering condition, a burst transmission request is generated based on the set of read requests, and the starting address of the burst transmission request is aligned to the starting address of the address range. The burst transmission request carrying the address mask is sent to the data storage medium.
[0106] 2. The read request merging method according to item 1, wherein the read request further includes an original request identifier; After receiving multiple read requests from the data access subject, the method further includes: Parse multiple read requests from the data access subject to obtain the access address, request attributes, and original request identifier of the read requests.
[0107] 3. The read request merging method according to item 2, characterized in that, when the read request set meets the triggering condition, the step of generating a burst transmission request based on the read request set further includes: Assign a new request identifier to the burst transmission request; The correspondence between the original request identifier of each read request in the read request set and the address location identified by the address mask is associated with the new request identifier and stored. The specific steps of sending the burst transmission request carrying the address mask to the data storage medium are as follows: The burst transmission request carrying the address mask and the new request identifier is sent to the data storage medium.
[0108] 4. The read request merging method according to item 3, characterized in that, after the step of sending the burst transmission request carrying the address mask and the new request identifier to the data storage medium, the method further includes: Receive a response data stream returned by the data storage medium, the response data stream carrying the new request identifier; Based on the new request identifier, the corresponding relationship is retrieved; Based on the address mask, extract the valid data portion from the response data stream; Based on the aforementioned correspondence, each valid data portion is associated with its corresponding original request identifier; Based on the original request identifier, each valid data portion is returned to the data access subject that issued the corresponding read request.
[0109] 5. The read request merging method according to any one of items 1-4, characterized in that the triggering condition is: The number of read requests in the read request set reaches a predetermined merging threshold; and / or Since the creation of the read request set, the waiting time of the read request set has reached a predetermined time threshold.
[0110] 6. The read request merging method according to item 5, wherein the predetermined merging quantity threshold is 2, 4, 8 or 16.
[0111] 7. The read request merging method according to any one of items 1-4, characterized in that the address mask is a bitmap, each bit in the bitmap corresponds to an address sub-block within the address range, and the value of the bit is used to indicate whether the corresponding address sub-block is accessed by any read request in the read request set.
[0112] 8. The read request merging method according to item 7, wherein the size of the address sub-block is 128 bytes.
[0113] 9. The read request merging method according to any one of items 1-4, characterized in that the size of the address range is one of 2KB, 1KB, 512B or 256B; The size of the address range is a fixed value or configured according to a merging quantity threshold.
[0114] 10. The read request merging method according to any one of items 1-4, characterized in that the method further comprises: when multiple read request sets simultaneously meet the triggering condition, selecting one from the multiple read request sets according to a predetermined selection strategy, and generating and sending a burst transmission request based on the selected read request set.
[0115] 11. The read request merging method according to any one of items 1-4, characterized in that the method further comprises: Maintain multiple read request sets, each corresponding to a different address range, and the total number of read request sets that can be maintained simultaneously has an upper limit; When the number of read request sets reaches the upper limit, and a new read request is received whose access address does not belong to any address range corresponding to the current read request set: According to the predetermined selection strategy, select a read request set from all current read request sets; Immediately generate and send burst transmission requests based on the selected set of read requests; Create a new set of read requests for the new read request.
[0116] 12. The read request merging method according to item 11, wherein the maximum upper limit is 16.
[0117] 13. The read request merging method according to any one of items 1-4, characterized in that the method further comprises: Count the total number of all read requests that have been categorized into the read request set and have not yet triggered the generation of burst transfer requests; When the total number exceeds a predetermined traffic pressure threshold, a read request set is selected from all current read request sets according to a predetermined selection strategy, and a burst transmission request is immediately generated and sent based on the selected read request set.
[0118] 14. The read request merging method according to any one of items 10-13, characterized in that the selection strategy is determined based on the waiting time, age information and / or the number of read requests contained in each read request set; The maintenance rule for the age information is that when a read request set is assigned a new read request, its age information is reset to the initial value. At the same time, for all other read request sets whose original age information values are less than the original age information of the read request set, their age information is increased by one.
[0119] 15. The read request merging method according to item 3 or 4, characterized in that the step of associating and storing the correspondence between the original request identifier of each read request in the read request set and the address position identified by the address mask with the new request identifier is specifically as follows: using the new request identifier as an index, the original request identifier of each read request is stored in the request identifier mapping table.
[0120] 16. The read request merging method according to item 15, wherein the request identifier mapping table has 512 entries; The depth of each entry is 16; and / or Each entry is 11 bits wide.
[0121] 17. The read request merging method according to item 4, characterized in that the data of each part of the response data stream arrives sequentially according to their access address order; According to the arrival order of the valid data portions, perform the following operations sequentially for each valid data portion: Based on the correspondence, associate the valid data portion with the corresponding original request identifier; Based on the original request identifier, the valid data portion is returned to the data access subject that issued the corresponding read request.
[0122] 18. The read request merging method according to any one of items 1-4, characterized in that the method further comprises: Create a new set of read requests for multiple read requests that have the same access address and request attributes; During the period when no burst transmission requests are generated for the new read request set, subsequent read requests with the same access address and request attributes are classified into the new read request set. After a burst transmission request is generated from the new set of read requests, another new set of read requests is created for subsequent read requests that have the same access address and request attributes.
[0123] 19. The read request merging method according to any one of items 1-4, characterized in that the data access subject is a first-level cache; The data storage medium includes a second-level cache.
[0124] 20. The read request merging method according to any one of items 1-4, characterized in that the method further comprises: For each current set of read requests, save the corresponding address range, request attributes, address mask, number of read requests, and the original request identifier of each read request.
[0125] 21. The read request merging method according to item 20, characterized in that, the step of classifying read requests whose access addresses are within the same address range and have the same request attributes into the same read request set according to the access address and request attributes specifically comprises: Compare the access address and request attributes of the new read request with the address range and request attributes of the current read request set; If a match is found, the new read request will be categorized into the set of matching read requests. If there is no match, a new set of read requests is created for the new read request.
[0126] 22. A read request merging system, characterized in that the system comprises: a data access subject, a decoding unit, a request merging arbitration module, and a data storage medium, wherein the decoding unit comprises a receiving module, a classification module, and a masking module, and the request merging arbitration module comprises a generation submodule and a sending submodule; The receiving module is used to receive multiple read requests from the data access subject, and the read requests include at least an access address and request attributes; The classification module is used to classify read requests whose access addresses are in the same address range and have the same request attributes into the same set of read requests based on the access address and request attributes. The mask module is used to generate and update an address mask based on the access address of each read request in the read request set. The address mask is used to identify the address positions accessed by the read request set within the address range. The generation submodule is used to generate a burst transmission request based on the read request set when the read request set meets the triggering condition. The starting address of the burst transmission request is aligned to the starting address of the address range. The sending submodule is used to send the burst transmission request carrying the address mask to the data storage medium.
[0127] 23. The read request merging system according to item 22, wherein the read request further includes an original request identifier; The decoding unit further includes: The parsing module is used to parse multiple read requests from the data access subject to obtain the access address, request attributes and original request identifier of the read requests.
[0128] 24. The read request merging system according to item 23, characterized in that the generation submodule further includes: A submodule used to assign a new request identifier to the burst transmission request; The system also includes a request information storage module; The request information storage module also includes: The association submodule associates and stores the correspondence between the original request identifier of each read request in the read request set and the address location identified by the address mask with the new request identifier; The sending submodule is also configured to send the burst transmission request carrying the address mask and the new request identifier to the data storage medium.
[0129] 25. The read request merging system according to item 24, characterized in that the system further includes a request identifier storage module; The request identifier storage module also includes: A submodule for receiving a response data stream returned by the data storage medium, the response data stream carrying the new request identifier; A submodule used to retrieve the corresponding relationship based on the new request identifier; A submodule for extracting the valid data portion from the response data stream based on the address mask; A submodule used to associate each valid data part with the corresponding original request identifier according to the correspondence; A submodule used to return each valid data portion to the data access subject that issued the corresponding read request, based on the original request identifier.
[0130] 26. The read request merging system according to any one of items 22-25, characterized in that the triggering condition is: The number of read requests in the read request set reaches a predetermined merging threshold; and / or Since the creation of the read request set, the waiting time of the read request set has reached a predetermined time threshold.
[0131] 27. The read request merging system according to item 26, wherein the predetermined merging quantity threshold is 2, 4, 8 or 16.
[0132] 28. The read request merging system according to any one of claims 22-25, wherein the address mask is a bitmap, each bit in the bitmap corresponds to an address sub-block within the address range, and the value of the bit is used to indicate whether the corresponding address sub-block is accessed by any read request in the read request set.
[0133] 29. The read request merging system according to item 28, wherein the size of the address sub-block is 128 bytes.
[0134] 30. The read request merging system according to any one of claims 22-25, wherein the size of the address range is one of 2KB, 1KB, 512B or 256B; The size of the address range is a fixed value or configured according to a merging quantity threshold.
[0135] 31. The read request merging system according to any one of items 22-25, wherein the request merging arbitration module is further configured to, when multiple read request sets simultaneously meet the triggering condition, select one from the multiple read request sets according to a predetermined selection strategy, and generate and send a burst transmission request based on the selected read request set.
[0136] 32. The read request merging system according to any one of items 22-25, characterized in that the request information storage module is further used to maintain multiple read request sets, each read request set corresponding to a different address range, and the total number of read request sets that can be maintained simultaneously has an upper limit; When the number of read request sets reaches the upper limit, and a new read request is received whose access address does not belong to any address range corresponding to the current read request set: The request merging arbitration module is also used to select a read request set from all current read request sets according to a predetermined selection strategy, and immediately generate and send a burst transmission request based on the selected read request set; The classification module is also used to create a new set of read requests for the new read requests.
[0137] 33. The read request merging system according to item 32, wherein the maximum upper limit is 16.
[0138] 34. The read request merging system according to any one of items 22-25, wherein the request information storage module is further used to count the total number of all read requests that have been classified into the read request set and have not yet triggered the generation of burst transmission requests; The request merging arbitration module is also used to select a read request set from all current read request sets according to a predetermined selection strategy when the total number exceeds a predetermined traffic pressure threshold, and immediately generate and send a burst transmission request based on the selected read request set.
[0139] 35. The read request merging system according to any one of items 31-34, characterized in that the selection strategy is determined based on the waiting time, age information and / or the number of read requests contained in each read request set; The maintenance rule for the age information is that when a read request set is assigned a new read request, its age information is reset to the initial value. At the same time, for all other read request sets whose original age information values are less than the original age information of the read request set, their age information is increased by one.
[0140] 36. The read request merging system according to item 24 or 25, wherein the association submodule is further configured to store the original request identifier of each read request in a request identifier mapping table using the new request identifier as an index.
[0141] 37. The read request merging system according to item 36, characterized in that the request identifier mapping table has 512 entries; The depth of each entry is 16; and / or Each entry is 11 bits wide.
[0142] 38. The read request merging system according to item 25, characterized in that the data of each part of the response data stream arrives sequentially according to their access addresses; The request identifier storage module is further configured to perform the following operations sequentially on each valid data portion according to the arrival order of the valid data portions: Based on the correspondence, associate the valid data portion with the corresponding original request identifier; Based on the original request identifier, the valid data portion is returned to the data access subject that issued the corresponding read request.
[0143] 39. The read request merging system according to any one of items 22-25, characterized in that the classification module further comprises: A submodule used to create a new set of read requests for multiple read requests that have the same access address and request attributes; This is a submodule used to classify subsequent read requests with the same access address and request attributes into the new read request set during the period when no burst transmission requests are generated for the new read request set. A submodule used to create another new set of read requests for subsequent read requests with the same access address and request attributes after a burst transmission request is generated for the new set of read requests.
[0144] 40. The read request merging system according to any one of items 22-25, characterized in that the data access subject is a first-level cache; The data storage medium includes a second-level cache.
[0145] 41. The read request merging system according to any one of items 22-25, wherein the request information storage module is further configured to store the corresponding address range, request attribute, address mask, number of read requests, and original request identifier of each read request for each current read request set.
[0146] 42. The read request merging system according to item 41, characterized in that the classification module further includes: A submodule used to compare the access address and request attributes of a new read request with the address range and request attributes of the current read request set; If a match is found, the submodule used to categorize new read requests into the set of matching read requests; If there is no match, a submodule is used to create a new set of read requests for the new read request.
Claims
1. A method for merging read requests, characterized in that, The method includes: Receive multiple read requests from a data access subject, wherein the read requests contain at least an access address and request attributes; Based on the access address and the request attribute, read requests whose access addresses are in the same address range and have the same request attribute are classified into the same set of read requests. Based on the access address of each read request in the read request set, an address mask is generated and updated. The address mask is used to identify the address locations accessed by the read request set within the address range. When the set of read requests meets the triggering condition, a burst transmission request is generated based on the set of read requests, and the starting address of the burst transmission request is aligned to the starting address of the address range. The burst transmission request carrying the address mask is sent to the data storage medium.
2. The read request merging method according to claim 1, characterized in that, The read request also includes the original request identifier; After receiving multiple read requests from the data access subject, the method further includes: Parse multiple read requests from the data access subject to obtain the access address, request attributes, and original request identifier of the read requests.
3. The read request merging method according to claim 2, characterized in that, When the set of read requests meets the triggering condition, the step of generating a burst transmission request based on the set of read requests further includes: Assign a new request identifier to the burst transmission request; The correspondence between the original request identifier of each read request in the read request set and the address location identified by the address mask is associated with the new request identifier and stored. The specific steps of sending the burst transmission request carrying the address mask to the data storage medium are as follows: The burst transmission request carrying the address mask and the new request identifier is sent to the data storage medium.
4. The read request merging method according to claim 3, characterized in that, After the step of sending the burst transmission request carrying the address mask and the new request identifier to the data storage medium, the method further includes: Receive a response data stream returned by the data storage medium, the response data stream carrying the new request identifier; Based on the new request identifier, the corresponding relationship is retrieved; Based on the address mask, extract the valid data portion from the response data stream; Based on the aforementioned correspondence, each valid data portion is associated with its corresponding original request identifier; Based on the original request identifier, each valid data portion is returned to the data access subject that issued the corresponding read request.
5. The read request merging method according to any one of claims 1-4, characterized in that, The triggering condition is: The number of read requests in the read request set reaches a predetermined merging threshold; and / or Since the creation of the read request set, the waiting time of the read request set has reached a predetermined time threshold.
6. The read request merging method according to claim 5, characterized in that, The predetermined threshold for the number of merges is 2, 4, 8, or 16.
7. The read request merging method according to any one of claims 1-4, characterized in that, The address mask is a bitmap, where each bit in the bitmap corresponds to an address sub-block within the address range. The value of the bit is used to indicate whether the corresponding address sub-block is accessed by any read request in the read request set.
8. The read request merging method according to claim 7, characterized in that, The address sub-block is 128 bytes in size.
9. The read request merging method according to any one of claims 1-4, characterized in that, The size of the address range is one of 2KB, 1KB, 512B or 256B; The size of the address range is a fixed value or configured according to a merging quantity threshold.
10. A read request merging system, characterized in that, The system includes: a data access subject, a decoding unit, a request merging arbitration module, and a data storage medium. The decoding unit includes a receiving module, a classification module, and a masking module. The request merging arbitration module includes a generation submodule and a sending submodule. The receiving module is used to receive multiple read requests from the data access subject, and the read requests include at least an access address and request attributes; The classification module is used to classify read requests whose access addresses are in the same address range and have the same request attributes into the same set of read requests based on the access address and request attributes. The mask module is used to generate and update an address mask based on the access address of each read request in the read request set. The address mask is used to identify the address positions accessed by the read request set within the address range. The generation submodule is used to generate a burst transmission request based on the read request set when the read request set meets the triggering condition. The starting address of the burst transmission request is aligned to the starting address of the address range. The sending submodule is used to send the burst transmission request carrying the address mask to the data storage medium.