Multifunctional universal power consumption scene capturing device and application method thereof

CN118586335APending Publication Date: 2024-09-03NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410803493.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing technology has low efficiency in accurately capturing peak power consumption and average power consumption in power consumption evaluation, and the degree of automation is insufficient. Especially when there are random factors, the target power consumption cannot be accurately obtained, the efficiency is low, and the existing method requires multiple simulations. to obtain the required data.

Method used

Design a multifunctional and universal power consumption scene capture device, including a process encapsulation component and a device core. Through the flip rate FIFO array, multi-granularity softening processing array, peak screening processing component and average processing component, the peak point and average flipping are realized It provides high-speed real-time collection, caching and processing, provides selective information output, and achieves one-pass simulation to obtain all data.

Benefits of technology

It achieves accurate capture of peak power consumption and average power consumption, provides scientific waveform data and flip rate information, improves the efficiency and automation of power consumption assessment, and can obtain multiple simulation results in one pass while ensuring accuracy. Power consumption values, including peak, typical, and average power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586335A
    Figure CN118586335A
Patent Text Reader

Abstract

The invention discloses a multifunctional universal power consumption scene capturing device and an application method thereof.The device comprises a process packaging component and a device kernel, and the process packaging component is used for packaging commands required by a user based on an emulator so as to conduct function configuration, information reading and mode selection on the device kernel; and the device kernel is used for collecting, caching, multi-granularity softening processing and peak point discrimination of the flip rate of one or more DUTs after receiving the packaged command, and selectively outputting information according to a processing result for the flip rate executed according to a power consumption target. According to the method, peak power consumption can be accurately captured, relatively scientific waveform data and turnover rate information can be provided for calculation according to average power consumption, meanwhile, information such as waveforms and turnover rates of various target power consumption scenes can be provided for program division, optimization and selection, and all data can be obtained through one-time simulation under the condition that accuracy is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the power consumption optimization technology in the field of integrated circuit design verification, and specifically relates to a multifunctional universal power consumption scene capturing device and an application method thereof. Background Art

[0002] Power consumption, together with performance and area (PPA: Performance Power and Area) are the three main evaluation indicators for measuring the design of integrated circuits, especially mobile phone chips, IoT chips, embedded chips, etc. The importance of efficient and accurate power consumption evaluation to integrated circuit design is self-evident. Common power consumption evaluation targets include peak power consumption, average power consumption, typical power consumption (i.e., average power consumption under typical applications), power consumption slope, etc. Among them, peak power consumption and average power consumption are the maximum and average power consumption of the chip under all possible application scenarios, respectively, while typical power consumption is the average power consumption under typical application scenarios. The power consumption slope refers to the speed of power consumption changes, which mainly affects the design of the power supply network.

[0003] At present, the main power consumption analysis methods are divided into forward calculation and reverse deduction. Among them, forward deduction is divided into two types. The first is to obtain the waveform required for the target evaluation target by a certain method, and then calculate the specific power consumption value through special power consumption calculation software such as PowerArtist and Joules. The second is to set a fixed flip rate value by a certain method (or based on experience), and then calculate the specific power consumption value through special power consumption calculation software such as PowerArtist and Joules; reverse deduction is to deduce the power consumption value of the DUT by geometric deduction based on the actual power consumption value of the existing chip and various design information, and various detailed design information of the design to be verified (DUT: Design Under Test). These methods have their own strengths and are currently used in the industry.

[0004] In the forward calculation process of power consumption, the accuracy and efficiency of the waveform file or flip rate information directly affect the accuracy and efficiency of the power consumption evaluation results. In some test scenarios, the full-cycle waveform can be obtained by simplifying the test stimulus, and then the peak power consumption, typical power consumption, average power consumption and other power consumption values ​​can be calculated. This method depends on the scientificity and efficiency of the test stimulus, and requires a clear understanding of the test scenarios of the chip operation and the operation of the target design under each test scenario, which places extremely high demands on designers. In order to obtain application scenarios that are as close to reality as possible, the industry also widely uses hardware simulation acceleration platforms or prototype systems. During the simulation of various test scenarios, the hardware resources in the acceleration platform or prototype system calculate in real time to obtain the flip rate information of the target design at each moment, and then capture the corresponding waveform data according to different requirements such as peak power consumption, typical power consumption, and average power consumption, and calculate the specific power consumption value through dedicated power consumption calculation software such as PowerArtist and Joules.

[0005] At present, the main means of power consumption evaluation in the industry is to use software simulators such as IUS and VCS to run test stimuli and calculate all waveforms and flip rates, and then manually select one or several waveforms for peak power consumption or average power consumption calculation. In terms of hardware simulation accelerators, the Palladium system hardware simulation accelerator provides multiple power consumption evaluation methods such as NTC (NormanlToggle Count, normal flip rate calculation), WTC (Weighted Toggle Count, weighted flip rate calculation), and FTC (Fast Toggle Count, fast flip rate calculation) for power consumption evaluation. The basic idea is to obtain the flip rate signal of each cycle through software online calculation or hardware resource online calculation, and then feed back the flip rate information to the user through various methods. After processing, the user selects the waveform required for the target function evaluation target scenario, and then performs a second simulation to capture the corresponding waveform data. The ZEBU simulation accelerator obtains flip rate information in a similar way, but compared with Palladium, users have many different ways to handle the flip rate they calculate. However, it can use tools such as Verdi and Siloti to flexibly consider the contribution of the process library to power consumption, and apply the waveform data obtained from the RTL (register transfer level) circuit to the calculation of netlist power consumption. The Veloce hardware simulation accelerator also has a power consumption evaluation process similar to the NTC on Palladium. With the increasingly urgent demand for domestic EDA tools, the research and development of domestic software simulators and hardware simulation acceleration has sprung up in the past two years, but they are basically in the embryonic or conceptual design stage. At present, its power consumption evaluation process is still in the exploration and reference stage.

[0006] In addition, whether it is based on a dedicated power consumption test program or a standard test stimulus, the accuracy and efficiency of power consumption assessment are closely related to the quality of the test stimulus. Therefore, the analysis, optimization and selection of test stimuli are also an important task, which requires DUT waveforms based on many power consumption target scenarios to assist in the analysis.

[0007] For peak power consumption, whether it is IUS, VCS, PLD, ZEBU, Veloce, etc., the selection of waveforms cannot be free from human intervention, and the degree of automation is too low. For PLD, ZEBU, Veloce, etc., it may be necessary to run twice to obtain the required waveform, which is too inefficient. When there are peripherals such as network cards and random factors such as serial port input during the test process, it is even impossible to accurately obtain the waveform required for the target power consumption, which is inefficient. For average power consumption, the existing technology can only take a variety of averages, but the sampling lacks measurement indicators and is too random; for program analysis optimization and selection, the existing technology can only use the "simulation-offline analysis-simulation" method, which is too inefficient. Summary of the invention

[0008] Technical problem to be solved by the present invention: In view of the above-mentioned problems in the prior art, a multifunctional universal power consumption scenario capture device and an application method thereof are provided. The present invention aims to accurately capture peak power consumption and provide relatively scientific waveform data and flip rate information for calculation based on average power consumption. At the same time, it can also provide various target power consumption scenario waveforms, flip rate and other information for program division, optimization and selection. While ensuring accuracy, all data can be obtained in one simulation.

