PandA-2024.02
Public Member Functions | Private Attributes
StateTransitionGraph_constructor Class Reference

#include <StateTransitionGraph_constructor.hpp>

Collaboration diagram for StateTransitionGraph_constructor:
Collaboration graph
[legend]

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_managerHLSMgr
 The HLSMgr. More...
 
unsigned int funId
 

Detailed Description

Definition at line 60 of file StateTransitionGraph_constructor.hpp.

Constructor & Destructor Documentation

◆ StateTransitionGraph_constructor()

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

Parameters
state_transition_graphs_collectionis the graph to be manipulated
HLSis the HLS data structure

Definition at line 55 of file StateTransitionGraph_constructor.cpp.

Member Function Documentation

◆ connect_state()

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.

Parameters
srcis the source vertex (as returned by create_state method)
tgtis the target vertex (as returned by create_state method)
typeis the edge type that it's going to be created (normal, direct edge is default)
exec_opis a list of operation vertices that will be executed by the transition
end_opis a list of operation vertices that will end in the transition
Returns
the descriptor of edge here created

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.

Here is the call graph for this function:

◆ copy_condition()

void StateTransitionGraph_constructor::copy_condition ( const EdgeDescriptor dest,
const EdgeDescriptor source 
)

copy condition from one edge to another

Parameters
destis the destination edge of the fsm
sourceis the source edge of the fsm

Definition at line 174 of file StateTransitionGraph_constructor.cpp.

References state_transition_graph.

◆ create_entry_state()

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.

Here is the call graph for this function:

◆ create_exit_state()

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.

Here is the call graph for this function:

◆ create_state()

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.

Parameters
exec_opis a list of operation vertices that will be executed by the created state
start_opis a list of operation vertices that will start to be executed by the created state
end_opis a list of operation vertices that will end in the created state
Returns
the created vertex

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.

◆ delete_edge()

void StateTransitionGraph_constructor::delete_edge ( const vertex src,
const vertex tgt 
)

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.

◆ delete_state()

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.

◆ set_condition()

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.

Parameters
eis the FSM edge
tis the condition type
opsis the vertex involved by this condition

Definition at line 151 of file StateTransitionGraph_constructor.cpp.

References state_transition_graph.

◆ set_switch_condition()

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

Parameters
eis the FSM edge
opis the controlling operations
labelsare the the switch guards/labels associated with the edge
has_defaultis 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.

◆ set_unbounded_condition()

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.

Field Documentation

◆ funId

unsigned int StateTransitionGraph_constructor::funId
private

◆ HLSMgr

const Wrefcount<const HLS_manager> StateTransitionGraph_constructor::HLSMgr
private

◆ state_index

unsigned int StateTransitionGraph_constructor::state_index
private

Index of the next state to be created.

Definition at line 64 of file StateTransitionGraph_constructor.hpp.

Referenced by create_state().

◆ state_transition_graph

const StateTransitionGraphRef StateTransitionGraph_constructor::state_transition_graph
private

◆ state_transition_graphs_collection

const StateTransitionGraphsCollectionRef StateTransitionGraph_constructor::state_transition_graphs_collection
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().


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