Skip to content

Commit 375db58

Browse files
Reverted packing optimizations for NoC benchmarks
1 parent e4ff934 commit 375db58

File tree

8 files changed

+33
-147
lines changed

8 files changed

+33
-147
lines changed

vpr/src/base/vpr_api.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,7 @@ bool vpr_pack(t_vpr_setup& vpr_setup, const t_arch& arch) {
659659
return try_pack(&vpr_setup.PackerOpts, &vpr_setup.AnalysisOpts,
660660
&arch, vpr_setup.user_models,
661661
vpr_setup.library_models, inter_cluster_delay,
662-
vpr_setup.PackerRRGraph,
663-
vpr_setup.NocOpts.noc);
662+
vpr_setup.PackerRRGraph);
664663
}
665664

666665
void vpr_load_packing(t_vpr_setup& vpr_setup, const t_arch& arch) {

vpr/src/pack/cluster.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,12 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
9191
const std::unordered_set<AtomNetId>& is_clock,
9292
const std::unordered_set<AtomNetId>& is_global,
9393
const std::unordered_map<AtomBlockId, t_pb_graph_node*>& expected_lowest_cost_pb_gnode,
94-
bool allow_high_fanout_connectivity_clustering,
9594
bool allow_unrelated_clustering,
9695
bool balance_block_type_utilization,
9796
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
9897
AttractionInfo& attraction_groups,
9998
bool& floorplan_regions_overfull,
100-
t_clustering_data& clustering_data,
101-
bool noc_enabled) {
99+
t_clustering_data& clustering_data) {
102100
/* Does the actual work of clustering multiple netlist blocks *
103101
* into clusters. */
104102

@@ -291,8 +289,7 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
291289
high_fanout_threshold,
292290
*timing_info,
293291
attraction_groups,
294-
net_output_feeds_driving_block_input,
295-
noc_enabled);
292+
net_output_feeds_driving_block_input);
296293
helper_ctx.total_clb_num++;
297294

298295
if (packer_opts.timing_driven) {
@@ -304,7 +301,6 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
304301
cluster_stats.num_unrelated_clustering_attempts = 0;
305302
next_molecule = get_molecule_for_cluster(cluster_ctx.clb_nlist.block_pb(clb_index),
306303
attraction_groups,
307-
allow_high_fanout_connectivity_clustering,
308304
allow_unrelated_clustering,
309305
packer_opts.prioritize_transitive_connectivity,
310306
packer_opts.transitive_fanout_threshold,
@@ -352,7 +348,6 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
352348
detailed_routing_stage,
353349
attraction_groups,
354350
clb_inter_blk_nets,
355-
allow_high_fanout_connectivity_clustering,
356351
allow_unrelated_clustering,
357352
high_fanout_threshold,
358353
is_clock,
@@ -365,8 +360,7 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
365360
clustering_data.unclustered_list_head,
366361
unclustered_list_head_size,
367362
net_output_feeds_driving_block_input,
368-
primitive_candidate_block_types,
369-
noc_enabled);
363+
primitive_candidate_block_types);
370364
}
371365

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

vpr/src/pack/cluster.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ std::map<t_logical_block_type_ptr, size_t> do_clustering(const t_packer_opts& pa
1818
const std::unordered_set<AtomNetId>& is_clock,
1919
const std::unordered_set<AtomNetId>& is_global,
2020
const std::unordered_map<AtomBlockId, t_pb_graph_node*>& expected_lowest_cost_pb_gnode,
21-
bool allow_high_fanout_connectivity_clustering,
2221
bool allow_unrelated_clustering,
2322
bool balance_block_type_utilization,
2423
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
2524
AttractionInfo& attraction_groups,
2625
bool& floorplan_regions_overfull,
27-
t_clustering_data& clustering_data,
28-
bool noc_enabled);
26+
t_clustering_data& clustering_data);
2927

3028
int get_cluster_of_block(int blkidx);
3129