[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is: A multifunctional universal power consumption scenario capturing device comprises two parts: a process encapsulation component and a device kernel. The process encapsulation component is used to package and encapsulate commands required by users based on a simulator for function configuration, information reading and mode selection of the device kernel. The device kernel is used to collect, cache, perform multi-granularity softening processing, and peak point identification of the flip rate of one or more design components under test (DUT) after receiving the packaged commands, and perform selective information output on the processing results of the flip rate according to the power consumption target.

[0010] Optionally, the process encapsulation component is used to package and encapsulate user-required commands based on the simulator. The user-required commands involved include serial port input commands, local mode entry commands, local mode exit commands, global function configuration commands, local function configuration commands, and global average flip rate viewing commands, wherein the serial port input command is used to simulate serial port input, the local mode entry command and the local mode exit command are used to display the entry and exit of the local mode respectively, the global function configuration command is used to configure the parameters of the global mode, the local function configuration command is used to configure the parameters of the local mode, the global average flip rate viewing command is used to view the global average flip rate, the local mode refers to power consumption capture for a certain code segment or subroutine of the test program, and the global mode refers to power consumption capture for the entire test program.

[0011] Optionally, the device core includes: a function control module, which is used to provide function control information for selecting output information through a built-in configuration register; a flip rate FIFO array, which is used to cache the flip rates of multiple design DUTs to be verified; a multi-granularity flip rate softening processing array, which is used to soften the flip rates of multiple design components DUT under test to eliminate power consumption peaks; a local average processing component, which is used to calculate the average flip rate of a program segment or subroutine; a global average processing component, which is used to calculate the average flip rate of the entire test process; a global peak identification processing component, which is used to identify the flip rate peak point in the entire test process; a local peak identification processing component, which is used to identify the flip rate of a program segment or subroutine. The information processing component is used to select and output the results of the local average processing component, the global average processing component, the global peak discrimination processing component and the local peak discrimination processing component according to the function control information provided by the function control module; the function control module is connected to the information processing component, the output end of the flip rate FIFO array is respectively connected to the input end of the multi-granularity flip rate softening processing array, the local average processing component, the global average processing component, the global peak discrimination processing component and the local peak discrimination processing component, and the output ends of the local average processing component, the global average processing component, the global peak discrimination processing component and the local peak discrimination processing component are respectively connected to the information processing component.

[0012] Optionally, the flip rate FIFO in the flip rate FIFO array is a configurable FIFO, and the configurable FIFO refers to a first-in-first-out cache queue with configurable depth and width. The flip rate FIFO array is connected to a function control module, and the function control module includes registers for configuring the depth and width of the configurable FIFO.

[0013] Optionally, the function expression of the multi-granularity flip rate softening processing array for softening processing is: , In the above formula, T ave is the flip rate after softening, n1~n i are the weights of the configured 1st to ith periods, T1 to T i is the toggle rate of the 1st to i-th cycles of the corresponding design DUT to be verified, i is the number of configured softening cycles, the multi-granularity toggle rate softening processing array is connected to the functional control module, and the functional control module contains registers for configuring weights and the number of softening cycles to achieve toggle rate softening processing of multiple granularities.

[0014] Optionally, the function expression for calculating the average flip rate of the entire test process by the global average processing component is: , In the above formula, is the average flip rate of the entire test process at the end of the current shot, is the global average flip rate of the entire test process at the end of the previous shot, It is the total number of cycles of the entire test process when the current beat ends; The function expression of the local average processing component for calculating the average flip rate of a certain program segment or subroutine is: * , In the above formula, It is the average flip rate of a certain program segment or subroutine of the test program at the end of the current beat. It is the global average flip rate of a certain program segment or subroutine of the test program at the end of the previous beat. It is the total number of cycles of a program segment or subroutine of the test program at the end of the current beat.

[0015] In addition, the present invention also provides an application method of the aforementioned multifunctional universal power consumption scenario capture device, including performing global mode power consumption capture for a test program to achieve peak power consumption and average power consumption evaluation: Step S1, start simulation: initialize the configuration registers in the flip rate FIFO array and the function control module, and set the total number of cycles at the end of the current beat Initialized to 0, and the total number of cycles when the current beat ends Automatically increments by one as the clock cycle progresses; Step S2, calling the global function configuration command encapsulated by the global function configuration encapsulation module to complete the configuration of the configuration register in the function control module; Step S3, calling the serial port input command encapsulated by the serial port input encapsulation module to simulate the serial port input to start the test program; Step S4, caching the toggle rates of multiple to-be-verified design DUTs through a toggle rate FIFO array; Step S5, softening the flip rates of multiple DUTs through a multi-granularity flip rate softening processing array to eliminate power consumption peaks, and calculating the average flip rate of the entire test process through a global average processing component; Step S6, identifying the peak point of the flip rate in the entire test process through a global peak identification processing component; Step S7, if the information processing component detects that the global peak identification processing component identifies a new flip rate peak point, then it is determined whether the flip rate peak point is greater than the flip rate threshold configured in the function control module, and the flip rate corresponding to the global peak point and the start and end time corresponding to the time period are controlled to be printed out by the global peak point flip rate information processing module and the global peak point time period information processing module in the information processing component, and at the same time, according to the "whether the global peak point waveform is exported in real time" information configured in the function control module, the waveform upload module in the information processing component controls the export of the waveform data corresponding to the global peak point; at the same time, if the information processing component receives a global average flip rate command from the user, the global average flip rate information processing module prints out the global average flip rate command; Step S8, determine whether the program has been executed. If not, jump to step S4; otherwise, end and exit.

[0016] Optionally, in step S6, when the peak value of the flip rate in the entire test process is identified by the global peak value identification processing component, multiple groups of peak flip rate registers and head and tail time registers are used to store and save the top values ​​of the flip rate and the head and tail time of the corresponding time period, and for each group of peak flip rate registers and head and tail time registers, at each rising edge of each clock cycle, the flip rate T after softening generated in the current cycle is calculated. ave The top several flip rates of the value generation flip rate constitute a flip rate list. The number of elements in the flip rate list is the same as the number of groups of the peak flip rate register and the head and tail time register. For each element in the flip rate list, if the flip rate T after softening of the element is ave If the value is greater than the corresponding peak flip rate register value, the softened flip rate T in the element is ave The value replaces the value of the corresponding peak toggle rate register, and the start and end times of the element replace the start and end times in the corresponding start and end time register.

[0017] Optionally, when the power consumption capture in a global mode is performed on the test program to achieve the evaluation of the peak power consumption and the average power consumption, the power consumption capture in a local mode is also performed in parallel on a certain program segment or subroutine of the test program for program power consumption optimization: Step P1, calling the local function configuration command encapsulated by the local function configuration encapsulation module to complete the configuration of the configuration register in the function control module; Step P2, calling the local mode entry command encapsulated by the local mode entry encapsulation module to enter the power consumption capture operation in the local mode, wherein the power consumption capture operation in the local mode and the power consumption capture operation in the global mode both work in parallel; Step P3, calling the serial port input command encapsulated by the serial port input encapsulation module to simulate the serial port input to start the test program segment or subroutine; Step P4, caching the toggle rates of multiple to-be-verified design DUTs through a toggle rate FIFO array; Step P5, softening the flip rates of multiple DUTs through a multi-granularity flip rate softening processing array to eliminate power consumption peaks, and calculating the average flip rate of the entire test process through a global average processing component; Step P6, identifying the peak point of the flip rate during the test process of the test program segment or subroutine through the local peak identification processing component; Step P7, if the information processing component detects that the local peak identification processing component identifies a new flip rate peak point, then it is determined whether the flip rate peak point is greater than the flip rate threshold configured in the function control module, and the flip rate corresponding to the local peak point and the start and end time corresponding to the time period are controlled to be printed out by the local peak point flip rate information processing module and the local peak point time period information processing module in the information processing component, and at the same time, according to the "whether the local peak point waveform is exported in real time" information configured in the function control module, the waveform upload module in the information processing component controls the export of the waveform data corresponding to the local peak point; at the same time, if the information processing component receives a local average flip rate command from the user, the local average flip rate information processing component prints out the local average flip rate command; Step P8, determine whether the program has been executed. If it has not been executed, jump to step P4; otherwise, jump to the next step; Step P9, calling the local mode exit command encapsulated by the local mode exit encapsulation module to display exit from the local mode; Step P10, centrally outputting local information through the information processing component, including: the local peak point flip rate information processing module, the local peak point time period information processing module, and the waveform upload module in the information processing component output the flip rate corresponding to the local peak point in the test program segment or subroutine process executed in this local mode, the start and end time corresponding to the time period, and the waveform data, and the waveform local average flip rate information processing module in the information processing component prints out the obtained local average flip rate; Step P11: Determine whether to re-enter the local mode to complete the power consumption behavior analysis of another program segment or subroutine. If necessary, jump to step P2 and re-enter the power consumption capture operation in the local mode; if not, go to step P11 to continue waiting, and at this time only perform the power consumption capture operation under the default global mode.

[0018] Optionally, in step P6, when the local peak value identification processing component is used to identify the peak value of the flip rate in the test process of the test program segment or subroutine, multiple groups of peak flip rate registers and head and tail time registers are used to store and save the top values ​​of the flip rate and the head and tail times of the corresponding time periods, and for each group of peak flip rate registers and head and tail time registers, at each rising edge of each clock cycle, the flip rate T after softening generated in the current cycle is calculated. ave The top several flip rates of the value generation flip rate constitute a flip rate list. The number of elements in the flip rate list is the same as the number of groups of the peak flip rate register and the head and tail time register. For each element in the flip rate list, if the flip rate T after softening of the element is ave If the value is greater than the corresponding peak flip rate register value, the softened flip rate T in the element is ave The value replaces the value of the corresponding peak toggle rate register, and the start and end times of the element replace the start and end times in the corresponding start and end time register.

[0019] Compared with the prior art, the present invention mainly has the following advantages: 1. The present invention can not only accurately capture the peak power consumption, but also provide relatively scientific waveform data and flip rate information for calculation based on average power consumption. At the same time, it can also provide various target power consumption scenario waveforms, flip rate and other information for program division, optimization and selection. While ensuring accuracy, all data can be obtained through one simulation. It can capture waveforms, flip rates and other power consumption scenarios according to power consumption targets and then calculate and obtain a variety of power consumption values, including peak power consumption, typical power consumption, average power consumption, etc.

[0020] 2. The present invention can be applied to the evaluation of peak power consumption, average power consumption or typical power consumption, and can also be applied to integrated circuit design and optimization, optimization analysis and selection of application programs, etc.

[0021] 3. When the corresponding data interface is available, the device of the present invention can be applied to almost all simulators and has strong versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 Schematic diagram of the device structure in an embodiment of the present invention.

[0023] Figure 2 Schematic diagram of the structure of the device kernel in an embodiment of the present invention.

[0024] Figure 3 Schematic diagram of the working process of the device in the global mode in an embodiment of the present invention.

[0025] Figure 4 FIG. 4 is a schematic diagram of a working process of a device in a local mode according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] like Figure 1 As shown, the multifunctional universal power consumption scenario capture device of this embodiment includes two parts: a process encapsulation component and a device core 1. The process encapsulation component is used to package and encapsulate the commands required by the user based on the simulator for function configuration, information reading and mode selection of the device core 1. The device core 1 is used to collect, cache, perform multi-granularity softening processing, and peak point identification for the flip rate of one or more design components under test DUT after receiving the encapsulated commands, and perform selective information output on the processing results of the flip rate according to the power consumption target.

