20
20
#include " vtr_vector.h"
21
21
22
22
/* *
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.
24
24
*
25
25
* The seed_type variable selects which algorithm to use to compute the seed
26
26
* gain.
@@ -32,17 +32,22 @@ static inline float get_seed_gain(AtomBlockId blk_id,
32
32
const t_molecule_stats& max_molecule_stats,
33
33
const vtr::vector<AtomBlockId, float >& atom_criticality) {
34
34
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.
36
38
case e_cluster_seed::TIMING:
37
39
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.
39
44
case e_cluster_seed::MAX_INPUTS:
40
45
{
41
46
const t_pack_molecule* blk_mol = prepacker.get_atom_molecule (blk_id);
42
47
const t_molecule_stats molecule_stats = calc_molecule_stats (blk_mol, atom_netlist);
43
48
return molecule_stats.num_used_ext_inputs ;
44
49
}
45
- // By blended gain (criticality and inputs used)
50
+ // By blended gain (criticality and inputs used).
46
51
case e_cluster_seed::BLEND:
47
52
{
48
53
// 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,
60
65
blend_gain *= (1 + 0.2 * (molecule_stats.num_blocks - 1 ));
61
66
return blend_gain;
62
67
}
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.
64
71
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.
65
80
case e_cluster_seed::MAX_INPUT_PINS:
66
81
{
67
82
const t_pack_molecule* blk_mol = prepacker.get_atom_molecule (blk_id);
68
83
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 ;
81
85
}
82
86
case e_cluster_seed::BLEND2:
83
87
{
0 commit comments