vpr/src/pack/cluster_util.cpp

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,6 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
14941494
const int detailed_routing_stage,
14951495
AttractionInfo& attraction_groups,
14961496
vtr::vector<ClusterBlockId, std::vector<AtomNetId>>& clb_inter_blk_nets,
1497-
bool allow_high_fanout_connectivity_clustering,
14981497
bool allow_unrelated_clustering,
14991498
const int& high_fanout_threshold,
15001499
const std::unordered_set<AtomNetId>& is_clock,
@@ -1507,8 +1506,7 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
15071506
t_molecule_link* unclustered_list_head,
15081507
const int& unclustered_list_head_size,
15091508
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,
1511-
bool noc_enabled) {
1509+
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types) {
15121510
auto& atom_ctx = g_vpr_ctx.atom();
15131511
auto& device_ctx = g_vpr_ctx.mutable_device();
15141512
auto& cluster_ctx = g_vpr_ctx.mutable_clustering();
@@ -1556,7 +1554,6 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
15561554

15571555
next_molecule = get_molecule_for_cluster(cluster_ctx.clb_nlist.block_pb(clb_index),
15581556
attraction_groups,
1559-
allow_high_fanout_connectivity_clustering,
15601557
allow_unrelated_clustering,
15611558
packer_opts.prioritize_transitive_connectivity,
15621559
packer_opts.transitive_fanout_threshold,
@@ -1602,16 +1599,14 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
16021599
high_fanout_threshold,
16031600
*timing_info,
16041601
attraction_groups,
1605-
net_output_feeds_driving_block_input,
1606-
noc_enabled);
1602+
net_output_feeds_driving_block_input);
16071603
cluster_stats.num_unrelated_clustering_attempts = 0;
16081604