[0027] like Figure 1As shown, the process encapsulation component of this embodiment is used to package and encapsulate user-required commands based on the simulator. The user-required commands involved in the encapsulation include serial port input commands, local mode entry commands, local mode exit commands, global function configuration commands, local function configuration commands, and global average flip rate viewing commands, wherein the serial port input command is used to simulate serial port input, the local mode entry command and the local mode exit command are used to display the entry and exit of the local mode respectively, the global function configuration command is used to configure the parameters of the global mode, the local function configuration command is used to configure the parameters of the local mode, the global average flip rate viewing command is used to view the global average flip rate, the local mode refers to power consumption capture for a certain code segment or subroutine of the test program, and the global mode refers to power consumption capture for the entire test program. The process encapsulation component mainly packages various configurations and control operations of the control module into commands, which can be called in the same environment as the program test commands to improve the automation level of the test. The specific encapsulated commands in this embodiment mainly include: serial port input command unw "*", which is used to simulate the input of various serial port commands; local mode entry command tom "lin"; local mode exit command tom "lout"; global function configuration command tom "gcfg *", which is used to configure various configuration information related to the global mode, * is the value of the relevant field of the configuration control register; local function configuration command tom "lcfg *", which is used to configure various configuration information related to the local mode, * is the value of the relevant field of the configuration control register; global average flip rate viewing command tom "Tga", which is used by the user to view the global average flip rate value at a certain time. The available examples of command outer layer encapsulation can be implemented using scripting languages ​​such as tcl, shell, python, perl, etc., which are specifically determined according to the language supported by the simulator. In terms of inner layer implementation, tom can be processed through the underlying commands supported by the emulator, such as force and deposit; and the underlying implementation of the unw command can be implemented in many ways, such as serial port input can be realized by forcing the relevant signals in the external uart hardware model, or the outer layer encapsulation command can be transmitted to the shell terminal of the real serial port chip host through the socket, and serial port input can be realized through shell commands.

[0028] The device core 1 is mainly responsible for processing the flip rate (the number of signal flips per unit time), identifying the peak point (the peak point, the point with the largest flip rate after softening), and outputting various information. Figure 2As shown, the device kernel 1 of this embodiment includes: a function control module 2, which is used to provide function control information for selecting output information through a built-in configuration register 10; a flip rate FIFO array 3, which is used to cache the flip rates of multiple design DUTs to be verified; a multi-granularity flip rate softening processing array 4, which is used to soften the flip rates of multiple design components DUT under test to eliminate power consumption peak spikes; a local average processing component 5, which is used to calculate the average flip rate of a certain program segment or subroutine; a global average processing component 6, which is used to calculate the average flip rate of the entire test process; a global peak value identification processing component 7, which is used to identify the flip rate peak point in the entire test process; a local peak value identification processing component 8, which is used to identify the flip rate peak point of a certain program segment or subroutine. value point; an information processing component 9, which is used to select and output the results of the local average processing component 5, the global average processing component 6, the global peak discrimination processing component 7, and the local peak discrimination processing component 8 according to the function control information provided by the function control module 2; the function control module 2 is connected to the information processing component 9, and the output end of the flip rate FIFO array 3 is respectively connected to the input end of the multi-granularity flip rate softening processing array 4, the local average processing component 5, the global average processing component 6, the global peak discrimination processing component 7 and the local peak discrimination processing component 8, and the output ends of the local average processing component 5, the global average processing component 6, the global peak discrimination processing component 7 and the local peak discrimination processing component 8 are respectively connected to the information processing component 9.

[0029] The toggle rate FIFO array is used to cache the toggle rate information of multiple DUTs to be verified. The FIFO depth and width are configurable. Figure 2 As shown, in this embodiment, the flip rate FIFO array 3 includes flip rate FIFO-1 to flip rate FIFO-i, a total of j flip rate FIFOs. Among them, the flip rate FIFO in the flip rate FIFO array 3 is a configurable FIFO (First In First Out, first in first out cache queue), and the configurable FIFO refers to a first in first out cache queue with configurable depth and width. The flip rate FIFO array 3 is connected to the function control module 2, and the function control module 2 contains a register for configuring the depth and width of the configurable FIFO.

[0030] The multi-granularity flip rate softening processing array 4 is used to perform multi-granularity and multi-algorithm softening processing on the flip rates of multiple DUTs to eliminate the influence of power consumption peaks on the evaluation accuracy. Figure 2 The multi-granularity flip rate softening processing array 4 includes a multi-granularity flip rate softening processing module 1 to a multi-granularity flip rate softening processing module j. In this embodiment, the multi-granularity flip rate softening processing array 4 performs softening processing as follows: , In the above formula, Tave is the flip rate after softening, n1~n i are the weights of the configured 1st to ith periods, T1 to T i is the toggle rate of the 1st to i-th cycles of the corresponding design DUT to be verified, i is the number of configured softening cycles, the multi-granularity toggle rate softening processing array 4 is connected to the function control module 2, and the function control module 2 contains registers for configuring weights and the number of softening cycles to achieve toggle rate softening processing of multiple granularities (different granularities for different i values). n1~n i The weight set for each cycle flip rate can be set according to the interval range. i The values ​​of are all 1, and the softening process is the simplest geometric mean. Considering the complexity of weight configuration, multiple softening algorithms are performed simultaneously, and the selection is made through the "softening algorithm" field / register in the step function control component. The number of softening cycles i represents the range within which the smoothing process is performed. Its value is affected by many factors such as parasitic / package / mainboard capacitance and design scale, and can be configured as needed.

