Skip to content

Commit f8d8330

Browse files
[SQUASH ME] Removed helper context
1 parent d2eb199 commit f8d8330

File tree

5 files changed

+17
-31
lines changed

5 files changed

+17
-31
lines changed

vpr/src/base/vpr_api.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,7 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a
360360

361361
fflush(stdout);
362362

363-
auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
364363
auto& device_ctx = g_vpr_ctx.mutable_device();
365-
helper_ctx.lb_type_rr_graphs = vpr_setup->PackerRRGraph;
366364
device_ctx.pad_loc_type = vpr_setup->PlacerOpts.pad_loc_type;
367365
}
368366

@@ -687,7 +685,9 @@ bool vpr_pack(t_vpr_setup& vpr_setup, const t_arch& arch) {
687685

688686
return try_pack(&vpr_setup.PackerOpts, &vpr_setup.AnalysisOpts,
689687
&arch, vpr_setup.user_models,
690-
vpr_setup.library_models, inter_cluster_delay);
688+
vpr_setup.library_models,
689+
vpr_setup.PackerRRGraph,
690+
inter_cluster_delay);
691691
}
692692

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

vpr/src/base/vpr_context.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,6 @@ struct ClusteringContext : public Context {
300300
vtr::vector<ClusterBlockId, std::unordered_set<AtomBlockId>> atoms_lookup;
301301
};
302302

