PandA-2024.02
|
#include <StateTransitionGraph_constructor.hpp>
Public Member Functions | |
StateTransitionGraph_constructor (const StateTransitionGraphsCollectionRef state_transition_graphs_collection, const HLS_managerConstRef HLSMgr, unsigned int funId) | |
Constructor of the class. More... | |
vertex | create_state (const std::list< vertex > &exec_op, const std::list< vertex > &start_op, const std::list< vertex > &end_op, const CustomOrderedSet< unsigned int > &BB_ids) |
Adds a new state managing the operations given as parameters. More... | |
void | create_entry_state () |
create the STG entry vertex More... | |
void | create_exit_state () |
create the STG exit vertex More... | |
EdgeDescriptor | connect_state (const vertex &src, const vertex &tgt, int type) |
Creates a connection between two vertices into the graph. More... | |
void | set_condition (const EdgeDescriptor &e, transition_type t, vertex ops) |
Changes the control condition associated to an edge. More... | |
void | set_unbounded_condition (const EdgeDescriptor &e, transition_type t, const CustomOrderedSet< vertex > &ops, vertex ref_state) |
void | set_switch_condition (const EdgeDescriptor &e, vertex op, const CustomOrderedSet< unsigned > &labels, bool has_default) |
function setting the condition on edge derived from switch statements More... | |
void | copy_condition (const EdgeDescriptor &dest, const EdgeDescriptor &source) |
copy condition from one edge to another More... | |
void | delete_edge (const vertex &src, const vertex &tgt) |
Removes the specified edge from the graph. More... | |
void | delete_state (const vertex &src) |
Removes the specified state from the graph. More... | |
Private Attributes | |
unsigned int | state_index |
Index of the next state to be created. More... | |
const StateTransitionGraphsCollectionRef | state_transition_graphs_collection |
The bulk state transition graph. More... | |
const StateTransitionGraphRef | state_transition_graph |
The complete state transition graph. More... | |
const Wrefcount< const HLS_manager > | HLSMgr |
The HLSMgr. More... | |
unsigned int | funId |
Definition at line 60 of file StateTransitionGraph_constructor.hpp.
StateTransitionGraph_constructor::StateTransitionGraph_constructor | ( | const StateTransitionGraphsCollectionRef | state_transition_graphs_collection, |
const HLS_managerConstRef | HLSMgr, | ||
unsigned int | funId | ||
) |
Constructor of the class.
Header include.
It creates a new empty graph and it sets reference to hls class
state_transition_graphs_collection | is the graph to be manipulated |
HLS | is the HLS data structure |
Definition at line 55 of file StateTransitionGraph_constructor.cpp.
EdgeDescriptor StateTransitionGraph_constructor::connect_state | ( | const vertex & | src, |
const vertex & | tgt, | ||
int | type | ||
) |
Creates a connection between two vertices into the graph.
You can also specify the edge kind. The method checks if the two vertices are stored into the graph, if one of them (or both) isn't, an exception is thrown.
src | is the source vertex (as returned by create_state method) |
tgt | is the target vertex (as returned by create_state method) |
type | is the edge type that it's going to be created (normal, direct edge is default) |
exec_op | is a list of operation vertices that will be executed by the transition |
end_op | is a list of operation vertices that will end in the transition |
Definition at line 120 of file StateTransitionGraph_constructor.cpp.
References FunctionBehavior::CFG, funId, HLSMgr, Wrefcount< T >::lock(), state_transition_graph, state_transition_graphs_collection, THROW_ASSERT, and test_panda::type.
void StateTransitionGraph_constructor::copy_condition | ( | const EdgeDescriptor & | dest, |
const EdgeDescriptor & | source | ||
) |
copy condition from one edge to another
dest | is the destination edge of the fsm |
source | is the source edge of the fsm |
Definition at line 174 of file StateTransitionGraph_constructor.cpp.
References state_transition_graph.
void StateTransitionGraph_constructor::create_entry_state | ( | ) |
create the STG entry vertex
Definition at line 66 of file StateTransitionGraph_constructor.cpp.
References FunctionBehavior::CFG, funId, HLSMgr, Wrefcount< T >::lock(), state_transition_graph, and state_transition_graphs_collection.
void StateTransitionGraph_constructor::create_exit_state | ( | ) |
create the STG exit vertex
Definition at line 82 of file StateTransitionGraph_constructor.cpp.
References FunctionBehavior::CFG, funId, HLSMgr, Wrefcount< T >::lock(), state_transition_graph, and state_transition_graphs_collection.
vertex StateTransitionGraph_constructor::create_state | ( | const std::list< vertex > & | exec_op, |
const std::list< vertex > & | start_op, | ||
const std::list< vertex > & | end_op, | ||
const CustomOrderedSet< unsigned int > & | BB_ids | ||
) |
Adds a new state managing the operations given as parameters.
exec_op | is a list of operation vertices that will be executed by the created state |
start_op | is a list of operation vertices that will start to be executed by the created state |
end_op | is a list of operation vertices that will end in the created state |
Definition at line 98 of file StateTransitionGraph_constructor.cpp.
References funId, HLSMgr, state_index, STATE_NAME_PREFIX, state_transition_graph, and state_transition_graphs_collection.
Removes the specified edge from the graph.
If the graph does not contain the specified edge, this method throws an exception.
Definition at line 187 of file StateTransitionGraph_constructor.cpp.
References state_transition_graphs_collection.
void StateTransitionGraph_constructor::delete_state | ( | const vertex & | src | ) |
Removes the specified state from the graph.
If the graph does not contain a vertex representing that state, this method throws an exception.
Definition at line 194 of file StateTransitionGraph_constructor.cpp.
References state_transition_graph, and state_transition_graphs_collection.
void StateTransitionGraph_constructor::set_condition | ( | const EdgeDescriptor & | e, |
transition_type | t, | ||
vertex | ops | ||
) |
Changes the control condition associated to an edge.
If no condition is given, previous one is erased and edge becomes without a true or false control dependence.
e | is the FSM edge |
t | is the condition type |
ops | is the vertex involved by this condition |
Definition at line 151 of file StateTransitionGraph_constructor.cpp.
References state_transition_graph.
void StateTransitionGraph_constructor::set_switch_condition | ( | const EdgeDescriptor & | e, |
vertex | op, | ||
const CustomOrderedSet< unsigned > & | labels, | ||
bool | has_default | ||
) |
function setting the condition on edge derived from switch statements
e | is the FSM edge |
op | is the controlling operations |
labels | are the the switch guards/labels associated with the edge |
has_default | is true when with the edge is associated the default guard/label |
Definition at line 165 of file StateTransitionGraph_constructor.cpp.
References CASE_COND, and state_transition_graph.
void StateTransitionGraph_constructor::set_unbounded_condition | ( | const EdgeDescriptor & | e, |
transition_type | t, | ||
const CustomOrderedSet< vertex > & | ops, | ||
vertex | ref_state | ||
) |
Definition at line 157 of file StateTransitionGraph_constructor.cpp.
References state_transition_graph.
|
private |
Definition at line 75 of file StateTransitionGraph_constructor.hpp.
Referenced by connect_state(), create_entry_state(), create_exit_state(), and create_state().
|
private |
The HLSMgr.
Definition at line 73 of file StateTransitionGraph_constructor.hpp.
Referenced by connect_state(), create_entry_state(), create_exit_state(), and create_state().
|
private |
Index of the next state to be created.
Definition at line 64 of file StateTransitionGraph_constructor.hpp.
Referenced by create_state().
|
private |
The complete state transition graph.
Definition at line 70 of file StateTransitionGraph_constructor.hpp.
Referenced by connect_state(), copy_condition(), create_entry_state(), create_exit_state(), create_state(), delete_state(), set_condition(), set_switch_condition(), and set_unbounded_condition().
|
private |
The bulk state transition graph.
Definition at line 67 of file StateTransitionGraph_constructor.hpp.
Referenced by connect_state(), create_entry_state(), create_exit_state(), create_state(), delete_edge(), and delete_state().