A test device and method for automatically generating DDR optimal efficiency configuration parameters
Through the test device that automatically generates the optimal efficiency configuration parameters of DDR, the bus excitation generator and efficiency analysis logic are used to automatically adjust the DDR address mapping configuration, the problem of low DDR efficiency is solved, and the automatic optimization and accuracy of DDR efficiency is achieved. Reduced labor and time costs.
Patent Information
- Application Number
- CN202111337312.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-11-12
AI Technical Summary
The prior art is difficult to effectively solve the problem of low DDR efficiency, especially due to the performance degradation caused by unreasonable address mapping configuration parameters. The traditional method relies on empirical configuration, lacks automation and accuracy, resulting in high labor and time costs.
Design a test device that automatically generates the optimal efficiency configuration parameters of DDR, including a bus excitation generator, a bus monitoring and analysis logic, an efficiency analysis logic and an address mapping configuration logic. By monitoring and analyzing DDR access behavior in real time, it automatically adjusts the address Map configuration parameters until the best configuration is found.
It realizes automated DDR efficiency optimization, avoids information exchange errors, saves manpower and time, and ensures the accuracy and optimality of DDR efficiency test results.
Smart Images

Figure CN113921074B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a testing device and method for automatically generating DDR optimal efficiency configuration parameters. Background Art
[0002] The efficiency of DDR is one of the core factors affecting chip performance. The efficiency of DDR is related to its operating frequency, particle model, capacity, software parameter configuration, system architecture, and usage scenarios. When the hardware is determined, the factor that has the greatest impact on DDR efficiency is the software configuration parameters of DDR itself. For the same DDR, using inappropriate software configuration may cause a significant performance degradation and fail to meet the expected indicators. Among all the software configuration parameters of DDR, a key configuration that affects its performance is the configuration of address mapping. The so-called address mapping means that the bus address issued by the upstream master when accessing DDR will be converted by the DDR controller into the storage address of the DDR particle according to certain rules. This storage address consists of three dimensions: column, row, and bank. Here, column and row are similar to the columns and rows of a table, and bank is similar to the page of a table. The bank of DDR is a logical bank (Logical Bank, referred to as L-Bank). At present, most DDR chips are designed with 4 L-Banks. If you need to access DDR, the addressing process is to specify the L-Bank address first, then the Row address, and then the Column address. In actual work, the L-Bank address and the corresponding Row address are issued at the same time. At this time, this command is called "Row Valid" or "Row Active". After that, the column addressing command and the specific operation command (read or write) will be sent. These two commands are also issued at the same time, so the column addressing is generally represented by "read / write command". According to the DDR protocol, the interval from "Row Valid" to "Read / Write Command" is defined as tRCD, that is, RAS to CAS Delay (RAS to CAS delay, RAS is the row address strobe pulse, CAS is the column address strobe pulse). For read operations, after the column address is selected, data transmission will be triggered, but it takes a certain amount of time from the output of the storage unit to the actual appearance of the memory particle I / O interface. This period of time is called CL (CAS Latency, column address pulse strobe latency). CL is only for read operations, and there is no latency for writes. In addition, if two adjacent operations need to open different rows, according to the design principle of DDR, the existing working row needs to be closed first, and then the new working row needs to be opened. This time interval is called tRP (Row Precharge command Period). From the above description, it can be seen that the three parameters tRCD, CL and tRP are crucial to the performance of DDR.Taking the read operation, the most important operation of DDR, as an example for analysis, when reading a certain address, there are mainly three situations: 1) The Row and L-Bank to be addressed are idle. At this time, the row valid command can be sent directly. The total time before data reading is tRCD+CL. This situation is called a page hit (PH, Page Hit); 2) The row to be addressed happens to be the existing working row. At this time, the column addressing command can be sent directly. The total time before data reading is only CL, which is the so-called back-to-back (Back to Back) addressing. This situation is called a page fast hit (PFH, PageFast Hit); 3) There is already an active row in the L-Bank where the row to be addressed is located. This phenomenon is called an addressing conflict. At this time, pre-charging must be performed to close the working row, and then a row valid command is sent to the new row. The total time is tRP+tRCD+CL. This situation is called a page miss (PM, Page Miss). From the above analysis, we can see that the more cases of page fast hits (PFH), the shorter the time it takes to access DDR and the higher the efficiency, while the more cases of page misses (PM), the longer the time it takes to access DDR and the lower the efficiency. The distribution of the above three access situations is closely related to the address distribution issued by the master. If the [bank, row, column] address continuity generated after mapping is good and the proportion of PFH access is large, then the efficiency performance of DDR will be better, otherwise it will be worse. You can try to adjust the address mapping configuration to reduce the probability of PM and increase the probability of PFH and PH, thereby improving the access efficiency of DDR.
[0003] However, how to obtain a suitable DDR address mapping configuration parameter is a difficult problem. First of all, the address mapping configuration is not like other DDR parameters that have protocol-specified standards. Whether its configuration is reasonable is closely related to the access behavior of the upstream master. It requires a certain understanding of both DDR and the upstream master to give a reasonable configuration. However, in reality, the verification or testing of DDR and the upstream master is often done by different people, and both parties generally do not know much about the modules that the other party is responsible for. The usual practice is that the upstream master tester proposes performance requirements and approximate address distribution. The DDR tester gives several sets of empirical configurations based on the provided address distribution. The master tester gets these configurations and tests them, and then selects a configuration result with relatively optimal efficiency. Obviously, there are many problems with the above approach:
[0004] 1) It is difficult to determine whether the relatively optimal configuration obtained is the true optimal solution, and whether there is a better configuration that can better explore the performance of DDR;
[0005] 2) It is possible that the address access distribution provided by the master tester does not completely match the actual situation. The DDR tester gives an unreasonable address mapping configuration based on the inaccurate address distribution, resulting in a decrease in DDR efficiency.
[0006] 3) Each time a new address mapping configuration is changed and attempted, upstream and downstream testers need to re-communicate, re-test, and compare and analyze DDR efficiency performance, which consumes a lot of manpower and time costs.
[0007] In summary, the above problems are often encountered in DDR performance testing, but there is a lack of effective solutions. Summary of the invention
[0008] The present invention provides a test device and method for automatically generating DDR optimal efficiency configuration parameters, automatically adjusting DDR address mapping configuration parameters according to test results, and restarting the test until a set of DDR optimal efficiency configuration parameters is output.
[0009] In order to achieve the purpose of the present invention, a test device for automatically generating DDR optimal efficiency configuration parameters includes a bus excitation generator, a bus monitoring and analysis logic, an efficiency analysis logic, an address mapping configuration logic and a DDR logic. The bus excitation generator is used to generate access excitation to the DDR logic. The bus monitoring and analysis logic monitors the read and write behavior of the bus excitation generator on the DDR logic in real time and outputs relevant monitoring data. The efficiency analysis logic collects the data generated by the bus monitoring and analysis logic, calculates the efficiency and then outputs the relevant data. The address mapping configuration logic collects the data generated by the efficiency analysis logic, analyzes it and decides whether to adjust the configuration parameters to restart the test.
[0010] In order to achieve the purpose of the present invention, a method for testing a test device that automatically generates DDR optimal efficiency configuration parameters includes the following steps:
[0011] 1) The bus monitoring and analysis logic converts the bus address generated by the bus stimulus generator according to the existing address mapping configuration, analyzes the conversion of the bus address and records it; the bus monitoring and analysis logic counts the time consumed by the bus stimulus generator to access the DDR logic;
[0012] 2) The efficiency analysis logic calculates and counts the proportion of PH, PFH and PM accesses in a round of testing based on the conversion address distribution output by the bus monitoring and analysis logic; the efficiency analysis logic obtains the consumption time data output by the bus monitoring and analysis logic, and calculates the average consumption time and maximum consumption time and bandwidth of reading and writing in a round of testing;
[0013] 3) The address mapping configuration logic automatically generates a new address mapping configuration according to the comprehensive efficiency performance output by the efficiency analysis logic and the PH, PFH and PM distribution generated by the bus monitoring and analysis logic, writes the configuration into the configuration parameters of the DDR logic, and automatically starts the bus stimulus generator to carry out a new round of testing; the address mapping configuration logic automatically compares the test results with the previous round, and records the configuration parameters with better efficiency performance, repeats the test until there is no obvious improvement in efficiency, and exits the test loop.
[0014] As an optimization solution of the present invention, after the efficiency analysis logic obtains the average consumption time and the maximum consumption time of reading and writing and the bandwidth index, it sets the priority of each index according to specific requirements and calculates the comprehensive efficiency of the DDR in this round of testing:
[0015] E=[BW, LATavr, LATmax, LATpercent] Formula 1
[0016] In Formula 1, E represents comprehensive efficiency, BW represents bandwidth, LATavr represents average consumption time, LATmax represents maximum consumption time, and LATpercent represents consumption time distribution percentage.
[0017] The present invention has positive effects: 1) The present invention can find the address mapping configuration that optimizes the DDR efficiency, solving the disadvantage of using empirical values in the traditional method;
[0018] 2) The method provided by the present invention can avoid information exchange errors between upstream and downstream DDR testers. Upstream testers can use the method independently to obtain the best address mapping configuration without the guidance of DDR testers, so that the efficiency test results are consistent with the actual situation as much as possible;
[0019] 3) The test method provided by the present invention can be run fully automatically without human intervention, which greatly saves manpower and reduces the time wasted on efficiency analysis by traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0021] Figure 1 It is the overall principle block diagram of the present invention;
[0022] Figure 2 It is the principle block diagram of bus monitoring and analysis logic;
[0023] Figure 3 It is the principle block diagram of the efficiency analysis logic;
[0024] Figure 4 It is a block diagram of the address mapping configuration logic.
[0025] Among them: 1. Bus stimulus generator, 2. Bus monitoring and analysis logic, 3. Efficiency analysis logic, 4. Address mapping configuration logic, 5. DDR logic. DETAILED DESCRIPTION
[0026] The implementation of the present invention is further described in detail below with reference to the accompanying drawings:
[0027] like Figure 1 As shown, the present invention discloses a test device for automatically generating DDR optimal efficiency configuration parameters, including a bus excitation generator 1, a bus monitoring and analysis logic 2, an efficiency analysis logic 3, an address mapping configuration logic 4 and a DDR logic 5, wherein the bus excitation generator 1 is used to generate access excitation to the DDR logic 5, the bus monitoring and analysis logic 2 monitors the read and write behavior of the bus excitation generator 1 to the DDR logic 5 in real time and outputs relevant monitoring data, the efficiency analysis logic 3 collects the data generated by the bus monitoring and analysis logic 2, calculates the efficiency and then outputs the relevant data, and the address mapping configuration logic 4 collects the data generated by the efficiency analysis logic 3, analyzes it and decides whether to adjust the configuration parameters to restart the test.
[0028] Bus stimulus generator 1 is the logic for generating specific access stimulus for DDR. After the tester gives the address distribution rule, this logic will generate stimulus corresponding to the address distribution. It can also be replaced by a real master.
[0029] like Figure 2 As shown, the bus monitoring and analysis logic 2 mainly implements the following functions:
[0030] 1. According to the existing address mapping configuration, the bus address generated by the bus stimulus generator 1 is converted, and the conversion of each access address is analyzed and recorded. The address conversion here is the conversion from the bus address to the actual DDR storage address [bank, row, column]. Common address mapping methods include BRC (Bank / Row / Column) and RBC (ROW / Bank / Column). Assuming that the bus address is a 32-bit address addr[31:0], after BRC mapping, it may be Bank = Addr[28:27] / Row = Addr[26:11] / Col = Addr[10:2], and after RBC mapping, it may be Row = Addr[28:13] / Bank = Addr[12:11] / Col = Addr[10:2]. The above two are just the most common mapping methods. In fact, the DDR controller may support more complex mapping methods, such as Row[15:2]=Addr[28:15] / Col[9:8]=Addr[14:13] / Bank[1]=Addr
[12] / Row[1:0]=Addr[11:10] / Col[7:0]=Addr[9:3] / Bank[0]=Addr[2]. Each of the above configurations may significantly change the DDR efficiency. In this step, the bus address is decomposed into [bank, row, column] addresses according to the preset address mapping configuration, and the corresponding relationship is recorded to obtain the distribution of the conversion address for subsequent calculation and analysis;
[0031] 2. Count the time consumed for each access (latency). Here, the latency of each read and write is calculated by monitoring the time it takes the master to send a read and write command and receive a DDR response.
[0032] like Figure 3 As shown, the efficiency analysis logic 3 mainly implements the following functions:
[0033] (1) After this round of testing is completed, the proportion of PH, PFH and PM in this round of testing is calculated and counted based on the distribution of the conversion addresses output by the bus monitoring and analysis logic 2. Here, the change of Bank and Row of several adjacent accesses is analyzed to determine which type the current access belongs to and the number of times is counted, and finally a proportion of the three types of access is obtained. The calculated result here is slightly different from the distribution of the three types of access when DDR is actually working. This is due to the arbitration optimization mechanism inside DDR and the influence of cache. However, the distribution curves of the two are similar after a long period of testing;
[0034] (2) After this round of testing is completed, the latency data output by the bus monitoring and analysis logic 2 is obtained, and the average latency, maximum latency and bandwidth of reading and writing in a round of testing are calculated. The average latency can reflect the average efficiency of DDR, and the maximum latency can reflect the worst access situation of DDR. The statistics of these two indicators are based on the fact that different masters may have different requirements for performance. Some masters pay more attention to the average latency, while some masters require that the worst situation cannot exceed a certain latency. The priorities of the two indicators can be set according to the different requirements of the master. Bandwidth is a more macro performance indicator of DDR efficiency. Usually, the master will have bandwidth requirements when accessing DDR. In theory, the smaller the average latency, the larger the bandwidth. Calculating the bandwidth can firstly show whether the command flow generated by the bus excitation generator is sufficient. If it is not enough, the packet setting needs to be adjusted. Secondly, it can intuitively reflect whether the DDR access path meets the bandwidth requirements of the master. After the calculation of the average latency, maximum latency and bandwidth of reading and writing, the priority of each indicator will be set according to the specific requirements to calculate the comprehensive efficiency of DDR in this round of testing:
[0035] E=[BW, LATavr, LATmax, LATpercent] Formula 1
[0036] In formula 1, E represents comprehensive efficiency, BW represents bandwidth, LATavr represents average latency, LATmax represents maximum latency, and LATpercent represents latency distribution percentage. This parameter represents the proportion of accesses that take longer than LATavr in a round of testing. The distribution of latency may be determined by presetting a ratio. For example, setting the target LATpercent = 30% means that 70% of access latencies will be less than LATavr, but at the same time, it may cause LATmax to be worse. Bandwidth is usually set to the highest priority, and LATavr and LATmax are set according to actual requirements. When performing efficiency comparison analysis, optimization will be prioritized to meet the highest priority indicator.
[0037] like Figure 4 As shown, the address mapping configuration logic 4 mainly implements the following functions:
[0038] 1. According to the comprehensive efficiency performance output by the efficiency analysis logic 3, combined with the PH, PFH and PM distribution generated by the bus monitoring and analysis logic 2, a new address mapping configuration is automatically generated, and the configuration is written into the DDR configuration parameters;
[0039] 2. Automatically start the bus stimulus data generator to start a new round of testing;
[0040] 3. Automatically compare the test results of the current round with the previous round, and record the configuration parameters with better efficiency performance. Repeat the test until the efficiency is not significantly improved and then exit the test loop.
[0041] A method for testing using a test device that automatically generates DDR optimal efficiency configuration parameters includes the following steps:
[0042] 1) The bus monitoring and analysis logic 2 converts the bus address generated by the bus stimulus generator 1 according to the existing address mapping configuration, analyzes the conversion of the bus address and records it; the bus monitoring and analysis logic 2 counts the time consumed by the bus stimulus generator 1 to access the DDR logic 5;
[0043] 2) The efficiency analysis logic 3 calculates and counts the proportion of PH, PFH and PM accesses in a round of testing according to the distribution of the conversion addresses output by the bus monitoring and analysis logic 2; the efficiency analysis logic 3 obtains the consumption time data output by the bus monitoring and analysis logic 2, and calculates the average consumption time and maximum consumption time and bandwidth of reading and writing in a round of testing;
[0044] 3) The address mapping configuration logic 4 automatically generates a new address mapping configuration according to the comprehensive efficiency performance output by the efficiency analysis logic 3 and the distribution of PH, PFH and PM generated by the bus monitoring and analysis logic 2, and writes the configuration into the configuration parameters of the DDR logic 5, and automatically starts the bus stimulus generator 1 to carry out a new round of testing; the address mapping configuration logic 4 automatically compares the test results with the previous round, and records the configuration parameters with better efficiency performance, repeating the test until the efficiency is not significantly improved and then exits the test loop.
[0045] The above-mentioned embodiments only express the implementation mode of the present invention, and the description is relatively specific and detailed, and it cannot be understood as limiting the scope of the present invention. It should be pointed out that several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A test method for automatically generating DDR optimal efficiency configuration parameters, characterized in that: The method is a method for testing by using a test device for automatically generating DDR optimal efficiency configuration parameters. The test device for automatically generating DDR optimal efficiency configuration parameters comprises a bus excitation generator (1), a bus monitoring and analysis logic (2), an efficiency analysis logic (3), an address mapping configuration logic (4) and a DDR logic (5). The bus excitation generator (1) is used to generate access excitation to the DDR logic (5). The bus monitoring and analysis logic (2) monitors the read and write behavior of the bus excitation generator (1) to the DDR logic (5) in real time and outputs relevant monitoring data. The efficiency analysis logic (3) collects the data generated by the bus monitoring and analysis logic (2), calculates the efficiency and then outputs the relevant data. The address mapping configuration logic (4) collects the data generated by the efficiency analysis logic (3), analyzes it and determines whether to adjust the configuration parameters to restart the test. The method comprises the following steps: 1) The bus monitoring and analysis logic (2) converts the bus address generated by the bus stimulus generator (1) according to the existing address mapping configuration, analyzes the conversion of the bus address and records it; The bus monitoring and analysis logic (2) counts the time consumed by the bus stimulus generator (1) to access the stimulus to the DDR logic (5); 2) The efficiency analysis logic (3) calculates and counts the proportions of the three types of access, PH, PFH and PM, in a round of testing based on the distribution of the conversion addresses output by the bus monitoring and analysis logic (2); the efficiency analysis logic (3) obtains the consumption time data output by the bus monitoring and analysis logic (2), and calculates the average consumption time and the maximum consumption time and bandwidth of reading and writing in a round of testing; 3) The address mapping configuration logic (4) automatically generates a new address mapping configuration based on the comprehensive efficiency of the DDR output by the efficiency analysis logic (3) and the distribution of PH, PFH and PM generated by the bus monitoring and analysis logic (2), and writes the configuration into the configuration parameters of the DDR logic (5), and automatically starts the bus stimulus generator (1) to start a new round of testing; the address mapping configuration logic (4) automatically compares the test results with the previous round, and records the efficiency performance configuration parameters, repeating the test until the efficiency is not significantly improved and exits the test cycle; The overall efficiency of DDR is: E=[BW, LATavr, LATmax, LATpercent] Formula 1; In Formula 1, E represents comprehensive efficiency, BW represents bandwidth, LATavr represents average consumption time, LATmax represents maximum consumption time, and LATpercent represents consumption time distribution percentage.
2. The test method for automatically generating DDR optimal efficiency configuration parameters according to claim 1, characterized in that: After obtaining the average and maximum consumption time of reading and writing and the bandwidth index, the efficiency analysis logic (3) sets the priority of each index according to specific requirements and calculates the comprehensive efficiency of the DDR in this round of testing.
