A processing method based on waveform data finite state machine state diagram

By decomposing the finite state machine state diagram into sub-state diagrams and highlighting selected groups on the user interface, the visual clutter problem of complex state diagrams is solved, improving readability and debugging efficiency in chip design.

CN121979593BActive Publication Date: 2026-07-24SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD
Filing Date
2026-04-09
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In chip design, complex finite state machine state diagrams can cause visual clutter, making it difficult to quickly locate specific states and identify abnormal transition paths, thus increasing the difficulty of debugging.

Method used

By decomposing the finite state machine state diagram into several sub-state diagrams based on waveform data, and highlighting the sub-state diagrams corresponding to the user-selected group on the user interface, the display is simplified and readability is improved.

Benefits of technology

It improves the speed at which users can obtain information about the sub-state diagrams corresponding to selected groups on the user interface, reduces interference with unselected groups, and enhances the readability of finite state machine state diagrams.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979593B_ABST
    Figure CN121979593B_ABST
Patent Text Reader

Abstract

The application relates to the chip design technical field, in particular to a processing method of a finite state machine state graph based on waveform data. The method comprises the following steps: obtaining a finite state machine state graph of a target signal; obtaining all state value changes of the target signal in time sequence according to waveform data of the target signal; decomposing the finite state machine state graph of the target signal into sub-state graphs corresponding to different groups according to the all state value changes; each sub-state graph corresponding to a group represents a state transition relationship of the target signal in a complete cycle, wherein the complete cycle is a cycle starting from a preset initial state value, passing through several other state values and finally returning to the preset initial state value; obtaining a user-selected group, and highlighting the sub-state graph corresponding to the user-selected group on a user display interface. The application can simplify the display of the finite state machine state graph and increase the readability of the finite state machine state graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of chip design, and in particular to a method for processing finite state machine state diagrams based on waveform data. Background Technology

[0002] In chip design, finite state machines (FSMs) are used to describe the transitions between different states of a system. As chip integration increases and system-on-a-chip (SoC) functions become more complex, individual FSMs contain more and more states, and their state transition relationships become increasingly complex. State diagrams can represent the different states of a FSM and the transitions between them. However, when a FSM includes many states or contains complex transitions, the corresponding state diagram often appears as a densely packed network of nodes and edges. This type of state diagram suffers from significant visual clutter and poor readability, making it difficult for users to quickly locate specific states and identify abnormal transition paths, thus increasing the difficulty of debugging. Summary of the Invention

[0003] The purpose of this invention is to provide a method for processing finite state machine state diagrams based on waveform data, so as to simplify the display of finite state machine state diagrams and increase their readability.

[0004] According to the present invention, a method for processing finite state machine state diagrams based on waveform data is provided, the method comprising the following steps: S100, Obtain the finite state machine state diagram of the target signal; the finite state machine state diagram of the target signal includes several nodes representing the state values ​​of the target signal and several directed lines connecting the nodes, wherein each directed line represents a state transition.

[0005] S200: Obtain all state value changes of the target signal in the waveform data in time order based on the waveform data of the target signal.

[0006] S300, based on all the changes in state values, the finite state machine state diagram of the target signal is decomposed into several sub-state diagrams corresponding to different groups; each sub-state diagram corresponding to a group represents the state transition relationship of the target signal in a complete cycle, the complete cycle being a cycle that starts from a preset initial state value, goes through several other state values, and finally returns to the preset initial state value.

[0007] S400: Obtain the group selected by the user and highlight the sub-state diagram corresponding to the selected group on the user display interface.

