Skip to content

Commit a31fe80

Browse files
don't consider constant net candidates when NoC is enabled
1 parent 3db9060 commit a31fe80

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

vpr/src/pack/cluster.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
9797
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
9898
AttractionInfo& attraction_groups,
9999
bool& floorplan_regions_overfull,
100-
t_clustering_data& clustering_data) {
100+
t_clustering_data& clustering_data,
101+
bool noc_enabled) {
101102
/* Does the actual work of clustering multiple netlist blocks *
102103
* into clusters. */
103104

@@ -290,7 +291,8 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
290291
high_fanout_threshold,
291292
*timing_info,
292293
attraction_groups,
293-
net_output_feeds_driving_block_input);
294+
net_output_feeds_driving_block_input,
295+
noc_enabled);
294296
helper_ctx.total_clb_num++;
295297

296298
if (packer_opts.timing_driven) {
@@ -363,7 +365,8 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
363365
clustering_data.unclustered_list_head,
364366
unclustered_list_head_size,
365367
net_output_feeds_driving_block_input,
366-
primitive_candidate_block_types);
368+
primitive_candidate_block_types,
369+
noc_enabled);
367370
}
368371

369372
is_cluster_legal = check_cluster_legality(verbosity, detailed_routing_stage, router_data);

vpr/src/pack/cluster.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
2424
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
2525
AttractionInfo& attraction_groups,
2626
bool& floorplan_regions_overfull,
27-
t_clustering_data& clustering_data);
27+
t_clustering_data& clustering_data,
28+
bool noc_enabled);
2829

2930
int get_cluster_of_block(int blkidx);
3031

vpr/src/pack/cluster_util.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,8 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
15071507
t_molecule_link* unclustered_list_head,
15081508
const int& unclustered_list_head_size,
15091509
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
1510-
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types) {
1510+
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types,
1511+
bool noc_enabled) {
15111512
auto& atom_ctx = g_vpr_ctx.atom();
15121513
auto& device_ctx = g_vpr_ctx.mutable_device();
15131514
auto& cluster_ctx = g_vpr_ctx.mutable_clustering();
@@ -1601,7 +1602,8 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
16011602
high_fanout_threshold,
16021603
*timing_info,
16031604
attraction_groups,
1604-
net_output_feeds_driving_block_input);
1605+
net_output_feeds_driving_block_input,
1606+
noc_enabled);
16051607
cluster_stats.num_unrelated_clustering_attempts = 0;
16061608

