A method for performance optimization of a DDR4 controller
By dynamically adjusting the port priority and bandwidth threshold of the DDR4 controller, the performance fluctuation problem of traditional DDR4 controllers in different scenarios is solved, and load balancing and performance stability of system access are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG SINOCHIP SEMICON CO LTD
- Filing Date
- 2022-10-20
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional DDR4 controllers, which set fixed priority and bandwidth policies during initialization, cannot meet the access requirements of different scenarios during system operation, resulting in performance fluctuations.
By dynamically adjusting the port priority and bandwidth threshold of the DDR4 controller, the bandwidth of each port is monitored in real time, and adjustments are made when the bandwidth exceeds the threshold for m consecutive times, so as to achieve load balancing.
It achieves stability and balance of DDR access performance under different system scenarios, thereby improving the overall stability and efficiency of system performance.
Smart Images

Figure CN115587056B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of memory performance optimization, and more specifically to a method for optimizing the performance of a DDR4 controller. Background Technology
[0002] DDR4 typically employs a multi-port architecture, where each port can have its access priority and bandwidth configured. During initialization, port priority and bandwidth allocation are generally set. Currently, the main factors affecting DDR4 port performance are priority and bandwidth. Priority determines the execution order of commands on different ports, while the port bandwidth setting determines the percentage of bandwidth used by each port. These two factors together determine the access performance of each port and ultimately the overall DDR access performance of the system.
[0003] However, during system operation, read and write commands for each port originate from different external modules. These commands may occur simultaneously, and the access requirements for each port are different. The actual access situation changes continuously with the access scenario. For example, some scenarios require a fast response to the access commands of the module corresponding to port1, while other scenarios require a fast response to the access commands of the module corresponding to port2. A fixed-priority bandwidth strategy is difficult to meet the diverse needs of the system during operation. Therefore, setting fixed priorities and bandwidth during initialization in conventional solutions cannot satisfy the different scenarios during system operation, resulting in significant fluctuations in the overall system performance. Summary of the Invention
[0004] The purpose of this invention is to propose a method for dynamically adjusting the performance of DDR4 multi-ports to meet the performance requirements of DDR access in different system scenarios.
[0005] To achieve the above objectives, the present invention employs the following technical solution:
[0006] A method for optimizing DDR4 controller performance includes the following steps:
[0007] S1) Set the priority of the nth port to Pn, set the upper and lower limits of the initial bandwidth threshold of the nth (n=1,2,3,...) port to Bn_max and Bn_min respectively, set the check time interval to T, set the adjustment to be required if the same situation occurs for m consecutive times (m=1,2,3...), and set the real-time bandwidth of the port checked for the mth time to Bn_m.
[0008] S2) When the check is triggered, obtain the bandwidth status of all ports, check the relationship between the real-time bandwidth and the bandwidth threshold, and record it;
[0009] S3) If a port has a bandwidth that is higher than the upper limit of the bandwidth threshold or lower than the lower limit of the bandwidth threshold for m consecutive times, the port priority and bandwidth will be adjusted according to the priority bandwidth policy.
[0010] Preferably, the priority bandwidth strategy steps include:
[0011] S31) If a port has a bandwidth higher than the bandwidth threshold for m consecutive times, check the port's priority. If it is not the highest priority, increase the port's priority by one level, and keep the bandwidth threshold unchanged. If it is the highest priority, adjust the bandwidth or bandwidth threshold according to the bandwidth adjustment strategy.
[0012] S32) If a port experiences a bandwidth lower than the lower limit of the bandwidth threshold for m consecutive times, check the port's priority. If it is not the lowest priority, lower the port's priority by one level, while keeping the bandwidth threshold unchanged. If it is the lowest priority, adjust the bandwidth or bandwidth threshold according to the bandwidth adjustment strategy.
[0013] The preferred bandwidth adjustment strategy is as follows:
[0014] If a port has a bandwidth higher than the upper limit of the bandwidth threshold for m consecutive times and is already the highest priority, then the bandwidth of other lower priority ports with bandwidth lower than the lower limit of the bandwidth threshold will be released for that port to use; if a port has a bandwidth lower than the lower limit of the bandwidth threshold for m consecutive times and is already the lowest priority, then its bandwidth will be released for other ports to use.
[0015] Preferably, the bandwidth released for low-priority ports with bandwidth below the lower threshold is calculated using the following formula:
[0016] Release bandwidth = (Bn_min + ) / 2.
[0017] Preferably, the bandwidth release strategy is as follows: in ports where the real-time bandwidth is below the lower threshold, bandwidth is released from low to high priority; in ports where the real-time bandwidth is above the upper threshold, bandwidth is used from high to low priority.
[0018] Preferably, the bandwidth adjustment strategy also includes: if the bandwidth is below the lower limit of the bandwidth threshold for m consecutive times, which is already the lowest priority, then the lower limit of the bandwidth threshold for that port is lowered.
[0019] The preferred, lowest priority bandwidth threshold adjustment strategy is as follows:
[0020] Adjust the lower limit of the bandwidth threshold for this port to the maximum value of all real-time bandwidths below the lower limit of the bandwidth threshold out of m bandwidths.
[0021] The advantages of this invention are as follows: Compared with the traditional DDR port priority access method, the method described in this patent fully considers the inconsistency of different port accesses during DDR operation and the uneven port access performance caused by the change of the current system load over time. Based on real-time monitoring of the bandwidth access of each port, the priority and access bandwidth threshold of each port are dynamically adjusted to ensure the load balance of each port and keep the overall performance of the system accessing DDR at a balanced level. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the process of the present invention. Detailed Implementation
[0023] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0024] This invention discloses a method for optimizing the performance of a DDR4 controller. Please refer to [link / reference]. Figure 1 A flowchart, including the steps:
[0025] S1) Set the check interval to T, set the priority of the nth port to Pn, set the upper and lower limits of the initial bandwidth threshold of the nth (n=1,2,3,...) port to Bn_max and Bn_min respectively, set the adjustment to be made if the same situation occurs for m consecutive times (m=1,2,3...), and set the real-time bandwidth of the port checked for the mth time to Bn_m.
[0026] S2) Trigger a timer to check the bandwidth status of all ports starting from port=0, check the relationship between the real-time bandwidth and the bandwidth threshold at this time, and record it.
[0027] S3) If a port experiences bandwidth exceeding the upper limit or falling below the lower limit of the bandwidth threshold for m consecutive times, the port priority and bandwidth threshold will be adjusted according to the priority bandwidth policy:
[0028] If a port has a bandwidth higher than the upper limit of the bandwidth threshold for m consecutive times, check the priority of the port. If it is not the highest priority, the priority of the port is increased by one level, and the bandwidth threshold remains unchanged. If it is the highest priority, the bandwidth or bandwidth threshold is adjusted according to the bandwidth adjustment strategy. In this embodiment, the adjustment strategy is to release the bandwidth of other low-priority ports with bandwidth below the lower limit of the threshold for the use of this port.
[0029] The released bandwidth is calculated using the following formula: Released bandwidth = (Bn_min + ... ) / 2
[0030] If a port experiences bandwidth below the lower limit of the bandwidth threshold m times consecutively, check the port's priority. If it is not the lowest priority, lower the port's priority by one level while keeping the bandwidth threshold unchanged. If it is the lowest priority, adjust the bandwidth or bandwidth threshold according to the bandwidth adjustment strategy. In this embodiment, the adjustment strategy is to release its bandwidth for use by other ports. The bandwidth release can be referred to in the above formula.
[0031] The rules for releasing bandwidth are as follows: in ports where the real-time bandwidth is below the lower threshold, bandwidth is released from low to high priority; in ports where the real-time bandwidth is above the upper threshold, bandwidth is used from high to low priority.
[0032] After the adjustment is completed, the port number is incremented by one and the above steps are repeated until all N ports have been checked, at which point the timer is triggered again to start the check.
[0033] In another embodiment, based on the previous embodiment, the bandwidth adjustment strategy adds the step of: if the bandwidth is lower than the lower limit of the bandwidth threshold for m consecutive times and is already the lowest priority, then the lower limit of the bandwidth threshold of the port is reduced. The reduction strategy is: adjust the lower limit of the bandwidth threshold of the port to the maximum value of all real-time bandwidths that are lower than the lower limit of the bandwidth threshold among the m bandwidths.
[0034] Lowering the lower limit of the bandwidth threshold can ensure the effective use of the port in the future. The adjustment can also be made by adjusting it to the average, median or minimum value of all real-time bandwidths below the lower limit of the bandwidth threshold. However, this embodiment uses the maximum value, which has a smaller adjustment range and a higher fault tolerance rate compared to other options, so it is a better choice.
[0035] Finally, it should be noted that the above description is only a preferred embodiment of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for optimizing the performance of a DDR4 controller, characterized in that, Including the following steps: S1) Set the priority of the nth port to Pn, set the upper and lower limits of the initial bandwidth threshold of the nth port to Bn_max and Bn_min respectively, set the check time interval to T, set the adjustment to be required if the same situation occurs m times consecutively, and set the real-time bandwidth of the port checked for the mth time to Bn_m; where n=1,2,3…; m=1,2,3…; S2) When the check is triggered, obtain the current bandwidth status of all ports, check the relationship between the real-time bandwidth and the bandwidth threshold, and record it; S3) If a port experiences a bandwidth exceeding the upper limit of the bandwidth threshold or falling below the lower limit of the bandwidth threshold for m consecutive times, the port priority and bandwidth will be adjusted according to the priority bandwidth policy. The priority bandwidth policy steps include: S31) If a port has a bandwidth higher than the bandwidth threshold for m consecutive times, check the port priority. If it is not the highest priority, raise the port priority by one level, and keep the bandwidth threshold unchanged. If it is the highest priority, adjust the bandwidth or bandwidth threshold according to the bandwidth adjustment strategy. S32) If a port experiences a bandwidth lower than the lower limit of the bandwidth threshold for m consecutive times, check the port's priority. If it is not the lowest priority, lower the port's priority by one level while keeping the bandwidth threshold unchanged. If it is the lowest priority, adjust the bandwidth or bandwidth threshold according to the bandwidth adjustment strategy.
2. The method for optimizing DDR4 controller performance according to claim 1, characterized in that, The bandwidth adjustment strategy is as follows: If a port whose bandwidth exceeds the upper limit of the bandwidth threshold for m consecutive times is already the highest priority, then the bandwidth of other lower priority ports whose bandwidth is below the lower limit of the bandwidth threshold will be released for that port to use; if a port whose bandwidth is below the lower limit of the bandwidth threshold for m consecutive times is already the lowest priority, then its bandwidth will be released for other ports to use.
3. The method for optimizing DDR4 controller performance according to claim 1, characterized in that, The bandwidth released from low-priority ports with bandwidth below the lower threshold is calculated using the following formula: Release bandwidth = (Bn_min + ) / 2.
4. The method for optimizing the performance of a DDR4 controller according to claim 3, characterized in that, The bandwidth release strategy is as follows: in ports where the real-time bandwidth is below the lower threshold, bandwidth is released from low to high priority; in ports where the real-time bandwidth is above the upper threshold, bandwidth is used from high to low priority.
5. The method for optimizing the performance of a DDR4 controller according to claim 2, characterized in that, The bandwidth adjustment strategy also includes: if the bandwidth is below the lower limit of the bandwidth threshold for m consecutive times, which is already the lowest priority, then the lower limit of the bandwidth threshold for that port will be lowered.
6. The method for optimizing DDR4 controller performance according to claim 5, characterized in that, The minimum priority bandwidth threshold adjustment strategy is as follows: Adjust the lower limit of the bandwidth threshold for this port to the maximum value of all real-time bandwidths below the lower limit of the bandwidth threshold in m bandwidth tests.