|
CIRCT 24.0.0git
|
Graph representing FSM machines, their states and transitions between these. More...
#include <FSMGraph.h>

Public Types | |
| using | iterator = detail::AddressIterator<NodeList::iterator> |
| Iterate through all states. | |
Public Member Functions | |
| FSMGraph (Operation *operation) | |
| Create a new graph of an FSM machine operation. | |
| FSMStateNode * | lookup (StateOp op) |
| Look up a FSMStateNode for a state. | |
| FSMStateNode * | lookup (StringAttr name) |
| Lookup a FSMStateNode by name. | |
| FSMStateNode * | operator[] (StateOp op) |
| Lookup a FSMStateNode for a state. | |
| FSMStateNode * | getEntryNode () |
| Get the node corresponding to the entry state of the FSM. | |
| MachineOp | getMachine () const |
| Return the FSM machine operation which this graph tracks. | |
| FSMStateNode * | getOrAddState (StateOp state) |
| Retrieves the state node for a 'state'. | |
| FSMStateNode * | createState (OpBuilder &builder, Location loc, StringRef name) |
| Creates a new StateOp operation in this machine and updates the graph. | |
| FSMTransitionEdge * | createTransition (OpBuilder &builder, Location loc, StateOp from, StateOp to) |
| Creates a new transition operation between two states and updates the graph. | |
| void | eraseState (StateOp state) |
| Removes this state from the graph. | |
| void | renameState (StateOp state, StringRef name) |
| Renames the 'state' to the provided 'name', and updates all referencing transitions. | |
| iterator | begin () |
| iterator | end () |
Private Types | |
| using | NodeList = llvm::iplist<FSMStateNode> |
| This is the list of FSMStateNodes in the graph. | |
Private Member Functions | |
| FSMGraph (const FSMGraph &)=delete | |
Private Attributes | |
| MachineOp | machine |
| The node under which all states are nested. | |
| NodeList | nodes |
| The storage for graph nodes, with deterministic iteration. | |
| llvm::DenseMap< Attribute, FSMStateNode * > | nodeMap |
| This maps each StateOp to its graph node. | |
Graph representing FSM machines, their states and transitions between these.
Definition at line 205 of file FSMGraph.h.
| using circt::fsm::FSMGraph::iterator = detail::AddressIterator<NodeList::iterator> |
Iterate through all states.
Definition at line 249 of file FSMGraph.h.
|
private |
This is the list of FSMStateNodes in the graph.
Definition at line 207 of file FSMGraph.h.
|
explicit |
Create a new graph of an FSM machine operation.
Referenced by FSMGraph().
|
privatedelete |
References FSMGraph().
|
inline |
Definition at line 250 of file FSMGraph.h.
References nodes.
Referenced by llvm::GraphTraits< circt::fsm::FSMGraph * >::nodes_begin().
| FSMStateNode * FSMGraph::createState | ( | OpBuilder & | builder, |
| Location | loc, | ||
| StringRef | name ) |
Creates a new StateOp operation in this machine and updates the graph.
Definition at line 84 of file FSMGraph.cpp.
References fsm.StateOp::create(), createState(), getMachine(), and getOrAddState().
Referenced by createState().
| FSMTransitionEdge * FSMGraph::createTransition | ( | OpBuilder & | builder, |
| Location | loc, | ||
| StateOp | from, | ||
| StateOp | to ) |
Creates a new transition operation between two states and updates the graph.
Definition at line 92 of file FSMGraph.cpp.
References fsm.TransitionOp::create(), createTransition(), and getOrAddState().
Referenced by createTransition().
|
inline |
Definition at line 251 of file FSMGraph.h.
References nodes.
Referenced by llvm::GraphTraits< circt::fsm::FSMGraph * >::nodes_end().
| void FSMGraph::eraseState | ( | StateOp | state | ) |
Removes this state from the graph.
This will also remove the state in the underlying machine and all transitions to the state.
Definition at line 103 of file FSMGraph.cpp.
References eraseState(), getOrAddState(), nodeMap, and nodes.
Referenced by eraseState().
| FSMStateNode * circt::fsm::FSMGraph::getEntryNode | ( | ) |
Get the node corresponding to the entry state of the FSM.
Referenced by llvm::GraphTraits< circt::fsm::FSMGraph * >::getEntryNode().
|
inline |
Return the FSM machine operation which this graph tracks.
Definition at line 226 of file FSMGraph.h.
References machine.
Referenced by llvm::DOTGraphTraits< circt::fsm::FSMGraph * >::addCustomGraphFeatures(), and createState().
| FSMStateNode * FSMGraph::getOrAddState | ( | StateOp | state | ) |
Retrieves the state node for a 'state'.
If the node does not yet exists, a new state node is created.
Definition at line 73 of file FSMGraph.cpp.
References getOrAddState(), nodeMap, and nodes.
Referenced by createState(), createTransition(), eraseState(), getOrAddState(), and renameState().
| FSMStateNode * circt::fsm::FSMGraph::lookup | ( | StateOp | op | ) |
Look up a FSMStateNode for a state.
Referenced by lookup(), and operator[]().
| FSMStateNode * FSMGraph::lookup | ( | StringAttr | name | ) |
Lookup a FSMStateNode by name.
Definition at line 62 of file FSMGraph.cpp.
|
inline |
| void FSMGraph::renameState | ( | StateOp | state, |
| StringRef | name ) |
Renames the 'state' to the provided 'name', and updates all referencing transitions.
Definition at line 115 of file FSMGraph.cpp.
References getOrAddState(), nodeMap, and renameState().
Referenced by renameState().
|
private |
The node under which all states are nested.
Definition at line 257 of file FSMGraph.h.
Referenced by getMachine().
|
private |
This maps each StateOp to its graph node.
Definition at line 263 of file FSMGraph.h.
Referenced by eraseState(), getOrAddState(), lookup(), and renameState().
|
private |
The storage for graph nodes, with deterministic iteration.
Definition at line 260 of file FSMGraph.h.
Referenced by begin(), end(), eraseState(), and getOrAddState().