Skip to content

Commit 2232cd4

Browse files
[Packer] Updated Comments
Updated comments based on Vaughn's feedback.
1 parent 96322ff commit 2232cd4

File tree

4 files changed

+56
-13
lines changed

4 files changed

+56
-13
lines changed

vpr/src/pack/cluster_util.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,9 +1879,6 @@ void print_pb_type_count_recurr(t_pb_type* pb_type, size_t max_name_chars, size_
18791879
}
18801880
}
18811881

1882-
/**
1883-
* Print the total number of used physical blocks for each pb type in the architecture
1884-
*/
18851882
void print_pb_type_count(const ClusteredNetlist& clb_nlist) {
18861883
auto& device_ctx = g_vpr_ctx.device();
18871884

vpr/src/pack/cluster_util.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,9 @@ void update_le_count(const t_pb* pb, const t_logical_block_type_ptr logic_block_
481481

482482
void print_pb_type_count_recurr(t_pb_type* type, size_t max_name_chars, size_t curr_depth, std::map<t_pb_type*, int>& pb_type_count);
483483

484+
/**
485+
* Print the total number of used physical blocks for each pb type in the architecture
486+
*/
484487
void print_pb_type_count(const ClusteredNetlist& clb_nlist);
485488

486489
/*

vpr/src/pack/greedy_clusterer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/**
22
* @file
3-
* @author Vaughn Betz (first revision - VPack), Alexander Marquardt (second revision - T-VPack), Jason Luu (third revision - AAPack)
3+
* @author Vaughn Betz (first revision - VPack),
4+
* Alexander Marquardt (second revision - T-VPack),
5+
* Jason Luu (third revision - AAPack),
6+
* Alex Singer (fourth revision - APPack)
47
* @date June 8, 2011
58
* @brief Main clustering algorithm
69
*

vpr/src/pack/greedy_clusterer.h

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ struct t_packer_opts;
2929
*
3030
* This clusterer generates one cluster at a time by finding candidate molecules
3131
* and selecting the molecule with the highest gain.
32+
*
33+
* The clusterer takes an Atom Netlist which has be pre-packed into pack
34+
* patterns (e.g. carry chains) as input and produces a set of legal clusters
35+
* of these pack molecules as output. Legality here means that it was able to
36+
* find a valid intra-lb route for the inputs of the clusters, through the
37+
* internal molecules, and to the outputs of the clusters.
3238
*/
3339
class GreedyClusterer {
3440
public:
@@ -51,11 +57,20 @@ class GreedyClusterer {
5157
* The architecture to cluster over.
5258
* @param high_fanout_thresholds
5359
* The thresholds for what to consider as a high-fanout net
54-
* for each logical block type.
60+
* for each logical block type. The clusterer will not consider
61+
* nets with fanout higher than this to be important in
62+
* candidate block selection (gain computation).
63+
* A reason for it being per block type is that some blocks,
64+
* like RAMs, have weak gains to other RAM primitives due to
65+
* fairly high fanout address nets, so a higher fanout
66+
* threshold for them is useful in generating a more dense
67+
* packing.
5568
* @param is_clock
5669
* The set of clock nets in the Atom Netlist.
5770
* @param is_global
58-
* The set of global nets in the Atom Netlist.
71+
* The set of global nets in the Atom Netlist. These will be
72+
* routed on special dedicated networks, and hence are less
73+
* relavent to locality / attraction.
5974
*/
6075
GreedyClusterer(const t_packer_opts& packer_opts,
6176
const t_analysis_opts& analysis_opts,
@@ -75,21 +90,30 @@ class GreedyClusterer {
7590
* grow clusters by adding molecules to a cluster.
7691
* @param prepacker
7792
* The prepacker object which contains the pack molecules that
78-
* atoms are pre-packed into before clustering.
93+
* are atoms which are pre-packed before the main clustering
94+
* (due to pack patterns, e.g. carry chains).
7995
* @param allow_unrelated_clustering
8096
* Allows primitives which have no attraction to the given
81-
* cluster to be packed into it.
97+
* cluster to be packed into it. This can lead to a denser
98+
* packing, but tends to be bad for wirelength and timing.
8299
* @param balance_block_type_utilization
83100
* When true, tries to create clusters that balance the logical
84-
* block type utilization.
101+
* block type utilization. This is useful when some primitives
102+
* have multiple logical block types to which they can cluster,
103+
* e.g. multiple sizes of physical RAMs exist on the chip.
85104
* @param attraction_groups
86105
* Information on the attraction groups used during the
87-
* clustering process.
106+
* clustering process. These are groups of primitives that have
107+
* extra attraction to each other; currently they are used to
108+
* guide the clusterer when it must cluster some parts of a
109+
* design densely due to user placement/floorplanning
110+
* constraints. They are created if some floorplan regions are
111+
* overfilled after a clustering attempt.
88112
*
89113
* @return num_used_type_instances
90-
* The number of used logical block types by the clustering.
91-
* This information may be useful when detecting if the
92-
* clustering can fit on the device.
114+
* The number of used logical blocks of each type by the
115+
* clustering. This information may be useful when detecting
116+
* if the clustering can fit on the device.
93117
*/
94118
std::map<t_logical_block_type_ptr, size_t>
95119
do_clustering(ClusterLegalizer& cluster_legalizer,
@@ -109,12 +133,28 @@ class GreedyClusterer {
109133
*/
110134
static constexpr int attraction_groups_max_repeated_molecules_ = 500;
111135

136+
/// @brief The packer options used to configure the clusterer.
112137
const t_packer_opts& packer_opts_;
138+
139+
/// @brief The analysis options used to configure timing analysis within the
140+
/// clusterer.
113141
const t_analysis_opts& analysis_opts_;
142+
143+
/// @brief The atom netlist to cluster over.
114144
const AtomNetlist& atom_netlist_;
145+
146+
/// @brief The device architecture to cluster onto.
115147
const t_arch* arch_ = nullptr;
148+
149+
/// @brief The high-fanout thresholds per logical block type. Used to ignore
150+
/// certain nets when calculating the gain for the next candidate
151+
/// molecule to cluster.
116152
const t_pack_high_fanout_thresholds& high_fanout_thresholds_;
153+
154+
/// @brief A set of atom nets which are considered as clocks.
117155
const std::unordered_set<AtomNetId>& is_clock_;
156+
157+
/// @brief A set of atom nets which are considered as global nets.
118158
const std::unordered_set<AtomNetId>& is_global_;
119159

120160
/// @brief Pre-computed logical block types for each model in the architecture.

0 commit comments

Comments
 (0)