[0008] Compared with the prior art, the present invention has at least the following beneficial effects: This invention decomposes the finite state machine (FSM) state diagram of the target signal into several sub-state diagrams corresponding to different groups based on all state value changes of the target signal in the waveform data. Each sub-state diagram represents the state transition relationship of the target signal in a complete cycle, where a complete cycle starts from a preset initial state value, passes through several other state values, and finally returns to the preset initial state value. Based on this, this invention can distinguish the sub-state diagrams corresponding to different complete cycles, thereby highlighting the sub-state diagram corresponding to the user-selected group on the user display interface. Compared to existing technologies that do not use state diagrams for display or display all state diagrams, this invention simplifies the display of the finite state machine state diagram by highlighting the sub-state diagram corresponding to the user-selected group on the display interface, increasing the readability of the finite state machine state diagram. This allows users to quickly obtain information about the sub-state diagram corresponding to their selected group without being affected by sub-state diagrams corresponding to unselected groups or nodes and directed lines that do not exist in any sub-state diagram corresponding to a group. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 A flowchart illustrating a method for processing finite state machine state diagrams based on waveform data, provided in an embodiment of the present invention; Figure 2 A finite state machine state diagram of the target signal provided in an embodiment of the present invention; Figure 3 This is a sub-state diagram corresponding to the first group provided in an embodiment of the present invention; Figure 4 This is a sub-state diagram corresponding to the second group provided in an embodiment of the present invention; Figure 5 This is a sub-state diagram corresponding to the third group provided in this embodiment of the invention; Figure 6 This is a sub-state diagram corresponding to the first group and the second group displayed on the user display interface, provided in an embodiment of the present invention. Detailed Implementation

[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0012] According to this embodiment, a method for processing finite state machine state diagrams based on waveform data is provided. The method includes the following steps: Figure 1 As shown: S100, Obtain the finite state machine state diagram of the target signal; the finite state machine state diagram of the target signal includes several nodes representing the state values ​​of the target signal and several directed lines connecting the nodes, wherein each directed line represents a state transition.

[0013] In this embodiment, the target signal is the signal that the user wants to display as a finite state machine state diagram. As a specific implementation, the finite state machine state diagram of the target signal is obtained by parsing the target code, which includes the target signal's state value information and state transition logic. It should be understood that parsing refers to statically analyzing the structure of the target code to draw the state diagram; parsing may include the following steps: constructing a syntax tree, extracting states and transitions, and generating a graphical description. Constructing a syntax tree refers to performing lexical and syntactic analysis on the target code to construct an abstract syntax tree to identify the state machine structure in the code; extracting states and transitions refers to traversing the abstract syntax tree and extracting constants or enumeration types defined in the code as state nodes; extracting conditional expressions and their corresponding assignment results from conditional branch statements (such as if-else or case statements) as directed connections (transition relationships) between states; generating a graphical description refers to generating a finite state machine state diagram containing nodes and directed lines based on the extracted nodes and transition relationships. The above parsing process is existing technology and will not be elaborated here.

[0014] As a specific implementation method, such as Figure 2 As shown, the target finite state machine (FSM) state diagram has 6 nodes representing state values, which are represented by circles. These 6 nodes are connected by 12 directed lines. Each directed line represents a state transition. For example, the directed line connecting the 1st and 2nd state values ​​and pointing to the 2nd state value represents the transition from the 1st state value to the 2nd state value, and the directed line connecting the 5th and 6th state values ​​and pointing to the 5th state value represents the transition from the 6th state value to the 5th state value.

[0015] As one specific implementation, the directed lines also display corresponding conversion conditions. Figure 2In this context, the first state value is the preset starting state value. It should be understood that after resetting, the system can return to the preset starting state value. The transition condition displayed on the directed line connecting the first and second state values ​​and pointing to the first state value is reset. Similarly, the transition condition displayed on the directed line connecting the first and fourth state values ​​and pointing to the first state value is reset, the transition condition displayed on the directed line connecting the first and fifth state values ​​and pointing to the first state value is reset, and the transition condition displayed on the directed line connecting the first and sixth state values ​​and pointing to the first state value is reset.

[0016] S200: Obtain all state value changes of the target signal in the waveform data in time order based on the waveform data of the target signal.