[0031] In addition to peak power consumption, average power consumption or typical power consumption is also an important indicator of the chip. Therefore, in this embodiment, the local average processing component 5 is used to calculate the average flip rate of a program segment or subroutine, and the global average processing component 6 is used to calculate the average flip rate of the entire test process. As an optional implementation, the function expression of the global average processing component 6 calculating the average flip rate of the entire test process in this embodiment is: , In the above formula, is the average flip rate of the entire test process at the end of the current shot, is the global average flip rate of the entire test process at the end of the previous shot, It is the total number of cycles of the entire test process when the current beat ends.

[0032] As an optional implementation, in this embodiment, the local average processing component 5 calculates the function expression of the average flip rate of a program segment or subroutine as follows: * , In the above formula, It is the average flip rate of a certain program segment or subroutine of the test program at the end of the current beat. It is the global average flip rate of a certain program segment or subroutine of the test program at the end of the previous beat. It is the total number of cycles of a program segment or subroutine of the test program at the end of the current beat.

[0033] The global peak identification processing component 7 is used for global peak identification processing, that is, to identify the peak point of the flip rate in the entire test process; the local peak identification processing component 8 is used for local peak identification processing, that is, to identify the peak point of the flip rate of a certain program segment or subroutine; as an optional implementation, in this embodiment, the global peak identification processing and local peak identification processing of the global peak identification processing component 7 and the local peak identification processing component 8 both use a bubble algorithm to capture the peak power consumption points and their time periods of the entire test process or each program segment / subroutine, and add a register to store the maximum flip rate after softening processing up to the current simulation cycle, and add a register to save the beginning and end time of the corresponding time period, so as to identify the peak power consumption points.

[0034] During the power consumption evaluation process, the information processing component 9 needs to output various information such as the injection flip rate, the simulation cycle corresponding to the peak point, and the waveform data. In addition, according to the different power consumption evaluation targets, the information output has to consider the factors such as the simulation speed, the simulator information output bandwidth, and the information observability. According to the configuration register 10 of the function control module 2, the "threshold configuration", "whether the global peak point waveform is exported in real time", "whether to implement the printing of peak toggle in local mode", "whether to implement the printing of waveform in local mode", "whether to print the peak point time period in local mode" and other configuration parameters are selectively output to various information, or only viewed in real time through commands. The function control module 2 mainly parses the encapsulation command, fills the control register related fields or register groups in the internal configuration register 10, and provides relevant control information for the flip rate FIFO array 3, the multi-granularity flip rate softening processing array 4, the peak identification processing component 5, the global average processing component 6, and the information processing component 9. As required, possible examples of control register fields or register groups include, "whether to export global peak waveform in real time", "whether to implement print peak toggle in local mode", "whether to implement print waveform in local mode", "whether to print peak point time period in real time in local mode", "softening granularity selection", "softening algorithm selection" fields, "DUT evaluation target number", "threshold configuration" and other fields or registers. See Figure 1In this embodiment, the configuration register 10 of the function control module 2 includes: a, whether to print the peak point in real time in the local mode, which is used for the output control of the information processing component 9; b, whether to print the peak point time period in real time in the local mode, which is used for the output control of the information processing component 9; c, whether the global peak point waveform is exported in real time, which is used for the output control of the information processing component 9; d, softening granularity selection, which is used to control the softening strategy of the flip rate softening processing array 4; e, whether the local peak point waveform is exported in real time, which is used for the output control of the information processing component 9; f, softening algorithm selection, which is used to control the softening strategy of the flip rate softening processing array 4; g, the number of DUT evaluation targets, which is used to control the number of working units of the flip rate FIFO array 3 and the flip rate softening processing array 4; h, threshold configuration, which is used for the output control of the information processing component 9, etc. Other configuration fields or registers can be deleted or added according to requirements, which are not described in detail here.

[0035] In summary, the multifunctional universal power consumption scene capture device of this embodiment can realize the caching and real-time softening of the flip rate information of each cycle, fully consider the influence of various levels of capacitance such as parasitic / package / mainboard capacitance in the chip and heat dissipation on power consumption, and the softening granularity and softening strategy can be selected through configuration, which improves the accuracy of power consumption evaluation. The real-time identification of the peak point (peak point, the point with the largest flip rate after softening) of global (the entire test process) and local (a specific program segment or subroutine) is realized respectively, and the flip rate, time period, and waveform data corresponding to the peak point are provided, and the average flip rate during the operation process is provided, and this information can be selected through configuration according to different target requirements, so that multiple goals such as peak power consumption, average power consumption, and program optimization selection can be completed in one simulation, thereby improving the efficiency of power consumption evaluation. The configuration of power consumption of the power consumption evaluation device, the entry and exit of the local mode, and the viewing of the global peak point signal are encapsulated in the process, which can be used on the same platform with the program test command, realizing test automation and improving test efficiency. The multifunctional universal power consumption scene capture device of this embodiment not only takes into account the influence of the chip's on-chip parasitic capacitance, package capacitance, and even the mainboard capacitance on the peak power consumption scene identification, but also considers the existence of the positive feedback mechanism between power consumption and heat dissipation, and realizes a variety of weighted smooth processing mechanisms, and a variety of softening algorithm results can be selected through configuration. By fitting the measured results with the big data of the evaluation results, the accuracy of peak power consumption scene identification can be improved. The multifunctional universal power consumption scene capture device of this embodiment sets a global average processing module and a local average processing module in the device kernel 1, and calculates the average flip rate of the entire test program or a single program segment / subroutine respectively. The results can be displayed and output through commands or automatically output when the local mode is exited, and the results are used for the evaluation of average power consumption and typical power consumption. By cooperating with the configuration command, a variety of control information is provided, and the number of FIFOs, FIFO depth, softening granularity, softening algorithm, and output content are effectively selected to achieve the versatility of this device.