303-
/**
304-
* @brief State relating to helper data structure using in the clustering stage
305-
*
306-
* This should contain helper data structures that are useful in the clustering/packing stage.
307-
* They are encapsulated here as they are useful in clustering and reclustering algorithms that may be used
308-
* in packing or placement stages.
309-
*/
310-
struct ClusteringHelperContext : public Context {
311-
// A vector of routing resource nodes within each of logic cluster_ctx.blocks types [1 .. num_logical_block_type-1]
312-
// FIXME: This is only used for a handoff between the vpr_setup and the packer.
313-
// This can be made cleaner.
314-
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs;
315-
};
316-
317303
/**
318304
* @brief State relating to packing multithreading
319305
*
@@ -691,9 +677,6 @@ class VprContext : public Context {
691677
const ClusteringContext& clustering() const { return clustering_; }
692678
ClusteringContext& mutable_clustering() { return clustering_; }
693679

694-
const ClusteringHelperContext& cl_helper() const { return helper_; }
695-
ClusteringHelperContext& mutable_cl_helper() { return helper_; }
696-
697680
const PlacementContext& placement() const { return placement_; }
698681
PlacementContext& mutable_placement() { return placement_; }
699682

@@ -723,8 +706,6 @@ class VprContext : public Context {
723706
PowerContext power_;
724707

725708
ClusteringContext clustering_;
726-
ClusteringHelperContext helper_;
727-
728709
PlacementContext placement_;
729710
RoutingContext routing_;
730711
FloorplanningContext constraints_;

vpr/src/pack/pack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ bool try_pack(t_packer_opts* packer_opts,
3535
const t_arch* arch,
3636
const t_model* user_models,
3737
const t_model* library_models,
38+
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
3839
float interc_delay) {
3940
const AtomContext& atom_ctx = g_vpr_ctx.atom();
40-
ClusteringHelperContext& helper_ctx = g_vpr_ctx.mutable_cl_helper();
4141
const DeviceContext& device_ctx = g_vpr_ctx.device();
4242

4343
std::unordered_set<AtomNetId> is_clock, is_global;
@@ -112,7 +112,7 @@ bool try_pack(t_packer_opts* packer_opts,
112112
ClusterLegalizer cluster_legalizer(atom_ctx.nlist,
113113
prepacker,
114114
device_ctx.logical_block_types,
115-
helper_ctx.lb_type_rr_graphs,
115+
lb_type_rr_graphs,
116116
num_models,
117117
packer_opts->target_external_pin_util,
118118
high_fanout_thresholds,

vpr/src/pack/pack.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
#define PACK_H
33

44
#include <unordered_set>
5+
#include <vector>
56

67
class AtomNetId;
78
struct t_analysis_opts;
89
struct t_arch;
10+
struct t_lb_type_rr_node;
911
struct t_model;
1012
struct t_packer_opts;
1113

@@ -14,6 +16,7 @@ bool try_pack(t_packer_opts* packer_opts,
1416
const t_arch* arch,
1517
const t_model* user_models,
1618
const t_model* library_models,
19+
std::vector<t_lb_type_rr_node>* lb_type_rr_graphs,
1720
float interc_delay);
1821

1922
float get_arch_switch_info(short switch_index, int switch_fanin, float& Tdel_switch, float& R_switch, float& Cout_switch);

vpr/src/pack/re_cluster_util.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ void remove_mol_from_cluster(const t_pack_molecule* molecule,
5656
int molecule_size,
5757
ClusterBlockId& old_clb,
5858
std::unordered_set<AtomBlockId>& old_clb_atoms,
59-
bool router_data_ready,
60-
t_lb_router_data*& router_data) {
61-
auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
59+
bool /*router_data_ready*/,
60+
t_lb_router_data*& /*router_data*/) {
61+
// auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
6262

6363
for (int i_atom = 0; i_atom < molecule_size; i_atom++) {
6464
if (molecule->atom_block_ids[i_atom]) {
@@ -69,8 +69,10 @@ void remove_mol_from_cluster(const t_pack_molecule* molecule,
6969
}
7070

7171
//re-build router_data structure for this cluster
72+
/*
7273
if (!router_data_ready)
7374
router_data = lb_load_router_data(helper_ctx.lb_type_rr_graphs, old_clb, old_clb_atoms);
75+
*/
7476

7577
update_cluster_pb_stats(molecule, molecule_size, old_clb, false);
7678
}
@@ -127,7 +129,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule,
127129
int /*force_site*/) {
128130
auto& atom_ctx = g_vpr_ctx.atom();
129131
auto& floorplanning_ctx = g_vpr_ctx.mutable_floorplanning();
130-
auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
132+
// auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
131133
auto& cluster_ctx = g_vpr_ctx.mutable_clustering();
132134

133135
/* Cluster's PartitionRegion is empty initially, meaning it has no floorplanning constraints */
@@ -146,7 +148,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule,
146148
// alloc_and_load_pb_stats(pb, feasible_block_array_size);
147149
pb->parent_pb = nullptr;
148150

149-
*router_data = alloc_and_load_router_data(&(helper_ctx.lb_type_rr_graphs[type->index]), type);
151+
// *router_data = alloc_and_load_router_data(&(helper_ctx.lb_type_rr_graphs[type->index]), type);
150152

151153
e_block_pack_status pack_result = e_block_pack_status::BLK_STATUS_UNDEFINED;
152154
pb->mode = mode;
@@ -229,7 +231,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule,
229231
bool /*enable_pin_feasibility_filter*/,
230232
int /*force_site*/) {
231233

232-
auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
234+
// auto& helper_ctx = g_vpr_ctx.mutable_cl_helper();
233235
auto& cluster_ctx = g_vpr_ctx.mutable_clustering();
234236

235237
// NocGroupId temp_cluster_noc_grp_id;
@@ -247,7 +249,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule,
247249
*/
248250

249251
//re-build router_data structure for this cluster
250-
router_data = lb_load_router_data(helper_ctx.lb_type_rr_graphs, new_clb, new_clb_atoms);
252+
// router_data = lb_load_router_data(helper_ctx.lb_type_rr_graphs, new_clb, new_clb_atoms);
251253

252254
/*
253255
pack_result = try_pack_molecule(nullptr, // &(helper_ctx.cluster_placement_stats[block_type->index]),

0 commit comments

Comments
 (0)