[0017] In this embodiment, the waveform data is a numerical sequence of the target signal changing over time, obtained through simulation or actual sampling. It typically includes a timestamp and its corresponding binary signal value. For example, if the target signal consists of 3 bits, its waveform data can be represented as a series of sampled values ​​at discrete time points: (0ns, 001), (1ns, 001), (2ns, 010), (3ns, 010), (4ns, 100), etc. It should be understood that the sampling interval in this example is 1ns, but it can also be other values. In this embodiment, the sampling interval is equal to the clock period.

[0018] In one specific implementation, the waveform data of the target signal is obtained by simulating the target code. As those skilled in the art know, the target code (such as Verilog) describing the behavior of the target signal is loaded into the simulator, a preset stimulus is applied, and the simulation is run until it ends; the simulator calculates the state value of the target signal in each clock cycle according to the code logic, and records the state value and corresponding time of each clock cycle, thereby generating the waveform data of the target signal.

[0019] In this embodiment, all state value changes of the target signal in the waveform data in time sequence include the values ​​before and after all state values ​​extracted from the waveform data that have undergone a transition. For example, if the target signal in the waveform data sequentially presents 001→010→100→001→…, then all state value changes of the target signal in the waveform data in time sequence are 001→010→100→001→…. All state value changes of the target signal in the waveform data in time sequence reflect all state transition paths experienced by the target signal during the simulation process.

[0020] As an optional specific implementation, after S200, the method further includes: identifying the current simulation time, highlighting the state value of the target signal at the current simulation time, and highlighting a directed line between the previous state value and the state value of the target signal at the current simulation time, pointing towards the state value of the target signal at the current simulation time.

[0021] It should be understood that the current simulation time refers to a discrete time indicator variable maintained internally by the simulator during the simulation of the target code. It represents the current moment in the simulation of the hardware logic, which can be understood as the simulation moment the user is currently observing. The previous state value refers to the state value before it transitioned to the state value of the target signal at the current simulation time. For example, the current state value of the target signal is... Figure 2 The 4th state value in the process, the previous state value was Figure 2 If the second state value is displayed, then in addition to highlighting the fourth state value, the directed line between the second and fourth state values ​​is also highlighted. Therefore, users can quickly obtain the state value and transition conditions corresponding to the current simulation time from the finite state machine state diagram of the target signal, improving the readability of the finite state machine state diagram of the target signal.

[0022] S300, based on all the changes in state values, the finite state machine state diagram of the target signal is decomposed into several sub-state diagrams corresponding to different groups; each sub-state diagram corresponding to a group represents the state transition relationship of the target signal in a complete cycle, the complete cycle being a cycle that starts from a preset initial state value, goes through several other state values, and finally returns to the preset initial state value.

[0023] As a specific implementation, the finite state machine state diagram of the target signal is decomposed into several sub-state diagrams corresponding to different groups based on all the changes in state values, including: S310, initialize queue counter k=1, and create an empty queue Q. k .

[0024] S320, set the pointer to the first state value of all state value changes.

[0025] S330: Starting from the position pointed to by the pointer, search backwards. When the first preset starting state value is encountered, push the starting state value into the current queue Q. k The pointer continues to move to the next position. Whenever it encounters a state value that is not the starting state value, it is enqueued and the pointer continues to move to the next position until it encounters the starting state value again. At this point, a loop is considered to have ended, and the starting state value is enqueued as the end of the loop. The pointer position remains unchanged, and then the current queue is closed.

[0026] It should be understood that if the starting state cannot be found from the current pointer in S330, the entire decomposition process should end.

[0027] S340: If k≠1 and the current queue is the same as a previous queue, clear the current queue and repeat S330 until all state value changes have been traversed; otherwise, update k to k+1 and create an empty queue Q. k Repeat S330 until all state value changes have been traversed.

