PandA-2024.02
|
Class used to manage a graph into finite state machine representation; it contains methods to build the graph, to add nodes, edges... More...
#include <state_transition_graph_manager.hpp>
Public Member Functions | |
StateTransitionGraphManager (const HLS_managerConstRef HLSMgr, hlsRef HLS, const ParameterConstRef _Param) | |
Constructor of the class. More... | |
~StateTransitionGraphManager () | |
Destructor. More... | |
CustomOrderedSet< vertex > | get_execution_states (const vertex &op) const |
CustomOrderedSet< vertex > | get_ending_states (const vertex &op) const |
CustomOrderedSet< vertex > | get_starting_states (const vertex &op) const |
void | ComputeCyclesCount (bool is_pipelined) |
Compute minimum and maximum number of cycles for bounded scheduling. More... | |
StateTransitionGraphRef | GetStg () |
Returns pointer to state transition graph created. More... | |
StateTransitionGraphRef | GetEPPStg () |
Returns pointer to acyclic STG with additional edges for Efficient Path Profiling. More... | |
const StateTransitionGraphConstRef | CGetEPPStg () const |
Returns pointer to acyclic STG with additional edges for Efficient Path Profiling. More... | |
const StateTransitionGraphConstRef | CGetStg () const |
Returns pointer to state transition graph created. More... | |
StateTransitionGraphRef | GetAstg () |
Returns pointer to state transition graph created. More... | |
const StateTransitionGraphConstRef | CGetAstg () const |
Returns pointer to state transition graph created. More... | |
void | print_statistics () const |
vertex | get_entry_state () const |
Gets vertex that represents state that contains entry node. More... | |
std::string | get_state_name (vertex state) const |
Get the name of a state. More... | |
vertex | get_exit_state () const |
Gets vertex that represents state that contains exit node. More... | |
unsigned int | get_number_of_states () const |
void | add_multi_unbounded_obj (vertex s, const CustomOrderedSet< vertex > &ops) |
void | specialise_mu (structural_objectRef &mu_mod, generic_objRef mu) const |
const std::map< vertex, generic_objRef > & | get_mu_ctrls () const |
void | add_to_SM (structural_objectRef clock_port, structural_objectRef reset_port) |
Add components to the datapath required by the FSM. More... | |
Data Fields | |
const StateTransitionGraph_constructorRef | STG_builder |
reference to the class for building the graph More... | |
Private Types | |
enum | StateTypes { EXECUTING, STARTING, ENDING } |
Private Member Functions | |
CustomOrderedSet< vertex > | get_states (const vertex &op, StateTypes statetypes) const |
Private Attributes | |
const StateTransitionGraphsCollectionRef | state_transition_graphs_collection |
The bulk graph. More... | |
const StateTransitionGraphRef | ACYCLIC_STG_graph |
The acyclic version of the STG. More... | |
const StateTransitionGraphRef | STG_graph |
The complete version of the STG. More... | |
const StateTransitionGraphRef | EPP_STG_graph |
The acyclic version of stg with additional edges necessary for Efficient Path Profiling. More... | |
const OpGraphConstRef | op_function_graph |
reference to operation graph More... | |
const ParameterConstRef | Param |
class containing all the parameters More... | |
int | output_level |
verbosity level More... | |
int | debug_level |
debugging level More... | |
const unsigned int | _max_cycles_bounded |
hlsRef | HLS |
HLS data-structure. More... | |
std::map< vertex, generic_objRef > | multi_unbounded_table |
map between state and multi-unbounded controllers More... | |
Class used to manage a graph into finite state machine representation; it contains methods to build the graph, to add nodes, edges...
and also to write the dotty representation of the graph. Two different graphs have been stored: the finite state machine and the related acyclic version (without any feedback edges)
Definition at line 70 of file state_transition_graph_manager.hpp.
|
private |
Enumerator | |
---|---|
EXECUTING | |
STARTING | |
ENDING |
Definition at line 100 of file state_transition_graph_manager.hpp.
StateTransitionGraphManager::StateTransitionGraphManager | ( | const HLS_managerConstRef | HLSMgr, |
hlsRef | HLS, | ||
const ParameterConstRef | _Param | ||
) |
Constructor of the class.
It creates a new empty graph and it sets reference to hls class
HLS | is the HLS data structure |
Definition at line 86 of file state_transition_graph_manager.cpp.
References STG_builder, and ~StateTransitionGraphManager().
|
default |
Destructor.
Referenced by StateTransitionGraphManager().
void StateTransitionGraphManager::add_multi_unbounded_obj | ( | vertex | s, |
const CustomOrderedSet< vertex > & | ops | ||
) |
Definition at line 282 of file state_transition_graph_manager.cpp.
References multi_unbounded_table, and STG_graph.
Referenced by BB_based_stg::InternalExec().
void StateTransitionGraphManager::add_to_SM | ( | structural_objectRef | clock_port, |
structural_objectRef | reset_port | ||
) |
Add components to the datapath required by the FSM.
Definition at line 303 of file state_transition_graph_manager.cpp.
References CLOCK_PORT_NAME, hls::datapath, debug_level, DEBUG_LEVEL_VERBOSE, structural_object::find_member(), structural_manager::get_circ(), HLS, hls::HLS_D, INDENT_DBG_MEX, multi_unbounded_table, port_o_K, RESET_PORT_NAME, SIMPLEJOIN_STD, and specialise_mu().
Referenced by get_mu_ctrls(), and classic_datapath::InternalExec().
const StateTransitionGraphConstRef StateTransitionGraphManager::CGetAstg | ( | ) | const |
Returns pointer to state transition graph created.
Definition at line 117 of file state_transition_graph_manager.cpp.
References ACYCLIC_STG_graph.
Referenced by liveness::are_in_conflict(), mux_connection_binding::create_connections(), create_control_flow_checker(), fsm_controller::create_state_machine(), pipeline_controller::InternalExec(), and FSM_NI_SSA_liveness::InternalExec().
const StateTransitionGraphConstRef StateTransitionGraphManager::CGetEPPStg | ( | ) | const |
Returns pointer to acyclic STG with additional edges for Efficient Path Profiling.
Definition at line 127 of file state_transition_graph_manager.cpp.
References EPP_STG_graph.
Referenced by BB_based_stg::compute_EPP_edge_increments(), and create_control_flow_checker().
const StateTransitionGraphConstRef StateTransitionGraphManager::CGetStg | ( | ) | const |
Returns pointer to state transition graph created.
Definition at line 122 of file state_transition_graph_manager.cpp.
References STG_graph.
Referenced by BB_based_stg::compute_EPP_edge_increments(), create_control_flow_checker(), fsm_controller::create_state_machine(), BB_based_stg::InternalExec(), FSM_NI_SSA_liveness::InternalExec(), ControlFlowChecker::InternalExec(), add_library::InternalExec(), BB_based_stg::optimize_cycles(), and BB_based_stg::res_const_operation().
void StateTransitionGraphManager::ComputeCyclesCount | ( | bool | is_pipelined | ) |
Compute minimum and maximum number of cycles for bounded scheduling.
is_pipelined | True if scheduling is pipelined |
Definition at line 132 of file state_transition_graph_manager.cpp.
References _max_cycles_bounded, ACYCLIC_STG_graph, max, min, Param, STG_graph, and THROW_ASSERT.
Referenced by BB_based_stg::InternalExec().
CustomOrderedSet< vertex > StateTransitionGraphManager::get_ending_states | ( | const vertex & | op | ) | const |
Definition at line 221 of file state_transition_graph_manager.cpp.
References get_states().
vertex StateTransitionGraphManager::get_entry_state | ( | ) | const |
Gets vertex that represents state that contains entry node.
Definition at line 178 of file state_transition_graph_manager.cpp.
References STG_graph.
Referenced by add_EPP_edges(), mux_connection_binding::connect_to_registers(), fsm_controller::create_state_machine(), pipeline_controller::InternalExec(), BB_based_stg::InternalExec(), FSM_NI_SSA_liveness::InternalExec(), and values_scheme::InternalExec().
CustomOrderedSet< vertex > StateTransitionGraphManager::get_execution_states | ( | const vertex & | op | ) | const |
Definition at line 231 of file state_transition_graph_manager.cpp.
References get_states().
vertex StateTransitionGraphManager::get_exit_state | ( | ) | const |
Gets vertex that represents state that contains exit node.
Definition at line 236 of file state_transition_graph_manager.cpp.
References STG_graph.
Referenced by add_EPP_edges(), fsm_controller::create_state_machine(), BB_based_stg::InternalExec(), and FSM_NI_SSA_liveness::InternalExec().
|
inline |
Definition at line 206 of file state_transition_graph_manager.hpp.
References add_to_SM(), and multi_unbounded_table.
Referenced by conn_binding::add_command_ports(), and mux_connection_binding::create_connections().
unsigned int StateTransitionGraphManager::get_number_of_states | ( | ) | const |
Definition at line 261 of file state_transition_graph_manager.cpp.
References state_transition_graphs_collection.
Referenced by AllocationInformation::EstimateControllerDelay(), pipeline_controller::InternalExec(), and print_statistics().
CustomOrderedSet< vertex > StateTransitionGraphManager::get_starting_states | ( | const vertex & | op | ) | const |
Definition at line 226 of file state_transition_graph_manager.cpp.
References get_states().
std::string StateTransitionGraphManager::get_state_name | ( | vertex | state | ) | const |
Get the name of a state.
state | is the state |
Definition at line 241 of file state_transition_graph_manager.cpp.
References STG_graph.
Referenced by BB_based_stg::InternalExec(), and FSM_NI_SSA_liveness::InternalExec().
|
private |
Definition at line 183 of file state_transition_graph_manager.cpp.
References ENDING, EXECUTING, GET_NAME, op_function_graph, STARTING, STG_graph, THROW_ASSERT, and THROW_UNREACHABLE.
Referenced by get_ending_states(), get_execution_states(), and get_starting_states().
StateTransitionGraphRef StateTransitionGraphManager::GetAstg | ( | ) |
Returns pointer to state transition graph created.
Definition at line 246 of file state_transition_graph_manager.cpp.
References ACYCLIC_STG_graph.
Referenced by liveness::are_in_conflict().
StateTransitionGraphRef StateTransitionGraphManager::GetEPPStg | ( | ) |
Returns pointer to acyclic STG with additional edges for Efficient Path Profiling.
Definition at line 256 of file state_transition_graph_manager.cpp.
References EPP_STG_graph.
Referenced by compute_edge_increments().
StateTransitionGraphRef StateTransitionGraphManager::GetStg | ( | ) |
Returns pointer to state transition graph created.
Definition at line 251 of file state_transition_graph_manager.cpp.
References STG_graph.
Referenced by add_EPP_edges(), reg_binding::bind(), mux_connection_binding::connect_to_registers(), mux_connection_binding::create_connections(), mux_connection_binding::create_single_conn(), BB_based_stg::InternalExec(), values_scheme::InternalExec(), BB_based_stg::move_with_duplication(), BB_based_stg::move_without_duplication(), BB_based_stg::optimize_cycles(), and BB_based_stg::res_const_operation().
void StateTransitionGraphManager::print_statistics | ( | ) | const |
Definition at line 266 of file state_transition_graph_manager.cpp.
References get_number_of_states(), INDENT_OUT_MEX, output_level, OUTPUT_LEVEL_MINIMUM, OUTPUT_LEVEL_VERY_PEDANTIC, STG_graph, and STR.
Referenced by BB_based_stg::InternalExec().
void StateTransitionGraphManager::specialise_mu | ( | structural_objectRef & | mu_mod, |
generic_objRef | mu | ||
) | const |
Definition at line 291 of file state_transition_graph_manager.cpp.
References hls::debug_level, DEBUG_LEVEL_VERBOSE, structural_object::find_member(), structural_object::get_path(), HLS, INDENT_DBG_MEX, port_vector_o_K, and THROW_ASSERT.
Referenced by add_to_SM().
|
private |
Definition at line 97 of file state_transition_graph_manager.hpp.
Referenced by ComputeCyclesCount().
|
private |
The acyclic version of the STG.
Definition at line 77 of file state_transition_graph_manager.hpp.
Referenced by CGetAstg(), ComputeCyclesCount(), and GetAstg().
|
private |
debugging level
Definition at line 95 of file state_transition_graph_manager.hpp.
Referenced by add_to_SM().
|
private |
The acyclic version of stg with additional edges necessary for Efficient Path Profiling.
Definition at line 83 of file state_transition_graph_manager.hpp.
Referenced by CGetEPPStg(), and GetEPPStg().
|
private |
HLS data-structure.
Definition at line 111 of file state_transition_graph_manager.hpp.
Referenced by add_to_SM(), and specialise_mu().
|
private |
map between state and multi-unbounded controllers
Definition at line 114 of file state_transition_graph_manager.hpp.
Referenced by add_multi_unbounded_obj(), add_to_SM(), and get_mu_ctrls().
|
private |
reference to operation graph
Definition at line 86 of file state_transition_graph_manager.hpp.
Referenced by get_states().
|
private |
verbosity level
Definition at line 92 of file state_transition_graph_manager.hpp.
Referenced by print_statistics().
|
private |
class containing all the parameters
Definition at line 89 of file state_transition_graph_manager.hpp.
Referenced by ComputeCyclesCount().
|
private |
The bulk graph.
Definition at line 74 of file state_transition_graph_manager.hpp.
Referenced by get_number_of_states().
const StateTransitionGraph_constructorRef StateTransitionGraphManager::STG_builder |
reference to the class for building the graph
Definition at line 118 of file state_transition_graph_manager.hpp.
Referenced by add_EPP_edges(), BB_based_stg::InternalExec(), BB_based_stg::move_with_duplication(), BB_based_stg::move_without_duplication(), BB_based_stg::optimize_cycles(), and StateTransitionGraphManager().
|
private |
The complete version of the STG.
Definition at line 80 of file state_transition_graph_manager.hpp.
Referenced by add_multi_unbounded_obj(), CGetStg(), ComputeCyclesCount(), get_entry_state(), get_exit_state(), get_state_name(), get_states(), GetStg(), and print_statistics().