[0036] In order to meet the needs of different power consumption assessment targets, the multifunctional universal power consumption scenario capture device of this embodiment has two working modes. One is the global mode, which is mainly used to evaluate the peak power consumption and average power consumption of the DUT. This mode is the default working mode and can be selected to be always on or turned off by command. The other is the local mode, which is mainly used to analyze the power consumption behavior of each subroutine or program segment and is used for program analysis optimization and selection. This mode requires commands to enter or exit the mode. Both the global mode and the local mode can work at the same time. The Golbal mode and the local mode have both shared functional components and their own independent functional components. Figure 3As shown, this embodiment also provides an application method of the aforementioned multifunctional universal power consumption scenario capture device, including performing global mode power consumption capture for a test program to achieve peak power consumption and average power consumption evaluation: Step S1, start simulation: initialize the configuration register 10 in the flip rate FIFO array 3 and the function control module 2, and set the total number of cycles at the end of the current beat Initialized to 0, and the total number of cycles when the current beat ends Automatically increments by one as the clock cycle progresses; Step S2, calling the global function configuration command encapsulated by the global function configuration encapsulation module to complete the configuration of the configuration register 10 in the function control module 2; in this embodiment, specifically, the relevant fields of the control register 10 in the function control module 2 are configured by the encapsulation command tom "gcfg *". The function control module 2 is mainly used to receive the global function configuration command from Figure 2The encapsulation commands "tom" and "unw" of the framework shown are parsed, and the relevant fields of the internal control registers are filled according to the parsing results, and relevant control information is provided for the flip rate FIFO array 3, the flip rate softening processing array 4, the local average processing component 5, the global average processing component 6, the global peak discrimination processing component 7, the local peak discrimination processing component 8 and the information processing component 9. If the power consumption assessment target includes the peak power consumption, the "Whether the global peak point waveform is exported in real time" field needs to be configured as "yes", and the information processing component 9 is controlled by the relevant control signal. Once the global peak discrimination processing component 7 discrimination processing module finds a new peak point, the waveform data can be exported; if the power consumption scenario does not include peak power consumption, in order to save disk overhead, etc., you can choose to configure this field as "no". The flip rate of a certain clock cycle cannot accurately reflect the actual peak power consumption and needs to be softened. Therefore, it is necessary to select the softening granularity (i.e., the time range within which the flip rate is softened) and the softening algorithm. By parsing the tom "gcfg *" command, the "softening granularity selection" and "softening algorithm selection" fields in the control register 10 are configured respectively, and the relevant control signals are given to the flip rate softening processing component 4. In order to improve the evaluation efficiency, the device can monitor and evaluate the power consumption information of multiple components under test DUT at the same time. By parsing the tom "gcfg *" command, the "DUT evaluation target number" field in the control register 10 is configured, and relevant control information is given to the flip rate FIFO array 3, the flip rate softening processing component 4, the local average processing component 5, the global average processing component 6, the global peak discrimination processing component 7, the local peak discrimination processing component 8 and the information processing component 9. The flip rates of the set number of components under test DUT are cached, processed and information output, so as to realize the power consumption evaluation of multiple components under test DUT at the same time. During the evaluation process, a large amount of data such as flip rate, time period, waveform, etc. may be output. On some simulation platforms, the output of a large amount of data may reduce the simulation speed or cause the clock to pause, affect the efficiency or cause functional abnormality (such as with dynamic IO devices). By parsing the tom "gcfg *" command, a reasonable threshold value is configured in the "threshold configuration" field in the control register 10, and relevant control signals are given to the information processing component 9. The above information is output only when the identified peak point flip rate is greater than the threshold value. Other configuration information can be added as required, which will not be described in detail here; Step S3, calling the serial port input command encapsulated by the serial port input encapsulation module to simulate the serial port input to start the test program; in this embodiment, specifically calling the serial port input command unw "*" encapsulated by the serial port input encapsulation module to simulate the serial port input and start the test program. During the power consumption evaluation process, it is inevitable to insert commands such as flip rate checking, local mode entry / exit, and function configuration during the test process. In order to realize the scripting and automation of the test, the process encapsulation module in the present invention performs the same process encapsulation on its commands and the serial port input commands to ensure that the two types of commands can be called on the same platform. The outermost encapsulation of the power consumption evaluation command tom and the serial port input command unw can be implemented by scripting languages ​​such as tcl or shell, which is specifically determined by the language supported by the emulator. In terms of inner layer implementation, tom can be processed by the underlying commands supported by the emulator such as force; and the underlying implementation of the unw command can be implemented in a variety of ways, and the serial port input can be realized by forcing the relevant signals in the external uart hardware model, or the outer encapsulation command can be transmitted to the shell terminal of the real serial port chip host through the socket, and the serial port input can be realized through the shell command; Step S4, the flip rate of multiple components under test DUT is cached through the flip rate FIFO array 3; the hardware resources or software calculation engine in the simulator will give the number of logic gates flipped by the module at the end of each clock cycle. Some simulators read the spef file that records the storage parameters, the lib file that calculates the device power consumption information, the def file that calculates the layout and wiring information, etc. when preparing the environment. The simulator will also add a weight to the flip of each logic gate according to the above information to ensure the accuracy of the evaluation. To facilitate the subsequent softening process, the flip rate FIFO array 3 provides a FIFO with a larger depth for each component under test DUT. In each cycle, the flip rate information is shifted in the FIFO. The data at the head of the FIFO is the flip rate newly generated in the current beat, and the data at the end of the FIFO is directly discarded. The FIFO depth and width of the flip rate FIFO array 3 are configurable; when the flip rate (Toggle_a) of multiple components under test DUT is cached through the flip rate FIFO array 3, the flip rate collected in the new beat is pressed into the FIFO head, the data in the FIFO is shifted, and the data at the end of the FIFO is lost; Step S5, softening the flip rates of multiple DUTs through the flip rate softening processing array 4 to eliminate power consumption peaks, and calculating the average flip rate of the entire test process through the global average processing component 6; Figure 1 In the figure, T_a1~T_ai represent the flip rates of the DUT buffered by the flip rate FIFO array 3, and T_b is the flip rate obtained after softening T_a1~T_ai. Step S6, identifying the peak point of the flip rate in the entire test process through the global peak identification processing component 7; Step S7, if the information processing component 9 detects that the global peak identification processing component 7 identifies a new flip rate peak point, then it is determined whether the flip rate peak point is greater than the flip rate threshold configured in the function control module 2, and the flip rate corresponding to the global peak point and the start and end time corresponding to the time period are controlled to be printed out by the global peak point flip rate information processing module and the global peak point time period information processing module in the information processing component 9, and at the same time, according to the "whether the global peak point waveform is exported in real time" information configured in the function control module 2, the waveform upload module in the information processing component 9 controls the export of the waveform data corresponding to the global peak point; at the same time, if the information processing component 9 receives a global average flip rate command (tom "Tga") from the user, the global average flip rate command is printed out by the global average flip rate information processing module; Step S8, determine whether the program has been executed. If not, jump to step S4; otherwise, end and exit.

[0037] Step S5 performs softening and global averaging on the flip rate data in the flip rate FIFO, which can be specifically divided into two parallel processing steps S5-1 and S5-2. Step S5-1: Softening the flip rate data in the flip rate FIFO. The flip rate FIFO array (3) records the total flip rate of the DUT evaluated in each cycle. On the one hand, due to the presence of parasitic capacitance, package capacitance, and even motherboard capacitance in the chip, even the peak power consumption is the average power consumption within a certain time range, and the size of the time range is affected by many factors such as parasitic / package / motherboard capacitance and design scale. On the other hand, due to the existence of the positive feedback mechanism between power consumption and heat dissipation (i.e., high power consumption leads to high heat dissipation pressure, and excessive temperature leads to higher power consumption of each device), different flip rates have different contributions to the heat generated by the current beat, and then to the temperature, and then to the peak power consumption. Therefore, the multi-granularity flip rate softening processing component 4 in the present invention softens the flip rates of each cycle collected, and its processing method is expressed by the formula: T ave =n1*T1+ n2*T2+……n i *T i In the above formula, T ave is the flip rate after softening, n1~n i are the weights of the configured 1st to ith periods, T1 to T i is the toggle rate of the 1st to i-th cycle of the corresponding DUT, i is the number of configured softening cycles. iThe weight set for each cycle flip rate can be set according to the interval range. i The values ​​of are all 1, then the softening process is the simplest geometric mean. Taking into account the complexity of the weight configuration, multiple softening processing algorithms are performed simultaneously, and the appropriate softening processing result is selected through the configuration in step S2. i represents the range within which the smoothing process is performed, and its value is affected by many factors such as parasitic / package / mainboard capacitance and design scale, which can be configured in step S2. Step S5-2: Perform global averaging on the flip rate data in the flip rate FIFO. The above function is to obtain peak power consumption. On the other hand, average power consumption or typical power consumption is also an important indicator of the chip. In order to evaluate the average power consumption or typical power consumption of the chip, the average flip rate information within a longer time range is particularly important. Therefore, in this step, the function expression of the global average processing component 6 calculating the average flip rate of the entire test process is: , In the above formula, is the average flip rate of the entire test process at the end of the current shot, is the global average flip rate of the entire test process at the end of the previous shot, It is the total number of cycles of the entire test process when the current beat ends; In step S6 of this embodiment, when the global peak value identification processing unit 7 identifies the peak value of the flip rate in the entire test process, multiple groups of peak flip rate registers and head and tail time registers are used to store and save the top values ​​of the flip rate and the head and tail time of the corresponding time period, and for each group of peak flip rate registers and head and tail time registers, at each rising edge of each clock cycle, the flip rate T after softening generated in the current cycle is calculated. ave The top several flip rates of the value generation flip rate constitute a flip rate list. The number of elements in the flip rate list is the same as the number of groups of the peak flip rate register and the head and tail time register. For each element in the flip rate list, if the flip rate T after softening of the element is ave If the value is greater than the corresponding peak flip rate register value, the softened flip rate T in the element is ave The value replaces the value of the corresponding peak flip rate register, and the start and end times of the element replace the start and end times in the corresponding start and end time register. For peak power consumption evaluation, The maximum value of and the corresponding time period are the capture targets. Therefore, the global peak discrimination processing component 7 adopts a bubbling algorithm to capture the maximum Value and its time period: add a register Used to store the maximum value of the current simulation cycle Value, add a register For saving The beginning and end time of the corresponding time period, each clock cycle rising edge, generally judge the new generation of the current cycle Is the value greater than If the value is greater than, the newly generated Value Replacement The value in Replace the first and last time of the time period corresponding to the value The value in , otherwise and The value in remains unchanged. According to the calculation formula of dynamic power consumption, the flip rate is not the only factor affecting dynamic power consumption, but is also affected by multiple information such as voltage and parasitic parameters. Therefore, it is impossible to fully prepare for the maximum power consumption based on the flip rate alone, but only a large trend can be obtained. In practical applications, it may be necessary to calculate the power consumption of multiple waveforms with the maximum flip rate, and then weigh the multiple power consumptions (this patent does not restrict this processing), and use the processing result as the final peak power consumption. For this reason, in this embodiment, not only one peak flip rate register is set for each component under test DUT and , but there will be a set of registers , , wait, , , Etc., save the top values ​​of the flip rate and the first and last times of the corresponding time periods respectively.