[0028] It should be understood that when k=1, the previous queue does not exist; if k=2, then the previous queue is Q1; if k=3, then the previous queues are Q1 and Q2, and so on. In a specific implementation, all the state value changes are: 000→001→010→011→000→001→010→011→000→010→100→000→… Therefore, the enqueued state values ​​in Q1 are: 000, 001, 010, 011, 000, and the enqueued state values ​​in Q2 are: 000, 010, 100, 000.

[0029] S350, For any queue, construct the sub-state diagram corresponding to the group in the queue based on the state values ​​stored in the queue and the transformation relationship between the state values.

[0030] It should be understood that the sequence of state values ​​stored in each queue is the state values ​​that a complete cycle goes through in sequence, and these state values ​​and the transition relationships between them constitute a sub-state diagram.

[0031] As a specific implementation method, Figure 2 The finite state machine state diagram shown is decomposed into three sub-state diagrams corresponding to the three groups, as follows: Figure 3 The diagram shown is the sub-state diagram corresponding to the first group, as follows: Figure 4 The diagram shown is the sub-state diagram corresponding to the second group, as follows: Figure 5 The diagram shown is the sub-state diagram corresponding to the third group. It should be understood that the sub-state diagram corresponding to the first group represents the state transition relationship of the target signal in the cycle of 1st state value → 2nd state value → 4th state value → 5th state value → 2nd state value → 1st state value; the sub-state diagram corresponding to the second group represents the state transition relationship of the target signal in the cycle of 1st state value → 3rd state value → 6th state value → 5th state value → 4th state value → 1st state value; and the sub-state diagram corresponding to the third group represents the state transition relationship of the target signal in the cycle of 1st state value → 6th state value → 1st state value.

[0032] S400: Obtain the group selected by the user and highlight the sub-state diagram corresponding to the selected group on the user display interface.

[0033] As a specific implementation, highlighting the sub-state diagram corresponding to the user-selected group on the user display interface includes: displaying only the sub-state diagram corresponding to the user-selected group on the user display interface, and not displaying the part of the finite state machine state diagram of the target signal other than the sub-state diagram corresponding to the user-selected group; or displaying the finite state machine state diagram of the target signal on the user display interface, and highlighting the sub-state diagram corresponding to the user-selected group therein.

[0034] In one specific implementation, the user-selected group is obtained based on the user's checkboxes. For example, there are three groups: Group 1, Group 2, and Group 3. Each group corresponds to a checkbox. If the user checks the corresponding box, it means the user wants to display the sub-state diagram corresponding to that group on the user display interface. For example, if the user only checks the box corresponding to Group 1, it means the user only wants to display the sub-state diagram corresponding to Group 1 on the user display interface; if the user checks the boxes corresponding to Group 1 and Group 2, it means the user wants to display the sub-state diagrams corresponding to both Group 1 and Group 2 on the user display interface simultaneously; if the user checks the boxes corresponding to Group 1, Group 2, and Group 3, it means the user wants to display the sub-state diagrams corresponding to all three groups on the user display interface simultaneously. Figure 6 The image shows the sub-state diagrams corresponding to the first and second groups displayed on the user interface, compared to... Figure 2 , Figure 6 Only the state values ​​and directed lines in the sub-state diagrams corresponding to Group 1 and Group 2 are included, filtering out other content outside the loops corresponding to Group 1 and Group 2. After this filtering, the readability of the sub-state diagrams corresponding to Group 1 and Group 2 displayed on the user interface is enhanced.

[0035] This embodiment decomposes the finite state machine (FSM) state diagram of the target signal into several sub-state diagrams corresponding to different groups based on all state value changes of the target signal in the waveform data. Each sub-state diagram corresponding to a group represents the state transition relationship of the target signal in a complete cycle, where a complete cycle is a cycle that starts from a preset initial state value, passes through several other state values, and finally returns to the preset initial state value. Based on this, this embodiment can distinguish the sub-state diagrams corresponding to different complete cycles, thereby achieving the purpose of highlighting the sub-state diagram corresponding to the user-selected group on the user display interface. Compared with existing technologies that do not use state diagrams for display or display all state diagrams, this embodiment simplifies the display of the finite state machine (FSM) state diagram by highlighting the sub-state diagram corresponding to the user-selected group on the display interface, increasing the readability of the finite state machine (FSM) state diagram. This allows users to quickly obtain information about the sub-state diagram corresponding to their selected group without being affected by sub-state diagrams corresponding to unselected groups or nodes and directed lines that do not exist in any sub-state diagram corresponding to any group.

