|
CkPttn 1.2.4
|
K-Way Fiduccia-Mattheyses Gain Calculator. More...
#include <FMKWayGainCalc.hpp>
Public Types | |
| using | ret_info = std::vector< std::vector< int > > |
Public Member Functions | |
| FMKWayGainCalc (const Gnl &hyprgraph, std::uint8_t num_parts) | |
| Constructs a new FMKWayGainCalc object. | |
| auto | init (std::span< const std::uint8_t > part) -> int |
| Initializes the FMKWayGainCalc object. | |
| auto | update_move_init () -> void |
| Resets the delta gain vector to 0. | |
| auto | update_move_2pin_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> node_t |
| Updates the gain for a 2-pin net after a move. | |
| void | init_idx_vec (const node_t &v, const node_t &net) |
| Initializes the index vector for a given vertex and net. | |
| auto | update_move_3pin_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> ret_info |
| Updates the gain for a 3-pin net after a move. | |
| auto | update_move_general_net (std::span< const std::uint8_t > part, const MoveInfo< node_t > &move_info) -> ret_info |
| Updates the gain for a general net after a move. | |
Public Attributes | |
| FMPmr::vector< int > | delta_gain_w |
| Delta gain values for each partition. | |
| FMPmr::vector< node_t > | idx_vec |
| Index vector for net vertex enumeration. | |
| bool | special_handle_2pin_nets {true} |
| Whether to use special handling for 2-pin nets (optimization) | |
Friends | |
| class | FMKWayGainMgr< Gnl > |
K-Way Fiduccia-Mattheyses Gain Calculator.
The FMKWayGainCalc class computes gain values for k-way partitioning. It tracks gain values for each vertex in each partition based on the number of nets that would become internal (gain) or external (loss) when moving a vertex between partitions.
| Gnl | The hypergraph type |
| using FMKWayGainCalc< Gnl >::ret_info = std::vector<std::vector<int> > |
|
inline |
Constructs a new FMKWayGainCalc object.
| [in] | hyprgraph | The netlist. |
| [in] | num_parts | The number of partitions. |
|
inline |
Initializes the FMKWayGainCalc object.
This function resets the total cost, initializes the vertex list and init gain list to 0, and then calls the _init_gain function for each net in the hypergraph.
| [in] | part | The partition to initialize. |
| void FMKWayGainCalc< Gnl >::init_idx_vec | ( | const node_t & | v, |
| const node_t & | net | ||
| ) |
Initializes the index vector for a given vertex and net.
This function is used to initialize the index vector for a vertex within a net. It is likely an implementation detail of the FMKWayGainCalc class.
| [in] | v | The vertex to initialize the index vector for. |
| [in] | net | The net that the vertex belongs to. |
| auto FMKWayGainCalc< Gnl >::update_move_2pin_net | ( | std::span< const std::uint8_t > | part, |
| const MoveInfo< node_t > & | move_info | ||
| ) | -> node_t |
Updates the gain for a 2-pin net after a move.
This function updates the gain for a 2-pin net after a move has been performed. It takes the current partition and the move information as input, and returns the updated gain for the net.
| [in] | part | The current partition. |
| [in] | move_info | The information about the move that was performed. |
| auto FMKWayGainCalc< Gnl >::update_move_3pin_net | ( | std::span< const std::uint8_t > | part, |
| const MoveInfo< node_t > & | move_info | ||
| ) | -> ret_info |
Updates the gain for a 3-pin net after a move.
This function updates the gain for a 3-pin net after a move has been performed. It takes the current partition and the move information as input, and returns the updated gain for the net.
| [in] | part | The current partition. |
| [in] | move_info | The information about the move that was performed. |
| auto FMKWayGainCalc< Gnl >::update_move_general_net | ( | std::span< const std::uint8_t > | part, |
| const MoveInfo< node_t > & | move_info | ||
| ) | -> ret_info |
Updates the gain for a general net after a move.
This function updates the gain for a general net (with any number of pins) after a move has been performed. It takes the current partition and the move information as input, and returns the updated gain for the net.
| [in] | part | The current partition. |
| [in] | move_info | The information about the move that was performed. |
| auto FMKWayGainCalc< Gnl >::update_move_init | ( | ) | -> void |
Resets the delta gain vector to 0.
This function is used to initialize the delta gain vector before updating the gains for a move.
|
friend |
| FMPmr::vector<int> FMKWayGainCalc< Gnl >::delta_gain_w |
Delta gain values for each partition.
| FMPmr::vector<node_t> FMKWayGainCalc< Gnl >::idx_vec |
Index vector for net vertex enumeration.
| bool FMKWayGainCalc< Gnl >::special_handle_2pin_nets {true} |
Whether to use special handling for 2-pin nets (optimization)