[0038] Step S7 can be specifically divided into two parallel processing steps S7-1 and S7-2. Step S7-1: Global peak point related information output control. If a new global peak point appears in step S6, the information processing component 9 first determines whether the value of the new global peak point flip rate is greater than the flip rate threshold configured in the step S2 function control module 2. If it is greater, the global peak point flip rate information processing module and the global peak point time period information processing module in the information processing component 9 control the printing and output of the flip rate corresponding to the global peak point and the beginning and end time corresponding to the time period. At the same time, according to the "whether the global peak point waveform is exported in real time" information configured in the step S2 function control module 2, the waveform upload module in the information processing component 9 controls the export of the waveform data corresponding to the global peak point. When the information output is completed, or the new global peak point flip rate appears in step S6 and is less than the threshold, enter the next step. Step S7-2: Global average flip rate information output control. During the test, the user may need to check the global average flip rate so far from time to time. At this time, the global average flip rate view encapsulation module encapsulation implementation tom "Tga" command is called to control the information processing component, and the waveform global average flip rate information processing module in the information processing component 9 selects the waveform global average flip rate in step S5-2 Print output.

[0039] like Figure 4 As shown, in this embodiment, when the power consumption of the test program is captured in a global mode to achieve the evaluation of the peak power consumption and the average power consumption, the power consumption of a certain program segment or subroutine of the test program is captured in a local mode in parallel for the program power consumption optimization: Step P1, call the local function configuration command encapsulated by the local function configuration encapsulation module to complete the configuration of the configuration register 10 in the function control module 2; specifically, configure the relevant fields of the control register 10 in the function control module 2 through the encapsulation command tom "lcfg *". If you want to enter the local mode, in addition to sharing some control information configured in step S2 in the default global mode, you also need to call the tom "lcfg *" command encapsulated by the local function configuration encapsulation module to configure the relevant control information. The local mode is mainly used for program analysis, optimization and selection, and the main concern is the peak flip rate and average flip rate of each program segment. Unlike the global mode, the local mode is entered or exited through the encapsulation command, and the simulator can explicitly obtain the start and exit of each program segment, so the flip rate information it is concerned about can be uniformly printed and output when the program segment exits. At this time, the flip rate, the beginning and end time of the time period, and the waveform data corresponding to each "pseudo peak point" (the peak point up to the current time point) during the execution of the program segment can be configured by parsing the tom "lcfg *" command to respectively configure the "whether to print the peak point switch in real time in the local mode", "whether to print the peak point time period in real time in the local mode", and "whether to export the local peak point waveform in real time" fields in the control register 10, and at the same time give relevant control signals to the information output processing component 9 to control whether the relevant information is printed and output; Step P2, call the local mode entry command encapsulated by the local mode entry module to enter the power consumption capture operation in the local mode, and the power consumption capture operation in the local mode and the power consumption capture operation in the global mode work in parallel; in this embodiment, the local mode is entered specifically through the encapsulation function tom "lin". When the program is just started, it will first enter the global mode (even if it is only used for program selection analysis and optimization, it may enter the global mode first) to perform relevant configurations. If it is necessary to enter the local mode to analyze the flip rate behavior of each program segment or subroutine, it is necessary to call the local mode entry module encapsulation tom "lin" command in the control script to display the entry into the local mode. At this time, the power consumption capture operation in the local mode and the power consumption capture operation in the global mode work in parallel; at the same time, the local average flip rate will be recorded. , record the local peak flip rate And the corresponding time information The registers are cleared to zero, and the counting registers that record the number of program execution cycles are cleared to zero. Assign the initial value to zero. As the simulation proceeds, Automatically increments by one as the clock cycle progresses; Step P3, calling the serial input command encapsulated by the serial input encapsulation module to simulate the serial input to start the test program segment or subroutine; in this embodiment, the test program segment or subroutine is started by encapsulating the command unw or the like. Except for the different target program (here, the program segment or subroutine) started, the content of this step is the same as step S3, and will not be repeated here; Step P4, caching the toggle rates of multiple to-be-verified design DUTs through the toggle rate FIFO array 3; Step P5, softening the flip rates of multiple DUTs through the multi-granularity flip rate softening processing array 4 to eliminate power consumption peaks, and calculating the average flip rate of the entire test process through the global average processing component 6; Step P6, identifying the peak point of the flip rate during the test process of the test program segment or subroutine through the local peak identification processing component 8; Step P7, if the information processing component 9 detects that the local peak identification processing component 8 identifies a new flip rate peak point, then it is determined whether the flip rate peak point is greater than the flip rate threshold configured in the function control module 2, and the flip rate corresponding to the local peak point and the start and end time corresponding to the time period are controlled to be printed out by the local peak point flip rate information processing module and the local peak point time period information processing module in the information processing component 9, and at the same time, according to the "whether the local peak point waveform is exported in real time" information configured in the function control module 2, the waveform upload module in the information processing component 9 controls the export of the waveform data corresponding to the local peak point; at the same time, if the information processing component 9 receives a local average flip rate command from the user, the local average flip rate information processing component 17 prints out the local average flip rate command; Step P8, determine whether the program has been executed. If it has not been executed, jump to step P4; otherwise, jump to the next step; Step P9, calling the local mode exit command encapsulated by the local mode exit encapsulation module to display exit from the local mode; Step P10, centrally outputting the local information through the information processing component 9, including: the local peak point flip rate information processing module, the local peak point time period information processing module, and the waveform upload module in the information processing component 9 output the flip rate corresponding to the local peak point in the test program segment or subroutine process executed in this local mode, the start and end time corresponding to the time period, and the waveform data, and the waveform local average flip rate information processing module in the information processing component 9 prints out the obtained local average flip rate; Step P11: Determine whether to re-enter the local mode to complete the power consumption behavior analysis of another program segment or subroutine. If necessary, jump to step P2 and re-enter the power consumption capture operation in the local mode; if not, go to step P11 to continue waiting, and at this time only perform the power consumption capture operation under the default global mode.

[0040] In this embodiment, step P5 performs a softening process, namely, a local average process, on the toggle rate data in the toggle rate FIFO array 3. Specifically, it can be divided into two parallel processing steps P5-1 and P5-2.

