PandA-2024.02
Public Member Functions | Data Fields | Private Types | Private Member Functions | Private Attributes
StateTransitionGraphManager Class Reference

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>

Collaboration diagram for StateTransitionGraphManager:
Collaboration graph
[legend]

Public Member Functions

 StateTransitionGraphManager (const HLS_managerConstRef HLSMgr, hlsRef HLS, const ParameterConstRef _Param)
 Constructor of the class. More...
 
 ~StateTransitionGraphManager ()
 Destructor. More...
 
CustomOrderedSet< vertexget_execution_states (const vertex &op) const
 
CustomOrderedSet< vertexget_ending_states (const vertex &op) const
 
CustomOrderedSet< vertexget_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< vertexget_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_objRefmulti_unbounded_table
 map between state and multi-unbounded controllers More...
 

Detailed Description

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.

Member Enumeration Documentation

◆ StateTypes

Enumerator
EXECUTING 
STARTING 
ENDING 

Definition at line 100 of file state_transition_graph_manager.hpp.

Constructor & Destructor Documentation

◆ StateTransitionGraphManager()

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

Parameters
HLSis the HLS data structure

Definition at line 86 of file state_transition_graph_manager.cpp.

References STG_builder, and ~StateTransitionGraphManager().

Here is the call graph for this function:

◆ ~StateTransitionGraphManager()

StateTransitionGraphManager::~StateTransitionGraphManager ( )
default

Destructor.

Referenced by StateTransitionGraphManager().

Here is the caller graph for this function:

Member Function Documentation

◆ add_multi_unbounded_obj()

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().

Here is the caller graph for this function:

◆ add_to_SM()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CGetAstg()

const StateTransitionGraphConstRef StateTransitionGraphManager::CGetAstg ( ) const

Returns pointer to state transition graph created.

Returns
reference to a graph that contains information about operations to be executed and control edges

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().

Here is the caller graph for this function:

◆ CGetEPPStg()

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().

Here is the caller graph for this function:

◆ CGetStg()

const StateTransitionGraphConstRef StateTransitionGraphManager::CGetStg ( ) const

Returns pointer to state transition graph created.

Returns
reference to a graph that contains information about operations to be executed and control edges

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().

Here is the caller graph for this function:

◆ ComputeCyclesCount()

void StateTransitionGraphManager::ComputeCyclesCount ( bool  is_pipelined)

Compute minimum and maximum number of cycles for bounded scheduling.

Parameters
is_pipelinedTrue 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().

Here is the caller graph for this function:

◆ get_ending_states()

CustomOrderedSet< vertex > StateTransitionGraphManager::get_ending_states ( const vertex op) const

Definition at line 221 of file state_transition_graph_manager.cpp.

References get_states().

Here is the call graph for this function:

◆ get_entry_state()

vertex StateTransitionGraphManager::get_entry_state ( ) const

Gets vertex that represents state that contains entry node.

Returns
the vertex of state associated to 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().

Here is the caller graph for this function:

◆ get_execution_states()

CustomOrderedSet< vertex > StateTransitionGraphManager::get_execution_states ( const vertex op) const

Definition at line 231 of file state_transition_graph_manager.cpp.

References get_states().

Here is the call graph for this function:

◆ get_exit_state()

vertex StateTransitionGraphManager::get_exit_state ( ) const

Gets vertex that represents state that contains exit node.

Returns
the vertex of state associated to 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().

Here is the caller graph for this function:

◆ get_mu_ctrls()

const std::map<vertex, generic_objRef>& StateTransitionGraphManager::get_mu_ctrls ( ) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_number_of_states()

unsigned int StateTransitionGraphManager::get_number_of_states ( ) const
Returns
the number of states of the FSM

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().

Here is the caller graph for this function:

◆ get_starting_states()

CustomOrderedSet< vertex > StateTransitionGraphManager::get_starting_states ( const vertex op) const

Definition at line 226 of file state_transition_graph_manager.cpp.

References get_states().

Here is the call graph for this function:

◆ get_state_name()

std::string StateTransitionGraphManager::get_state_name ( vertex  state) const

Get the name of a state.

Parameters
stateis the state
Returns
the name of 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().

Here is the caller graph for this function:

◆ get_states()

CustomOrderedSet< vertex > StateTransitionGraphManager::get_states ( const vertex op,
StateTypes  statetypes 
) const
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().

Here is the caller graph for this function:

◆ GetAstg()

StateTransitionGraphRef StateTransitionGraphManager::GetAstg ( )

Returns pointer to state transition graph created.

Returns
reference to a graph that contains information about operations to be executed and control edges

Definition at line 246 of file state_transition_graph_manager.cpp.

References ACYCLIC_STG_graph.

Referenced by liveness::are_in_conflict().

Here is the caller graph for this function:

◆ GetEPPStg()

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().

Here is the caller graph for this function:

◆ GetStg()

StateTransitionGraphRef StateTransitionGraphManager::GetStg ( )

Returns pointer to state transition graph created.

Returns
reference to a graph that contains information about operations to be executed and control edges

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().

Here is the caller graph for this function:

◆ print_statistics()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ specialise_mu()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _max_cycles_bounded

const unsigned int StateTransitionGraphManager::_max_cycles_bounded
private

Definition at line 97 of file state_transition_graph_manager.hpp.

Referenced by ComputeCyclesCount().

◆ ACYCLIC_STG_graph

const StateTransitionGraphRef StateTransitionGraphManager::ACYCLIC_STG_graph
private

The acyclic version of the STG.

Definition at line 77 of file state_transition_graph_manager.hpp.

Referenced by CGetAstg(), ComputeCyclesCount(), and GetAstg().

◆ debug_level

int StateTransitionGraphManager::debug_level
private

debugging level

Definition at line 95 of file state_transition_graph_manager.hpp.

Referenced by add_to_SM().

◆ EPP_STG_graph

const StateTransitionGraphRef StateTransitionGraphManager::EPP_STG_graph
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().

◆ HLS

hlsRef StateTransitionGraphManager::HLS
private

HLS data-structure.

Definition at line 111 of file state_transition_graph_manager.hpp.

Referenced by add_to_SM(), and specialise_mu().

◆ multi_unbounded_table

std::map<vertex, generic_objRef> StateTransitionGraphManager::multi_unbounded_table
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().

◆ op_function_graph

const OpGraphConstRef StateTransitionGraphManager::op_function_graph
private

reference to operation graph

Definition at line 86 of file state_transition_graph_manager.hpp.

Referenced by get_states().

◆ output_level

int StateTransitionGraphManager::output_level
private

verbosity level

Definition at line 92 of file state_transition_graph_manager.hpp.

Referenced by print_statistics().

◆ Param

const ParameterConstRef StateTransitionGraphManager::Param
private

class containing all the parameters

Definition at line 89 of file state_transition_graph_manager.hpp.

Referenced by ComputeCyclesCount().

◆ state_transition_graphs_collection

const StateTransitionGraphsCollectionRef StateTransitionGraphManager::state_transition_graphs_collection
private

The bulk graph.

Definition at line 74 of file state_transition_graph_manager.hpp.

Referenced by get_number_of_states().

◆ STG_builder

const StateTransitionGraph_constructorRef StateTransitionGraphManager::STG_builder

◆ STG_graph

const StateTransitionGraphRef StateTransitionGraphManager::STG_graph
private

The documentation for this class was generated from the following files:

Generated on Mon Feb 12 2024 13:04:03 for PandA-2024.02 by doxygen 1.8.13