[0036] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims

1. A method for processing finite state machine state diagrams based on waveform data, characterized in that, The method includes the following steps: S100, Obtain the finite state machine state diagram of the target signal; the finite state machine state diagram of the target signal includes several nodes representing the state values ​​of the target signal and several directed lines connecting the nodes, wherein each directed line represents a state transition. S200: Obtain all state value changes of the target signal in the waveform data in time order based on the waveform data of the target signal; S300, based on all the changes in state values, the finite state machine state diagram of the target signal is decomposed into several sub-state diagrams corresponding to different groups; each sub-state diagram corresponding to a group represents the state transition relationship of the target signal in a complete cycle, the complete cycle being a cycle that starts from a preset initial state value, goes through several other state values, and finally returns to the preset initial state value. S400: Obtain the group selected by the user and highlight the sub-state diagram corresponding to the selected group on the user display interface.

2. The method for processing finite state machine state diagrams based on waveform data according to claim 1, characterized in that, Based on all the state value changes, the finite state machine state diagram of the target signal is decomposed into several sub-state diagrams corresponding to different groups, including: S310, initialize queue counter k=1, and create an empty queue Q. k ; S320, Set the pointer to point to the first state value where all state values ​​have changed; S330: Starting from the position pointed to by the pointer, search backwards. When the first preset starting state value is encountered, push the starting state value into the current queue Q. k The pointer continues to move to the next position. Whenever it encounters a state value that is not the starting state value, it is enqueued and the pointer continues to move to the next position until it encounters the starting state value again. At this point, a loop is considered to have ended, and the starting state value is enqueued as the end of the loop. The pointer position remains unchanged, and then the current queue is closed. S340: If k≠1 and the current queue is the same as a previous queue, clear the current queue and repeat S330 until all state value changes have been traversed; otherwise, update k to k+1 and create an empty queue Q. k Repeat S330 until all state value changes have been traversed; S350, For any queue, construct the sub-state diagram corresponding to the group in the queue based on the state values ​​stored in the queue and the transformation relationship between the state values.

3. The method for processing finite state machine state diagrams based on waveform data according to claim 1, characterized in that, Following S200, the method further includes: identifying the current simulation time, highlighting the state value of the target signal at the current simulation time, and highlighting a directed line between the previous state value and the state value of the target signal at the current simulation time, pointing towards the state value of the target signal at the current simulation time.

4. The method for processing finite state machine state diagrams based on waveform data according to claim 1, characterized in that, The directional lines also display corresponding conversion conditions.

5. The method for processing finite state machine state diagrams based on waveform data according to claim 1, characterized in that, Highlighting the sub-state diagram corresponding to the user-selected group on the user display interface includes: displaying only the sub-state diagram corresponding to the user-selected group on the user display interface, and not displaying the part of the finite state machine state diagram of the target signal other than the sub-state diagram corresponding to the user-selected group; or displaying the finite state machine state diagram of the target signal on the user display interface, and highlighting the sub-state diagram corresponding to the user-selected group.

6. The method for processing finite state machine state diagrams based on waveform data according to claim 1, characterized in that, The group selected by the user is obtained based on the results of the user checking the checkboxes.

7. The method for processing finite state machine state diagrams based on waveform data according to claim 1, characterized in that, The finite state machine state diagram of the target signal is obtained by parsing the target code, and the waveform data of the target signal is obtained by simulating the target code; the target code includes the state value information and state transition logic of the target signal.