[0041] Step P5-1: Soften the toggle rate data in the toggle rate FIFO array 3. The soft processing operation of this step is basically the same as that of step S5-1, but there may be one difference: in step S5-1, the softening processing formula =n1*T1+ n2*T2+……ni*Ti, the values ​​of T1, T2, etc. are zero only at the beginning of the simulation (the initial value of the atomic flip rate FIFO with a value of zero). During the entire simulation process, there will be no initialization operation. In step P5-1, whenever a new program segment is entered through the encapsulation command tom "lin", the flip rates cached in the flip rate FIFO array 3 cannot be cleared to zero (otherwise it will affect the normal operation of the global mode of default operation). The clearing operation of the flip rate FIFO array 3 before entering the local mode can only be achieved through the smooth processing component (4): If =1, then T2, T2...Ti and other values ​​are reset to zero. =2, then T3, T4...Ti and other values ​​are reset to zero, and so on, until the initialization is completed. At the same time, it may be noted that the initialization phase is only tens to tens of thousands of cycles, and this duration is almost negligible relative to the entire program segment or subroutine, that is, the impact of the reset operation is almost negligible. Therefore, the reset operation may not be performed in step P5-1. At this time, the content of step P5-1 is exactly the same as step S5-1. Step P5-2: Perform local averaging on the flip rate data in the flip rate FIFO array 3. In each clock cycle in the program segment or subroutine, the local average processing component 5 calculates the function expression of the average flip rate of a program segment or subroutine as: * , In the above formula, It is the average flip rate of a program segment or subroutine at the end of the current beat. is the global average flip rate of a program segment or subroutine at the end of the previous beat, It is the total number of cycles of a program segment or subroutine at the end of the current beat.

[0042] In step P6 of this embodiment, when the local peak value identification processing unit 8 identifies the peak value of the flip rate in the test process of the test program segment or subroutine, multiple groups of peak flip rate registers and head and tail time registers are used to store and save the top values ​​of the flip rate and the head and tail time of the corresponding time period, and for each group of peak flip rate registers and head and tail time registers, at each rising edge of each clock cycle, the flip rate T after softening generated in the current cycle is calculated. ave The top several flip rates of the value generation flip rate constitute a flip rate list. The number of elements in the flip rate list is the same as the number of groups of the peak flip rate register and the head and tail time register. For each element in the flip rate list, if the flip rate T after softening of the element is ave If the value is greater than the corresponding peak flip rate register value, the softened flip rate T in the element is ave The value replaces the value of the corresponding peak flip rate register, and the start and end time of the element replaces the start and end time in the corresponding start and end time register. The peak flip rate of each program segment or subroutine is also an important information for program analysis. Therefore, the local peak identification processing (8) component uses a bubbling algorithm to capture the maximum flip rate in this program segment or subroutine. Value and its time period: add a register Used to store the maximum value in the current simulation cycle of this program segment or subroutine Value, add a register For saving The beginning and end time of the corresponding time period, each clock cycle rising edge, generally judge the new generation of the current cycle Is the value greater than If the value is greater than, the newly generated Value Replacement The value in Replace the first and last time of the time period corresponding to the value The value in , otherwise and The value in remains unchanged. Similar to step S6, in this patent, not only one peak flip rate register is set for each component under test DUT. and , but there will be a set of registers , , wait, , , Etc., save the top values ​​of the flip rate and the first and last times of the corresponding time periods respectively.

[0043] When the output control of the local peak point related information is performed in step P7, if a new local peak point appears in step P6, the information processing component 9 first determines whether the value of the flip rate of the new local peak point is greater than the flip rate threshold configured in the control module of step S2. If it is greater, the local peak point flip rate information processing module, the local peak point time period information processing module, and the waveform upload module select whether to print out the flip rate corresponding to the local peak point, the beginning and end time corresponding to the time period, and the waveform data according to the "whether to print the peak point switch in real time in the local mode", "whether to print the peak point time period in real time in the local mode", and "whether to export the local peak point waveform in real time" fields configured in the control module in step P1. When the information output is completed, or the flip rate of the new local peak point appears in step P6 and is less than the threshold, the next step is entered.

[0044] In summary, the multifunctional universal power consumption waveform scene capture device of this embodiment can not only accurately capture the peak power consumption, but also provide relatively scientific waveform data and flip rate information for calculation based on average power consumption, and can also provide various target power consumption scene waveforms, flip rate and other information for program division, optimization and selection. Under the condition of ensuring accuracy, all data can be obtained by one simulation. At the same time, if the corresponding data interface is obtained, the device can be applied to almost all simulators, and has strong versatility. The present invention realizes the caching and real-time softening of the flip rate information of each cycle, fully considering the influence of various levels of capacitance such as parasitic / package / mainboard capacitance in the chip and heat dissipation on power consumption, and the softening granularity and softening strategy can be selected through configuration, which improves the accuracy of power consumption evaluation. It realizes the real-time identification of global (the whole test process) and local (a specific program segment or subroutine) peak points (the point with the largest flip rate after softening), provides the flip rate, time period, and waveform data corresponding to the peak point, and provides the average flip rate during operation. This information can be selected through configuration according to different target requirements, so that multiple goals such as peak power consumption, average power consumption, and program optimization selection can be completed in one simulation, improving the efficiency of power consumption evaluation. The configuration of power consumption of the power consumption evaluation device, entry and exit of local mode, and viewing of global peak point signals are encapsulated in processes, which can be used on the same platform with program test commands, realizing test automation and improving test efficiency.

[0045] 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 multifunctional universal power consumption scene capture device, characterized in that: The invention comprises two parts: a process encapsulation component and a device kernel (1). The process encapsulation component is used to package and encapsulate commands required by users based on a simulator so as to perform function configuration, information reading and mode selection on the device kernel (1). The device kernel (1) is used to collect, cache, perform multi-granularity softening processing, and peak point identification on the flip rate of one or more design components under test (DUT) after receiving the packaged command, and selectively output information based on the processing result of the flip rate according to the power consumption target.

2. The multifunctional universal power consumption scene capturing device according to claim 1, characterized in that: The process encapsulation component is used to package the user-required commands based on the simulator. The user-required commands involved in the encapsulation include serial port input commands, local mode entry commands, local mode exit commands, global function configuration commands, local function configuration commands, and global average flip rate viewing commands, wherein the serial port input command is used to simulate serial port input, the local mode entry command and the local mode exit command are used to display the entry and exit of the local mode respectively, the global function configuration command is used to configure the parameters of the global mode, the local function configuration command is used to configure the parameters of the local mode, the global average flip rate viewing command is used to view the global average flip rate, the local mode refers to power consumption capture for a certain code segment or subroutine of the test program, and the global mode refers to power consumption capture for the entire test program.

3. The multifunctional universal power consumption scene capturing device according to claim 1, characterized in that: The device core (1) comprises: a function control module (2) for providing function control information for selecting output information through a built-in configuration register (10); a flip rate FIFO array (3) for caching flip rates of multiple design DUTs to be verified; a multi-granularity flip rate softening processing array (4) for softening the flip rates of multiple design components DUTs to be tested to eliminate power consumption peak spikes; a local average processing component (5) for calculating the average flip rate of a certain program segment or subroutine; a global average processing component (6) for calculating the average flip rate of the entire test process; a global peak value identification processing component (7) for identifying the flip rate peak point in the entire test process; a local peak value identification processing component (8) for identifying the flip rate peak point of a certain program segment or subroutine; an information processing component (9), The method is used for selectively outputting the results of the local average processing component (5), the global average processing component (6), the global peak discrimination processing component (7), and the local peak discrimination processing component (8) according to the function control information provided by the function control module (2); the function control module (2) is connected to the information processing component (9); the output end of the flip rate FIFO array (3) is respectively connected to the input ends of the multi-granularity flip rate softening processing array (4), the local average processing component (5), the global average processing component (6), the global peak discrimination processing component (7), and the local peak discrimination processing component (8); and the output ends of the local average processing component (5), the global average processing component (6), the global peak discrimination processing component (7), and the local peak discrimination processing component (8) are respectively connected to the information processing component (9).

4. The multifunctional universal power consumption scene capturing device according to claim 3, characterized in that: The flip rate FIFO in the flip rate FIFO array (3) is a configurable FIFO, which refers to a first-in-first-out cache queue with configurable depth and width. The flip rate FIFO array (3) is connected to a function control module (2), and the function control module (2) contains registers for configuring the depth and width of the configurable FIFO.

