56 #include <boost/tuple/tuple.hpp> 80 GetPointer<OpNodeInfo>(node_info)->vertex_name = source;
81 const vertex v_og =
og->AddVertex(node_info);
94 return og->AddEdge(source, dest, selector);
99 og->RemoveSelector(source, dest, selector);
104 og->RemoveSelector(edge, selector);
117 boost::tie(e, inserted) = boost::edge(src, tgt, *
og);
119 get_edge_info<OpEdgeInfo>(e, *(
og))->add_nodeID(NodeID, selector);
123 const std::string& operation_t,
unsigned int bb_index,
124 const unsigned int node_id)
130 node_id ==
op_graph->CGetOpNodeInfo(current)->GetNodeId(),
131 "Trying to set node_id " +
STR(node_id) +
" to vertex " + src +
" that has already node_id " +
132 STR(
op_graph->CGetOpNodeInfo(current)->GetNodeId()));
137 const unsigned int updated_node_id =
op_graph->GetOpNodeInfo(current)->GetNodeId();
138 if(updated_node_id != 0 && updated_node_id !=
ENTRY_ID && updated_node_id !=
EXIT_ID)
145 op_graph->GetOpGraphInfo()->entry_vertex = current;
149 op_graph->GetOpGraphInfo()->exit_vertex = current;
151 op_graph->GetOpGraphInfo()->tree_node_to_operation[node_id] = current;
157 THROW_ASSERT(type_t != 0,
"Type of vertex " + src +
" is zero");
173 op_graph->GetOpNodeInfo(op_vertex)->variables[variable_type][access_type].insert(variable);
178 op_graph->GetOpNodeInfo(Ver)->actual_parameters.push_back(Var);
188 op_graph->GetOpNodeInfo(Ver)->cited_variables.insert(Vargc);
OpGraphConstRef op_graph
The operation graph (for scheduling purpose) (cannot be const because of = operator) ...
const OpGraphRef op_graph
The graph with all the edges.
const OpGraphsCollectionRef og
reference to the bulk operations graph
void add_called_function(const std::string &source, unsigned int called_function)
Adds a call to the vertex.
const tree_nodeRef CGetTreeReindex(const unsigned int i) const
Return a tree_reindex wrapping the i-th tree_node.
#define GET_NODE_INFO(data, NodeInfo, vertex_index)
void CompressEdges()
Remove all redundant edges.
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
Information associated with a generic operation node.
tree_managerRef TM
The tree manager.
void add_edge_info(const vertex src, const vertex tgt, const int selector, unsigned int NodeID)
Add edge info to the graph.
exceptions managed by PandA
FunctionBehavior_VariableType
The possible type of a variable.
Definition of hash function for EdgeDescriptor.
void Clear()
Remove all vertices and edges.
void add_type(const std::string &src, unsigned int type)
Add the type associated with a vertex.
Base class description of data information associated with each node of a graph.
redefinition of map to manage ordered/unordered structures
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
const tree_nodeRef get_tree_node_const(unsigned int i) const
Return the reference to the i-th tree_node Constant version of get_tree_node.
#define EXIT_ID
constant used to represent tree node index of exit operation
This class specifies the characteristic of a particular operation working on a given functional unit...
#define ENTRY
Superclass include.
void AddVariable(const vertex op_vertex, const unsigned int variable, const FunctionBehavior_VariableType variable_type, const FunctionBehavior_VariableAccessType access_type)
Adds an access to a variable to an operation vertex.
void AddOperation(const tree_managerRef TM, const std::string &src, const std::string &oper, unsigned int bb_index, const unsigned int node_id)
Add the operation associated with a vertex.
redefinition of set to manage ordered/unordered structures
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
FunctionBehavior_VariableAccessType
The access type to a variable.
Classes specification of the tree_node data structures.
void RemoveEdge(const vertex source, const vertex dest, int selector)
remove a selector between two vertices
void add_parameter(const vertex &Ver, unsigned int Vargc)
Adds a parameter to the vertex.
operations_graph_constructor(OpGraphsCollectionRef _og)
Constructor.
vertex CgetIndex(const std::string &source) const
Return the vertex index given the id of the vertex node.
~operations_graph_constructor()
Destructor.
void AddSourceCodeVariable(const vertex &Ver, unsigned int Vargc)
Adds a (ssa-)variable to the set of variables referred by the operation vertex.
#define ENTRY_ID
constant used to represent tree node index of entry operation
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
EdgeDescriptor AddEdge(const vertex source, const vertex dest, int selector)
add an edge between vertex source and vertex dest
vertex getIndex(const std::string &source)
Return the vertex index given the id of the vertex node.
Class used to describe a particular graph with operations as nodes.
This class provides methods to build an operations graph.
#define TYPE_GENERIC
constant identifying the node type of a GENERIC operation.
void RemoveSelector(const EdgeDescriptor edge, const int selector)
set the selector of an edge between vertex source and vertex dest
std::map< std::string, vertex > index_map
Mapping between id to index.
Class specification of the manager of the tree structures extracted from the raw file.
A brief description of the C++ Header File.
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...