Method, device, electronic device and readable storage medium for reading memory data
By pre-opening multiple memory unit groups and dynamically adjusting data read paths in the stacked architecture of multi-core CPU and DRAM, the problem of traditional prefetch strategies failing to fully utilize the potential of multi-bank parallel processing is solved, achieving faster data access. and higher system performance.
Patent Information
- Application Number
- CN202410942650.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-15
AI Technical Summary
Traditional prefetching strategies fail to fully utilize the potential of multi-bank parallel processing, resulting in high data access delays and affecting system performance.
By pre-opening multiple storage unit groups in the stacking architecture of many-core CPU and DRAM, and dynamically adjusting the data read path according to the distance between CPU cores, monitoring the status of the storage unit group and bus occupancy, multiple storage units Groups are sorted to achieve intelligent scheduling and optimization.
It significantly reduces data access delay, improves system performance, effectively utilizes the potential of multi-bank parallel processing, and balances the read-ahead strategy and system load through cache feedback to avoid ineffective power consumption.
Smart Images

Figure CN118484286B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for reading memory data, an electronic device and a readable storage medium. Background Art
[0002] Memory is the core component responsible for storing data in a computer system. It provides necessary data support for the execution of all programs. In modern computer systems, DRAM is the main memory component, and its performance directly affects the operating efficiency of the entire system. Modern dynamic random access memory (DRAM) adopts a multi-bank design to improve data throughput. The multi-bank design allows multiple data access requests to be made simultaneously, reducing waiting time and improving memory access speed. However, traditional prefetching strategies usually only operate on a single bank and fail to fully utilize the potential of multi-bank parallel processing. Therefore, it is particularly important to study and develop prefetching strategies that can adapt to multi-bank parallel operations. Summary of the invention
[0003] The problem solved by the present invention is to provide a method, device, electronic device and readable storage medium for reading memory data. By pre-opening multiple banks to pre-read data in parallel and dynamically adjusting the data reading path according to the distance between CPU cores, data access delay is significantly reduced and system performance is improved.
[0004] In order to solve the above problems, the present invention provides a method for reading memory data, which is applied to a stacking architecture of a multi-core CPU and a DRAM, wherein the multi-core CPU is arranged in an N*N array, and comprises:
[0005] Before the data request arrives, the pre-reading module pre-enables a plurality of storage unit groups in the memory, and the plurality of storage unit groups enter a reading state;
[0006] The pre-reading module monitors the states of the plurality of storage unit groups and bus occupancy, and performs pre-reading sorting on the plurality of storage unit groups according to the occupancy information;
[0007] Assuming that the number of CPU cores passed by the shortest path between the first CPU core and the second CPU core is n, when n is greater than or equal to N / 2-1, the data in the cache of the second CPU core is read into the cache of the first CPU core through the upper memory according to the order; when n is less than or equal to N / 2, the data in the cache of the second CPU core is read into the cache of the first CPU core from near to far according to the order through the caches of the n CPU cores on the shortest path;
[0008] The first CPU core cache feeds back the current state to the pre-reading module;
[0009] The pre-reading module re-performs a pre-reading order on the plurality of storage unit groups according to the cache current state information.
[0010] Optionally, the pre-reading module implements the method through a software program;
[0011] The software program runs in a controller added outside the memory, or runs in firmware added in a processor core.
[0012] Optionally, the multiple storage unit groups include multiple storage units, and the multiple storage units are arranged in a matrix; wherein the storage units are memory particles.
[0013] Optionally, the pre-reading module transmits the pre-reading instruction via a peripheral interface in the memory.
[0014] Optionally, the step of the pre-reading module pre-enabling multiple storage unit groups in the memory further includes:
[0015] The pre-reading of data in the plurality of memory cell groups is controlled by a timing circuit in the memory.
[0016] Optionally, the step of pre-reading and sorting the plurality of storage unit groups further includes:
[0017] The plurality of storage unit groups are marked as a 1st priority to an Nth priority, wherein the priorities decrease in sequence from 1 to N.
[0018] Optionally, the memory is one or more of a dynamic random access memory, a flash memory, a phase change memory, or a magnetic tunnel junction memory.
[0019] The present invention also provides a device for reading memory data, the device comprising:
[0020] A memory for storing data; wherein the memory comprises a plurality of storage unit groups, a peripheral interface, a control circuit and a timing circuit;
[0021] Cache, used to store data last read by the processor;
[0022] A pre-reading module, used for pre-enabling a plurality of memories in the memory, monitoring the plurality of storage unit groups and a bus, and pre-reading and sorting the plurality of storage unit groups;
[0023] Wherein, the pre-reading module re-pre-reads and sorts the plurality of storage unit groups according to the cache current state information;
[0024] The pre-reading module transmits the pre-reading instruction through the peripheral interface in the memory;
[0025] The pre-reading module controls the pre-reading of data in the plurality of storage unit groups through a timing circuit in the memory.
[0026] The present invention also provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any one of the above methods.
[0027] The present invention also provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the methods described above.
[0028] Compared with the prior art, the technical solution of the embodiment of the present invention has the following advantages:
[0029] In the technical solution of the implementation mode of the present invention, multiple storage unit groups have a pre-enabling function, and parallel pre-reading significantly speeds up data acquisition and reduces memory access delay; by analyzing the status of multiple storage unit groups and bus occupancy, multiple storage unit groups are sorted, and the reading method of data in the cache is dynamically adjusted according to the distance between the CPU cores, thereby realizing intelligent scheduling and optimization and effectively utilizing the resources of the dynamic storage unit group; at the same time, according to the feedback of the cache data, the pre-reading strategy and the system load are balanced to avoid invalid power consumption and achieve energy efficiency optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flow chart of a method for reading memory data provided by an embodiment of the present invention;
[0031] Figure 2 A schematic diagram of a memory data reading device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the embodiments in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0033] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0034] refer to Figure 1, Figure 1 A method for reading memory data is provided in an embodiment of the present invention.
[0035] The method is applied to a stacked architecture of a multi-core CPU and a DRAM, wherein the multi-core CPU is arranged in an N*N array, and the memory data reading method includes:
[0036] Step S1: before a data request arrives, a pre-reading module pre-enables a plurality of storage unit groups in a memory, and the plurality of storage unit groups enter a reading state;
[0037] Step S2: the pre-reading module monitors the states of the plurality of storage unit groups and bus occupancy, and performs pre-reading sorting on the plurality of storage unit groups according to the occupancy information;
[0038] Step S3: Assume that the number of CPU cores that the shortest path between the first CPU core and the second CPU core passes through is n. When n is greater than or equal to N / 2-1, the data in the cache of the second CPU core is read into the cache of the first CPU core through the upper memory according to the order; when n is less than or equal to N / 2, the data in the cache of the second CPU core is read into the cache of the first CPU core from near to far according to the order through the caches of the n CPU cores on the shortest path;
[0039] Step S4: the first CPU core cache feeds back the current state to the pre-reading module;
[0040] Step S5: the pre-reading module re-pre-reads and sorts the plurality of storage unit groups according to the cache current state information.
[0041] refer to Figure 2 , Figure 2 Another embodiment of the present invention provides a memory data reading device, the device comprising: a memory 21, for storing data; wherein the memory 21 comprises a plurality of storage unit groups 22, a peripheral interface 23, a control circuit 24 and a timing circuit 25;
[0042] Cache 30, used to store data read by the processor last time;
[0043] The pre-reading module 26 is used to pre-enable the multiple storage unit groups 22 in the memory 21; specifically, it allows the multiple storage unit groups 22 to be activated in advance before the data request is officially received, so that they enter the reading state. Through the precise control of the timing circuit 25, it is ensured that the multiple storage unit groups 22 are immediately available when the data is really needed, and the time required for the activation waiting of the multiple storage unit groups 22 is reduced.
[0044] In a specific embodiment of the present invention, the pre-reading module 26 belongs to a dynamic scheduling system, which monitors the multiple storage unit groups 22 and the bus 29, pre-reads the multiple storage unit groups 22, dynamically adjusts the pre-reading order and the activation strategy of the multiple storage unit groups 22 to avoid conflicts, gives priority to high-priority pre-reading requests, and ensures the timely transmission of critical data.
[0045] Continue to refer Figure 2 , the pre-reading module 26 re-pre-reads and sorts the multiple storage unit groups 22 according to the current state information of the cache 30; as shown in the figure, the cache 30 works in coordination with the pre-reading module 26, and the state information feedback of the cache 30 guides the pre-reading module 26 to make decisions, reduce redundant pre-reading, and improve the hit rate. At the same time, the cache 30 is used as a temporary buffer for the pre-reading data of the pre-reading module 26, which reduces the access pressure of the memory 21.
[0046] Continue to refer Figure 2 , the pre-reading module 26 transmits the pre-reading instruction through the peripheral interface 23 in the memory 21;
[0047] The pre-reading module 26 controls the pre-reading of data in the plurality of storage unit groups 22 through the timing circuit 25 in the memory 21. Specifically, the step of pre-reading and sorting the plurality of storage unit groups 22 also includes: marking the plurality of storage unit groups 22 as the first priority to the Nth priority; wherein the priority decreases from 1 to N in sequence.
[0048] In the embodiment of the present invention, the pre-reading module 26 implements the method through a software program 28, wherein the software program 28 runs in a controller added outside the memory 21, or runs in a firmware added to a processor core. Specifically, as shown in the figure, the software program 28 also includes a dedicated driver interface 27.
[0049] It should be noted that, in the embodiment of the present invention, the plurality of storage unit groups 22 include a plurality of storage units, and the plurality of storage units are arranged in a matrix; wherein the storage units are memory particles.
[0050] It should be noted that the memory 21 is one or more of a dynamic random access memory, a flash memory, a phase change memory, or a magnetic tunnel junction memory.
[0051] From the above description, it can be seen that the memory data reading method provided by the technical solution of the present invention enables multiple storage unit groups to have a pre-opening function, and parallel pre-reading significantly speeds up data acquisition and reduces memory access delay; by analyzing the status of multiple storage unit groups and bus occupancy, multiple storage unit groups are sorted to achieve intelligent scheduling and optimization, and effectively utilize the resources of dynamic storage unit groups; at the same time, according to the feedback of cache data, the pre-reading strategy and system load are balanced to avoid invalid power consumption and achieve energy efficiency optimization.
[0052] An embodiment of the present invention further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the memory reading method as described in any one of the above items.
[0053] An embodiment of the present invention further provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the memory reading methods described above.
[0054] The various embodiments in this specification are described in a progressive, parallel, or progressive and parallel manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referenced to each other.
[0055] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that an article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the article or device including the above elements.
[0056] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for reading memory data, applied to a stacked architecture of a multi-core CPU and DRAM, wherein the multi-core CPU is arranged in an N*N array, characterized in that: include: Before the data request arrives, the pre-reading module pre-enables a plurality of storage unit groups in the memory, and the plurality of storage unit groups enter a reading state; The pre-reading module monitors the states of the plurality of storage unit groups and bus occupancy, and performs pre-reading sorting on the plurality of storage unit groups according to the occupancy information; Assuming that the number of CPU cores passed by the shortest path between the first CPU core and the second CPU core is n, when n is greater than or equal to N / 2-1, the data in the cache of the second CPU core is read into the cache of the first CPU core through the upper memory according to the above order; When n is less than N / 2, the data in the cache of the second CPU core is read from the caches of the n CPU cores on the shortest path from near to far according to the order to the cache of the first CPU core; The first CPU core cache feeds back its current state to the pre-reading module; The pre-reading module re-pre-reads and sorts the plurality of storage unit groups according to the cache current state information; The cache works in coordination with the pre-read module, and the pre-read module is guided to make decisions through the state information feedback of the cache, thereby reducing redundant pre-reading and improving the hit rate. At the same time, the cache is used as a temporary buffer for the pre-read data by the pre-read module, thereby reducing the access pressure of the memory.
2. The method according to claim 1, characterized in that The pre-reading module implements the method through a software program; The software program runs in a controller added outside the memory, or runs in firmware added in a processor core.
3. The method according to claim 1, characterized in that The plurality of storage unit groups include a plurality of storage units, and the plurality of storage units are arranged in a matrix; wherein the storage units are memory particles.
4. The method according to claim 1, characterized in that The pre-reading module transmits the pre-reading instruction through the peripheral interface in the memory.
5. The method according to claim 1, characterized in that The step of pre-enabling a plurality of storage unit groups in the memory by the pre-reading module further includes: The pre-reading of data in the plurality of memory cell groups is controlled by a timing circuit in the memory.
6. The method according to claim 1, characterized in that The step of pre-reading and sorting the plurality of storage unit groups further includes: The plurality of storage unit groups are marked as a 1st priority to an Nth priority, wherein the priorities decrease in sequence from 1 to N.
7. The method according to claim 1, characterized in that The memory is one or more of a dynamic random access memory, a flash memory, a phase change memory, or a magnetic tunnel junction memory.
8. A device for reading memory data, characterized in that: The device comprises: A memory for storing data; wherein the memory comprises a plurality of storage unit groups, a peripheral interface, a control circuit and a timing circuit; Cache, used to store data last read by the processor; A pre-reading module, used for pre-enabling a plurality of storage unit groups in the memory, monitoring the plurality of storage unit groups and a bus, and pre-reading and sorting the plurality of storage unit groups; Wherein, the pre-reading module re-pre-reads and sorts the plurality of storage unit groups according to the cache current state information; The pre-reading module transmits the pre-reading instruction through the peripheral interface in the memory; The pre-reading module controls the pre-reading of data in the plurality of storage unit groups through a timing circuit in the memory; Assume that the number of CPU cores passed by the shortest path between the first CPU core and the second CPU core is n, when n is greater than or equal to N / 2-1, the data in the cache of the second CPU core is read into the cache of the first CPU core through the upper memory according to the order; when n is less than or equal to N / 2, the data in the cache of the second CPU core is read into the cache of the first CPU core from near to far according to the order through the caches of the n CPU cores on the shortest path; the first CPU core cache feeds back its current state to the pre-reading module; the pre-reading module re-pre-reads and sorts the multiple storage unit groups according to the current state information of the cache, the cache works in coordination with the pre-reading module, and guides the pre-reading module to make decisions through the state information feedback of the cache, thereby reducing redundant pre-reading and improving the hit rate. At the same time, the cache is used as a temporary buffer for pre-reading data by the pre-reading module, thereby reducing the access pressure of the memory.
9. An electronic device, characterized in that: include: processor; A memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Cache data segmentation reading method and device, computer equipment and storage medium
CN117112454A
Thread group scheduling method, universal graphics processor and storage medium
CN117492965A
