Weight-configurable network-on-chip caching system and method and data updating method
By dynamically configuring the cache weight and optimizing the cache processing mechanism according to the data request type of the processor core, the problems of low cache hit rate and frequent external memory interaction in the existing technology are solved, and the system performance is improved.
Patent Information
- Application Number
- CN202410974187.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-09-20
AI Technical Summary
The existing unified cache management strategy is difficult to balance the differences in data requests of different processor cores, resulting in low cache hit rates, frequent external memory interactions, and low storage bandwidth utilization.
By dynamically configuring the cache weight and adopting cache replacement and bypass strategies according to the data request type of each core, the cache processing mechanism is optimized and the cache hit rate and system performance are improved.
Significantly improves the cache hit rate, reduces the frequency of external memory interactions, and improves overall system performance.
Smart Images

Figure CN118672967A
Abstract
Description
Technical Field
[0001] The present application relates to the field of on-chip network interconnection and chip cache technology, for example, to a weight-configurable on-chip network cache system, method, and data update method. Background Art
[0002] In the field of chip design, as the advancement of Moore's Law gradually slows down, multi-processor systems on chip have become a new research and development focus. However, traditional communication modes, such as buses or crossbar switches, can no longer meet the growing demand for high-speed and high-bandwidth communication between multi-processors. Especially in the context of the increasing number of processor cores, communication efficiency has become a key factor restricting the performance of multi-processor systems on chip.
[0003] To solve this problem, on-chip network technology was developed based on the concept of computer network data transmission, and gradually replaced the traditional communication method. This technology simplifies the data request process by building a topology that connects multiple cores and shares cache resources, significantly improving the scalability and transmission bandwidth of the system.
[0004] However, in on-chip network communication, the data request patterns of different cores vary significantly. Some cores need to frequently access the same data, requiring the cache to have strong data retention capabilities; while other cores prefer to quickly iterate different data and require the cache to be updated quickly. These two completely different requirements are difficult to be properly balanced under the existing unified cache management strategy, resulting in low cache hit rate, frequent external memory interaction, and low storage bandwidth utilization.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0007] The disclosed embodiments provide a weight-configurable on-chip network cache system, method, and data update method. By dynamically configuring cache weights, this solution can significantly improve cache hit rates and reduce the frequency of external memory interactions, thereby improving overall system performance.
[0008] In some embodiments, the system comprises: Multiple cores, each with different data processing requirements; Cache nodes, located at the center of the on-chip network, are used to store data and minimize data access latency; A register system, connected to the cache nodes, to keep track of hit counts, total misses, and configuration times; The execution logic module is used to determine a cache processing mechanism according to the type of data request of each core, and update the replacement priority of the relevant cache line, wherein the cache processing mechanism includes cache replacement and bypass strategies.
[0009] Optionally, the execution logic module is configured to: When there is a cache miss, if the request comes from a core with high data iteration requirements, the system will give priority to the bypass mechanism, directly reading data from the external memory to keep the data in the cache unchanged; if the request comes from a core that needs to keep the data, the system will give priority to the cache replacement mechanism, reading new data from the external memory while updating the cache content; When a cache hit occurs, the replacement priority of the cache line is dynamically adjusted according to the data iteration or retention requirements of the requesting core.
[0010] Optionally, the cache group includes multiple cache lines, each of which includes: A valid bit is used to indicate whether the data in the cache line is valid; The identification bit is used to compare with the received data request signal to determine whether the cache hits; Data bits are the specific data required for memory access; Miss count is the number of cache misses.
[0011] In some embodiments, the data update method is applied to the aforementioned weight-configurable on-chip network cache system, and the method includes: Cache node initialization operation: by analyzing the different data request types of different cores, the corresponding config_data is written into the register table with coreID as the address in each cache line; Memory access logic judgment: judge whether the memory access is missed or hit through the tag signal in the corresponding cache_line; In case of a memory miss, increase the miss_counter in all cache lines by 1; In the case of a memory access hit, the register table with coreID as the address in each cache line is updated according to the input memory access coreID; The memory access logic judgment process is performed again.
[0012] Optionally, the step of updating the register table with coreID as the address in each cache line includes: Locate cache line: find the corresponding cache line according to coreID, coreID is used as the address or index of the register table; Update the hit count: In the register table of the cache line, find the hit count register hit_counter and increase its value by 1; Update the hit sum: find the hit sum register hit_sum, and add the current value of the miss count miss_counter to the value of the hit sum hit_sum; Reset miss count: Set the miss count register miss_counter in the same cache line to zero.
[0013] In some embodiments, the weight-configurable on-chip network cache method is applied to the aforementioned weight-configurable on-chip network cache system, and the method includes: Receive data request information from the core; According to the tag bit signal of the memory address in the information, it is determined whether the memory access request hits the cache; Determine the cache processing mechanism based on the cache hit result; Repeat the above steps to achieve dynamic management and optimization of the on-chip network cache.
[0014] Optionally, when a memory access request hits the cache, the following steps are performed: The cache line data that hits the access is output; Access the hit_counter, hit_sum, and config_data registers associated with the requested coreID, where the config_data register stores the minimum number of memory misses allowed for each core; According to hit_counter, hit_sum, config_data and the number of memory access misses calculated in real time, a new replacement priority is calculated and assigned to the hit cache line using a first preset formula.
[0015] Optionally, the first preset formula is:
[0016] in, Indicates the number of memory misses calculated in real time.
[0017] Optionally, when the memory access request does not hit the cache, the following steps are performed: Compare the miss_counter of the cache line with the highest replacement priority in the corresponding cache group with the threshold; If miss_counter is less than the threshold, the cache bypass method is selected to directly extract data from the external memory; If miss_counter is greater than or equal to the threshold, a cache replacement operation is performed; When performing a cache replacement operation, If there is a free cache line in the cache, the data extracted from the external memory is directly inserted into the free cache line; If there are no free cache lines in the cache, before inserting the data, the cache line with the highest replacement priority is evicted first, and then the data extracted from the external memory is inserted into the evicted cache line, and a new replacement priority is assigned to the cache line, and the value of the new replacement priority is calculated and assigned by a first preset formula.
[0018] Optionally, the threshold is calculated based on hit_counter, hit_sum, config_data extracted from the register table corresponding to the coreID and a second preset formula, The second preset formula is: .
[0019] The weight-configurable on-chip network cache system, method, and data update method provided by the embodiments of the present disclosure can achieve the following technical effects: The present disclosure configures different cache read / write / replacement weights according to the characteristics of different core data requests, so that the cache has different data retention / data iteration mechanisms for requests from different cores, effectively improving the cache data hit rate.
[0020] Through this solution, the data replacement / retention selection of the cache is associated with the specific needs of the core, effectively improving the processing capability of the cache in the on-chip network system for multi-core data request types.
[0021] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein: Figure 1 is a network on chip topology diagram provided by an embodiment of the present disclosure; Figure 2 is a topological diagram of a cache node provided by an embodiment of the present disclosure; Figure 3 is a topological diagram of another cache group provided by an embodiment of the present disclosure; Figure 4 is a data update logic diagram provided by an embodiment of the present disclosure; Figure 5 It is an execution logic diagram of a weight-configurable cache implementation solution for an on-chip network provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0024] The terms "first", "second", etc. in the embodiments of the present disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0025] Unless otherwise stated, the term "plurality" means two or more.
[0026] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0027] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0028] coreID can be understood as the core ID; hit_counter is the number of hits, hit_sum is the total number of hits, and the data in config_data (coreID) is the minimum number of memory misses allowed for each customized core.
[0029] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0030] The present invention proposes a weight-configurable on-chip network cache method, which allows the cache's read, write, and replace weights to be flexibly configured according to different core data request characteristics. Through this strategy, the cache can adjust the data retention and data iteration mechanisms according to the needs of different cores, thereby significantly improving the cache data hit rate.
[0031] This method designs a targeted processing mechanism based on two different situations: cache miss and cache hit. By maintaining a detailed register table about the hit count, total miss, and configuration times, the optimal cache processing strategy can be intelligently selected according to the type of data request. In the case of a cache miss, if the request comes from a core with high data iteration requirements, the system will give priority to the bypass mechanism, directly read data from the external memory, and keep the data in the cache unchanged; if the request comes from a core that needs to keep the data, the cache replacement mechanism will be triggered to update the cache content while reading new data from the external memory. In the case of a cache hit, the replacement priority of the cache line is dynamically adjusted according to the data iteration or retention requirements of the requesting core, thereby further optimizing the cache efficiency.
[0032] By dynamically configuring cache weights, this solution can significantly improve cache hit rates and reduce the frequency of external memory interactions, thereby improving overall system performance.
[0033] As an example, the present disclosure provides a weight-configurable cache implementation solution for an on-chip network.
[0034] The specific implementation process of the present invention includes the following three aspects: 1. Physical Implementation of Network-on-Chip Weight Configurable Cache The physical implementation of the weight-configurable on-chip network cache system of the present invention is as follows: Figure 1 shown.
[0035] Figure 1 This is the topological relationship between the core and cache in the on-chip network. To ensure the minimum number of hops from the core to the cache, the cache node is generally located in the center of the core and receives data requests from multiple cores.
[0036] Figure 2 The topological structure of the cache node is shown in FIG. 4 . A 4-way group is connected as an example. The cache includes multiple cache groups, and each cache group includes 4 cache line data.
[0037] Figure 3 The topology of a cache group.
[0038] The cache consists of multiple cache groups. Each cache group maintains three register tables related to the core number bit width, recording: Hit count: counts the number of cache hits, reflecting the effectiveness and efficiency of the cache for different core request data; Total Misses: records the total number of cache misses, that is, the number of requests that need to obtain data from a higher level storage hierarchy; Configuration times: records the number of cache configuration changes; The register table is used to adopt an appropriate cache processing mechanism according to different data request types of different cores to optimize overall performance and efficiency.
[0039] A cache group consists of multiple cache lines, each of which contains: A valid bit is used to indicate whether the data in the cache line is valid; The identification bit is used to compare with the received data request signal to determine whether the cache hits; Data bits are the specific data required for memory access; Miss count is the number of cache misses.
[0040] (II) On-chip network weight configurable cache data update logic The data update logic of the data update method of the weight-configurable on-chip network cache system of the present invention is as follows: Figure 4 As shown. Includes: S01, cache node initialization operation, by analyzing the different data request types of different cores, write the corresponding config_data into the register table with coreID as the address in each cache line, where the data of config_data (coreID) is the customized minimum number of memory access misses allowed for each core.
[0041] S02, memory access logic judgment, judging whether the memory access is a miss or a hit through the tag signal in the corresponding cache_line.
[0042] S03, in case of a memory access miss, increase the miss_counter in all cache lines by 1.
[0043] S04, in case of a memory access hit, based on the input memory access coreID, update the register table with coreID as the address in each cache line, and the specific update logic is to add 1 to the hit_counter value and add miss_counter to the hit_sum value; at the same time, set the miss_counter of the corresponding cache line to zero.
[0044] S05, repeat the S02 process.
[0045] 3. Weight-configurable on-chip network cache method execution logic The execution logic of the weight-configurable on-chip network cache method of the present invention is as follows: Figure 5 As shown, the specific execution process is divided into the following steps: First, when a core's data request information enters the cache, it determines whether the memory access is a hit based on the tag bit signal of its memory address; If the core's memory access request hits, the data in the cache line that hits will be accessed as data output. Access the hit_counter, hit_sum and config_data stored in the corresponding coreID, and assign a new replacement priority to the cache line data that is hit according to the following formula. Among them, the data of config_data (coreID) is the minimum number of memory misses allowed by each core that is customized. The larger the value is, the greater the corresponding core's demand for data update frequency. Indicates the number of memory misses calculated in real time.
[0046] The final effect is as follows: if the core needs to frequently access different data, has high data iteration requirements, and needs to cache frequently updated data, a larger config_data value is defined. After a cache hit occurs, the probability that the core requests the data again is low, and a higher replacement priority is given according to the formula; if the core needs to frequently access the same data, has a high data access frequency, and requires the cache to have the ability to retain the data for a certain period of time, a smaller config_data value is defined. After a cache hit occurs, the probability that the core requests the data again is high, and a lower replacement priority is given according to the formula.
[0047]
[0048] If the current memory access request of the core is missed, the miss_counter of the highest replacement priority cache line in the corresponding cache group is compared with the threshold.
[0049] The threshold size is extracted from the register table based on the corresponding coreID hit_counter, hit_sum and config_data, according to the formula Calculated.
[0050] If miss_counter is less than the threshold, it means that the core does not need to update the cache due to the current memory access miss, so the cache bypass method is selected to directly extract data from the external memory; If miss_counter is greater than the threshold, it means that the core's current memory access miss requires the cache to be updated, so the cache replacement method is selected to extract data from the external memory to update the cache.
[0051] When selecting the cache replacement mode, if there is a free cache line in the cache (that is, the valid bit of the cache line is 0), the data extracted from the external memory is directly inserted into the free cache line; if there is no free cache line in the cache, then before inserting the data, the cache line with the highest replacement priority is evicted first, and then the data extracted from the external memory is inserted into the evicted cache line, and a new replacement priority is assigned to the cache line. The value of the new replacement priority is also assigned according to the replacement priority formula above.
[0052] The overall implementation logic of this solution, whether it is the priority change of cache hits, the replacement / bypass selection of cache misses, or the priority change of cache replacement, constantly selects different solutions based on the specific data request type of the core, and assigns different replacement priorities to the corresponding cache lines based on the core's data retention capacity and data iteration requirements. Through this solution, the data replacement / retention selection of the cache is associated with the specific needs of the core, effectively improving the cache's processing capacity for multi-core data request types in the on-chip network system.
[0053] The present invention aims at the existing on-chip network cache implementation scheme that adopts a unified cache processing method for all cores, does not distinguish the specific data request characteristics of the core, and cannot coordinate the conflict between retention capacity and data iteration, resulting in the overall on-chip network having a low cache hit rate, too frequent interaction with external memory, and low storage bandwidth utilization. A weighted configurable cache implementation scheme for on-chip networks is proposed. Different cache read / write / replace weights are configured according to different core data request characteristics, so that the cache has different data retention / data iteration mechanisms for requests from different cores, effectively improving the cache data hit rate.
[0054] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the scope of protection. As used in the description in the text, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0055] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians may clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0056] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically separately, or two or more units may be integrated in one unit.
[0057] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A weight-configurable network-on-chip cache system, characterized in that: include: Multiple cores, each with different data processing requirements; Cache nodes, located at the center of the on-chip network, are used to store data and minimize data access latency; A register system, connected to the cache nodes, to keep track of hit counts, total misses, and configuration times; The execution logic module is used to determine a cache processing mechanism according to the data request characteristics of each core, wherein the cache processing mechanism includes a cache replacement and a bypass strategy.
2. The system according to claim 1, characterized in that The execution logic module is configured as follows: When there is a cache miss, if the request comes from a core with high data iteration requirements, the system will prioritize the bypass mechanism and read data directly from external memory, keeping the data in the cache unchanged; If the request comes from a core that needs to keep data, the system will prioritize the cache replacement mechanism, reading new data from external memory while updating the cache content; When a cache hit occurs, the replacement priority of the cache line is dynamically adjusted according to the data iteration or retention requirements of the requesting core.
3. The system according to claim 2, characterized in that A cache group consists of multiple cache lines, each of which contains: A valid bit is used to indicate whether the data in the cache line is valid; The identification bit is used to compare with the received data request signal to determine whether the cache hits; Data bits are the specific data required for memory access; Miss count is the number of cache misses.
4. A data updating method, characterized in that: Applied to the weight-configurable on-chip network cache system according to any one of claims 1 to 3, the method comprising: Cache node initialization operation: by analyzing the different data request types of different cores, the corresponding config_data is written into the register table with coreID as the address in each cache line; Memory access logic judgment: judge whether the memory access is missed or hit through the tag signal in the corresponding cache_line; In case of a memory miss, increase the miss_counter in all cache lines by 1; In the case of a memory access hit, the register table with coreID as the address in each cache line is updated according to the input memory access coreID; The memory access logic judgment process is performed again.
5. The method according to claim 4, characterized in that The steps of updating the register table with coreID as the address in each cache line include: Locate cache line: find the corresponding cache line according to coreID, coreID is used as the address or index of the register table; Update the hit count: In the register table of the cache line, find the hit count register hit_counter and increase its value by 1; Update the hit sum: find the hit sum register hit_sum, and add the current value of the miss count miss_counter to the value of the hit sum hit_sum; Reset miss count: Set the miss count register miss_counter in the same cache line to zero.
6. A weight-configurable on-chip network cache method, characterized in that: Applied to the weight-configurable on-chip network cache system according to any one of claims 1 to 3, the method comprising: Receive data request information from the core; According to the tag bit signal of the memory address in the information, it is determined whether the memory access request hits the cache; Determine the cache processing mechanism based on the cache hit result; Repeat the above steps to achieve dynamic management and optimization of the on-chip network cache.
7. The method according to claim 6, characterized in that When a memory access request hits the cache, the following steps are performed: The cache line data that hits the access is output; Access the hit_counter, hit_sum, and config_data registers associated with the requested coreID, where the config_data register stores the minimum number of memory misses allowed for each core; According to hit_counter, hit_sum, config_data and the number of memory access misses calculated in real time, a new replacement priority is calculated and assigned to the hit cache line using a first preset formula.
8. The method according to claim 7, characterized in that The first preset formula is: , in, Indicates the number of memory misses calculated in real time.
9. The method according to claim 8, characterized in that When a memory access request misses the cache, the following steps are performed: Compare the miss_counter of the cache line with the highest replacement priority in the corresponding cache group with the threshold; If miss_counter is less than the threshold, the cache bypass method is selected to directly extract data from the external memory; If miss_counter is greater than or equal to the threshold, a cache replacement operation is performed; When performing a cache replacement operation, If there is a free cache line in the cache, the data extracted from the external memory is directly inserted into the free cache line; If there are no free cache lines in the cache, before inserting the data, the cache line with the highest replacement priority is evicted first, and then the data extracted from the external memory is inserted into the evicted cache line, and a new replacement priority is assigned to the cache line, and the value of the new replacement priority is calculated and assigned by a first preset formula.
10. The method according to claim 9, characterized in that The threshold is calculated based on hit_counter, hit_sum, config_data extracted from the register table corresponding to coreID and a second preset formula. The second preset formula is: 。
Citation Information
Cited By
Automatic adaptive streaming access replacement method, CPU core and system-on-chip
CN121255477A
Data transmission method and device of network-on-chip, routing node and storage medium
CN121412174A
