2020#include " vtr_vector.h"
2121
2222/* *
23- * @brief Helper method that computes the seed gain of the give atom block.
23+ * @brief Helper method that computes the seed gain of the given atom block.
2424 *
2525 * The seed_type variable selects which algorithm to use to compute the seed
2626 * gain.
@@ -32,17 +32,22 @@ static inline float get_seed_gain(AtomBlockId blk_id,
3232 const t_molecule_stats& max_molecule_stats,
3333 const vtr::vector<AtomBlockId, float >& atom_criticality) {
3434 switch (seed_type) {
35- // By criticality
35+ // By criticality.
36+ // Intuition: starting a cluster with primitives that have timing-
37+ // critical connections may help timing.
3638 case e_cluster_seed::TIMING:
3739 return atom_criticality[blk_id];
38- // By number of used molecule input pins
40+ // By number of used molecule input pins.
41+ // Intuition: molecules that use more inputs can be difficult to legally
42+ // pack into partially full clusters. Use them as seeds
43+ // instead.
3944 case e_cluster_seed::MAX_INPUTS:
4045 {
4146 const t_pack_molecule* blk_mol = prepacker.get_atom_molecule (blk_id);
4247 const t_molecule_stats molecule_stats = calc_molecule_stats (blk_mol, atom_netlist);
4348 return molecule_stats.num_used_ext_inputs ;
4449 }
45- // By blended gain (criticality and inputs used)
50+ // By blended gain (criticality and inputs used).
4651 case e_cluster_seed::BLEND:
4752 {
4853 // Score seed gain of each block as a weighted sum of timing
@@ -60,24 +65,23 @@ static inline float get_seed_gain(AtomBlockId blk_id,
6065 blend_gain *= (1 + 0.2 * (molecule_stats.num_blocks - 1 ));
6166 return blend_gain;
6267 }
63- // By pins per molecule (i.e. available pins on primitives, not pins in use)
68+ // By pins per molecule (i.e. available pins on primitives, not pins in use).
69+ // Intuition (a weak one): primitive types with more pins might be
70+ // harder to pack.
6471 case e_cluster_seed::MAX_PINS:
72+ {
73+ const t_pack_molecule* blk_mol = prepacker.get_atom_molecule (blk_id);
74+ const t_molecule_stats molecule_stats = calc_molecule_stats (blk_mol, atom_netlist);
75+ return molecule_stats.num_pins ;
76+ }
77+ // By input pins per molecule (i.e. available pins on primitives, not pins in use).
78+ // Intuition (a weak one): primitive types with more input pins might be
79+ // harder to pack.
6580 case e_cluster_seed::MAX_INPUT_PINS:
6681 {
6782 const t_pack_molecule* blk_mol = prepacker.get_atom_molecule (blk_id);
6883 const t_molecule_stats molecule_stats = calc_molecule_stats (blk_mol, atom_netlist);
69-
70- int molecule_pins = 0 ;
71- if (seed_type == e_cluster_seed::MAX_PINS) {
72- // All pins
73- molecule_pins = molecule_stats.num_pins ;
74- } else {
75- VTR_ASSERT (seed_type == e_cluster_seed::MAX_INPUT_PINS);
76- // Input pins only
77- molecule_pins = molecule_stats.num_input_pins ;
78- }
79-
80- return molecule_pins;
84+ return molecule_stats.num_input_pins ;
8185 }
8286 case e_cluster_seed::BLEND2:
8387 {
0 commit comments