Methods, apparatus, electronic devices and storage media for optimizing chip memory power consumption
Optimizing the power consumption of chip memory by calculating and selecting suitable physical memory solves the problem of high memory power consumption in chip design and achieves lower power consumption and better chip design solutions.
Patent Information
- Application Number
- CN202210265614.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-03-17
AI Technical Summary
The memory power consumption in existing chip designs is high, which results in increased chip physical design complexity, increased dynamic voltage drop, increased capacitance requirements, excessive solder ball current, and strict heat dissipation solution requirements, which affects chip performance and feasibility.
By extracting the design information of the logical memory, calculate the pre-selection indicators, select the physical memory that meets the performance conditions and has the smallest area as the pre-selection memory, and then select the target memory with the best power consumption from the physical memories that meet the pre-selection indicators, based on the target memory design Logic memory to optimize the power consumption of chip memory.
While ensuring that the total chip memory area is as optimal as possible, the memory power consumption can be significantly reduced, the complexity and performance of chip design can be improved, and the competitiveness of chip products can be enhanced.
Smart Images

Figure CN114462353B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology, and in particular to a chip memory power consumption optimization method, device, electronic device and storage medium. Background Art
[0002] Chip is a general term for semiconductor component products, which are actually integrated circuits. For large network switching chips with ultra-high performance and ultra-high bandwidth under advanced processes, memory power consumption occupies a significant dominant position in the total power consumption of the chip. Excessive total power consumption will greatly increase the complexity of chip physical design and system design, and will also lead to increased dynamic voltage drop of the chip, a lot of capacitance added to the silicon wafer and package of the chip, difficulty in meeting the timing requirements, excessive current passing through a single solder ball, insufficient total number of power solder balls, and too high requirements for system heat dissipation solutions.
[0003] However, the current chip design method has the problem that the designed chip memory has high power consumption. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a chip memory power consumption optimization method, device, electronic device and storage medium, which can improve the problem of high power consumption of designed chip memories existing in current chip design methods.
[0005] In order to achieve the above objectives, the technical solutions adopted by the embodiments of the present invention are as follows.
[0006] In a first aspect, an embodiment of the present invention provides a method for optimizing power consumption of a chip memory, which adopts the following technical solution.
[0007] A method for optimizing chip memory power consumption, the method comprising:
[0008] Extracting design information of required logic memory, wherein the design information includes address depth and data width;
[0009] Calculate at least one group of pre-selected indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information, each group of the pre-selected indicators including address depth and data width;
[0010] Obtaining a pre-selected memory satisfying a preliminary selection condition from a plurality of physical memories satisfying the pre-selected indexes of each group, wherein the pre-selected condition includes a performance condition and a minimum area;
[0011] Calculating the preliminary performance of the logic memory formed by the pre-selected memory, wherein the preliminary performance includes a first area, a first power consumption, an area loss coefficient, and a power consumption optimization coefficient;
[0012] Based on the pre-selected performance, a target memory that meets the optimal power consumption condition is obtained from the physical memories that meet the pre-selected indicators of each group;
[0013] A logical memory based on the target memory design requirement is obtained to obtain a chip memory power consumption optimization solution.
[0014] Furthermore, the optimal power consumption condition includes an area condition and a power consumption condition;
[0015] The step of obtaining a target memory that meets the optimal power consumption condition from the physical memories that meet each group of the pre-selected indicators based on the pre-selected performance includes:
[0016] For each group of the pre-selected indicators, poll each physical memory that meets the pre-selected indicators, and if the currently polled physical memory meets the performance condition, calculate the second area and the second power consumption of the logical memory constituted by the physical memory;
[0017] Calculating an area condition according to the first area and the area loss coefficient, and calculating a power consumption condition according to the first power consumption and the power consumption optimization coefficient;
[0018] If the second area is smaller than the area condition, and the second power consumption is smaller than the power consumption condition, the currently polled physical memory is used as the pre-selected memory, and the pre-selected performance is updated;
[0019] After all physical memories meeting the pre-selected index are polled based on the updated preliminary performance, each physical memory meeting the next group of pre-selected indexes is continuously polled until all physical memories meeting all the pre-selected indexes are polled;
[0020] After the polling is completed, the final pre-selected memory is used as the target memory.
[0021] Furthermore, the area condition includes: A = A c ×(1+X i ), where A represents the area condition, A c represents the first area, X i represents the area loss coefficient;
[0022] The power consumption conditions include: P = P c ×(1-Y i );
[0023] Among them, P represents the power consumption condition, P c Indicates the first power consumption, Y i Indicates the power consumption optimization factor.
[0024] Furthermore, the design information also includes the number of instantiations;
[0025] The step of calculating the preliminary performance of the logical memory formed by the pre-selected memory comprises:
[0026] Calculating a first area and a first power consumption of a logic memory formed by the preselected memory according to the compilation index of the preselected memory and the instantiation times;
[0027] Calculating the area ratio and power consumption ratio of the logic memory formed by the preselected memory on the chip according to the first area and the first power consumption;
[0028] Based on the size relationship between the area ratio and the preset first set of thresholds, setting an area loss coefficient that matches the size relationship;
[0029] Based on the size relationship between the power consumption proportion and the preset second set of thresholds, a power consumption optimization coefficient matching the size relationship is set.
[0030] Furthermore, the step of calculating at least one set of pre-selected indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information includes:
[0031] According to the address depth and the data width of the logical memory and the compilation index of the same type of physical memory, a first range value of the address depth segmentation coefficient and a second range value of the data width segmentation coefficient are obtained;
[0032] According to the first range value and the second range value, a plurality of groups of segmentation coefficients are obtained, each group of segmentation coefficients including an address depth segmentation coefficient and a data width segmentation coefficient;
[0033] Each group of the slicing coefficients is combined with the address depth and the data width of the logical memory to determine a group of pre-selected indicators.
[0034] Further, the compilation indicators of the same type of physical memory include a maximum supported address depth, a minimum supported address depth, a maximum supported data width, and a minimum supported data width;
[0035] The step of obtaining a first range value of an address depth slicing coefficient and a second range value of a data width slicing coefficient according to the address depth and the data width of the logical memory and a compilation indicator of a physical memory of the same type comprises:
[0036] Obtaining a first range value of an address depth segmentation coefficient according to a quotient between the address depth of the logical memory and the minimum supported address depth, and a quotient between the address depth of the logical memory and the maximum supported address depth;
[0037] A second range value of the data width slicing coefficient is obtained according to a quotient between the data width of the logical memory and the minimum supported data width, and a quotient between the data width of the logical memory and the maximum supported data width.
[0038] Furthermore, the step of obtaining a pre-selected memory satisfying a preliminary selection condition from a plurality of physical memories satisfying the pre-selected indicators of each group includes:
[0039] Initialize the first unit storage area value of the selected memory to infinity;
[0040] For each group of the pre-selected indicators, poll each physical memory that meets the pre-selected indicators in order of area from small to large, and if the currently polled physical memory meets the performance condition, calculate the second unit storage area value of the currently polled physical memory;
[0041] If the second unit storage area value is smaller than the first unit storage area value, the currently polled physical memory is used as the selected memory, and the first unit storage area value is updated to the second unit storage area value;
[0042] After all physical memories meeting the pre-selected index are polled based on the updated first unit storage area value, each physical memory meeting the next group of the pre-selected indexes is continuously polled until all physical memories meeting all the pre-selected indexes are polled;
[0043] After the polling is completed, the final selected memory is used as the pre-selected memory.
[0044] In a second aspect, an embodiment of the present invention provides a chip memory power consumption optimization device, which adopts the following technical solution.
[0045] A chip memory power consumption optimization device comprises a pre-selection module, a final selection module and an optimization module;
[0046] The pre-selection module is used to extract the design information of the required logic memory, wherein the design information includes address depth, data width and instantiation times;
[0047] The pre-selection module is further used to calculate at least one group of pre-selected indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information, each group of the pre-selected indicators including address depth and data width;
[0048] The pre-selection module is further used to obtain a pre-selected memory that meets a preliminary selection condition from a plurality of physical memories that meet the pre-selection indexes of each group, wherein the preliminary selection condition includes a performance condition and a minimum area;
[0049] The final selection module is used to calculate the preliminary performance of the logical memory composed of the pre-selected memory, and based on the preliminary performance, obtain the target memory that meets the optimal power consumption condition from the physical memory that meets each group of the pre-selected indicators, wherein the preliminary performance includes a first area, a first power consumption, an area loss coefficient, and a power consumption optimization coefficient;
[0050] The optimization module is used to design a logic memory based on the target memory requirements to obtain a chip memory power consumption optimization solution.
[0051] In a third aspect, an embodiment of the present invention provides an electronic device, which adopts the following technical solution.
[0052] An electronic device comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the chip memory power consumption optimization method as described in the first aspect.
[0053] A fourth solution is provided in an embodiment of the present invention, which provides a storage medium and adopts the following technical solution.
[0054] A storage medium stores a computer program, which, when executed by a processor, implements the chip memory power consumption optimization method as described in the first aspect.
[0055] The chip memory power consumption optimization method, device, electronic device and storage medium provided by the embodiment of the present invention obtain at least one set of pre-selected indicators according to the design information of the required logical memory and the compilation indicators of the same type of physical memory, and select the physical memory that meets the performance conditions and has the smallest area as the pre-selected memory from multiple physical memories that meet the pre-selected indicators, and then obtain the target memory with the best power consumption from the multiple physical memories that meet the pre-selected indicators according to the preliminary performance of the logical memory constituted by the pre-selected memory, and make the area of the target memory as small as possible and the power consumption as optimal as possible under the premise of meeting the performance conditions, and then design the logical memory according to the target memory, so that the design scheme of the chip memory can achieve the goal of reducing the power consumption of the memory as much as possible while ensuring that the total area of the chip memory is as optimal as possible.
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 A block diagram of a chip memory power consumption optimization system provided by an embodiment of the present invention is shown.
[0059] Figure 2 A schematic flow chart of a chip memory power consumption optimization method provided by an embodiment of the present invention is shown.
[0060] Figure 3 Shows Figure 2 Schematic diagram of the process of some sub-steps of step S102.
[0061] Figure 4 Shows Figure 2 Schematic diagram of the process of some sub-steps of step S103.
[0062] Figure 5 Shows Figure 2 Schematic diagram of the process of some sub-steps of step S104.
[0063] Figure 6 Shows Figure 2 Schematic diagram of the flow chart of some sub-steps of step S105.
[0064] Figure 7 A block diagram of a chip memory power consumption optimization device provided by an embodiment of the present invention is shown.
[0065] Figure 8 A block diagram of an electronic device provided by an embodiment of the present invention is shown.
[0066] Icons: 100 - chip memory power consumption optimization system; 110 - terminal; 120 - server; 130 - chip memory power consumption optimization device; 140 - pre-selection module; 150 - final selection module; 160 - optimization module; 170 - electronic equipment. DETAILED DESCRIPTION
[0067] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0068] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0069] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0070] For large network switching chips with ultra-high performance and ultra-high bandwidth under advanced processes, memory power consumption occupies a significant dominant position in the total power consumption of the chip. Excessive total power consumption will increase the complexity of chip physical design and system design, and will also lead to increased dynamic voltage drop of the chip, a lot of capacitance added to the silicon wafer and package of the chip, difficulty in meeting the timing requirements, excessive current passing through a single solder ball, insufficient total number of power solder balls, and too high requirements for the system heat dissipation solution.
[0071] The power consumption of memory is a key factor affecting the success of chip design and the competitiveness of the chip. However, the current chip design method has the problem of high power consumption of the designed chip memory.
[0072] Based on the above considerations, an embodiment of the present invention provides a chip memory power consumption optimization solution, which can reduce the power consumption of the chip memory. The following will introduce the chip memory power consumption optimization method from the perspective of the chip memory power consumption optimization method.
[0073] The chip memory power consumption optimization solution provided by the embodiment of the present invention can be applied to Figure 1In the chip memory power consumption optimization system 100 shown, the chip upgrade system includes a terminal 110 and a server 120. The server 120 includes a database, and the database stores information of various physical memories on the market. The terminal 110 and the server 120 can communicate through a network. The terminal 110 sends the design information of the required logical memory to the server 120. The server 120 uses the chip memory power consumption optimization method based on the design information to obtain the target memory with the optimal area and power consumption.
[0074] The terminal 110 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 120 may be implemented as an independent server 120 or a server 120 cluster consisting of multiple servers 120.
[0075] It should be noted that the chip memory power consumption optimization method provided in the embodiment of the present invention can also be applied to the terminal 110. In this case, only the terminal 110 is needed to realize the chip memory power consumption optimization.
[0076] In one embodiment, Figure 2 As shown, a method for optimizing chip memory power consumption is provided. This embodiment mainly applies this method to Figure 1 The server 120 in FIG. 1 is used as an example.
[0077] S101, extracting design information of required logical memory.
[0078] The design information includes address depth and data width.
[0079] It should be understood that there may be more than one required logical memory. When there are multiple required logical memories, the design information of each required logical memory may be extracted one by one.
[0080] S102, calculating at least one set of pre-selected indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information.
[0081] Each set of pre-selected indicators includes address depth and data width.
[0082] The number of groups of preselected indicators is determined by design information of the required logical memory and compilation indicators of the physical memory of the same type as the logical memory.
[0083] After the type of the logical memory is determined, compilation indicators of various physical memories of the same type as the logical memory may be extracted from the database.
[0084] S103, obtaining a pre-selected memory that meets the initial selection condition from a plurality of physical memories that meet each group of pre-selected indicators.
[0085] Among them, the preliminary selection conditions include performance conditions and minimum area.
[0086] After obtaining the pre-selected index, all physical memories that meet each set of pre-selected indexes can be extracted from the database. Meeting the pre-selected index means having the address width and data width in the pre-selected index.
[0087] S104, calculating the preliminary performance of the logical memory formed by the pre-selected memory.
[0088] The preliminary performance includes a first area, a first power consumption, an area loss coefficient and a power consumption optimization coefficient.
[0089] The required address depth and data width of the logical memory are generally much larger than the address depth and data width of the physical memory. Therefore, generally a logical memory is composed of multiple physical memories.
[0090] S105 , based on the preliminary performance, obtaining a target memory that meets the optimal power consumption condition from the physical memories that meet the pre-selected indicators of each group.
[0091] S106, designing a logic memory based on the target memory requirements to obtain a chip memory power consumption optimization solution.
[0092] In the above chip memory power consumption optimization method, at least one set of pre-selected indicators is obtained according to the design information of the required logical memory and the compilation indicators of the same type of physical memory, and the physical memory that meets the performance conditions and has the smallest area is selected as the pre-selected memory from the multiple physical memories that meet the pre-selected indicators. Then, according to the preliminary performance of the logical memory constituted by the pre-selected memory, the target memory with the best power consumption is obtained from the multiple physical memories that meet the pre-selected indicators. Under the premise of meeting the performance conditions, the area of the target memory is made as small as possible and the power consumption is as optimal as possible. Then, the logical memory is designed according to the target memory, so that the design scheme of the chip memory can achieve the goal of reducing the power consumption of the memory as much as possible while ensuring that the total area of the chip memory is as optimal as possible.
[0093] When there are multiple required logical memories, for each required logical memory, the above steps S101 to S106 are used to obtain the target memory of each required logical memory, thereby achieving power consumption optimization of the chip memory.
[0094] The design information of the required logical memory also includes ports. For step S102, the type of the logical memory is determined according to the ports. For example, if the design information includes a read port and a write port, then the physical memory of the same type as the logical memory also includes a read port and a write port. If the design information only includes a write port, then the physical memory of the same type as the logical memory also includes only a write port.
[0095] For step S102, the method for calculating the pre-selected index can be flexibly selected. For example, the pre-selected index can be calculated in combination with a neural network, or the pre-selected index can be calculated according to a preset calculation specification. Figure 3 , is a flowchart of some sub-steps of the above step S102, and at least one set of pre-selected indicators is calculated through the following steps.
[0096] S102-1, obtaining a first range value of an address depth segmentation coefficient and a second range value of a data width segmentation coefficient according to the address depth and data width of the logical memory and the compilation index of the same type of physical memory.
[0097] S102-2, obtaining multiple groups of segmentation coefficients according to the first range value and the second range value.
[0098] Each group of segmentation coefficients includes an address depth segmentation coefficient and a data width segmentation coefficient.
[0099] An address depth slicing coefficient in the first range value and a data width slicing coefficient in the second range value form a group of slicing coefficients. For example, if there are 5 address depth slicing coefficients in the first range value and 5 data width slicing coefficients in the second range value, there are a total of 5*5=25 groups of slicing coefficients.
[0100] S102-3, each group of segmentation coefficients is combined with the address depth and data width of the logic memory to determine a group of pre-selected indicators.
[0101] The pre-selected indicators include a pre-selected address depth Di and a pre-selected data width Wi.
[0102] Assuming that a set of slicing coefficients is {D_div, W_div}, the slicing depth D / D_div and slicing width W / W_div corresponding to the set of slicing coefficients are calculated. The address depth of the physical memory that is closest to the slicing depth D / D_div and exists on the market is rounded up to obtain the pre-selected address depth Di. Similarly, the address depth of the physical memory that is closest to the slicing width W / W_div and exists on the market is rounded up to obtain the pre-selected data width Wi.
[0103] Similar to the above steps S102 - 1 to S102 - 3 , a logical memory that meets the requirements and is in line with multiple sets of pre-selected indicators of the actual physical memory can be obtained.
[0104] Furthermore, the compilation index of the same type of physical memory may include a maximum supported address depth, a minimum supported address depth, a maximum supported data width, and a minimum supported data width. Based on this, the above step S102-1 may be implemented by the following method.
[0105] A first range value of the address depth segmentation coefficient is obtained according to a quotient between the address depth of the logical memory and a minimum supported address depth, and a quotient between the address depth of the logical memory and a maximum supported address depth.
[0106] A second range value of the data width slicing coefficient is obtained according to a quotient between the data width of the logical memory and the minimum supported data width, and a quotient between the data width of the logical memory and the maximum supported data width.
[0107] For example, suppose the required logical memory has an address depth of D and a data width of W. The minimum supported address depth of the physical memory of the same type as the required logical memory on the market is D. rmin , the maximum supported address depth is D rmax , the maximum supported data width is W rmax , the minimum supported data width is W rmin , the address depth division coefficient and data width division coefficient are calculated by the following formula:
[0108] and
[0109] Therefore, the first range value of the address depth division coefficient is D_div={D min , D min +1,…,D max}, the second range value of the data width division coefficient is W_div={W min , W min +1,…,W max}.
[0110] The design information may also include performance requirements. It should be understood that in step S103, the performance conditions in the preliminary selection conditions may be performance requirements of the logic memory that meet the requirements under all working conditions.
[0111] For S103, the method of obtaining the pre-selected memory that meets the preliminary selection conditions can be flexibly selected. For example, the pre-selected memory can be selected according to the machine learning model, or the pre-selected memory can be selected according to the preset rules. Figure 4, is a flowchart of some sub-steps of the above step S103. The following steps are used to obtain a pre-selected memory that meets the preliminary selection conditions from multiple physical memories that meet each group of pre-selected indicators.
[0112] S103-1, initializing the first unit storage area value of the selected memory to infinity.
[0113] Initializing the first unit storage area value Rc to infinity can provide a sufficiently large judgment range for the polling process, thereby helping to improve the superiority of the selected pre-selected memory.
[0114] S103 - 2 , for each group of pre-selected indicators, poll each physical memory that meets the pre-selected indicators in order of area from small to large.
[0115] S103-3, determine whether the currently polled physical memory meets the performance condition. If not, execute step S103-5, and if so, execute step S103-4.
[0116] If the currently polled physical memory meets the performance requirement of the required logical memory under all conditions, it is determined that the currently polled physical memory meets the performance condition.
[0117] S103-5, determine whether the currently polled physical storage is the last physical storage that meets the pre-selected indicator. If not, execute S103-7. If yes, execute step S103-9.
[0118] S103-7, continue to poll the next physical storage that meets the pre-selected indicator. After step S103-7, execute step S103-3.
[0119] S103-9, polling multiple physical memories that meet the next set of pre-selected indicators in order of area from small to large.
[0120] S103-4, calculating the second unit storage area value of the currently polled physical memory.
[0121] If the area of the currently polled physical memory is Ak and the total number of bits is Bi, then the second unit storage area value is Rk=Ak / Bi, where Rk represents the second storage area value. The total number of bits Bi is equal to the product of the address depth and the data width.
[0122] S103-6, determine whether the second unit storage area value is smaller than the first unit storage area value. If not, execute step S103-5. If yes, execute step S103-8.
[0123] In S103-8, use the currently polled physical memory as the selected memory, and update the first unit storage area value to the second unit storage area value. After S103-8 is executed, S103-5 is executed.
[0124] That is, if Rk < Rc, then let Rc = Rk.
[0125] After polling all physical memories that meet the preselected indicators of each group through steps S103-1 to S103-9, that is, after the polling ends, use the final selected memory as the preselected memory.
[0126] Through the above steps S103-1 to S103-9, it is possible to select, from physical memories that meet all preselected indicators, the physical memory with the smallest area that can meet the performance requirements of the logical memory that can meet the demand under any conditions, thereby helping to reduce the area ratio of the chip memory.
[0127] The design information of the logical memory required also includes the number of instantiations. On this basis, in one implementation, refer to Figure 5 , which is a schematic flow diagram of some sub-steps of step S104. Calculate the initial performance of the logical memory composed of the preselected memory through the following steps.
[0128] S104-1, according to the compilation indicators of the preselected memory and the number of instantiations, calculate the first area and the first power consumption of the logical memory composed of the preselected memory.
[0129] Optionally, the following area calculation formula can be used to calculate the first area of the logical memory composed of the preselected memory, and the power consumption calculation formula can be used to calculate the first power consumption of the logical memory composed of the preselected memory.
[0130] The area calculation formula includes: Among them, Ai represents the first area of the logical memory composed of the preselected memory, N represents the number of instantiations, Ap represents the area of the preselected memory, Dp represents the address depth of the preselected memory, and Wp represents the data width of the preselected memory.
[0131] The power consumption calculation formula includes: Among them, Pi represents the first power consumption of the logical memory composed of the preselected memory, and Pp represents the power consumption of the preselected memory.
[0132] S104-2, according to the first area and the first power consumption, calculate the area ratio and the power consumption ratio of the logical memory composed of the preselected memory on the chip.
[0133] If the area of the entire chip is At0, then the area ratio of the logic memory constituted by the pre-selected memory on the chip is Ai / At0. If the power consumption of the entire chip is Pt0, then the power consumption ratio of the logic memory constituted by the pre-selected memory on the chip is Pi / Pt0.
[0134] S104-3, based on the size relationship between the area ratio and the preset first set of thresholds, setting an area loss coefficient that matches the size relationship.
[0135] S104-4, based on the size relationship between the power consumption ratio and the preset second set of thresholds, setting a power consumption optimization coefficient that matches the size relationship.
[0136] A first group of thresholds including multiple area thresholds may be set, wherein the multiple area thresholds have a size relationship, and an area level range is formed between every two adjacent area thresholds, and each area level range has an area loss coefficient matching it. If the area ratio falls between two adjacent area thresholds, that is, the area ratio is larger than the smaller area threshold and smaller than the larger area threshold, the area loss coefficient matching the area level range is used as the area loss coefficient.
[0137] Similarly, a second group of thresholds including multiple power consumption thresholds can be set, and there is a size relationship between the multiple power consumption thresholds. A power consumption level range is formed between every two adjacent power consumption thresholds, and each power consumption level range has a power consumption optimization coefficient matching it. If the power consumption ratio falls between two adjacent power consumption thresholds, that is, the power consumption ratio of the smaller power consumption threshold is larger, and the larger power consumption threshold is smaller, then the power consumption optimization coefficient matching the power consumption level range is used as the power consumption optimization coefficient.
[0138] Each area level range may have a corresponding area loss calculation formula, each power consumption level range may have a corresponding power consumption optimization calculation formula, the area loss coefficient may be calculated based on the area loss calculation formula, and the power consumption optimization coefficient may be calculated based on the power consumption optimization calculation formula.
[0139] In other implementations, the area loss coefficient and the power consumption optimization coefficient are obtained by using a neural network or according to preset calculation rules.
[0140] Furthermore, the optimal power consumption condition includes an area condition and a power consumption condition. Based on this, for S105, the method of obtaining the target memory can be flexibly selected, for example, the target memory can be obtained according to a preset rule, or the target memory can be determined by a method such as a neural network.
[0141] In one embodiment, referring to Figure 6, which is a flowchart of some sub-steps of the above step S105. The following steps can be used to obtain a target memory that meets the optimal power consumption condition from the physical memories that meet each group of pre-selected indicators based on the preliminary performance.
[0142] S105 - 1 , for each group of pre-selected indicators, poll each physical storage that meets the pre-selected indicators.
[0143] Each physical memory meeting the pre-selected index may be polled in order of area from small to large.
[0144] S105-2, determine whether the currently polled physical memory meets the performance condition. If not, execute step S105-3, and if so, execute step S105-4.
[0145] When the currently polled physical memory meets the performance requirement of the required logical memory under all conditions, it can be determined that the currently polled physical memory meets the performance condition.
[0146] S105-3, determine whether the currently polled physical memory is the last physical memory that meets the pre-selected index. If not, execute step S105-5, if yes, execute step S105-7.
[0147] S105-5, continue to poll the next physical storage that meets the pre-selected index. After step S105-5, execute step S105-3.
[0148] S105-7, polling multiple physical memories that meet the next set of pre-selected indicators in order of area from small to large.
[0149] S105-4, calculating the second area and the second power consumption of the logical memory formed by the physical memory, calculating the area condition according to the first area and the area loss coefficient, and calculating the power consumption condition according to the first power consumption and the power consumption optimization coefficient.
[0150] Optionally, the following first calculation formula may be used to calculate the second area of the logical memory constituted by the currently polled physical memory, and the second calculation formula may be used to calculate the second power consumption of the logical memory constituted by the currently polled physical memory.
[0151] The first calculation formula includes: Among them, Aj represents the second area of the logical memory constituted by the currently polled physical memory, N represents the number of instantiations, Ak represents the area of the currently polled physical memory, Dk represents the address depth of the currently polled physical memory, and Wk represents the data width of the currently polled physical memory.
[0152] The second calculation formula includes: Among them, Pj represents the second power consumption of the logical memory composed of the currently polled physical memory, and Pk represents the power consumption of the currently polled physical memory.
[0153] Based on this, the area condition includes: A = A c ×(1 + X i ). Among them, A represents the area condition, A c represents the first area, and X i represents the area loss coefficient.
[0154] The power consumption condition includes: P = P c ×(1 - Y i ). Among them, P represents the power consumption condition, P c represents the first power consumption, and Y i represents the power consumption optimization coefficient.
[0155] S105-6: Determine whether the second area is less than the area condition and whether the second power consumption is less than the power consumption condition. If the second area is less than the area condition and the second power consumption is less than the power consumption condition, then execute step S105-8; otherwise, execute step S105-3.
[0156] If Aj < A and Pj < P, then execute step S105-8; otherwise, execute step S105-3.
[0157] S105-8: Take the currently polled physical memory as the preselected memory and update the primary performance. After the execution of S105-8 ends, execute S105-3.
[0158] Among them, the occurrence performance is updated according to the method of step S104.
[0159] After polling all the physical memories that meet the preselection indicators of each group through steps S105-1 to S105-8, that is, after the polling ends, take the final preselected memory as the target memory.
[0160] Through the above steps S105-1 to S105-8, it is possible to select, based on the preselected memory, the physical memory that can meet the performance requirements of the logical memory that can meet the demands under any conditions and satisfies the optimal power consumption condition from the physical memories that meet all the preselection indicators as the target memory, thereby realizing the power consumption optimization of the chip memory.
[0161] The chip memory power consumption optimization method provided by the embodiments of the present invention can significantly reduce the memory power consumption while ensuring that the total area of the chip memory is almost close to the optimal, thereby significantly improving the realizability of the chip and greatly enhancing the competitiveness of the chip product.
[0162] In practical applications, a large network chip is optimized by using the chip memory power consumption optimization method provided by the embodiment of the present invention. As shown in Table 1, before the optimization, the chip memory area is 103.80 mm^2, the memory power consumption is 263.04 W, and after the optimization, the chip memory area is 104.41 mm^2, the memory power consumption is 204.10 W, the memory area optimization ratio is 0.59%, and the memory power consumption optimization ratio is -22.41%.
[0163] The area only increased by 0.59%, but the total power consumption decreased by 22.41%, greatly reducing the chip's physical memory power consumption.
[0164] Table 1
[0165] category Memory area (mm^2) Memory power consumption (W) Before optimization 103.80 263.04 After optimization 104.41 204.10 Optimize ratio 0.59% -22.41%
[0166] It should be understood that although Figure 2-Figure 6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 6 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0167] In one embodiment, based on the same inventive concept as the above-mentioned chip memory power consumption optimization method, as Figure 7 As shown, a chip memory power consumption optimization device 130 is provided, including a pre-selection module 140 , a final selection module 150 and an optimization module 160 .
[0168] The pre-selection module 140 is used to extract the required design information of the logic memory.
[0169] The design information includes address depth, data width, and number of instantiations.
[0170] The pre-selection module 140 is further configured to calculate at least one set of pre-selection indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information.
[0171] Each set of pre-selected indicators includes address depth and data width.
[0172] The pre-selection module 140 is further configured to obtain a pre-selected memory satisfying a preliminary selection condition from a plurality of physical memories satisfying each group of pre-selection indicators.
[0173] Among them, the preliminary selection conditions include performance conditions and minimum area.
[0174] The final selection module 150 is used to calculate the preliminary performance of the logical memory composed of the pre-selected memories, and based on the preliminary performance, obtain the target memory that meets the optimal power consumption condition from the physical memories that meet each group of pre-selected indicators.
[0175] The preliminary performance includes a first area, a first power consumption, an area loss coefficient and a power consumption optimization coefficient.
[0176] The optimization module 160 is used to design the logic memory based on the target memory requirements to obtain a chip memory power consumption optimization solution.
[0177] Through the above-mentioned chip memory power consumption optimization device 130, according to the design information of the required logical memory, the target memory with the optimal power consumption can be obtained from the physical memories actually existing on the market. Under the premise of meeting the performance conditions, the area of the target memory can be made as small as possible and the power consumption can be as optimal as possible. Then, the logical memory is designed according to the target memory, so that the design scheme of the chip memory can reduce the power consumption of the memory as much as possible while ensuring that the total area of the chip memory is as optimal as possible.
[0178] For the specific definition of the chip memory power consumption optimization device 130, please refer to the definition of the chip memory power consumption optimization method above, which will not be repeated here. Each module in the above-mentioned chip memory power consumption optimization device 130 can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules 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 of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0179] In one embodiment, an electronic device 170 is provided. The electronic device 170 may be a terminal 110, and its internal structure diagram may be as follows: Figure 8As shown. The electronic device 170 includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device 170 is used to provide computing and control capabilities. The memory of the electronic device 170 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device 170 is used to communicate with the external terminal 110 in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a chip memory power consumption optimization method is implemented. The display screen of the electronic device 170 can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device 170 can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the electronic device 170, or an external keyboard, touchpad or mouse.
[0180] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention 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.
[0181] In one embodiment, the chip memory power consumption optimization device 130 provided by the present invention can be implemented in the form of a computer program. The computer program can be Figure 8 The memory of the electronic device 170 may store various program modules constituting the chip memory power consumption optimization device 130, for example, Figure 7 The pre-selection module 140, the final selection module 150 and the optimization module 160 are shown. The computer program composed of various program modules enables the processor to execute the steps of the chip memory power consumption optimization method of various embodiments of the present invention described in this specification.
[0182] For example, Figure 8 The electronic device 170 shown may be Figure 7 The pre-selection module 140 in the chip memory power consumption optimization device 130 shown in the figure performs steps S101-S103. The electronic device 170 can perform steps S104 and S105 through the final selection module 150. The electronic device 170 can perform step S106 through the optimization module 160.
[0183] In one embodiment, an electronic device 170 is provided, including a memory and a processor, the memory storing a computer program (or machine executable instructions) that can be executed by the processor, and the processor implementing the following steps when executing the computer program: extracting design information of the required logical memory, the design information including address depth and data width; calculating at least one group of pre-selected indicators based on the compilation indicators of the physical memory of the same type as the logical memory and the design information, each group of pre-selected indicators including address depth and data width; obtaining a pre-selected memory that meets the preliminary selection conditions from a plurality of physical memories that meet each group of pre-selected indicators, the preliminary selection conditions including performance conditions and minimum area; calculating the preliminary performance of the logical memory constituted by the pre-selected memory, the preliminary performance including a first area, a first power consumption, an area loss coefficient and a power consumption optimization coefficient; based on the preliminary performance, obtaining a target memory that meets the optimal power consumption condition from the physical memories that meet each group of pre-selected indicators; designing the required logical memory based on the target memory to obtain a chip memory power consumption optimization solution.
[0184] In one embodiment, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: extracting design information of a required logical memory, the design information including address depth and data width; calculating at least one group of pre-selected indicators based on compilation indicators of a physical memory of the same type as the logical memory and the design information, each group of pre-selected indicators including address depth and data width; obtaining a pre-selected memory that meets preliminary selection conditions from a plurality of physical memories that meet each group of pre-selected indicators, the preliminary selection conditions including performance conditions and minimum area; calculating preliminary selection performance of a logical memory constituted by the pre-selected memory, the preliminary selection performance including a first area, a first power consumption, an area loss coefficient and a power consumption optimization coefficient; based on the preliminary selection performance, obtaining a target memory that meets the optimal power consumption condition from the physical memories that meet each group of pre-selected indicators; and designing the required logical memory based on the target memory to obtain a chip memory power consumption optimization solution.
[0185] 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 by the present invention 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 or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).
[0186] 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.
[0187] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A chip memory power consumption optimization method, characterized in that: The method comprises: Extracting design information of required logic memory, wherein the design information includes address depth and data width; Calculate at least one group of pre-selected indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information, each group of the pre-selected indicators including address depth and data width; Obtaining a pre-selected memory satisfying a preliminary selection condition from a plurality of physical memories satisfying the pre-selected indexes of each group, wherein the pre-selected condition includes a performance condition and a minimum area; Calculating the preliminary performance of the logic memory formed by the pre-selected memory, wherein the preliminary performance includes a first area, a first power consumption, an area loss coefficient, and a power consumption optimization coefficient; Based on the pre-selected performance, a target memory that meets the optimal power consumption condition is obtained from the physical memories that meet the pre-selected indicators of each group; A logical memory based on the target memory design requirement is obtained to obtain a chip memory power consumption optimization solution.
2. The chip memory power consumption optimization method according to claim 1, characterized in that: The optimal power consumption condition includes an area condition and a power consumption condition; The step of obtaining a target memory that meets the optimal power consumption condition from the physical memories that meet each group of the pre-selected indicators based on the pre-selected performance includes: For each group of the pre-selected indicators, poll each physical memory that meets the pre-selected indicators, and if the currently polled physical memory meets the performance condition, calculate the second area and the second power consumption of the logical memory constituted by the physical memory; Calculating an area condition according to the first area and the area loss coefficient, and calculating a power consumption condition according to the first power consumption and the power consumption optimization coefficient; If the second area is smaller than the area condition, and the second power consumption is smaller than the power consumption condition, the currently polled physical memory is used as the pre-selected memory, and the pre-selected performance is updated; After all physical memories meeting the pre-selected index are polled based on the updated preliminary performance, each physical memory meeting the next group of pre-selected indexes is continuously polled until all physical memories meeting all the pre-selected indexes are polled; After the polling is completed, the final pre-selected memory is used as the target memory.
3. The chip memory power consumption optimization method according to claim 2, characterized in that: The area conditions include: A = A c ×(1+X i ), where A represents the area condition, A c represents the first area, X i represents the area loss coefficient; The power consumption conditions include: P = P c ×(1-Y i ); Among them, P represents the power consumption condition, P c Indicates the first power consumption, Y i Indicates the power consumption optimization factor.
4. The chip memory power consumption optimization method according to any one of claims 1 to 3, characterized in that: The design information also includes the number of instantiations; The step of calculating the preliminary performance of the logical memory formed by the pre-selected memory comprises: Calculating a first area and a first power consumption of a logic memory formed by the preselected memory according to the compilation index of the preselected memory and the instantiation times; Calculating the area ratio and power consumption ratio of the logic memory formed by the preselected memory on the chip according to the first area and the first power consumption; Based on the size relationship between the area ratio and the preset first set of thresholds, setting an area loss coefficient that matches the size relationship; Based on the size relationship between the power consumption proportion and the preset second set of thresholds, a power consumption optimization coefficient matching the size relationship is set.
5. The chip memory power consumption optimization method according to any one of claims 1 to 3, characterized in that: The step of calculating at least one set of pre-selected indicators based on the compilation indicators of the physical memory of the same type as the logical memory and the design information comprises: According to the address depth and the data width of the logical memory and the compilation index of the same type of physical memory, a first range value of the address depth segmentation coefficient and a second range value of the data width segmentation coefficient are obtained; According to the first range value and the second range value, a plurality of groups of segmentation coefficients are obtained, each group of segmentation coefficients including an address depth segmentation coefficient and a data width segmentation coefficient; Each group of the slicing coefficients is combined with the address depth and the data width of the logical memory to determine a group of pre-selected indicators.
6. The chip memory power consumption optimization method according to claim 5, characterized in that: The compilation indicators of the same type of physical memory include a maximum supported address depth, a minimum supported address depth, a maximum supported data width, and a minimum supported data width; The step of obtaining a first range value of an address depth slicing coefficient and a second range value of a data width slicing coefficient according to the address depth and the data width of the logical memory and a compilation indicator of a physical memory of the same type comprises: Obtaining a first range value of an address depth segmentation coefficient according to a quotient between the address depth of the logical memory and the minimum supported address depth, and a quotient between the address depth of the logical memory and the maximum supported address depth; A second range value of the data width slicing coefficient is obtained according to a quotient between the data width of the logical memory and the minimum supported data width, and a quotient between the data width of the logical memory and the maximum supported data width.
7. The chip memory power consumption optimization method according to any one of claims 1 to 3, characterized in that: The step of obtaining a pre-selected memory satisfying the preliminary selection condition from a plurality of physical memories satisfying the pre-selected indexes of each group comprises: Initialize the first unit storage area value of the selected memory to infinity; For each group of the pre-selected indicators, poll each physical memory that meets the pre-selected indicators in order of area from small to large, and if the currently polled physical memory meets the performance condition, calculate the second unit storage area value of the currently polled physical memory; If the second unit storage area value is smaller than the first unit storage area value, the currently polled physical memory is used as the selected memory, and the first unit storage area value is updated to the second unit storage area value; After all physical memories meeting the pre-selected index are polled based on the updated first unit storage area value, each physical memory meeting the next group of the pre-selected indexes is continuously polled until all physical memories meeting all the pre-selected indexes are polled; After the polling is completed, the final selected memory is used as the pre-selected memory.
8. A chip memory power consumption optimization device, characterized in that: Including pre-selection module, final selection module and optimization module; The pre-selection module is used to extract the design information of the required logic memory, wherein the design information includes address depth, data width and instantiation times; The pre-selection module is further used to calculate at least one group of pre-selected indicators according to the compilation indicators of the physical memory of the same type as the logical memory and the design information, each group of the pre-selected indicators including address depth and data width; The pre-selection module is further used to obtain a pre-selected memory that meets a preliminary selection condition from a plurality of physical memories that meet the pre-selection indexes of each group, wherein the preliminary selection condition includes a performance condition and a minimum area; The final selection module is used to calculate the preliminary performance of the logical memory composed of the pre-selected memory, and based on the preliminary performance, obtain the target memory that meets the optimal power consumption condition from the physical memory that meets each group of the pre-selected indicators, wherein the preliminary performance includes a first area, a first power consumption, an area loss coefficient, and a power consumption optimization coefficient; The optimization module is used to design a logic memory based on the target memory requirements to obtain a chip memory power consumption optimization solution.
9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the chip memory power consumption optimization method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the chip memory power consumption optimization method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Memory management method and apparatus
KR1020150078951A
Method and Apparatus for Optimizing Memory-Built-In-Self Test
US20140089875A1
Logical memory address regions
US20170046272A1