16071609
if (packer_opts.timing_driven) {
@@ -1763,7 +1765,8 @@ void mark_and_update_partial_gain(const AtomNetId net_id,
17631765
const SetupTimingInfo& timing_info,
17641766
const std::unordered_set<AtomNetId>& is_global,
17651767
const int high_fanout_net_threshold,
1766-
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input) {
1768+
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
1769+
bool noc_enabled) {
17671770
/* Updates the marked data structures, and if gain_flag is GAIN, *
17681771
* the gain when an atom block is added to a cluster. The *
17691772
* sharinggain is the number of inputs that a atom block shares with *
@@ -1783,7 +1786,7 @@ void mark_and_update_partial_gain(const AtomNetId net_id,
17831786
/* There are VCC and GND nets in the netlist. These nets have a high fanout,
17841787
* but their sinks do not necessarily have a logical relation with each other.
17851788
* Therefore, we exclude constant nets when evaluating high fanout connectivity. */
1786-
if (!is_global.count(net_id)) {
1789+
if (!is_global.count(net_id) && (!noc_enabled || !atom_ctx.nlist.net_is_constant(net_id))) {
17871790
/* If no low/medium fanout nets, we may need to consider
17881791
* high fan-out nets for packing, so select one and store it */
17891792
AtomNetId stored_net = cur_pb->pb_stats->tie_break_high_fanout_net;
@@ -1919,7 +1922,8 @@ void update_cluster_stats(const t_pack_molecule* molecule,
19191922
const int high_fanout_net_threshold,
19201923
const SetupTimingInfo& timing_info,
19211924
AttractionInfo& attraction_groups,
1922-
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input) {
1925+
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
1926+
bool noc_enabled) {
19231927
/* Routine that is called each time a new molecule is added to the cluster.
19241928
* Makes calls to update cluster stats such as the gain map for atoms, used pins, and clock structures,
19251929
* in order to reflect the new content of the cluster.
@@ -1976,15 +1980,17 @@ void update_cluster_stats(const t_pack_molecule* molecule,
19761980
timing_info,
19771981
is_global,
19781982
high_fanout_net_threshold,
1979-
net_output_feeds_driving_block_input);
1983+
net_output_feeds_driving_block_input,
1984+
noc_enabled);
19801985
} else {
19811986
mark_and_update_partial_gain(net_id, NO_GAIN, blk_id,
19821987
timing_driven,
19831988
connection_driven, OUTPUT,
19841989
timing_info,
19851990
is_global,
19861991
high_fanout_net_threshold,
1987-
net_output_feeds_driving_block_input);
1992+
net_output_feeds_driving_block_input,
1993+
noc_enabled);
19881994
}
19891995
}
19901996

@@ -1997,7 +2003,8 @@ void update_cluster_stats(const t_pack_molecule* molecule,
19972003
timing_info,
19982004
is_global,
19992005
high_fanout_net_threshold,
2000-
net_output_feeds_driving_block_input);
2006+
net_output_feeds_driving_block_input,
2007+
noc_enabled);
20012008
}
20022009

20032010
/* Finally Clocks */
@@ -2009,14 +2016,16 @@ void update_cluster_stats(const t_pack_molecule* molecule,
20092016
timing_info,
20102017
is_global,
20112018
high_fanout_net_threshold,
2012-
net_output_feeds_driving_block_input);
2019+
net_output_feeds_driving_block_input,
2020+
noc_enabled);
20132021
} else {
20142022
mark_and_update_partial_gain(net_id, GAIN, blk_id,
20152023
timing_driven, connection_driven, INPUT,
20162024
timing_info,
20172025
is_global,
20182026
high_fanout_net_threshold,
2019-
net_output_feeds_driving_block_input);
2027+
net_output_feeds_driving_block_input,
2028+
noc_enabled);
20202029
}
20212030
}
20222031

vpr/src/pack/cluster_util.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
242242
t_molecule_link* unclustered_list_head,
243243
const int& unclustered_list_head_size,
244244
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
245-
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types);
245+
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types,
246+
bool noc_enabled);
246247

247248
t_pack_molecule* save_cluster_routing_and_pick_new_seed(const t_packer_opts& packer_opts,
248249
const int& num_clb,
@@ -305,7 +306,8 @@ void mark_and_update_partial_gain(const AtomNetId net_id,
305306
const SetupTimingInfo& timing_info,
306307
const std::unordered_set<AtomNetId>& is_global,
307308
const int high_fanout_net_threshold,
308-
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input);
309+
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
310+
bool noc_enabled);
309311

310312
void update_total_gain(float alpha, float beta, bool timing_driven, bool connection_driven, t_pb* pb, AttractionInfo& attraction_groups);
311313

@@ -321,7 +323,8 @@ void update_cluster_stats(const t_pack_molecule* molecule,
321323
const int high_fanout_net_threshold,
322324
const SetupTimingInfo& timing_info,
323325
AttractionInfo& attraction_groups,
324-
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input);
326+
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
327+
bool noc_enabled);
325328

326329
void start_new_cluster(t_cluster_placement_stats* cluster_placement_stats,
327330
t_pb_graph_node** primitives_list,

vpr/src/pack/pack.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ bool try_pack(t_packer_opts* packer_opts,
177177
lb_type_rr_graphs,
178178
attraction_groups,
179179
floorplan_regions_overfull,
180-
clustering_data);
180+
clustering_data,
181+
noc_enabled);
181182

182183
//Try to size/find a device
183184
bool fits_on_device = try_size_device_grid(*arch, helper_ctx.num_used_type_instances, packer_opts->target_device_utilization, packer_opts->device_layout);

0 commit comments

Comments
 (0)