5. The multifunctional universal power consumption scene capturing device according to claim 3, characterized in that: The function expression of the softening processing performed by the multi-granularity flip rate softening processing array (4) is: , In the above formula, T ave is the flip rate after softening, n1~n i are the weights of the configured 1st to ith periods, T1 to T i is the toggle rate of the 1st to i-th cycles of the corresponding design DUT to be verified, i is the number of configured softening cycles, the multi-granularity toggle rate softening processing array (4) is connected to the function control module (2), and the function control module (2) contains registers for configuring weights and the number of softening cycles to achieve toggle rate softening processing of multiple granularities.

6. The multifunctional universal power consumption scene capturing device according to claim 3, characterized in that: The function expression of the global average processing component (6) for calculating the average flip rate of the entire test process is: , In the above formula, is the average flip rate of the entire test process at the end of the current shot, is the global average flip rate of the entire test process at the end of the previous shot, It is the total number of cycles of the entire test process when the current beat ends; The function expression of the local average processing component (5) for calculating the average flip rate of a certain program segment or subroutine is: * , In the above formula, It is the average flip rate of a certain program segment or subroutine of the test program at the end of the current beat. It is the global average flip rate of a certain program segment or subroutine of the test program at the end of the previous beat. It is the total number of cycles of a program segment or subroutine of the test program at the end of the current beat.

7. An application method of the multifunctional universal power consumption scene capture device according to any one of claims 3 to 6, characterized in that: Includes global mode power capture for test programs to enable peak and average power consumption evaluation: Step S1, start simulation: initialize the flip rate FIFO array (3) and the configuration register (10) in the function control module (2), and set the total number of cycles at the end of the current beat Initialized to 0, and the total number of cycles when the current beat ends Automatically increments by one as the clock cycle progresses; Step S2, calling the global function configuration command encapsulated by the global function configuration encapsulation module to complete the configuration of the configuration register (10) in the function control module (2); Step S3, calling the serial port input command encapsulated by the serial port input encapsulation module to simulate the serial port input to start the test program; Step S4, caching the toggle rates of multiple to-be-verified design DUTs through the toggle rate FIFO array (3); Step S5, softening the flip rates of multiple DUTs through a multi-granularity flip rate softening processing array (4) to eliminate power consumption peaks, and calculating the average flip rate of the entire test process through a global average processing component (6); Step S6, identifying the peak point of the flip rate in the entire test process through the global peak identification processing component (7); Step S7, if the information processing component (9) detects that the global peak identification processing component (7) identifies a new flip rate peak point, it is determined whether the flip rate peak point is greater than the flip rate threshold configured in the function control module (2), and the flip rate corresponding to the global peak point and the start and end time corresponding to the time period are controlled to be printed out by the global peak point flip rate information processing module and the global peak point time period information processing module in the information processing component (9), and at the same time, according to the "whether the global peak point waveform is exported in real time" information configured in the function control module (2), the waveform upload module in the information processing component (9) controls the export of the waveform data corresponding to the global peak point; at the same time, if the information processing component (9) receives a global average flip rate command from the user, the global average flip rate information processing module prints out the global average flip rate command; Step S8, determine whether the program has been executed. If not, jump to step S4; otherwise, end and exit.

8. The application method of the multifunctional universal power consumption scene capturing device according to claim 7, characterized in that: In step S6, when the peak value of the flip rate in the whole test process is identified by the global peak value identification processing component (7), multiple groups of peak flip rate registers and head and tail time registers are used to store the top values ​​of the flip rate and the head and tail time of the corresponding time period, and for each group of peak flip rate registers and head and tail time registers, at each rising edge of each clock cycle, the flip rate T after softening generated in the current cycle is calculated. ave The top several flip rates of the value generation flip rate constitute a flip rate list. The number of elements in the flip rate list is the same as the number of groups of the peak flip rate register and the head and tail time register. For each element in the flip rate list, if the flip rate T after softening of the element is ave If the value is greater than the corresponding peak flip rate register value, the softened flip rate T in the element is ave The value replaces the value of the corresponding peak toggle rate register, and the start and end times of the element replace the start and end times in the corresponding start and end time register.

9. The application method of the multifunctional universal power consumption scene capturing device according to claim 7, characterized in that: When the power consumption of the test program is captured in a global mode to achieve the evaluation of the peak power consumption and the average power consumption, the power consumption of a certain program segment or subroutine of the test program is captured in a local mode in parallel for program power consumption optimization: Step P1, calling the local function configuration command encapsulated by the local function configuration encapsulation module to complete the configuration of the configuration register (10) in the function control module (2); Step P2, calling the local mode entry command encapsulated by the local mode entry encapsulation module to enter the power consumption capture operation in the local mode, wherein the power consumption capture operation in the local mode and the power consumption capture operation in the global mode work in parallel; Step P3, calling the serial port input command encapsulated by the serial port input encapsulation module to simulate the serial port input to start the test program segment or subroutine; Step P4, caching the toggle rates of multiple to-be-verified design DUTs through the toggle rate FIFO array (3); Step P5, softening the flip rates of multiple DUTs through a multi-granularity flip rate softening processing array (4) to eliminate power consumption peaks, and calculating the average flip rate of the entire test process through a global average processing component (6); Step P6, identifying the peak point of the flip rate during the test process of the test program segment or subroutine through the local peak identification processing component (8); Step P7, if the information processing component (9) detects that the local peak identification processing component (8) identifies a new flip rate peak point, it is determined whether the flip rate peak point is greater than the flip rate threshold configured in the function control module (2), and the flip rate corresponding to the local peak point and the start and end time corresponding to the time period are controlled to be printed out by the local peak point flip rate information processing module and the local peak point time period information processing module in the information processing component (9), and at the same time, according to the "whether the local peak point waveform is exported in real time" information configured in the function control module (2), the waveform upload module in the information processing component (9) controls the export of the waveform data corresponding to the local peak point; at the same time, if the information processing component (9) receives a local average flip rate command from the user, the local average flip rate information processing component (17) prints out the local average flip rate command; Step P8, determine whether the program has been executed. If it has not been executed, jump to step P4; otherwise, jump to the next step; Step P9, calling the local mode exit command encapsulated by the local mode exit encapsulation module to display exit from the local mode; Step P10, centrally outputting the local information through the information processing component (9), including: the local peak point flip rate information processing module, the local peak point time period information processing module, and the waveform uploading module in the information processing component (9) output the flip rate corresponding to the local peak point in the test program segment or subroutine process executed in the local mode, the start and end time corresponding to the time period, and the waveform data, and the waveform local average flip rate information processing module in the information processing component (9) prints out the obtained local average flip rate; Step P11: Determine whether to re-enter the local mode to complete the power consumption behavior analysis of another program segment or subroutine. If necessary, jump to step P2 and re-enter the power consumption capture operation in the local mode; if not, go to step P11 to continue waiting, and at this time only perform the power consumption capture operation under the default global mode.

10. The application method of the multifunctional universal power consumption scene capturing device according to claim 9, characterized in that: In step P6, when the local peak value identification processing component (8) identifies the peak value of the flip rate in the test process of the test program segment or subroutine, it includes using multiple groups of peak flip rate registers and head and tail time registers to store and save the top values ​​of the flip rate and the head and tail times of the corresponding time period, and for each group of peak flip rate registers and head and tail time registers, at each rising edge of each clock cycle, according to the newly generated softened flip rate T in the current cycle ave The top several flip rates of the value generation flip rate constitute a flip rate list. The number of elements in the flip rate list is the same as the number of groups of the peak flip rate register and the head and tail time register. For each element in the flip rate list, if the flip rate T after softening of the element is ave If the value is greater than the corresponding peak flip rate register value, the softened flip rate T in the element is ave The value replaces the value of the corresponding peak toggle rate register, and the start and end times of the element replace the start and end times in the corresponding start and end time register.