16091605
if (packer_opts.timing_driven) {
16101606
cluster_stats.blocks_since_last_analysis++; /* historically, timing slacks were recomputed after X number of blocks were packed, but this doesn't significantly alter results so I (jluu) did not port the code */
16111607
}
16121608
next_molecule = get_molecule_for_cluster(cluster_ctx.clb_nlist.block_pb(clb_index),
16131609
attraction_groups,
1614-
allow_high_fanout_connectivity_clustering,
16151610
allow_unrelated_clustering,
16161611
packer_opts.prioritize_transitive_connectivity,
16171612
packer_opts.transitive_fanout_threshold,
@@ -1765,8 +1760,7 @@ void mark_and_update_partial_gain(const AtomNetId net_id,
17651760
const SetupTimingInfo& timing_info,
17661761
const std::unordered_set<AtomNetId>& is_global,
17671762
const int high_fanout_net_threshold,
1768-
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
1769-
bool noc_enabled) {
1763+
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input) {
17701764
/* Updates the marked data structures, and if gain_flag is GAIN, *
17711765
* the gain when an atom block is added to a cluster. The *
17721766
* sharinggain is the number of inputs that a atom block shares with *
@@ -1783,10 +1777,7 @@ void mark_and_update_partial_gain(const AtomNetId net_id,
17831777
/* Optimization: It can be too runtime costly for marking all sinks for
17841778
* a high fanout-net that probably has no hope of ever getting packed,
17851779
* thus ignore those high fanout nets */
1786-
/* There are VCC and GND nets in the netlist. These nets have a high fanout,
1787-
* but their sinks do not necessarily have a logical relation with each other.
1788-
* Therefore, we exclude constant nets when evaluating high fanout connectivity. */
1789-
if (!is_global.count(net_id) && (!noc_enabled || !atom_ctx.nlist.net_is_constant(net_id))) {
1780+
if (!is_global.count(net_id)) {
17901781
/* If no low/medium fanout nets, we may need to consider
17911782
* high fan-out nets for packing, so select one and store it */
17921783
AtomNetId stored_net = cur_pb->pb_stats->tie_break_high_fanout_net;
@@ -1922,8 +1913,7 @@ void update_cluster_stats(const t_pack_molecule* molecule,
19221913
const int high_fanout_net_threshold,
19231914
const SetupTimingInfo& timing_info,
19241915
AttractionInfo& attraction_groups,
1925-
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input,
1926-
bool noc_enabled) {
1916+
std::unordered_map<AtomNetId, int>& net_output_feeds_driving_block_input) {
19271917
/* Routine that is called each time a new molecule is added to the cluster.
19281918
* Makes calls to update cluster stats such as the gain map for atoms, used pins, and clock structures,
19291919
* in order to reflect the new content of the cluster.
@@ -1980,17 +1970,15 @@ void update_cluster_stats(const t_pack_molecule* molecule,
19801970
timing_info,
19811971
is_global,
19821972
high_fanout_net_threshold,
1983-
net_output_feeds_driving_block_input,
1984-
noc_enabled);
1973+
net_output_feeds_driving_block_input);
19851974
} else {
19861975
mark_and_update_partial_gain(net_id, NO_GAIN, blk_id,
19871976
timing_driven,
19881977
connection_driven, OUTPUT,
19891978
timing_info,
19901979
is_global,
19911980
high_fanout_net_threshold,
1992-
net_output_feeds_driving_block_input,
1993-
noc_enabled);
1981+
net_output_feeds_driving_block_input);
19941982
}
19951983
}
19961984

@@ -2003,8 +1991,7 @@ void update_cluster_stats(const t_pack_molecule* molecule,
20031991
timing_info,
20041992
is_global,
20051993
high_fanout_net_threshold,
2006-
net_output_feeds_driving_block_input,
2007-
noc_enabled);
1994+
net_output_feeds_driving_block_input);
20081995
}
20091996

20101997
/* Finally Clocks */
@@ -2016,16 +2003,14 @@ void update_cluster_stats(const t_pack_molecule* molecule,
20162003
timing_info,
20172004
is_global,
20182005
high_fanout_net_threshold,
2019-
net_output_feeds_driving_block_input,
2020-
noc_enabled);
2006+
net_output_feeds_driving_block_input);
20212007
} else {
20222008
mark_and_update_partial_gain(net_id, GAIN, blk_id,
20232009
timing_driven, connection_driven, INPUT,
20242010
timing_info,
20252011
is_global,
20262012
high_fanout_net_threshold,
2027-
net_output_feeds_driving_block_input,
2028-
noc_enabled);
2013+
net_output_feeds_driving_block_input);
20292014
}
20302015
}
20312016

@@ -2216,7 +2201,6 @@ t_pack_molecule* get_highest_gain_molecule(t_pb* cur_pb,
22162201
vtr::vector<ClusterBlockId, std::vector<AtomNetId>>& clb_inter_blk_nets,
22172202
const ClusterBlockId cluster_index,
22182203
bool prioritize_transitive_connectivity,
2219-
bool allow_high_fanout_connectivity_clustering,
22202204
int transitive_fanout_threshold,
22212205
const int feasible_block_array_size,
22222206
std::map<const t_model*, std::vector<t_logical_block_type_ptr>>& primitive_candidate_block_types) {
@@ -2243,12 +2227,12 @@ t_pack_molecule* get_highest_gain_molecule(t_pb* cur_pb,
22432227
}
22442228

22452229
// 3. Find unpacked molecules based on weak connectedness (connected by high fanout nets) with current cluster
2246-
if (cur_pb->pb_stats->num_feasible_blocks == 0 && cur_pb->pb_stats->tie_break_high_fanout_net && allow_high_fanout_connectivity_clustering) {
2230+
if (cur_pb->pb_stats->num_feasible_blocks == 0 && cur_pb->pb_stats->tie_break_high_fanout_net) {
22472231
add_cluster_molecule_candidates_by_highfanout_connectivity(cur_pb, cluster_placement_stats_ptr, feasible_block_array_size, attraction_groups);
22482232
}
22492233
} else { //Reverse order
22502234
// 3. Find unpacked molecules based on weak connectedness (connected by high fanout nets) with current cluster
2251-
if (cur_pb->pb_stats->num_feasible_blocks == 0 && cur_pb->pb_stats->tie_break_high_fanout_net && allow_high_fanout_connectivity_clustering) {
2235+
if (cur_pb->pb_stats->num_feasible_blocks == 0 && cur_pb->pb_stats->tie_break_high_fanout_net) {
22522236
add_cluster_molecule_candidates_by_highfanout_connectivity(cur_pb, cluster_placement_stats_ptr, feasible_block_array_size, attraction_groups);
22532237
}
22542238

@@ -2521,7 +2505,6 @@ bool check_free_primitives_for_molecule_atoms(t_pack_molecule* molecule, t_clust
25212505
/*****************************************/
25222506
t_pack_molecule* get_molecule_for_cluster(t_pb* cur_pb,
25232507
AttractionInfo& attraction_groups,
2524-
const bool allow_high_fanout_connectivity_clustering,
25252508
const bool allow_unrelated_clustering,
25262509
const bool prioritize_transitive_connectivity,
25272510
const int transitive_fanout_threshold,
@@ -2545,7 +2528,7 @@ t_pack_molecule* get_molecule_for_cluster(t_pb* cur_pb,
25452528

25462529
auto best_molecule = get_highest_gain_molecule(cur_pb, attraction_groups,
25472530
NOT_HILL_CLIMBING, cluster_placement_stats_ptr, clb_inter_blk_nets,
2548-
cluster_index, prioritize_transitive_connectivity, allow_high_fanout_connectivity_clustering,
2531+
cluster_index, prioritize_transitive_connectivity,
25492532
transitive_fanout_threshold, feasible_block_array_size, primitive_candidate_block_types);
25502533

25512534
/* If no blocks have any gain to the current cluster, the code above *

0 commit comments

Comments
 (0)