Waveform data acquisition method, electronic equipment and storage medium
By dividing the target time length into interval time lengths and smaller time periods, the method of obtaining waveform data solves the problem of low efficiency in waveform data storage and acquisition in the existing technology, and achieves a more efficient storage and simulation process.
Patent Information
- Application Number
- CN202411043158.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-01
AI Technical Summary
When acquiring and storing waveform data, the existing technology is limited by storage space and computing resources, resulting in low system efficiency. Especially when processing long-term waveform data, the system needs to invest a lot of resources for compression, decompression, and retrieval.
By dividing the target time length T into several interval time lengths TI, and obtaining waveform data of smaller time periods tc in each TI, these data are used for rough positioning and iterative fine-grained acquisition, reducing storage space and acquisition time. , improve simulation efficiency.
The storage capacity and acquisition time occupied by waveform data are reduced, and the efficiency of simulation is improved. The system can run at full speed when waveform data is not acquired, reducing the time for system deceleration.
Smart Images

Figure CN118734599A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of waveform data technology, and in particular to a waveform data acquisition method, electronic equipment and storage medium. Background Art
[0002] In the simulation, testing and debugging process, waveform data acquisition is a crucial link. Waveform data, as an intuitive representation of signal changes over time, is a key tool for understanding system behavior, verifying design correctness, and troubleshooting. With the advancement of technology, especially the development of storage technology and data compression algorithms, it has become possible to acquire and store waveform data for longer periods of time.
[0003] The technology for obtaining waveforms mainly relies on real-time monitoring and data capture during program operation. The system will continuously record circuit status and signal changes to form a waveform data set. In the past, due to storage space limitations, the collection of waveform data was often constrained by the length of time. However, by increasing the capacity of the storage medium and combining data compression technology, such as lossless compression algorithms LZ77, LZ78, Huffman coding, etc., waveform data can be saved for a longer time even under limited storage conditions, meeting the needs of complex system analysis.
[0004] However, with the surge in the amount of waveform data, storing a large amount of waveform data not only requires more disk space, but also requires the system to invest more computing resources and time in the process of data compression, decompression, transmission and retrieval. For example, although the compression algorithm can reduce the storage capacity, it consumes additional CPU cycles during compression and decompression. Therefore, there is an urgent need for a method for obtaining waveform data that can reduce the storage capacity occupied by waveform data and improve work efficiency. Summary of the invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is: a method for acquiring waveform data, the method comprising the following steps:
[0006] S100, obtaining an interval time length TI and a target time length tc within TI, wherein T>TI>tc, and T is a target time length for obtaining a waveform.
[0007] S200, run the program code, obtain the waveform data in tc in each TI, obtain the waveform data of N time segments data = {data tc1 ,data tc2 ,…,data tcx ,…,data tcN}, data tcx is the xth interval time TI xObtain the waveform data within tc, the value range of x is 1 to N, N = T / TI.
[0008] S300, obtaining the interval time TI of the waveform data of the specified abnormality i , where TI i is the i-th interval time in T, and the value of i ranges from 1 to N.
[0009] S400, TI i The previous interval time TI i-1 As the target interval time, the waveform data within the target interval time is obtained, including:
[0010] S410, when TI is not specified i-1 When the interval time length and target time length are within the range, run the program until TI i-1 , directly obtain TI i-1 All waveform data within.
[0011] S420, when specifying TI i-1 The interval time length mTI and the target time length mtc, where TI i-1 >mTI>mtc, run the program to TI i-1 , at TI i-1 Get the waveform data in mtc every mTI, and get the waveform data of M time segments; when the target interval time mTI of the specified abnormal waveform data is j When mTI j For TI i-1 In the j-th interval time period, where the value of j ranges from 1 to M, S400 is iteratively executed.
[0012] In addition, the present invention also provides an electronic device, comprising: at least one processing unit, which is a processor or a programmable logic device; and a memory communicatively connected to the at least one processing unit; wherein the memory stores a program, instruction, or hardware description language (HDL) code for configuring the programmable logic device that can be executed by the processor; when the program or instruction is stored, the program or instruction is configured to enable the processor to execute the above method when executed; when the hardware description language (HDL) code for configuring the programmable logic device is stored, the HDL code is configured to configure the programmable logic device to implement the above method.
[0013] In addition, the present invention also provides a non-transitory readable storage medium, which stores a program, an instruction, or a hardware description language (HDL) code for configuring a programmable logic device; when the program or instruction is stored, the program or instruction is configured to cause the processor to perform the above method when executed; when the hardware description language (HDL) code for configuring a programmable logic device is stored, the HDL code is configured to configure the programmable logic device to implement the above method.
[0014] The present invention has at least the following beneficial effects:
[0015] The embodiments of the present invention provide a waveform data acquisition method, electronic device, and storage medium, which acquire waveform data of a part of the time period through TI and tc, thereby reducing the time length for acquiring waveform data, thereby reducing the occupied storage capacity. In addition, since the time length for acquiring waveform data is greatly reduced, the time for the system to slow down due to acquiring waveform data is reduced, thereby improving the efficiency of simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 A flow chart of a method for acquiring waveform data provided by an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of the relationship between full waveform data and waveform data of N time segments provided in an embodiment of the present invention;
[0019] Figure 3 For Figure 2 Based on this, a schematic diagram for obtaining waveform data with finer granularity is provided. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] Taking the simulation waveform as an example, when it is necessary to obtain the simulation waveform in the entire simulation time T to locate the cause of the simulation anomaly, the traditional method will obtain the waveform data from the start of the hardware simulation until the end of the entire hardware simulation. There are the following defects in obtaining waveform data using this method: if a simulation case with a particularly long running time is encountered, the entire waveform length is very long, resulting in a long process for obtaining the waveform data within T.
[0022] In order to solve this problem, the present invention takes T as the entire target time, divides T into several small interval time lengths TI, and obtains waveform data of a time length tc in each small time length, wherein TI>tc, which is equivalent to obtaining waveform data of a smaller time period in each small time length. The waveform of this smaller time period is used to roughly locate the interval time where the abnormal waveform is located. Then, the same method is adopted, taking the previous interval time of the interval time as the entire target time, and the same sampling is used for more fine-grained iteration, and so on to obtain waveform data. Since the embodiment of the present invention obtains waveform data of a part of the time period, the capacity of the storage space occupied by the waveform data is reduced. And since the time when the waveform data is not obtained is greatly increased, the system can run at full speed during the time when the waveform data is not obtained, thereby improving the efficiency of the simulation.
[0023] The embodiments of the present invention are further described below with reference to the accompanying drawings.
[0024] See also Figure 1 , which shows a method for acquiring waveform data, the method comprising the following steps:
[0025] S100, obtaining an interval time length TI and a target time length tc within TI, wherein T>TI>tc, and T is a target time length for obtaining a waveform.
[0026] Optionally, the target time length is the entire time period from the start to the end of the waveform, or it can be a specified time period in the entire time period from the start to the end of the waveform.
[0027] Optionally, TI and tc are parameters specified by the user. Alternatively, TI is calculated based on the size of the storage space for storing the waveform data and T, where the relationship between size and T satisfies: TI = T / size. Other methods for obtaining TI and tc fall within the protection scope of the present invention.
[0028] Among them, by configuring TI to adjust the granularity and sampling frequency, and by configuring tc to adjust the width of the waveform obtained each time, on the whole, a longer waveform can be obtained in a limited storage space for coarse-grained positioning, and then the interval where the problem occurs can be gradually located. Based on the limited storage space, waveforms of longer time periods can be obtained. The traditional method of obtaining waveforms is to obtain all waveforms, but due to the limited depth of the storage space, only a section of the waveform can be obtained each time. When the storage is full, it is necessary to suspend the hardware simulation, transfer the waveform in the storage space to the server, and then resume the hardware simulation.
[0029] S200, run the program code, obtain the waveform data in tc in each TI, obtain the waveform data of N time segments data = {data tc1 ,data tc2 ,…,data tcx ,…,data tcN}, data tcx is the xth interval time TI x Obtain the waveform data within tc, the value range of x is 1 to N, N = T / TI.
[0030] The program is a pre-written software code. Running a program means starting and executing the software code.
[0031] See also Figure 2 , which shows a schematic diagram of the relationship between the full waveform data and the waveform data of N time segments provided by an embodiment of the present invention. Figure 2 The waveform a is obtained by using the traditional method to obtain all waveform data in T. Figure 2 The waveform b is a schematic diagram of obtaining partial waveform data in T by using the method of S200 of the embodiment of the present invention, wherein T is divided into N time intervals {TI1, TI2, ..., TI x ,…,TI N}, TI x is the xth interval time in T. The waveform data of the tc time period in each time interval is the waveform data obtained and stored in the corresponding storage space. The black part is the time period where the waveform data is not obtained. For example, the waveform data in tc1 is obtained in TI1, and the waveform data in tc2 is obtained in TI2. x Get tc x The waveform data in TI N Get tc N The waveform data in .
[0032] Among them, the complete waveform data is divided into N time segments using TI, and waveform data of time length tc is obtained in each time segment. For storage space, all waveform data are stored in the storage space, and the storage space required is STO; the storage space required for the waveform data obtained by TI and tc is STO×(tc / TI). That is, the size of the storage space required by the method for obtaining waveform data provided by the embodiment of the present invention is tc / TI times that of the traditional method, which greatly saves storage space resources.
[0033] Among them, when waveform data is not obtained, the system runs at full speed; when waveform data is obtained, the system runs at a reduced speed. When all waveform data in T are obtained according to the traditional method, the entire hardware emulator runs in a mode of obtaining all waveform data in T at a reduced speed, and the running speed of the hardware emulator is reduced to Vc, and the time t0 required to obtain the waveform in T is t / Vc. However, the method provided in the embodiment of the present invention does not obtain all waveform data, but obtains part of the waveform data intermittently, thereby greatly increasing the full-speed Vf running time of the hardware emulator. The time required to run a complete hardware simulation is t1 = (T×tc / TI) / Vc+(T×(TI-tc) / TI) / Vf, which improves the efficiency of debugging or simulation. Compared with the traditional method, the method provided in the embodiment of the present invention maintains the same speed in the tc / TI time period during the entire hardware simulation process, and the hardware simulation speed in the (TI-tc) / TI time period is increased by Vf / Vc times.
[0034] S300, obtaining the interval time TI of the waveform data of the specified abnormality i , where TI i is the i-th interval time in T, and the value of i ranges from 1 to N. The value of i can be x.
[0035] Optional, TI i Specified by the user. The interval time period TI of the abnormal waveform data located by other means i All of the methods fall within the protection scope of the present invention.
[0036] Optional, TI i It is the time interval of the first abnormal waveform data.
[0037] It should be noted that, assuming that the target interval time TI of the specified abnormal waveform data is i , T.I. i is the interval time when the abnormal waveform data first appears, so in TI i The previous waveform data is normal waveform data.
[0038] It should be noted that after S100 and S200 complete the first round of waveform data acquisition, the user can find the interval time period TI where the abnormal waveform data is located by specifying or using other methods. i Then run the program again and only get the i The previous time interval TI i-1 If the TI i-1 If all waveform data in the memory still exceeds the storage capacity, the TI i-1 Further division is performed so as to store partial data of the entire waveform data in the storage space.
[0039] S400, TI i The previous interval time TI i-1 As the target interval time, the waveform data within the target interval time is obtained, including:
[0040] S410, when TI is not specified i-1 When the interval time length and target time length are within the range, run the program until TI i-1 , directly obtain TI i-1 All waveform data within.
[0041] It should be noted that when the first abnormal waveform data in T is in TI i Internal time, also known as TI i The waveform data acquired within is abnormal and TI i-1 The waveform data obtained within TI is normal, so it is inferred that the starting point of the abnormality is at TI i-1 For the part of the waveform data not obtained, further analysis of TI i-1 Therefore, it is necessary to run the program again to obtain TI in a more targeted and fine-grained manner. i-1 The waveform data in .
[0042] Wherein, run the program to TI i-1 No waveform data is acquired before. TI i-1 The target interval time period where the first abnormal waveform data is located, that is, in TI i-1 The previous waveform data are all correct waveform data, and the correct waveform data are not the data that need to be focused on. The first abnormal waveform data are the data that need to be focused on, so the abnormal waveform data needs to be stored in the storage space.
[0043] Among them, when the program content is not changed, the waveform data obtained each time the same program is run is the same.
[0044] It should be noted that when TI is not specified i-1When the interval time length and target time length are equal, it means that the storage space can fully accommodate the TI i-1 All waveform data within.
[0045] S420, when specifying TI i-1 The interval time length mTI and the target time length mtc, where TI i-1 >mTI>mtc, run the program to TI i-1 , at TI i-1 Get the waveform data in mtc every mTI, and get the waveform data of M time segments; when the target interval time mTI where the abnormal waveform data is located is specified j When mTI j For TI i-1 In the j-th interval time period, where the value of j ranges from 1 to M, S400 is iteratively executed.
[0046] Among them, through mTI and mtc to TI i-1 The waveform data within is obtained in a more fine-grained manner to further find the specific location of the abnormal waveform data. Then it is iterated and subdivided: the target time interval mTI of the abnormal waveform found this time is j S400 is iterated again.
[0047] Among them, see Figure 3 , Figure 3 Shown in Figure 2 Based on this, a more fine-grained waveform data acquisition schematic is provided. Through mTI, TI i-1 Divide into M time segments, and obtain the waveform data of MTC in each time segment.
[0048] It should be noted that after several iterations, when the divided interval time is within the preset acceptable range, all waveforms within the interval time can be directly obtained. By analyzing all waveforms within the interval time, the user can locate the specific moment of the abnormal waveform data and find the root cause of the problem.
[0049] When the waveform data is waveform data obtained by software simulation (Simulation) or waveform data obtained by other means, it also falls within the protection scope of the present invention.
[0050] In summary, an embodiment of the present invention provides a method for acquiring waveform data, which divides T into several small interval time lengths TI, acquires waveform data of time length tc in each small time length, and when the target time interval where the abnormal waveform data is located is specified, the same sampling is used again for more fine-grained iteration, and so on to acquire waveform data. The embodiment of the present invention acquires waveform data of a part of the time period through TI and tc, reduces the time length for acquiring waveform data, and thus reduces the occupied storage capacity. And because the time length for acquiring waveform data is greatly reduced, the time for the system to slow down due to acquiring waveform data is reduced, thereby improving the efficiency of the simulation.
[0051] As a preferred embodiment, S200 further includes displaying data in a visualization window in chronological order, and not displaying waveforms within a time range in which waveform data is not obtained.
[0052] As a preferred embodiment, S420 further includes displaying the obtained waveform data of the M time segments in time sequence in the visualization window, and not displaying the waveform within the time range where the waveform data is not obtained.
[0053] Optionally, the time range where the waveform is not displayed is filled with a specified color. Preferably, the specified color is gray, and other specified colors also fall within the protection scope of the present invention. The scattered small segments of waveform data are presented in the visualization window in chronological order through the visualization window, which is convenient for users to view.
[0054] As a preferred embodiment, S200 also includes recording all current internal state data in tc in each TI and external stimulus state data between the current internal state and the next internal state.
[0055] Among them, recording refers to recording and saving the status of the system during operation for subsequent analysis or reproduction.
[0056] Optionally, the internal state data is the value of a register, or the data state stored in each memory. Other internal state data also fall within the protection scope of the present invention.
[0057] Optionally, the external excitation state data is a signal or event input into the circuit, which may be a clock pulse, data input, control signal, etc., used to drive the behavior of the circuit. Other external excitation state data also fall within the protection scope of the present invention.
[0058] As a preferred embodiment, S400 also includes directly playing back the recorded TI i-1 All current internal state data in tc and external stimulus state data between the current internal state and the next internal state.
[0059] Among them, playback refers to reloading and executing the data state saved during the admission process at another time point or environment outside of admission to reproduce the system's behavior during the original admission time period.
[0060] As a preferred embodiment, in S420, in TI i-1 When acquiring the waveform data in the mtc every mTI, all the current internal state data in the mtc in each mTI and the external stimulus state data between the current internal state and the next internal state are also recorded; when the target interval mTI where the abnormal waveform data is located is specified j When playing back the recorded mTI j All current internal state data in the MTC and the external stimulus state data between the current internal state and the next internal state.
[0061] Combining the recording and playback steps allows you to jump directly to the TI without having to rerun the entire simulation. i-1 In the tc time period, you can view the circuit status and input stimulus at that time, making it easier to analyze the problem more deeply and comprehensively or verify the circuit behavior under specific conditions.
[0062] An embodiment of the present invention also provides an electronic device, comprising: at least one processing unit, which is a processor or a programmable logic device; and a memory communicatively connected to the at least one processing unit; wherein the memory stores a program, instruction, or hardware description language (HDL) code for configuring the programmable logic device that can be executed by the processor; when the program or instruction is stored, the program or instruction is configured to enable the processor to execute the above method when executed; when the hardware description language (HDL) code for configuring the programmable logic device is stored, the HDL code is configured to configure the programmable logic device to implement the above method.
[0063] Optionally, the processor is a central processing unit (CPU), a graphics processing unit (GPU) or a Boolean processor. Other types of processors also fall within the protection scope of the present invention.
[0064] Optionally, the programmable logic device is an FPGA. Other types of programmable logic devices also fall within the protection scope of the present invention.
[0065] An embodiment of the present invention also provides a non-transitory readable storage medium, which stores a program, an instruction, or a hardware description language (HDL) code for configuring a programmable logic device; when the program or instruction is stored, the program or instruction is configured to cause the processor to perform the above method when executed; when the hardware description language (HDL) code for configuring a programmable logic device is stored, the HDL code is configured to configure the programmable logic device to implement the above method.
[0066] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0067] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A method for acquiring waveform data, characterized in that: The method comprises the following steps: S100, obtaining the interval time length TI and the target time length tc within TI, wherein T>TI>tc, and T is the target time length for obtaining the waveform; S200, run the program code, obtain the waveform data in tc in each TI, obtain the waveform data of N time segments data = {data tc1 ,data tc2 ,…,data tcx ,…,data tcN }, data tcx is the xth interval time TI x Get the waveform data in tc, the value range of x is 1 to N, N = T / TI; S300, obtaining the interval time TI of the waveform data of the specified abnormality i , where TI i is the i-th interval time in T, and the value of i ranges from 1 to N; S400, TI i The previous interval time TI i-1 As the target interval time, the waveform data within the target interval time is obtained, including: S410, when TI is not specified i-1 When the interval time length and target time length are within the range, run the program until TI i-1 , directly obtain TI i-1 All waveform data in S420, when specifying TI i-1 The interval time length mTI and the target time length mtc, where TI i-1 >mTI>mtc, run the program to TI i-1 , at TI i-1 Get the waveform data in mtc every mTI, and get the waveform data of M time segments; when the target interval time mTI of the specified abnormal waveform data is j When mTI j For TI i-1 In the j-th interval time period, where the value of j ranges from 1 to M, S400 is iteratively executed.
2. The method according to claim 1, characterized in that S200 also includes displaying the data in a visualization window in chronological order, and not displaying the waveform within a time range in which the waveform data is not obtained.
3. The method according to claim 1, characterized in that S420 further includes displaying the obtained waveform data of the M time segments in a time sequence in the visualization window, and not displaying the waveform within the time range where the waveform data is not obtained.
4. The method according to claim 2 or 3, characterized in that: Fill the time range where waveforms are not displayed with the specified color.
5. The method according to claim 1, characterized in that S200 also includes recording all current internal state data in tc in each TI and external stimulus state data between the current internal state and the next internal state; S400 also includes direct playback of recorded TI i-1 All current internal state data in tc and external stimulus state data between the current internal state and the next internal state.
6. The method according to claim 1, characterized in that S420 in TI i-1 When acquiring the waveform data in the mtc every mTI, all the current internal state data in the mtc in each mTI and the external excitation state data between the current internal state and the next internal state are also recorded; When the target interval mTI of the specified abnormal waveform data is j When playing back the recorded mTI j All current internal state data in the MTC and the external stimulus state data between the current internal state and the next internal state.
7. The method according to claim 1, characterized in that In S300, the TI i It is the time interval of the first abnormal waveform data.
8. The method according to claim 1, characterized in that: In S410 and S420, the program is run until TI i-1 No waveform data is acquired before.
9. An electronic device, characterized in that: include: at least one processing unit, wherein the processing unit is a processor or a programmable logic device; and, a memory in communication with the at least one processing unit; wherein the memory stores a program, an instruction, or a hardware description language (HDL) code for configuring a programmable logic device that can be executed by the processor; When the program or instruction is stored, the program or instruction is configured to cause the processor to perform the method according to any one of claims 1 to 8 when executed; When a hardware description language (HDL) code for configuring a programmable logic device is stored, the HDL code is configured to configure the programmable logic device to implement the method according to any one of claims 1-8.
10. A non-transitory readable storage medium, characterized in that: The storage medium stores a program, an instruction, or a hardware description language (HDL) code for configuring a programmable logic device; When the program or instruction is stored, the program or instruction is configured to cause the processor to perform the method according to any one of claims 1 to 8 when executed; When a hardware description language (HDL) code for configuring a programmable logic device is stored, the HDL code is configured to configure the programmable logic device to implement the method according to any one of claims 1-8.
