48 #include "config_HAVE_HLS_BUILT.hpp" 49 #include "config_HAVE_UNORDERED.hpp" 59 #include <boost/graph/graph_traits.hpp> 79 #define ENTRY_ID (std::numeric_limits<unsigned int>::max()) 80 #define EXIT_ID (std::numeric_limits<unsigned int>::max() - 1) 90 #define TYPE_OPAQUE 1 << 0 95 #define TYPE_EXTERNAL 1 << 4 100 #define TYPE_IF 1 << 5 105 #define TYPE_SWITCH 1 << 6 110 #define TYPE_WHILE 1 << 7 115 #define TYPE_FOR 1 << 8 120 #define TYPE_DO 1 << 9 125 #define TYPE_ASSIGN 1 << 10 130 #define TYPE_NOP 1 << 11 135 #define TYPE_PHI 1 << 12 140 #define TYPE_RET 1 << 13 145 #define TYPE_TO_BE_REMOVED 1 << 14 151 #define TYPE_LABEL 1 << 15 157 #define TYPE_GOTO 1 << 16 162 #define TYPE_VPHI 1 << 17 167 #define TYPE_INIT 1 << 18 172 #define TYPE_LOAD 1 << 19 177 #define TYPE_STORE 1 << 20 182 #define TYPE_MEMCPY 1 << 21 187 #define TYPE_WAS_GIMPLE_PHI 1 << 22 192 #define TYPE_FIRST_OP 1 << 23 197 #define TYPE_LAST_OP 1 << 24 202 #define TYPE_MULTIIF 1 << 25 207 #define TYPE_ATOMIC 1 << 26 212 #define TYPE_PREDICATED 1 << 27 217 #define TYPE_RW 1 << 28 224 #define ASSIGN "ASSIGN" 229 #define STORE "STORE" 230 #define PREDICATED_STORE "PREDICATED_STORE" 235 #define PREDICATED_LOAD "PREDICATED_LOAD" 240 #define ASSERT_EXPR "assert_expr" 245 #define EXTRACT_BIT_EXPR "extract_bit_expr" 250 #define LUT_EXPR "lut_expr" 255 #define READ_COND "READ_COND" 260 #define MULTI_READ_COND "MULTI_READ_COND" 265 #define SWITCH_COND "SWITCH_COND" 270 #define GIMPLE_LABEL "gimple_label" 275 #define GIMPLE_GOTO "gimple_goto" 285 #define GIMPLE_RETURN "gimple_return" 290 #define GIMPLE_NOP "gimple_nop" 295 #define GIMPLE_PHI "gimple_phi" 300 #define GIMPLE_ASM "gimple_asm" 305 #define GIMPLE_PRAGMA "gimple_pragma" 310 #define MEMCPY "__internal_bambu_memcpy" 315 #define MEMCMP "memcmp" 320 #define MEMSET "__internal_bambu_memset" 325 #define VECT_CONCATENATION "VECT_CONCATENATION" 330 #define ADDR_EXPR "addr_expr" 335 #define NOP_EXPR "nop_expr" 340 #define FLOAT_EXPR "float_expr" 345 #define FIX_TRUNC_EXPR "fix_trunc_expr" 350 #define CONVERT_EXPR "convert_expr" 355 #define VIEW_CONVERT_EXPR "view_convert_expr" 358 #define BUILTIN_WAIT_CALL "__builtin_wait_call" 435 #define GET_BB_INDEX(data, vertex_index) Cget_node_info<OpNodeInfo>(vertex_index, *(data))->bb_index 441 #define GET_CER(data, vertex_index) Cget_node_info<OpNodeInfo>(vertex_index, *(data))->cer 446 #define DFG_SCA_SELECTOR 1 << 7 448 #define DFG_AGG_SELECTOR 1 << 8 450 #define DFG_SELECTOR (DFG_SCA_SELECTOR | DFG_AGG_SELECTOR) 452 #define FB_DFG_SCA_SELECTOR 1 << 9 454 #define FB_DFG_AGG_SELECTOR 1 << 10 456 #define FB_DFG_SELECTOR (FB_DFG_SCA_SELECTOR | FB_DFG_AGG_SELECTOR) 458 #define FDFG_SELECTOR (DFG_SELECTOR | FB_DFG_SELECTOR) 462 #define ADG_SCA_SELECTOR 1 << 11 463 #define ADG_AGG_SELECTOR 1 << 12 465 #define ADG_SELECTOR (ADG_SCA_SELECTOR | ADG_AGG_SELECTOR) 467 #define FB_ADG_SCA_SELECTOR 1 << 13 469 #define FB_ADG_AGG_SELECTOR 1 << 14 471 #define FB_ADG_SELECTOR (FB_ADG_SCA_SELECTOR | FB_ADG_AGG_SELECTOR) 473 #define FADG_SELECTOR (ADG_SELECTOR | FB_ADG_SELECTOR) 477 #define ODG_SCA_SELECTOR 1 << 15 478 #define ODG_AGG_SELECTOR 1 << 16 480 #define ODG_SELECTOR (ODG_SCA_SELECTOR | ODG_AGG_SELECTOR) 482 #define FB_ODG_SCA_SELECTOR 1 << 17 484 #define FB_ODG_AGG_SELECTOR 1 << 18 486 #define FB_ODG_SELECTOR (FB_ODG_SCA_SELECTOR | FB_ODG_AGG_SELECTOR) 488 #define FODG_SELECTOR (ODG_SELECTOR | FB_ODG_SELECTOR) 492 #define SDG_SELECTOR (CDG_SELECTOR | DFG_SELECTOR) 493 #define FSDG_SELECTOR (FCDG_SELECTOR | FDFG_SELECTOR) 495 #define RSDG_SELECTOR (TRED_SELECTOR) 499 #define FSADG_SELECTOR \ 500 (CDG_SELECTOR | DFG_SELECTOR | ADG_SELECTOR | FB_CDG_SELECTOR | FB_DFG_SELECTOR | FB_ADG_SELECTOR) 501 #define SAODG_SELECTOR (CDG_SELECTOR | DFG_SELECTOR | ADG_SELECTOR | ODG_SELECTOR) 503 #define FADFG_SELECTOR (DFG_SELECTOR | ADG_SELECTOR) 507 #define CSG_SELECTOR 1 << 19 508 #define SG_SELECTOR (CSG_SELECTOR | DFG_SELECTOR | ADG_SELECTOR | ODG_SELECTOR | FLG_SELECTOR) 512 #define RPDG_SELECTOR 1 << 20 515 #define FLG_SELECTOR 1 << 21 518 #define FB_FLG_SELECTOR 1 << 22 521 #define DEBUG_SELECTOR 1 << 23 542 bool FlgEdgeT()
const;
547 bool FlgEdgeF()
const;
607 template <
typename value>
666 template <
typename value>
679 class OpEdgeSorter : std::binary_function<EdgeDescriptor, EdgeDescriptor, bool>
702 class OpEdgeSet :
public std::set<EdgeDescriptor, OpEdgeSorter>
743 if(ExistsEdge(source, target))
745 return AddSelector(source, target, selector);
758 boost::graph_traits<boost_graphs_collection>::vertex_descriptor AddVertex(
const NodeInfoRef info)
override;
764 void RemoveVertex(boost::graph_traits<boost_graphs_collection>::vertex_descriptor v)
override;
803 const CustomUnorderedSet<boost::graph_traits<OpGraphsCollection>::vertex_descriptor>& sub);
815 void WriteDot(
const std::string& file_name,
const int detail_level = 0)
const;
824 void WriteDot(
const std::string& file_name,
const hlsConstRef HLS,
864 return RefcountCast<OpGraphInfo>(GetGraphInfo());
873 return RefcountCast<const OpGraphInfo>(CGetGraphInfo());
882 return RefcountCast<OpGraphInfo>(GetGraphInfo());
906 boost::iterator_range<InEdgeIterator> CGetInEdges(
const vertex v)
const;
916 boost::iterator_range<OutEdgeIterator> CGetOutEdges(
const vertex v)
const;
CustomSet< unsigned int > called
Store the index of called functions.
CustomMap< FunctionBehavior_VariableType, CustomMap< FunctionBehavior_VariableAccessType, CustomSet< unsigned int > > > variables
set of scalar ssa accessed in this node
~OpNodeInfo() override
Destructor.
OpGraphConstRef op_graph
The operation graph to which vertices belong Note: this should be const, but can not because of assig...
unsigned int cer
Store the index of the control equivalent region.
Base class storing user data information to the whole graph.
vertex exit_vertex
Index identifying the exit vertex.
vertex entry_vertex
Index identifying the entry vertex.
Class managing the schedule of the operations.
std::list< unsigned int > actual_parameters
Set of actual parameters of called function (used in pthread backend.
Class specification of the graph structures.
Information associated with a generic operation node.
CustomOrderedMap< T, U > CustomMap
Information associated with an operation or basic block graph.
const EdgeInfoConstRef CGetEdgeInfo(typename boost::graph_traits< graphs_collection >::vertex_descriptor source, typename boost::graph_traits< graphs_collection >::vertex_descriptor target) const
Get the edge property.
FunctionBehavior_VariableType
The possible type of a variable.
Definition of hash function for EdgeDescriptor.
OpGraphInfoRef GetOpGraphInfo()
Returns the property associated with the graph.
EdgeDescriptor AddEdge(const vertex source, const vertex target, const int selector)
Add an edge with empty information associated.
const OpEdgeInfoConstRef CGetOpEdgeInfo(const EdgeDescriptor edge) const
Returns the info associated with an edge.
Base class description of data information associated with each node of a graph.
NodeInfoRef GetNodeInfo(typename boost::graph_traits< graphs_collection >::vertex_descriptor node)
FIXME: this method should become protected and called by equivalent method in subclasses Get the node...
redefinition of map to manage ordered/unordered structures
A set of operation vertices.
OpGraphConstRef op_graph
The operation graph to which vertices belong Note: this should be const, but can not because of assig...
unsigned int GetNodeId() const
Return the node id of the operation associated with the vertex.
tree_nodeRef node
The tree node associated with this vertex.
CustomSet< unsigned int > cited_variables
set of cited variables (i.e., variables which are included in the c printing of this statement) ...
OpNodeInfoRef GetOpNodeInfo(const vertex node)
Returns the info associated with a node.
information associated with the whole graph
const OpNodeInfoConstRef CGetOpNodeInfo(const vertex node) const
Returns the info associated with a node.
void WriteDot(const std::string &file_name, OpGraphConstRef sub_op_graph=OpGraphConstRef(), OpVertexSet *opSet=nullptr) const
Function that writes the dot file of the scheduling by using the AT&T direct graph representation...
unsigned int bb_index
Store the index of the basic block which this operation vertex belongs to.
unsigned map[NUM_VERTICES]
absl::flat_hash_map< T, U, Hash, Eq, Alloc > CustomUnorderedMap
CustomMap< unsigned int, vertex > tree_node_to_operation
For each statement, the vertex in which it is contained.
const NodeInfoConstRef CGetNodeInfo(typename boost::graph_traits< graphs_collection >::vertex_descriptor node) const
Get the node property.
const CustomSet< unsigned int > & GetVariables(const FunctionBehavior_VariableType variable_type, const FunctionBehavior_VariableAccessType access_type) const
Return a set of accessed scalar variables.
refcount< EdgeInfo > EdgeInfoRef
RefCount type definition of the edge_info class structure.
The info associated with an edge of operation graph.
const std::string GetOperation() const
Return the operation associated with the vertex.
redefinition of set to manage ordered/unordered structures
const OpGraphInfoConstRef CGetOpGraphInfo() const
Returns the property associated with the graph.
void Print(std::ostream &stream, const BehavioralHelperConstRef behavioral_helper, const bool dotty_format) const
Print the content of this node.
This class macros for the definition of strong typedef.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Map from operation vertices to value.
General class used to describe a graph in PandA.
FunctionBehavior_VariableAccessType
The access type to a variable.
CONSTREF_FORWARD_DECL(BehavioralHelper)
Autoheader include.
OpVertexSet operations
The set of operations.
Template definition of refcount.
OpVertexMap(const OpGraphConstRef op_graph)
Constructor.
Data structures used to represent an edge in operation and basic block graphs.
const BehavioralHelperConstRef BH
The behavioral helper.
void Initialize()
Initialize variable maps.
UINT_STRONG_TYPEDEF(MemoryAddress)
Data structure that contains all information about high level synthesis process.
x
Return the smallest n such that 2^n >= _x.
Class used to describe a particular graph with operations as nodes.
OpGraphInfoRef CGetOpGraphInfo()
Returns the property associated with the graph.
This structure defines graphs where nodes are operations.
A brief description of the C++ Header File.
boost::graph_traits< graph >::edge_descriptor EdgeDescriptor
edge definition.