Search

CN-121979593-A - Finite state machine state diagram processing method based on waveform data

CN121979593ACN 121979593 ACN121979593 ACN 121979593ACN-121979593-A

Abstract

The application relates to the technical field of chip design, in particular to a processing method of a finite state machine state diagram based on waveform data. The method comprises the steps of obtaining a finite state machine state diagram of a target signal, obtaining all state value changes of the target signal in time sequence in the waveform data according to the waveform data of the target signal, decomposing the finite state machine state diagram of the target signal into a plurality of sub-state diagrams corresponding to different groups according to all state value changes, wherein each sub-state diagram corresponding to each group represents a state conversion relation of the target signal in a complete cycle, the complete cycle is a cycle starting from a preset initial state value and finally returning to the preset initial state value after a plurality of other state values, obtaining a group selected by a user, and highlighting the sub-state diagram corresponding to the group selected by the user on a user display interface. The application can simplify the display of the state diagram of the finite state machine and increase the readability of the state diagram of the finite state machine.

Inventors

  • PAN WEIFENG
  • XIANG JUN

Assignees

  • 上海合见工业软件集团股份有限公司
  • 成都融见软件科技有限公司

Dates

Publication Date
20260505
Application Date
20260409

Claims (7)

  1. 1. A method for processing a finite state machine state diagram based on waveform data, the method comprising the steps of: S100, acquiring a finite state machine state diagram of a target signal, wherein the finite state machine state diagram of the target signal comprises a plurality of nodes representing state values of the target signal and a plurality of directed lines connected with the nodes, and each directed line represents one state transition; S200, acquiring all state value changes of the target signal in time sequence in the waveform data according to the waveform data of the target signal; S300, decomposing a finite state machine state diagram of a target signal into a plurality of sub-state diagrams corresponding to different groups according to the change of all state values, wherein each sub-state diagram corresponding to each group represents the state conversion relation of the target signal in a complete cycle, and the complete cycle is a cycle starting from a preset initial state value and returning to the preset initial state value after a plurality of other state values; S400, obtaining the grouping selected by the user, and highlighting the sub-state diagram corresponding to the grouping selected by the user on the user display interface.
  2. 2. The method for processing the finite state machine state diagram based on the waveform data according to claim 1, wherein decomposing the finite state machine state diagram of the target signal into sub-state diagrams corresponding to a plurality of different packets according to the all state value changes comprises: S310, initializing a queue counter k=1, and creating an empty queue Q k ; S320, setting pointers to point to the first state value of all state value changes; S330, searching backwards from the pointed position of the pointer, pressing the initial state value into a current queue Q k when a first preset initial state value is met, continuously moving the pointer to the next position, queuing the pointer to the next position each time a state value which is not the initial state value is met, continuously moving the pointer to the next position until the initial state value is met again, judging that one cycle is finished, queuing the initial state value as the end point of the cycle, keeping the pointer position motionless, and then closing the current queue; S340, if k is not equal to 1 and the current queue is the same as a previous one, emptying the current queue and repeating S330 until all state value changes are traversed, otherwise, updating k to be k+1, creating an empty queue Q k and repeating S330 until all state value changes are traversed; S350, for any queue, constructing a sub-state diagram corresponding to the packet corresponding to the queue according to the state value stored in the queue and the conversion relation between the state values.
  3. 3. The method of claim 1, further comprising, after S200, identifying a current simulation time, highlighting a state value at which the current simulation time target signal is located, and highlighting a directional line between a previous state value and the state value at which the current simulation time target signal is located and pointing to the state value at which the current simulation time target signal is located.
  4. 4. The method for processing a finite state machine state diagram based on waveform data according to claim 1, the method is characterized in that the directed lines are also displayed with corresponding conversion conditions.
  5. 5. The method of claim 1, wherein highlighting the sub-state diagram corresponding to the group selected by the user on the user display interface comprises displaying only the sub-state diagram corresponding to the group selected by the user on the user display interface, and not displaying the portion of the finite state machine state diagram of the target signal other than the sub-state diagram corresponding to the group selected by the user, 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 group selected by the user.
  6. 6. The method of claim 1, wherein the user-selected packets are obtained based on a result of a check box checked by the user.
  7. 7. The method for processing the finite state machine state diagram based on the waveform data according to claim 1, wherein the finite state machine state diagram of the target signal is obtained by analyzing a target code, the waveform data of the target signal is obtained by simulating the target code, and the target code includes state value information and state transition logic of the target signal.

Description

Finite state machine state diagram processing method based on waveform data Technical Field The invention relates to the field of chip design, in particular to a processing method of a finite state machine state diagram based on waveform data. Background In chip design, a finite state machine is used to describe the transition behavior of a system between different states. With the continuous improvement of chip integration and the increasing complexity of system-level chip functions, a single state machine contains more and more states, and the state transition relation is also more and more complex. The state diagram can present different states of the state machine and conversion relations among the states, but when the states included by the state machine are more or contain complex conversion relations, the corresponding state diagram is often represented as a net-shaped diagram with highly dense nodes and edges, and the state diagram has serious visual confusion problem and poor readability, so that a user is difficult to quickly locate a specific state and identify an abnormal jump path, and the debugging difficulty is increased. Disclosure of Invention The invention aims to provide a processing method of a finite state machine state diagram based on waveform data, which is used for simplifying the display of the finite state machine state diagram and increasing the readability of the finite state machine state diagram. According to the present invention, there is provided a method for processing a finite state machine state diagram based on waveform data, the method comprising the steps of: And S100, acquiring a finite state machine state diagram of the target signal, wherein the finite state machine state diagram of the target signal comprises a plurality of nodes representing state values of the target signal and a plurality of directed lines connected with the nodes, and each directed line represents one state transition. S200, acquiring all state value changes of the target signal in time sequence in the waveform data according to the waveform data of the target signal. And S300, decomposing a finite state machine state diagram of the target signal into a plurality of sub-state diagrams corresponding to different groups according to the change of all the state values, wherein each sub-state diagram corresponding to each group represents the state conversion relation of the target signal in a complete cycle, and the complete cycle is a cycle starting from a preset initial state value and returning to the preset initial state value after a plurality of other state values. S400, obtaining the grouping selected by the user, and highlighting the sub-state diagram corresponding to the grouping selected by the user on the user display interface. Compared with the prior art, the invention has at least the following beneficial effects: The invention decomposes the finite state machine state diagram of the target signal into a plurality of sub-state diagram state diagrams corresponding to different groups according to all state value changes of the target signal in waveform data, wherein each sub-state diagram corresponding to each group represents the state conversion relation of the target signal in a complete cycle, wherein the complete cycle is a cycle starting from a preset initial state value and finally returning to the preset initial state value after passing through a plurality of other state values. Compared with the prior art that the state diagram is not used for displaying or the state diagram is displayed in full, the method provided by the invention has the advantages that the sub-state diagram corresponding to the group selected by the user is highlighted on the display interface, so that the display of the state diagram of the finite state machine is simplified, the readability of the state diagram of the finite state machine is increased, and the user is not influenced by the sub-state diagram corresponding to the unselected group or the nodes and the directed lines which are not in the sub-state diagram corresponding to any group when acquiring the information of the sub-state diagram corresponding to the selected group, so that the user can acquire the information of the sub-state diagram corresponding to the selected group more quickly. Drawings In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. FIG. 1 is a flowchart of a method for processing a finite state machine state diagram based on waveform data according to an embodiment of the present invention; Fig. 2 is a state diagram of a finite state machine