43 #ifndef PORT_SWAPPING_HPP 44 #define PORT_SWAPPING_HPP 48 #include <boost/graph/adjacency_list.hpp> 56 using PSGraph = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::no_property,
57 boost::property<boost::edge_color_t, boost::default_color_type>>;
58 using PSEdge = boost::graph_traits<PSGraph>::edge_descriptor;
59 using PSVertex = boost::graph_traits<PSGraph>::vertex_descriptor;
60 using PSE = std::pair<unsigned int, unsigned int>;
69 std::vector<PSVSet> vset;
106 std::vector<PSVSet>& vset);
154 std::vector<std::pair<PSVertex, unsigned int>>
p_swap(
PSGraph& g);
169 unsigned int get_results(
PSVertex operand,
const std::vector<std::pair<PSVertex, unsigned int>>& results);
const HLS_managerRef HLSMgr
information about all the HLS synthesis
PSVertex find_max_degree(const CustomOrderedSet< std::pair< PSVertex, unsigned int >> &dSet)
This function finds the maximum degree (out_edges) of a vertex.
~port_swapping() override
Destructor.
std::vector< PSE > spt_vector_edges
RelationshipType
The relationship type.
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
long unsigned int cardinality
struct { PSVertex v PSVSet
std::vector< PSE > co_tree_vector_edges
struct { std::vector< PSVSet > vset PSMultiStart
DesignFlowStep_Status InternalExec() override
Execute the step.
port_swapping(const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager)
Constructor.
boost::graph_traits< PSGraph >::vertex_descriptor PSVertex
This class specifies the characteristic of a particular operation working on a given functional unit...
std::pair< unsigned int, unsigned int > PSE
unsigned int get_results(PSVertex operand, const std::vector< std::pair< PSVertex, unsigned int >> &results)
This function returns the belonging set of a given vertex.
std::vector< std::pair< PSVertex, unsigned int > > p_swap(PSGraph &g)
This function is the wrapper that executes port_swapping_algorithms and extracts the best solution...
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
bool is_commutative_op(const std::string &operation)
This function checks if an operation is commutative or not.
DesignFlowStep_Status
The status of a step.
PSVertex get_co_tree_vertex(PSVertex vertex, const std::vector< PSE > &edges)
This function selects the right vertex from the co_tree_edges vector.
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, boost::no_property, boost::property< boost::edge_color_t, boost::default_color_type > > PSGraph
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > ComputeHLSRelationships(const DesignFlowStep::RelationshipType relationship_type) const override
Compute the relationship of this step.
boost::graph_traits< PSGraph >::edge_descriptor PSEdge
int vertex_distance(const std::vector< PSE > &spt_edges, PSVertex root, PSVertex dest, std::vector< PSVSet > &vset)
This function calculates the distances between two vertices in a spanning tree.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
void update_degree(PSGraph g2, CustomOrderedSet< std::pair< PSVertex, unsigned int >> &dSet)
This function updates the degree of all the vertices.
std::vector< PSE > odd_co_tree_vector_edges
void vertex_levels(const std::vector< PSE > &spt_edges, PSVertex root, size_t num_vertices_g, std::vector< PSVSet > &vset)
This function calculates the levels of all te vertices starting from root.
void port_swapping_algorithm(PSGraph &g, std::vector< PSMultiStart > &vector_sets, size_t num_vertices_g, PSVertex root)
This function computes the port_swapping.