Performance optimization method for DRAM (Dynamic Random Access Memory) controller
Through the performance optimization method of the DRAM controller, identifying and modifying RMW operations, splitting and reordering read and write commands, the problem of low writing efficiency of data smaller than the prefetch cache size in traditional technology is solved, and the read and write performance of the system is improved. and arbitration flexibility.
Patent Information
- Application Number
- CN202410341569.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2024-09-17
AI Technical Summary
When writing data smaller than the prefetch cache size, traditional DRAM devices need to go through Mask write or read-modify-write operations, resulting in additional data line requirements and frequent switching of read and write commands, reducing system efficiency.
Provides a performance optimization method for DRAM controllers by preprocessing request commands, identifying and modifying RMW operations into RMW read commands, adding RMW tags, storing them in the command queue, assigning queue numbers, extracting and arbitrating command feature information, and disassembling Divide and reorder read and write commands to ensure that RMW read commands are executed before RMW write commands and reduce the flip rate of read and write commands.
It improves the system's read and write performance, reduces the switching frequency of read and write operations, increases the flexibility of command arbitration, reduces latency, and improves the overall performance of the system.
Smart Images

Figure CN118656018A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer memory, and in particular to a performance optimization method for a DRAM controller. Background Art
[0002] Memory is an important part of computer architecture. Dynamic Random Access Memory (DRAM) is widely used in servers, graphics cards, mobile phones and other scenarios due to its high density and low cost. Mainstream DRAM devices include but are not limited to DDR (Double Data Rate SDRAM), GDDR (Graphics DDR), LPDDR (Low Power DDR) and HBM (High Bandwidth Memory). DRAM devices are suitable for batch read and write operations to better utilize data bandwidth and meet the needs of high-performance computing.
[0003] In traditional technology, for writing data smaller than the prefetch size, DRAM generally implements it in two ways: Mask write (write operation with mask) or Read-Modify-Write (RMW) operation, among which RMW is the most commonly used.
[0004] However, in traditional technology, because the Mask in the DRAM device requires additional data lines to transmit, and these data lines usually need to be shared with other functions, such as the Mask and Error Correcting Code (ECC) of HBM2 are transmitted through the same set of data lines, the two functions cannot be used at the same time. Or there is no Mask data line in the DRAM device, such as HBM3. Therefore, the writing of data smaller than the prefetch cache size needs to be implemented through RMW. RMW is divided into two commands, read and write. First, the old data stored in a specific address of DRAM is read back, and the new data and the old data are merged and then written back to the specific address of DRAM, so as to achieve a partial update of the data at a certain address. However, switching between read and write commands requires additional waiting time, so the frequent switching of read and write caused by RMW operations will greatly reduce the efficiency of the system. Summary of the invention
[0005] Based on this, it is necessary to provide a performance optimization method for a DRAM controller that can reduce the switching frequency of read and write operations, improve command arbitration flexibility, reduce latency, and improve system read and write performance in response to the above technical problems.
[0006] In a first aspect, the present application provides a performance optimization method for a DRAM controller, comprising:
[0007] Preprocess the obtained request command and obtain the command preprocessing result;
[0008] Assign numbers to command preprocessing results to obtain a mapping relationship between assigned commands and numbers;
[0009] Perform arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics, and obtain the arbitration judgment result;
[0010] When the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment continues.
[0011] In one embodiment, preprocessing the obtained request command to obtain the command preprocessing result includes:
[0012] Perform type judgment on the request command and obtain the type judgment result;
[0013] When the type judgment result is that the request command contains an RMW operation, the request command with the RMW operation is modified into a read command;
[0014] Perform an add operation on the modified read command based on the RMW tag to obtain the RMW read command;
[0015] Store the RMW read command and other commands into the command queue;
[0016] When the type judgment result is that there is no RMW operation in the request command; the request command is stored in the command queue.
[0017] In one embodiment, preprocessing the obtained request command to obtain the command preprocessing result also includes:
[0018] When a write command exists in the request command, data corresponding to the write command is stored in the write data cache.
[0019] In one embodiment, assigning numbers to command preprocessing results to obtain a mapping relationship between assigned commands and numbers includes:
[0020] Based on the remaining queue numbers, numbers are assigned to newly added commands to be executed in the command queue to obtain the assigned commands to be executed;
[0021] The cache address is calculated according to the allocated command to be executed, the write data cache and the read data cache to obtain a number mapping relationship.
[0022] In one embodiment, an arbitration judgment is performed on the allocated command to be executed according to the preset arbitration feature to obtain an arbitration judgment result, including
[0023] Extract features of multiple allocated commands to be executed in the command queue according to preset arbitration feature indicators to obtain feature information of the commands to be executed;
[0024] Based on the preset arbitration characteristic information, arbitration and classification are performed on the characteristic information of each command to be executed after allocation, so as to obtain multiple priority commands;
[0025] A plurality of priority commands are screened according to a preset selection principle, a target post-allocation command to be executed is obtained, and the target post-allocation command to be executed is set as a post-screening command.
[0026] In one of the embodiments, when the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment is continued, including:
[0027] When the arbitration judgment result is that the filtered command is an RMW read command, the RMW read command is executed to obtain the read data returned by the memory and the read data returned by the memory is stored in the read data cache;
[0028] Modify the RMW read command in the command queue to an RMW write command according to the number mapping relationship and the number allocation index, and perform arbitration judgment again;
[0029] When the arbitration judgment result of the next execution is that the filtered command is an RMW write command, the write data corresponding to the RMW write command is merged with the read data returned by the memory to obtain the merged data and write the merged data into the memory.
[0030] In one embodiment, the method further comprises:
[0031] When the arbitration judgment result is that the filtered command is a read command, receiving read data corresponding to the read command, and storing the read data in a read data cache;
[0032] Sort the data in the read data cache based on the number mapping relationship to obtain sorted read data;
[0033] When the arbitration judgment result is that the filtered command is a write command, data is extracted from the write data cache based on the number mapping relationship and the queue number corresponding to the write command to obtain data corresponding to the write command;
[0034] Write the data corresponding to the write command into the memory.
[0035] In a second aspect, the present application further provides a performance optimization device for a DRAM controller, comprising:
[0036] A preprocessing module is used to preprocess the acquired request command and obtain the command preprocessing result;
[0037] The queue control module is used to assign numbers to command preprocessing results and obtain the mapping relationship between assigned commands and numbers;
[0038] A command arbitration module, used for performing arbitration judgment on the assigned commands to be executed according to preset arbitration characteristics, and obtaining arbitration judgment results;
[0039] The command execution module is used to modify the command at the corresponding position of the filtered command in the command queue according to the number mapping relationship and the number allocation index when the arbitration judgment result is that the filtered command is an RMW read command, obtain the modified command and continue the arbitration judgment.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] Preprocess the obtained request command and obtain the command preprocessing result;
[0042] Assign numbers to command preprocessing results to obtain a mapping relationship between assigned commands and numbers;
[0043] Perform arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics, and obtain the arbitration judgment result;
[0044] When the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment continues.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0046] Preprocess the obtained request command and obtain the command preprocessing result;
[0047] Assign numbers to command preprocessing results to obtain a mapping relationship between assigned commands and numbers;
[0048] Perform arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics, and obtain the arbitration judgment result;
[0049] When the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment continues.
[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0051] Preprocess the obtained request command and obtain the command preprocessing result;
[0052] Assign numbers to command preprocessing results to obtain a mapping relationship between assigned commands and numbers;
[0053] Perform arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics, and obtain the arbitration judgment result;
[0054] When the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment continues.
[0055] The above-mentioned performance optimization method, device, computer equipment, storage medium and computer program product for DRAM controller modify the RMW operation into an RMW read command after receiving it, and add an RMW tag, then store the RMW read command and other commands with the RMW tag in the command queue, then allocate a queue number and calculate the number mapping relationship according to the command and queue number, then extract features of all commands in the command queue to obtain feature information for arbitration, perform arbitration judgment and screening on the feature information of all commands to determine the filtered commands, and then perform tag analysis on the filtered commands, and then perform different operations based on the analysis results. By splitting and reordering the read and write commands in the RMW operation, and setting a mechanism for the RMW read command to be executed before the RMW write command, it is achieved that the flip rate of the read and write commands is reduced while ensuring the integrity of the RMW operation, and the arbitration flexibility is improved to reduce delays, thereby achieving the effect of improving the read and write capabilities of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1A schematic diagram of a flow chart of a performance optimization method for a DRAM controller in one embodiment;
[0058] Figure 2 A schematic diagram of a flow chart of an arbitration judgment step in an embodiment;
[0059] Figure 3 Schematic diagram of the RMW operation steps in one embodiment;
[0060] Figure 4 A structural block diagram of a performance optimization device for a DRAM controller in one embodiment;
[0061] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0063] In one embodiment, Figure 1 As shown, a performance optimization method for a DRAM controller is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0064] Step 102: pre-process the acquired request command to obtain a command pre-processing result.
[0065] Exemplarily, after obtaining a new request command, the received request command is identified by an RMW operation. When an RMW operation exists in the command, the RMW operation is changed to a read command, and an RMW tag is added to the read command, that is, the read command is modified to an RMW read command. The RMW read command is then stored in the command queue together with other commands.
[0066] The data of the write command is simultaneously stored in the write data cache and waits to be written into the DRAM.
[0067] Step 104: assign numbers to the command preprocessing results to obtain a mapping relationship between the assigned commands and numbers.
[0068] Exemplarily, after the preprocessing operation is completed, the queue controller assigns a queue number to the command newly added to the command queue, and obtains a command with a queue number, i.e., a command after assignment. Then, the address of the write data cache and the address of the read data cache are calculated according to the assigned queue number, and the mapping relationship between the address of the write data cache and the address of the read data cache and each command in the command queue, i.e., the number mapping relationship, is obtained.
[0069] Step 106: perform arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics to obtain an arbitration judgment result.
[0070] The preset arbitration feature includes a preset arbitration feature indicator and preset arbitration feature information. The preset arbitration feature indicator includes bank information (ie, storage array information), row and column addresses, and direction (write or read).
[0071] For example, based on the preset arbitration feature index, the features of each command in the command queue are extracted to obtain the arbitration feature information of each command, and then the priority of each command in the command queue is classified in combination with the preset arbitration feature information to obtain multiple priority commands. Then, the command corresponding to the highest priority is screened from the multiple priority commands, i.e., the screened command.
[0072] Step 108, when the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment continues.
[0073] The arbitration judgment result includes that the command after screening is a RMW read command, the command after screening is a read command, and the command after screening is a write command.
[0074] Exemplarily, when the filtered command is an RMW read command, the RMW read command is executed, and the DRAM returns the read data corresponding to the RMW read command. After the RMW read command is executed, the RMW read command is modified to an RMW write command. Then the RMW write command is arbitrated again with the remaining commands.
[0075] In the above-mentioned performance optimization method for DRAM controller, after receiving the RMW operation, it is modified into an RMW read command and an RMW tag is added, and then the RMW read command with the RMW tag and other commands are stored in the command queue, and then the queue number is allocated and the number mapping relationship is calculated according to the command and queue number, and then all the commands in the command queue are feature extracted to obtain feature information for arbitration, and arbitration judgment and screening are performed on the feature information of all commands to determine the filtered commands, and then the filtered commands are subjected to tag analysis, and then different operations are performed based on the analysis results, and by splitting and reordering the read and write commands in the RMW operation, and setting a mechanism for the RMW read command to be executed before the RMW write command, it is achieved that the flip rate of the read and write commands is reduced while ensuring the integrity of the RMW operation, and the arbitration flexibility is improved to reduce the delay, thereby achieving the effect of improving the read and write capabilities of the system.
[0076] In an exemplary embodiment, preprocessing the acquired request command to obtain the command preprocessing result includes:
[0077] Perform type judgment on the request command to obtain a type judgment result; when the type judgment result is that there is an RMW operation in the request command, modify the request command with the RMW operation to a read command; add the modified read command based on the RMW tag to obtain an RMW read command; store the RMW read command and other commands in the command queue; when the type judgment result is that there is no RMW operation in the request command; store the request command in the command queue.
[0078] Exemplarily, a type judgment is performed on the obtained request command to determine whether there is an RMW operation in the request command.
[0079] When there is an RMW operation in the request command, the RMW operation is modified to a read command, and an RMW tag is added to the read command so that the read command is changed to an RMW read command. The RMW read command is then stored in the command queue together with other commands.
[0080] When there is no RMW operation in the request command, all commands are stored in the command queue.
[0081] In this embodiment, RMW operation recognition is performed on the obtained request command, and the recognized RMW operation is changed to an RMW read command. By splitting and reordering the read and write commands in the RMW operation, and setting a mechanism in which the RMW read command is executed before the RMW write command, the flip rate of the read and write commands is reduced while ensuring the integrity of the RMW operation.
[0082] In an exemplary embodiment, preprocessing the acquired request command to obtain the command preprocessing result further includes:
[0083] When there is a write command or an RMW write command in the request command, the data corresponding to the write command or the data corresponding to the RMW write command is stored in the write data cache. Exemplarily, when there is a write command in the request command, the data corresponding to the write command is stored in the write data cache.
[0084] In this embodiment, the input corresponding to the write command is stored in the write data cache, so that corresponding data can be extracted from the write data cache when the write command is executed based on the mapping relationship obtained by subsequent operations, thereby achieving the effect of data writing.
[0085] In an exemplary embodiment, assigning numbers to command preprocessing results to obtain a mapping relationship between assigned commands and numbers includes:
[0086] Based on the remaining queue numbers, numbers are assigned to newly added commands to be executed in the command queue to obtain assigned commands to be executed; cache addresses are calculated according to the assigned commands to be executed, write data cache, and read data cache to obtain a number mapping relationship.
[0087] For example, when a new to-be-executed command is stored in the command queue, the unassigned queue number is used to assign a number to the new to-be-executed command, thereby obtaining a to-be-executed command with a queue number, i.e., an assigned to-be-executed command. The queue number is then used to calculate a mapping relationship between each command in the command queue and the data in the address of the write data cache (or the address of the read data cache), i.e., a number mapping relationship.
[0088] In this embodiment, a queue number is assigned to new commands to be executed in the command queue, which facilitates the calculation of the mapping relationship between each command and the data in the address of the write data cache (or the address of the read data cache), so that the corresponding data can be quickly queried and extracted after the command is selected by arbitration, thereby improving the read and write performance of the system.
[0089] In an exemplary embodiment, Figure 2 As shown, performing arbitration judgment on the allocated command to be executed according to the preset arbitration feature to obtain the arbitration judgment result includes the following steps 202 to 206. Among them:
[0090] Step 202 : extracting features of a plurality of allocated commands to be executed in the command queue according to preset arbitration feature indicators to obtain feature information of the commands to be executed.
[0091] The preset arbitration characteristic indicators include bank information (ie, storage array information), row and column addresses, and write direction (or read direction).
[0092] Exemplarily, bank information, row and column addresses, and write direction (or read direction) are extracted from each command in the command queue, that is, command feature information to be executed of each command is obtained.
[0093] Step 204 , arbitrating and classifying the command characteristic information to be executed of each allocated command to be executed based on the preset arbitration characteristic information to obtain multiple priority commands.
[0094] The preset arbitration feature information includes:
[0095] ① The command selected by the arbitration module of the previous command is in a different Bank Group (storage array group);
[0096] ②The row of the bank (storage array) is activated;
[0097] ③The row of the bank (storage array) can be activated immediately;
[0098] ④ The command direction is the same as that selected by the arbitration module in the previous command (no read-write switching).
[0099] Exemplarily, after obtaining the characteristic information of the command to be executed, each command is prioritized using the preset arbitration characteristic information, and the specific classification criteria are:
[0100] First priority: commands with ①②④ in the feature information of the commands to be executed;
[0101] Second priority: commands with ①, ③, and ④ in the feature information of the commands to be executed;
[0102] The third priority: commands with ②④ in the feature information of the commands to be executed;
[0103] Fourth priority: commands with ③④ in the feature information of the commands to be executed;
[0104] Fifth priority: Commands ①②③④ do not exist in the feature information of commands to be executed.
[0105] Step 206 , screening multiple priority commands according to a preset selection principle, obtaining a target post-allocation command to be executed and setting the target post-allocation command to be executed as the screened command.
[0106] Among them, the preset selection principle is the shortest delay time.
[0107] Exemplarily, when it is determined that there is at least one priority level among the first priority level to the fourth priority level, the command with the shortest delay time is selected from the commands with the previous priority level as the target post-allocation command to be executed, and it is set as the post-screening command.
[0108] When there are only commands of the fifth priority level, the command first stored in the command queue is selected as the target post-allocation command to be executed, and is set as the post-screening command.
[0109] In this implementation, feature extraction is performed on all commands in the command queue to obtain feature information used for arbitration, and arbitration judgment and screening are performed on the feature information of all commands to determine the filtered commands, thereby reducing the flip rate of read and write commands, reducing latency, and improving system read and write performance.
[0110] In an exemplary embodiment, when the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment is continued, including:
[0111] When the arbitration judgment result is that the command after filtering is an RMW read command, the RMW read command is executed to obtain the read data returned by the memory and the read data returned by the memory is stored in the read data cache; the RMW read command in the command queue is modified to an RMW write command according to the number mapping relationship and the number allocation index, and the arbitration judgment is performed again; when the arbitration judgment result of the next execution is that the command after filtering is an RMW write command, the write data corresponding to the RMW write command is merged with the read data returned by the memory to obtain the merged data and write the merged data into the memory.
[0112] The arbitration judgment result includes that the command after screening is a RMW read command, a RMW write command, the command after screening is a read command, and the command after screening is a write command.
[0113] For example, when the arbitration result is that the filtered command is an RMW read command, the RMW read command is executed, and the DRAM returns the read data corresponding to the RMW read command and stores it in the read data cache. The RMW read command is then modified to an RMW write command, and then the RMW write command and other commands wait for arbitration.
[0114] When the RMW write command is obtained by arbitration screening, the queue number corresponding to the RMW write command and the storage space corresponding to the data corresponding to the RMW write command are released. At the same time, the data corresponding to the RMW write command is merged with the read data returned by the DRAM and written into the DRAM. Figure 3 As shown, R represents a read command, W represents a write command, RMW-R represents an RMW read command, and RMW-W represents an RMW write command.
[0115] Assumptions Figure 3 -a In this case, RMW1-R and RMW2-R are both selected by arbitration and executed. Then the commands in the command queue will be arranged as follows: Figure 3-b, where RMW1-W and RMW2-W wait for arbitration along with other commands.
[0116] After RMW1-W and RMW2-W are selected and output by arbitration, the queue numbers corresponding to RMW1-W and RMW2-W and the storage space corresponding to the data of RMW1-W and RMW2-W are released and can be used by new commands, such as Figure 3 -c.
[0117] In this embodiment, after the RMW read command is arbitrated and screened, the RMW write command corresponding to the RMW read command is filled in the same position in the command queue to ensure that the RMW read command is completed before the RMW write command, thereby ensuring the integrity of the RMW operation and achieving the effect of using one command queue to implement RMW read and write split execution, thereby reducing the consumption of logical resources.
[0118] In an exemplary embodiment, the performance optimization method for a DRAM controller further includes:
[0119] When the arbitration judgment result is that the command after filtering is a read command, the read data corresponding to the read command is received, and the read data is stored in the read data cache; the data in the read data cache is sorted based on the number mapping relationship to obtain the sorted read data; when the arbitration judgment result is that the command after filtering is a write command, data is extracted from the write data cache based on the number mapping relationship and the queue number corresponding to the write command to obtain the data corresponding to the write command; the data corresponding to the write command is written into the memory.
[0120] Exemplarily, when the filtered command is a read command, the read data returned by the DRAM is stored in the read data cache, and the read data in the read data cache is reordered based on the queue number.
[0121] When the filtered command is a write command, the write data corresponding to the write command is searched in the write data cache based on the queue number, and the write data is stored in the DRAM.
[0122] In this embodiment, the reordered data returned by the read command and the to-be-merged data read back by the RMW-R share a read data cache, thereby saving resources.
[0123] In an exemplary embodiment, a performance optimization method for a DRAM controller is provided, the method comprising the following steps:
[0124] Perform type judgment on the request command and obtain the type judgment result.
[0125] When the type judgment result is that the request command contains an RMW operation, the request command with the RMW operation is modified into a read command.
[0126] An addition operation is performed on the modified read command based on the RMW tag to obtain the RMW read command.
[0127] Store the RMW read command and other commands into the command queue.
[0128] When the type judgment result is that there is no RMW operation in the request command; the request command is stored in the command queue.
[0129] When a write command or an RMW write command exists in the request command, data corresponding to the write command or data corresponding to the RMW write command is stored in the write data cache.
[0130] Numbers are allocated to newly added commands to be executed in the command queue based on the remaining queue numbers to obtain allocated commands to be executed.
[0131] The cache address is calculated according to the allocated command to be executed, the write data cache and the read data cache to obtain a number mapping relationship.
[0132] Feature extraction is performed on a plurality of allocated commands to be executed in the command queue according to preset arbitration feature indicators to obtain feature information of the commands to be executed.
[0133] Based on the preset arbitration characteristic information, the characteristic information of each command to be executed after allocation is arbitrated and classified to obtain multiple priority commands.
[0134] A plurality of priority commands are screened according to a preset selection principle, a target post-allocation command to be executed is obtained, and the target post-allocation command to be executed is set as a post-screening command.
[0135] When the arbitration judgment result is that the filtered command is an RMW read command, the RMW read command is executed to obtain the read data returned by the memory and the read data returned by the memory is stored in the read data cache.
[0136] The RMW read command in the command queue is modified into an RMW write command according to the number mapping relationship and the number allocation index, and the arbitration judgment is performed again.
[0137] When the arbitration judgment result of the next execution is that the filtered command is an RMW write command, the write data corresponding to the RMW write command is merged with the read data returned by the memory to obtain the merged data and write the merged data into the memory.
[0138] When the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment continues.
[0139] When the arbitration judgment result is that the filtered command is a read command, read data corresponding to the read command is received and stored in a read data cache.
[0140] The data in the read data cache is sorted based on the number mapping relationship to obtain sorted read data.
[0141] When the arbitration judgment result is that the filtered command is a write command, data is extracted from the write data cache based on the number mapping relationship and the queue number corresponding to the write command to obtain data corresponding to the write command.
[0142] Write the data corresponding to the write command into the memory.
[0143] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0144] Based on the same inventive concept, the embodiment of the present application also provides a performance optimization device for a DRAM controller for implementing the performance optimization method for a DRAM controller involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the performance optimization device for a DRAM controller provided below can refer to the limitations of the performance optimization method for a DRAM controller above, and will not be repeated here.
[0145] In an exemplary embodiment, Figure 4 As shown, a performance optimization device for a DRAM controller is provided, comprising: a pre-processing module 402, a queue control module 404, a command arbitration module 406 and a command execution module 408, wherein:
[0146] The preprocessing module 402 is used to preprocess the obtained request command and obtain the command preprocessing result.
[0147] The queue control module 404 is used to assign numbers to the command preprocessing results and obtain a mapping relationship between the assigned commands and numbers.
[0148] The command arbitration module 406 is used to perform arbitration judgment on the allocated commands to be executed according to preset arbitration characteristics to obtain arbitration judgment results.
[0149] The command execution module 408 is used to modify the command at the corresponding position of the filtered command in the command queue according to the number mapping relationship and the number allocation index when the arbitration judgment result is that the filtered command is a RMW read command, obtain the modified command and continue the arbitration judgment.
[0150] In one of the embodiments, the preprocessing module 402 is also used to perform type judgment on the request command to obtain a type judgment result; when the type judgment result is that there is an RMW operation in the request command, the request command with the RMW operation is modified to a read command; based on the RMW tag, an add operation is performed on the modified read command to obtain an RMW read command; the RMW read command and other commands are stored in a command queue; when the type judgment result is that there is no RMW operation in the request command; the request command is stored in the command queue.
[0151] In one embodiment, the pre-processing module 402 is further configured to store data corresponding to a write command into a write data cache when a write command exists in the request command.
[0152] In one embodiment, the queue control module 404 is also used to assign numbers to newly added commands to be executed in the command queue based on the remaining queue numbers to obtain assigned commands to be executed; and to calculate cache addresses based on the assigned commands to be executed, write data cache, and read data cache to obtain a number mapping relationship.
[0153] In one of the embodiments, the command arbitration module 406 is further used to extract features of multiple post-allocation commands to be executed in the command queue according to preset arbitration feature indicators to obtain feature information of the commands to be executed; arbitrate and classify the feature information of each post-allocation command to be executed based on the preset arbitration feature information to obtain multiple priority commands; filter the multiple priority commands according to preset selection principles to obtain the target post-allocation command to be executed and set the target post-allocation command to be executed as the filtered command.
[0154] In one of the embodiments, the command execution module 408 is also used to, when the arbitration judgment result is that the command after filtering is an RMW read command, execute the RMW read command to obtain the read data returned by the memory and store the read data returned by the memory into the read data cache; modify the RMW read command in the command queue to an RMW write command according to the number mapping relationship and the number allocation index, and perform the arbitration judgment again; when the arbitration judgment result of the next execution is that the command after filtering is an RMW write command, merge the write data corresponding to the RMW write command with the read data returned by the memory, obtain the merged data and write the merged data into the memory.
[0155] In one of the embodiments, the command execution module 408 is further used to, when the arbitration judgment result is that the command after filtering is a read command, receive read data corresponding to the read command and store the read data in a read data cache; sort the data in the read data cache based on the number mapping relationship to obtain the sorted read data; when the arbitration judgment result is that the command after filtering is a write command, extract data from the write data cache based on the number mapping relationship and the queue number corresponding to the write command to obtain data corresponding to the write command; and write the data corresponding to the write command into the memory.
[0156] Each module in the above-mentioned performance optimization device for DRAM controller can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0157] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store request command data and its corresponding data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a performance optimization method for a DRAM controller is implemented.
[0158] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0159] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0160] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0161] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0164] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0165] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A performance optimization method for a DRAM controller, It is characterized in that The method comprises: Preprocess the obtained request command and obtain the command preprocessing result; Assigning numbers to the command preprocessing results to obtain a mapping relationship between the assigned commands and numbers; Perform arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics, and obtain the arbitration judgment result; When the arbitration judgment result is that the filtered command is a RMW read command, the command at the corresponding position of the filtered command in the command queue is modified according to the number mapping relationship and the number allocation index, the modified command is obtained and the arbitration judgment is continued.
2. The method according to claim 1, It is characterized in that The step of preprocessing the acquired request command to obtain the command preprocessing result includes: Performing type judgment on the request command to obtain a type judgment result; When the type determination result is that the request command contains an RMW operation, the request command containing the RMW operation is modified into a read command; Add an RMW tag to the modified read command to obtain the RMW read command; Storing the RMW read command and other commands in a command queue; When the type determination result is that there is no RMW operation in the request command; the request command is stored in a command queue.
3. The method according to claim 2, It is characterized in that The step of preprocessing the acquired request command and obtaining the command preprocessing result further includes: When a write command or an RMW write command exists in the request command, data corresponding to the write command or data corresponding to the RMW write command is stored in the write data cache.
4. The method according to claim 1, It is characterized in that The step of assigning numbers to the command preprocessing results to obtain a mapping relationship between the assigned commands and numbers includes: Based on the remaining queue numbers, numbers are assigned to newly added commands to be executed in the command queue to obtain the assigned commands to be executed; A cache address calculation is performed according to the allocated command to be executed, the write data cache and the read data cache to obtain a number mapping relationship.
5. The method according to claim 1, It is characterized in that The preset arbitration feature includes a preset arbitration feature indicator and preset arbitration feature information; The step of performing arbitration judgment on the allocated command to be executed according to the preset arbitration characteristics to obtain the arbitration judgment result includes: Extract features of multiple allocated commands to be executed in the command queue according to preset arbitration feature indicators to obtain feature information of the commands to be executed; Based on the preset arbitration characteristic information, the characteristic information of each command to be executed after allocation is arbitrated and classified to obtain multiple priority commands; A plurality of priority commands are screened according to a preset selection principle to obtain a target post-allocation command to be executed and the target post-allocation command to be executed is set as a screened command.
6. The method according to claim 1, It is characterized in that When the arbitration judgment result is that the filtered command is a RMW read command, modifying the command at the corresponding position of the filtered command in the command queue according to the number mapping relationship and the number allocation index, obtaining the modified command and continuing the arbitration judgment, including: When the arbitration judgment result is that the filtered command is an RMW read command, executing the RMW read command to obtain the read data returned by the memory and storing the read data returned by the memory into a read data cache; Modify the RMW read command in the command queue to an RMW write command according to the number mapping relationship and the number allocation index, and perform arbitration judgment again; When the arbitration judgment result of the next execution is that the filtered command is an RMW write command, the write data corresponding to the RMW write command is merged with the read data returned by the memory to obtain merged data and write the merged data into the memory.
7. The method according to claim 1, It is characterized in that The method further comprises: When the arbitration judgment result is that the filtered command is a read command, receiving read data corresponding to the read command, and storing the read data in a read data cache; Sorting the data in the read data cache based on the number mapping relationship to obtain sorted read data; When the arbitration judgment result is that the filtered command is a write command, data is extracted from the write data cache based on the number mapping relationship and the queue number corresponding to the write command to obtain data corresponding to the write command; The data corresponding to the write command is written into the memory.
8. A performance optimization device for a DRAM controller, It is characterized in that The device comprises: A preprocessing module is used to preprocess the acquired request command and obtain the command preprocessing result; A queue control module, used to assign numbers to the command preprocessing results and obtain a mapping relationship between the assigned commands and numbers; A command arbitration module, used for performing arbitration judgment on the assigned commands to be executed according to preset arbitration characteristics, and obtaining arbitration judgment results; The command execution module is used to modify the command at the corresponding position of the filtered command in the command queue according to the number mapping relationship and the number allocation index when the arbitration judgment result is that the filtered command is an RMW read command, obtain the modified command and continue the arbitration judgment.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
High-performance Inline ECC (Error Correction Code) implementation system
CN119759808A
