A method and system for in-memory logic comprehensive mapping for energy consumption optimization
By using energy consumption information as area parameters, filtering and replacing logic gate combinations with lower energy consumption, the problem of energy consumption optimization of in-memory logic comprehensive mapping in edge computing is solved, and the in-memory logic design with low energy consumption is realized, and the equipment is extended battery life.
Patent Information
- Application Number
- CN202411073143.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-06
AI Technical Summary
The prior art ignores the energy consumption evaluation and optimization of the final logic sequence by in-memory logic synthesis mapping method in edge computing scenarios, resulting in limited equipment battery life.
The in-memory logic comprehensive mapping method for energy consumption optimization is adopted. By using energy consumption information as area parameters, the comprehensive tool uses the target of the minimum area, and converts the input original logic function into a comprehensive netlist composed of the basic logic gate. And filter out candidate basic logic gate combinations with lower energy consumption, and replace the cyclic-dependent logic gate combinations to reduce energy consumption.
It realizes integrated in-memory logic mapping for low-energy computing, reduces the energy consumption of designed in-memory logic, adapts to the needs of edge computing scenarios provided by low-energy consumption, and extends the battery life of the equipment.
Smart Images

Figure CN118643773B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuit design, and in particular relates to an in-memory logic comprehensive mapping method and system for energy consumption optimization. Background Art
[0002] In the edge computing scenario, computing devices often rely only on limited reserve power to support their work. However, the storage and computing separation structure of the traditional von Neumann system is accompanied by a large amount of data transmission, which puts a heavy burden on the device's endurance. The computing method based on the state logic (in-memory logic) in the memristor array has become a potential carrier for edge computing because it eliminates the movement of data. When designing in-memory logic, using different comprehensive mapping methods for the same computing task will result in different in-memory state logic gate execution sequences. However, the existing comprehensive mapping methods for the post-synthesis netlist have ignored the energy consumption evaluation and optimization of the final logic sequence. The fundamental reason is the lack of systematic evaluation of the energy consumption of a single logic gate. Therefore, it is necessary to study the in-memory logic comprehensive mapping method for low-energy computing to meet the application requirements of edge computing scenarios with low energy supply. Summary of the invention
[0003] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a method and system for comprehensive in-memory logic mapping for energy consumption optimization are provided. The present invention aims to realize comprehensive in-memory logic mapping for low-energy computing, reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of edge computing scenarios with low energy supply.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0005] A method for in-memory logic synthesis mapping for energy consumption optimization includes the following steps:
[0006] S1, taking the basic logic gate as the basic unit of the synthesis process, taking the energy consumption information as the area parameter, and using the synthesis tool to minimize the area, the input original logic function is converted into a post-synthesis netlist composed of the functions of the basic logic gates, and the candidate basic logic gate combinations that can be merged into composite logic gates are obtained from the post-synthesis netlist;
[0007] S2, for the candidate basic logic gate combinations, selecting a candidate basic logic gate combination whose energy consumption of the combined composite logic gate is lower than the sum of the energy consumption of each basic logic gate in the candidate basic logic gate combination as the basic logic gate combination to be optimized;
[0008] S3, for each basic logic gate combination to be optimized, determine whether the basic logic gate combination to be optimized has a circular dependency. If there is no circular dependency, replace the basic logic gate combination to be optimized with the corresponding composite logic gate in the synthesized netlist and adjust the netlist structure, and finally obtain the logic function netlist after the comprehensive mapping is completed.
[0009] Optionally, step S2 includes:
[0010] S2.1, traverse and select a candidate basic logic gate combination from the obtained set of candidate basic logic gate combinations. If the traversal and selection are completed, jump to step S3; otherwise, jump to step S2.2;
[0011] S2.2, for the current candidate basic logic gate combination, query a preset standard cell library for each basic logic gate therein to obtain the energy consumption of the basic logic gate, and then sum the energy consumptions of all basic logic gates in the current candidate basic logic gate combination to obtain the original energy consumption of the current candidate basic logic gate combination; for the current candidate basic logic gate combination, query a preset standard cell library according to the combined composite logic gate thereof to obtain the energy consumption of the combined composite logic gate as the combined energy consumption of the current candidate basic logic gate combination;
[0012] S2.3, compare the original energy consumption of the current candidate basic logic gate combination with the energy consumption after merging. If the energy consumption after merging is smaller, the current candidate basic logic gate combination is used as the basic logic gate combination to be optimized; jump to step S2.1.
[0013] Optionally, judging in step S3 whether there is a circular dependency in the basic logic gate combination to be optimized includes: for the composite logic gate obtained by merging the basic logic gate combination to be optimized, if the composite logic gate obtained after the merger uses the output obtained after execution to overwrite the logic gate data of the last input, thereby affecting the execution of other subsequent logic gates of the covered logic gate, and at the same time, the subsequent logic gates of the covered logic gate depend on the output of the composite logic gate obtained after the merger, then it is determined that there is a circular dependency in the basic logic gate combination to be optimized; otherwise, it is determined that there is no circular dependency in the basic logic gate combination to be optimized.
[0014] Optionally, when determining whether the basic logic gate combination to be optimized has a circular dependency in step S3, it also includes calculating the difference between the original energy consumption and the merged energy consumption of the basic logic gate combination to be optimized when the basic logic gate combination to be optimized has a circular dependency. If the difference between the original energy consumption and the merged energy consumption is greater than the energy consumption of a copy gate COPY required to be added to eliminate the circular dependency of the basic logic gate combination to be optimized, firstly add a copy gate COPY to the basic logic gate combination to be optimized to eliminate the circular dependency, and then replace the basic logic gate combination to be optimized with a corresponding composite logic gate and adjust the netlist structure; if the difference between the original energy consumption and the merged energy consumption is less than or equal to the energy consumption of a copy gate COPY required to be added to eliminate the circular dependency of the basic logic gate combination to be optimized, then abandon replacing the basic logic gate combination to be optimized with the corresponding composite logic gate.
[0015] Optionally, when the basic logic gate combination to be optimized is replaced with the corresponding composite logic gate and the netlist structure is adjusted in step S3, if there is a continuous NOT gate NOT + NOT gate NOT after the merger, the latter NOT gate NOT is deleted and the downstream circuit of the latter NOT gate NOT is connected to the input end of the previous NOT gate NOT.
[0016] Optionally, when obtaining candidate basic logic gate combinations that can be combined into composite logic gates from the input post-synthesis netlist in step S1, the candidate basic logic gate combinations that can be combined into composite logic gates meet the following conditions: (1): the output of the previous basic logic gate in the replaced candidate basic logic gate combination cannot drive another basic logic gate other than the next basic logic gate in the same candidate basic logic gate combination; (2): the other input of the next basic logic gate in the replaced candidate basic logic gate combination is a covered input after replacement and cannot be used as a covered input of other composite logic gates.
[0017] Optionally, when obtaining candidate basic logic gate combinations that can be combined into composite logic gates from the input post-synthesis netlist in step S1, the basic logic gates in the candidate basic logic gate combinations include NOT gate, NOR gate and OR gate, and the basic logic gate combination corresponding to the obtained composite logic gate includes the basic logic gate combination NOR(NOT)+OR corresponding to the composite logic gate ONOR(IMP), and the basic logic gate combination NOR(NOT)+NOR corresponding to the composite logic gate ONOR(IMP)+NOT, wherein ONOR is a NOR logic gate, IMP is an implication logic gate, and NOT is a NOT gate.
[0018] In addition, the present invention also provides an in-memory logic synthesis mapping system for energy consumption optimization, including a microprocessor and a memory connected to each other, wherein the microprocessor is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization.
[0019] In addition, the present invention also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization through a processor.
[0020] In addition, the present invention also provides a computer program product, including a computer program or instructions, wherein the computer program or instructions are programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization through a processor.
[0021] Compared with the prior art, the present invention mainly has the following advantages:
[0022] Firstly, the present invention includes using basic logic gates as the basic units of the synthesis process, using energy consumption information as an area parameter, and using a synthesis tool with the minimum area as the goal to convert the input original logic function into a synthesized netlist composed of the functions of the basic logic gates. The traditional method is to set the area of the basic logic gates to be the same and perform synthesis with the minimum area constraint. The present invention uses energy consumption information as an area parameter and uses a synthesis tool with the minimum area as the goal to convert the input original logic function into a post-synthesis netlist composed of basic logic gates, thereby realizing energy consumption optimization in the first link, so that the present invention can realize in-memory logic synthesis mapping for low-energy computing, reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of edge computing scenarios with low energy supply.
[0023] Secondly, the present invention includes obtaining candidate basic logic gate combinations that can be merged into composite logic gates from the synthesized netlist, and for the candidate basic logic gate combinations, screening out candidate basic logic gate combinations whose energy consumption of the merged composite logic gates is lower than the sum of the energy consumption of each basic logic gate in the candidate basic logic gate combination as the basic logic gate combination to be optimized, that is, by selecting the basic logic gate combination to be optimized according to the relative size of the energy consumption of logic gates in different states, the energy consumption optimization of the second link of the in-memory logic synthesis mapping is achieved, so that the present invention can further reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of edge computing scenarios with low energy consumption supply.
[0024] Thirdly, the present invention can further determine whether there is a circular dependency in the basic logic gate combination to be optimized. If there is a circular dependency in the basic logic gate combination to be optimized, the difference between the original energy consumption and the merged energy consumption of the basic logic gate combination to be optimized is calculated. If the difference between the original energy consumption and the merged energy consumption is greater than the energy consumption of the copy gate COPY required to eliminate the circular dependency of the basic logic gate combination to be optimized, the copy gate COPY is first added to the basic logic gate combination to be optimized to eliminate the circular dependency, and then the basic logic gate combination to be optimized is replaced with the corresponding composite logic gate and the netlist structure is adjusted; if the difference between the original energy consumption and the merged energy consumption is less than or equal to the energy consumption of the copy gate COPY required to eliminate the circular dependency of the basic logic gate combination to be optimized, the replacement of the basic logic gate combination to be optimized with the corresponding composite logic gate is abandoned, that is, the basic logic gate combination to be optimized is selected by adding the copy gate COPY to solve the relative size of the energy consumption of the circular dependency, thereby realizing the energy consumption optimization of the third link of the in-memory logic comprehensive mapping, so that the present invention can further reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of the edge computing scenario with low energy consumption supply. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Schematic diagram of the basic flow of the method of the embodiment of the present invention.
[0026] Figure 2 These are the results of the correctness of various logic gates verified in the embodiments of the present invention and the instantaneous energy consumption data.
[0027] Figure 3 This is an example of a circular dependency problem that exists after merging in an embodiment of the present invention.
[0028] Figure 4 Schematic diagram of the merging operation in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] like Figure 1 and Figure 2 As shown, the in-memory logic comprehensive mapping method for energy consumption optimization in this embodiment includes the following steps:
[0030] S1, taking basic logic gates (such as NOT gate, NOR gate and OR gate) as the basic unit of the synthesis process, taking energy consumption information as the area parameter, and using the synthesis tool to minimize the area, converting the input original logic function into a post-synthesis netlist composed of the functions of the basic logic gates, and obtaining candidate basic logic gate combinations that can be merged into composite logic gates from the post-synthesis netlist;
[0031] S2, for the candidate basic logic gate combinations, selecting a candidate basic logic gate combination whose energy consumption of the combined composite logic gate is lower than the sum of the energy consumption of each basic logic gate in the candidate basic logic gate combination as the basic logic gate combination to be optimized;
[0032] S3, for each basic logic gate combination to be optimized, determine whether the basic logic gate combination to be optimized has a circular dependency. If there is no circular dependency, replace the basic logic gate combination to be optimized with the corresponding composite logic gate in the synthesized netlist and adjust the netlist structure, and finally obtain the logic function netlist after the comprehensive mapping is completed.
[0033] In the traditional method, when the input original logic function is converted into a comprehensive netlist composed of the functions of the basic logic gates, the area of each basic logic gate is the same. However, in step S1 of this embodiment, the energy consumption information of the basic logic gate is used as the area parameter and a comprehensive tool (such as DC, etc.) is used to convert the input original logic function into a comprehensive netlist composed of the functions of the basic logic gates with the minimum area as the goal. That is, the energy consumption of different basic logic gates is used as the area attribute of the basic logic gate. By using the comprehensive tool with the minimum area as the goal, the energy consumption of the basic logic gate is minimized as the optimization goal, and the input original logic function is converted into a comprehensive netlist composed of the functions of the basic logic gates, thereby realizing the energy consumption optimization of the first link, so that the present invention can realize the in-memory logic comprehensive mapping for low-energy computing, reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of the edge computing scenario with low energy supply.
[0034] In this embodiment, the energy consumption information of the basic logic gates and the energy consumption information of the compound logic gates are obtained by functional verification and energy consumption evaluation of simple logic gates and compound logic gates and stored in the standard cell library. When it is necessary to read the energy consumption information and other properties of the basic logic gates and compound logic gates, they can be directly read from the standard cell library. The functional verification in this embodiment is implemented by simulation. The verified state logic gates are established based on the simulation model of the given memristor, and the correctness of the function of the state logic gate is verified by the circuit simulation tool. If the correctness of the function is verified, it is added to the custom standard cell library and the energy consumption information is extracted at the same time. For example, the memristor model used in this embodiment is Stanford RRAM Model v1.0.0 (but not limited to this), and the circuit simulation tool is HSPICE (but not limited to this) to verify the correctness of the function of the state logic gate. The verification results are as follows: Figure 2As shown in the figure, the first row shows the applied pulse voltage, followed by the gap change (reflecting the resistance change) and instantaneous energy consumption value of the input and output devices during each gate operation. The gap value reflects the resistance of the device, 1.7nm represents the high resistance state (HRS, logic 0), and 0.2nm represents the low resistance state (LRS, logic 1). The simulation results of the copy gate COPY and the OR gate OR are shown in Figure 1. Figure 2 In both gates, the logic output is LRS before execution, and the logic function is based on the conditional reset transition of the output device. The other two simple logic gates with NOT and NOR functions are based on the conditional set transition of the output device. The simulation results are shown in Figure 2 As shown in (b) i and (c). Based on the simple gate, additional simulation is added to verify the functions of the two complex gates IMP and ONOR. For example, Figure 2 ii in (b) shows that when the initial output value of NOT gate is set to LRS, the output will not change. Therefore, Figure 2 (b) i and ii together demonstrate the functional verification of the IMP gate. Figure 2 (c) and (d) are the functional verification of the ONOR logic gate. Figure 2 In, V in Represents the control voltage applied to the input device, V out Indicates the control voltage applied to the output device, in1 indicates the first logic input information, in2 indicates the second logic input information, out indicates the logic output information, and P is the instantaneous power consumption. According to the instantaneous energy consumption value obtained, in each input combination of the target state logic gate, the instantaneous energy consumption is multiplied and accumulated with the simulation step size to obtain the energy consumption value under this input condition, and then the energy consumption values of all input conditions are averaged to obtain the energy consumption information of the logic gate in this state. The energy consumption results of each logic gate are shown in Table 1.
[0035] As an optional implementation, in this embodiment, a verified state logic gate is established based on a real given resistive memory array, and the functional correctness of the state logic gate is verified by applying voltage and grounding. If the functional correctness verification passes, it is added to the standard cell library, and its energy consumption information is calculated and added to the standard cell library.
[0036] Table 1 Calculation results of energy consumption of logic gates
[0037]
[0038] In step S1, converting the input original logic function into a post-synthesis netlist consisting of the functions of basic logic gates includes: adding basic logic gates (basic logic gates with different functions to be used in the synthesis stage) to the cell library file (.lib file) of the synthesis tool, and setting the area attribute value of each basic logic gate to the energy consumption value obtained by evaluation, and setting the maximum load capacitance to a preset maximum value, the specific value of which can be set as needed, for example, in this embodiment, the maximum load capacitance is set to 1000.00; converting the cell library file to a cell library file (.db file) that can be used by the synthesis tool, for example, in this embodiment, specifically using the read_lib and write_lib commands of DC to convert the .lib cell library file to a .db cell library file that can be used by the synthesis tool, and adding the usable cell library file (.db file) to the target library list target_library and the link library list link_library to be used in the synthesis of the synthesis tool through the configuration file; setting the maximum delay in the synthesis constraint in the synthesis tool to a preset maximum value (which can be set as needed, for example, 10 in this embodiment); 8 ), the maximum area is 0, the synthesis process is set to optimize for area, and the iterative synthesis process of the synthesis tool is started to convert the input original logic function into a post-synthesis netlist composed of the functions of basic logic gates.
[0039] Step S2 of this embodiment is used to select the basic logic gate combination to be optimized according to the relative energy consumption of logic gates in different states, thereby realizing the energy consumption optimization of the second link of the in-memory logic comprehensive mapping, and can further reduce the energy consumption of the designed in-memory logic to meet the application requirements of edge computing scenarios with low energy consumption. Specifically, step S2 of this embodiment includes:
[0040] S2.1, traverse and select a candidate basic logic gate combination from the obtained set of candidate basic logic gate combinations. If the traversal and selection are completed, jump to step S3; otherwise, jump to step S2.2;
[0041] S2.2, for the current candidate basic logic gate combination, query a preset standard cell library for each basic logic gate therein to obtain the energy consumption of the basic logic gate, and then sum the energy consumptions of all basic logic gates in the current candidate basic logic gate combination to obtain the original energy consumption of the current candidate basic logic gate combination; for the current candidate basic logic gate combination, query a preset standard cell library according to the combined composite logic gate thereof to obtain the energy consumption of the combined composite logic gate as the combined energy consumption of the current candidate basic logic gate combination;
[0042] S2.3, compare the original energy consumption of the current candidate basic logic gate combination with the energy consumption after merging. If the energy consumption after merging is smaller, the current candidate basic logic gate combination is used as the basic logic gate combination to be optimized; jump to step S2.1.
[0043] In this embodiment, judging whether there is a circular dependency in the basic logic gate combination to be optimized in step S3 includes: for the composite logic gate obtained by merging the basic logic gate combination to be optimized, if the composite logic gate obtained after the merger uses the output to overwrite the logic gate data of the last input after execution, thereby affecting the execution of other subsequent logic gates of the covered logic gate, and at the same time, the subsequent logic gates of the covered logic gate depend on the output of the composite logic gate obtained after the merger, then it is determined that there is a circular dependency in the basic logic gate combination to be optimized; otherwise, it is determined that there is no circular dependency in the basic logic gate combination to be optimized. The situation of circular dependency is as follows Figure 3 As shown, numbers 1 to 10 represent nodes of basic logic gates, x is a compound logic gate, y and z are basic logic gates. Among all the parent nodes of node 3: basic logic gate y, node 7, compound logic gate x, the compound logic gate x that will cover node 3 should be executed after basic logic gate y and node 7. When the situations in the rectangular dashed boxes where nodes 2 and 3 are located appear continuously, taking node 2 as the object of investigation, according to the same rule, it can be obtained that basic logic gate y should be executed after basic logic gate z and node 6. In this order, the basic logic gates that need to be executed before compound logic gate x are all the dashed nodes in the figure. On the other hand, the nodes whose execution depends on the result of compound logic gate x are represented by diamonds in the figure (nodes 8 and 9), and these logic gates need to be executed after compound logic gate x. It can be found that node 10 has both dashed and diamond characteristics, which means that there is a circular dependency problem in compound logic gate x, and the merge operation here is skipped at this time.
[0044] In step S3 of this embodiment, the relative size of the energy consumption values of the logic gate operations of each state is analyzed, so as to select the merged processing that reduces the overall energy consumption value as the search target during subsequent optimization, and whether the COPY gate needs to be used when there is a circular dependency. Specifically, when judging whether the basic logic gate combination to be optimized has a circular dependency in step S3 of this embodiment, it also includes calculating the difference between the original energy consumption and the merged energy consumption of the basic logic gate combination to be optimized when there is a circular dependency in the basic logic gate combination to be optimized. If the difference between the original energy consumption and the merged energy consumption is greater than the energy consumption of the copy gate COPY required to eliminate the circular dependency of the basic logic gate combination to be optimized, the basic logic gate combination to be optimized is first replaced with the corresponding composite logic gate and the netlist structure is adjusted, and then the copy gate COPY is added to the basic logic gate combination to be optimized to eliminate the circular dependency; if the difference between the original energy consumption and the merged energy consumption is less than or equal to the energy consumption of the copy gate COPY required to eliminate the circular dependency of the basic logic gate combination to be optimized, the basic logic gate combination to be optimized is abandoned to be replaced with the corresponding composite logic gate. In this case, the replacement operation is abandoned.
[0045] In this embodiment, when the basic logic gate combination to be optimized is replaced with the corresponding composite logic gate and the netlist structure is adjusted in step S3, if there is a continuous NOT gate NOT + NOT gate NOT after the merger, the latter NOT gate NOT is deleted, and the downstream circuit of the latter NOT gate NOT is connected to the input end of the previous NOT gate NOT.
[0046] In this embodiment, when obtaining candidate basic logic gate combinations that can be combined into a composite logic gate from the input post-synthesis netlist in step S1, the candidate basic logic gate combinations that can be combined into a composite logic gate meet the following conditions: (1) the output of the previous basic logic gate in the replaced candidate basic logic gate combination cannot drive another basic logic gate other than the next basic logic gate in the same candidate basic logic gate combination; Figure 4 The dotted gate xx shown in (a) cannot exist. (2): The other input of the next basic logic gate in the candidate basic logic gate combination to be replaced becomes the covered input after replacement and cannot be used as the covered input of other compound logic gates; Figure 4 The dashed ONOR / IMP gate shown in (a) cannot exist. Figure 4 The result of the merge operation in (a) is as follows: Figure 4 As shown in (b) and (c).
[0047] In this embodiment, when obtaining candidate basic logic gate combinations that can be merged into a composite logic gate from the input post-synthesis netlist in step S1, the basic logic gates in the candidate basic logic gate combinations include NOT gates, NOR gates, and OR gates, and the basic logic gate combinations corresponding to the composite logic gates obtained include the basic logic gate combination NOR(NOT)+OR corresponding to the composite logic gate ONOR(IMP), and the basic logic gate combination NOR(NOT)+NOR corresponding to the composite logic gate ONOR(IMP)+NOT, wherein ONOR is a NOR logic gate, IMP is an implied logic gate, and NOT is a NOT gate. In this example, when there is a logic structure of NOR(NOT)+NOR+NOT and its overall energy consumption value is greater than the energy consumption value of ONOR(IMP)+NOT, this merging operation is performed; and the energy consumption of the COPY gate is greater than the energy consumption reduction value brought about by the aforementioned merging operation, so the merging operation that will generate a circular dependency is abandoned.
[0048] The mapping process in this embodiment is based on SIMPLER MAGIC, and the improvements include: 1. Ensure that the composite logic gate is the last logic gate to be mapped and executed among all parent logic gates; 2. When mapping, the composite logic gate directly assigns the cells occupied by the child nodes that will be covered to it; 3. The intermediate cells and output cells in the array are divided into two categories, which are initialized to 0 and 1 respectively, because the initialization state requirements of the output devices when the logic gates used are executed are different. The ratio of the number of cells initialized to 0 and 1 is determined by the total number of the two logic gates and the minimum number of cells to execute a single gate.
[0049] Finally, after obtaining the logic function netlist, the mapping tool can be used to map the single row of the processed logic function netlist to obtain the state logic gate execution sequence in a single row of the memristor storage array of the in-memory logic, including: S4.1, analyzing and recording the connection relationship of the nodes in the processed netlist, and calculating the minimum number of units CU required for each node to complete execution from the child node; S4.2, dividing the units other than the input units in the memristor storage array into two categories: intermediate units and output units, and initializing them to 0 and 1 in proportion. The proportion of the initialized units is determined by the total number of the two logic gates and the minimum number of units CU required to execute a single logic gate: the proportion of units initialized to 0 = (the proportion of the number of logic gates that need to be initialized to 0 to the total number of gates + the number of units that need to be initialized to 0 =(the maximum value of the CU value of the logic gate that needs to be initialized to 1 / the sum of the maximum values of the CU values of the two logic gates) / 2, the proportion of cells initialized to 1 = (the proportion of the number of logic gates that need to be initialized to 1 to the total number of gates + the maximum value of the CU value of the logic gate that needs to be initialized to 1 / the sum of the maximum values of the CU values of the two logic gates) / 2; calculate the proportion of the two types of initialization logic gates in the processed netlist, and set the proportion of the array cell type to minimize the total number of array cells required for allocation; S4.3, starting from the root node in the processed netlist, recursively allocate cells in the array to the child nodes, for the current node: if the node is a complex logic gate, then the complex The composite logic gate is processed by the combined logic gate, including: the composite logic gate is the last logic gate to be mapped and executed among all parent logic gates; when mapping, the composite logic gate directly allocates the cells occupied by the child node to be covered to it; if the node is a basic logic gate, it is allocated in descending order of CU value; S4.4, determines whether all nodes in the processed netlist have been allocated, if not, updates the cell information of the given memristor storage array, and jumps to step S4.3; if it has been allocated, the execution sequence of the state logic gates in a single row in the memristor storage array of the in-memory logic can be obtained, and ends and exits.
[0050] In summary, this embodiment discloses a low-energy comprehensive mapping method for in-memory state logic, the purpose of which is to complete the low-energy comprehensive mapping of complex combinational logic functions to in-memory state logic gates of a memristor memory array. The entire method includes: (1) verifying the compatibility of the in-memristor state logic gates used to the same memristor memory array and evaluating the energy consumption value of each logic gate. The state logic gates used include but are not limited to simple gates of four logic functions, NOR, NOT, OR, and COPY, and compound gates of two logic functions, ONOR and IMP; (2) using a circuit synthesis tool for CMOS logic to convert the original computing function into a synthesized netlist consisting of simple gates such as NOR, NOT, and OR with the goal of minimum area; (3) using a specially developed post-processing process to merge and adjust the logic gates of the synthesized netlist, including merging NOR gates and OR gates that meet the merging conditions into ONOR gates, merging NOT gates and OR gates that meet the merging conditions into IMP gates, and deleting duplicate NOT gates; (4) using a mapping process improved from the SIMPLER MAGIC method to complete the mapping of the synthesized logic gate netlist to the in-memory state logic gates in a single row of the memristive memory array, and determine the execution sequence of the in-memory state logic gates. The method of this embodiment determines the execution sequence of using in-memory state logic gates in a single row of the memristive memory array to implement complex computing functions, which can greatly reduce the energy consumption of the memristive state logic when completing the computing function. The method of this embodiment can utilize the corresponding relationship between the functions of simple logic gates and compound logic gates to merge multiple groups of simple state logic gates into compound logic gates, and solve the problems in the comprehensive mapping process to achieve low-energy comprehensive mapping. The in-memory logic comprehensive mapping method for energy consumption optimization in this embodiment uses energy consumption information as an area parameter and uses a comprehensive tool with the minimum area as the goal, and then converts the input original logic function into basic logic gates, thereby achieving energy consumption optimization in the first link, so that the present invention can achieve in-memory logic comprehensive mapping for low-energy computing, and reduce the energy consumption of the designed in-memory logic to meet the application requirements of edge computing scenarios with low energy supply. The in-memory logic comprehensive mapping method for energy consumption optimization in this embodiment selects the basic logic gate combination to be optimized according to the relative size of the energy consumption of logic gates in different states, and achieves energy consumption optimization in the second link of the in-memory logic comprehensive mapping, so that the present invention can further reduce the energy consumption of the designed in-memory logic to meet the application requirements of edge computing scenarios with low energy supply. The in-memory logic comprehensive mapping method for energy consumption optimization in this embodiment also solves the relative energy consumption of loop dependency by adding a copy gate COPY to select the basic logic gate combination to be optimized, thereby realizing energy consumption optimization of the third link of the in-memory logic comprehensive mapping. Through the energy consumption optimization of the above three links, the present invention can further reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of edge computing scenarios with low energy consumption supply.The in-memory logic comprehensive mapping method for energy consumption optimization of the present embodiment utilizes energy consumption information to optimize the comprehensive mapping process with respect to energy consumption, thereby reducing the computational energy consumption of the comprehensive mapping result, and automatically obtaining operations that complete given complex computing functions with lower energy consumption, so that the in-memory logic comprehensive mapping method for energy consumption optimization of the present embodiment can further reduce the energy consumption of the designed in-memory logic to adapt to the application requirements of edge computing scenarios with low energy consumption supply.
[0051] In addition, this embodiment also provides an in-memory logic synthesis mapping system for energy consumption optimization, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization.
[0052] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored. The computer program or instruction is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization through a processor.
[0053] In addition, this embodiment also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization through a processor.
[0054] Those skilled in the art should understand that the embodiments of the present application may provide methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0055] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for in-memory logic synthesis mapping for energy consumption optimization, characterized in that: The steps include: S1, taking the basic logic gate as the basic unit of the synthesis process, taking the energy consumption information as the area parameter, and using the synthesis tool to minimize the area, the input original logic function is converted into a post-synthesis netlist composed of the functions of the basic logic gates, and the candidate basic logic gate combinations that can be merged into composite logic gates are obtained from the post-synthesis netlist; S2, for the candidate basic logic gate combination, screen out the candidate basic logic gate combination whose energy consumption of the combined composite logic gate is lower than the sum of the energy consumption of each basic logic gate in the candidate basic logic gate combination as the basic logic gate combination to be optimized; the basic logic gates in the candidate basic logic gate combination include NOT gate, NOR gate and OR gate; S3, for each basic logic gate combination to be optimized, determine whether the basic logic gate combination to be optimized has a circular dependency, if not, replace the basic logic gate combination to be optimized with a corresponding composite logic gate in the synthesized netlist and adjust the netlist structure, and finally obtain a logic function netlist after the comprehensive mapping is completed; The determining whether there is a circular dependency in the basic logic gate combination to be optimized includes: for the composite logic gate that can be merged with the basic logic gate combination to be optimized, if the composite logic gate obtained after the merger uses the output to overwrite the logic gate data of the last input after execution, thereby affecting the execution of other subsequent logic gates of the covered logic gate, and at the same time, the subsequent logic gates of the covered logic gate depend on the output of the composite logic gate obtained after the merger, then it is determined that there is a circular dependency in the basic logic gate combination to be optimized; otherwise, it is determined that there is no circular dependency in the basic logic gate combination to be optimized.
2. The in-memory logic comprehensive mapping method for energy consumption optimization according to claim 1, characterized in that: Step S2 includes: S2.1, traverse and select a candidate basic logic gate combination from the obtained set of candidate basic logic gate combinations. If the traversal and selection are completed, jump to step S3; otherwise, jump to step S2.2; S2.2, for the current candidate basic logic gate combination, query a preset standard cell library for each basic logic gate therein to obtain the energy consumption of the basic logic gate, and then sum the energy consumptions of all basic logic gates in the current candidate basic logic gate combination to obtain the original energy consumption of the current candidate basic logic gate combination; for the current candidate basic logic gate combination, query a preset standard cell library according to the combined composite logic gate thereof to obtain the energy consumption of the combined composite logic gate as the combined energy consumption of the current candidate basic logic gate combination; S2.3, compare the original energy consumption of the current candidate basic logic gate combination with the energy consumption after merging. If the energy consumption after merging is smaller, the current candidate basic logic gate combination is used as the basic logic gate combination to be optimized; jump to step S2.
1.
3. The in-memory logic comprehensive mapping method for energy consumption optimization according to claim 2, characterized in that: When judging whether the basic logic gate combination to be optimized has a circular dependency in step S3, it also includes calculating the difference between the original energy consumption and the combined energy consumption of the basic logic gate combination to be optimized when the basic logic gate combination to be optimized has a circular dependency. If the difference between the original energy consumption and the combined energy consumption is greater than the energy consumption of the copy gate COPY required to be added to eliminate the circular dependency of the basic logic gate combination to be optimized, firstly add the copy gate COPY to the basic logic gate combination to be optimized to eliminate the circular dependency, and then replace the basic logic gate combination to be optimized with the corresponding composite logic gate and adjust the netlist structure; if the difference between the original energy consumption and the combined energy consumption is less than or equal to the energy consumption of the copy gate COPY required to be added to eliminate the circular dependency of the basic logic gate combination to be optimized, then give up replacing the basic logic gate combination to be optimized with the corresponding composite logic gate.
4. The in-memory logic comprehensive mapping method for energy consumption optimization according to claim 1, characterized in that: When the basic logic gate combination to be optimized is replaced with the corresponding composite logic gate and the netlist structure is adjusted in step S3, if there is a continuous NOT gate NOT + NOT gate NOT after the merger, the latter NOT gate NOT is deleted, and the downstream circuit of the latter NOT gate NOT is connected to the input end of the previous NOT gate NOT.
5. The in-memory logic synthesis mapping method for energy consumption optimization according to claim 1, characterized in that: When obtaining candidate basic logic gate combinations that can be merged into composite logic gates from the input post-synthesis netlist in step S1, the candidate basic logic gate combinations that can be merged into composite logic gates meet the following conditions: (1): the output of the previous basic logic gate in the replaced candidate basic logic gate combination cannot drive another basic logic gate other than the next basic logic gate in the same candidate basic logic gate combination; (2): the other input of the next basic logic gate in the replaced candidate basic logic gate combination is a covered input after replacement and cannot be used as a covered input of other composite logic gates.
6. The in-memory logic synthesis mapping method for energy consumption optimization according to claim 1, characterized in that: When obtaining candidate basic logic gate combinations that can be merged into composite logic gates from the input post-synthesis netlist in step S1, the basic logic gate combinations corresponding to the composite logic gates obtained include the basic logic gate combination NOR+OR corresponding to the composite logic gate ONOR, the basic logic gate combination NOT+OR corresponding to the composite logic gate IMP, the basic logic gate combination NOR+NOR corresponding to the composite logic gate ONOR+NOT, and the basic logic gate combination NOT+NOR corresponding to the composite logic gate IMP+NOT, wherein ONOR is an NOR-OR logic gate, IMP is an implication logic gate, NOT is a NOT gate, NOR is an NOR gate, and OR is an OR gate.
7. An in-memory logic synthesis mapping system for energy consumption optimization, comprising a microprocessor and a memory connected to each other, characterized in that: The microprocessor is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization as described in any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program or instruction stored therein, characterized in that: The computer program or instruction is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization described in any one of claims 1 to 6 through a processor.
9. A computer program product comprising a computer program or instructions, characterized in that The computer program or instruction is programmed or configured to execute the in-memory logic synthesis mapping method for energy consumption optimization described in any one of claims 1 to 6 through a processor.
