Skip to content

Commit f778c87

Browse files
remove exclusivity_index and fix some typos
1 parent 895e34f commit f778c87

File tree

6 files changed

+20
-56
lines changed

6 files changed

+20
-56
lines changed

vpr/src/base/partition_region.cpp

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,6 @@ bool PartitionRegion::is_loc_in_part_reg(const t_pl_loc& loc) const {
3636
return is_in_pr;
3737
}
3838

39-
int PartitionRegion::get_exclusivity_index() const {
40-
return exclusivity_index;
41-
}
42-
43-
void PartitionRegion::set_exclusivity_index(int index) {
44-
/* negative exclusivity index means this PartitionRegion is compatible
45-
* with other PartitionsRegions as long as the intersection of their
46-
* regions is not empty.
47-
*/
48-
if (index < 0) {
49-
index = -1;
50-
}
51-
52-
exclusivity_index = index;
53-
}
54-
5539
PartitionRegion intersection(const PartitionRegion& cluster_pr, const PartitionRegion& new_pr) {
5640
/**for N regions in part_region and M in the calling object you can get anywhere from
5741
* 0 to M*N regions in the resulting vector. Only intersection regions with non-zero area rectangles and
@@ -60,14 +44,6 @@ PartitionRegion intersection(const PartitionRegion& cluster_pr, const PartitionR
6044
*/
6145
PartitionRegion pr;
6246

63-
const int cluster_exclusivity = cluster_pr.get_exclusivity_index();
64-
const int new_exclusivity = new_pr.get_exclusivity_index();
65-
66-
// PartitionRegion are not compatible even if their regions overlap
67-
if (cluster_exclusivity != new_exclusivity) {
68-
return pr;
69-
}
70-
7147
auto& pr_regions = pr.get_mutable_regions();
7248

7349
for (const auto& cluster_region : cluster_pr.get_regions()) {
@@ -85,19 +61,12 @@ PartitionRegion intersection(const PartitionRegion& cluster_pr, const PartitionR
8561
void update_cluster_part_reg(PartitionRegion& cluster_pr, const PartitionRegion& new_pr) {
8662
std::vector<Region> int_regions;
8763

88-
const int cluster_exclusivity = cluster_pr.get_exclusivity_index();
89-
const int new_exclusivity = new_pr.get_exclusivity_index();
90-
91-
// check whether PartitionRegions are compatible in the first place
92-
if (cluster_exclusivity == new_exclusivity) {
93-
94-
// now that we know PartitionRegions are compatible, look for overlapping regions
95-
for (const auto& cluster_region : cluster_pr.get_regions()) {
96-
for (const auto& new_region : new_pr.get_regions()) {
97-
Region intersect_region = intersection(cluster_region, new_region);
98-
if (!intersect_region.empty()) {
99-
int_regions.push_back(intersect_region);
100-
}
64+
// now that we know PartitionRegions are compatible, look for overlapping regions
65+
for (const auto& cluster_region : cluster_pr.get_regions()) {
66+
for (const auto& new_region : new_pr.get_regions()) {
67+
Region intersect_region = intersection(cluster_region, new_region);
68+
if (!intersect_region.empty()) {
69+
int_regions.push_back(intersect_region);
10170
}
10271
}
10372
}

vpr/src/base/partition_region.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,8 @@ class PartitionRegion {
5050
*/
5151
bool is_loc_in_part_reg(const t_pl_loc& loc) const;
5252

53-
int get_exclusivity_index() const;
54-
55-
void set_exclusivity_index(int index);
56-
5753
private:
5854
std::vector<Region> regions; ///< union of rectangular regions that a partition can be placed in
59-
int exclusivity_index = -1; ///< PartitionRegions with different exclusivity_index values are not compatible
6055
};
6156

6257
///@brief used to print data from a PartitionRegion

vpr/src/base/setup_noc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void create_noc_routers(const t_noc_inf& noc_info, NocStorage* noc_model, std::v
139139
double curr_logical_router_position_x;
140140
double curr_logical_router_position_y;
141141

142-
// keep track of the index of each physical router (this helps uniqely identify them)
142+
// keep track of the index of each physical router (this helps uniquely identify them)
143143
int curr_physical_router_index = 0;
144144

145145
// keep track of the ids of the routers that create the case where multiple routers have the same distance to a physical router tile
@@ -153,7 +153,7 @@ void create_noc_routers(const t_noc_inf& noc_info, NocStorage* noc_model, std::v
153153

154154
// Below we create all the routers within the NoC //
155155

156-
// go through each user desctibed router in the arch file and assign it to a physical router on the FPGA
156+
// go through each user described router in the arch file and assign it to a physical router on the FPGA
157157
for (auto logical_router = noc_info.router_list.begin(); logical_router != noc_info.router_list.end(); logical_router++) {
158158
// assign the shortest distance to a large value (this is done so that the first distance calculated and we can replace this)
159159
shortest_distance = LLONG_MAX;
@@ -173,7 +173,7 @@ void create_noc_routers(const t_noc_inf& noc_info, NocStorage* noc_model, std::v
173173
error_case_physical_router_index_2 = INVALID_PHYSICAL_ROUTER_INDEX;
174174

175175
// determine the physical router tile that is closest to the current user described router in the arch file
176-
for (auto & physical_router : noc_router_tiles) {
176+
for (auto& physical_router : noc_router_tiles) {
177177
// get the position of the current physical router tile on the FPGA device
178178
curr_physical_router_pos_x = physical_router.tile_centroid_x;
179179
curr_physical_router_pos_y = physical_router.tile_centroid_y;
@@ -237,7 +237,7 @@ void create_noc_links(const t_noc_inf* noc_info, NocStorage* noc_model) {
237237
noc_model->make_room_for_noc_router_link_list();
238238

239239
// go through each router and add its outgoing links to the NoC
240-
for (const auto & router : noc_info->router_list) {
240+
for (const auto& router : noc_info->router_list) {
241241
// get the converted id of the current source router
242242
source_router = noc_model->convert_router_id(router.id);
243243

vpr/src/pack/attraction_groups.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void AttractionInfo::create_att_groups_for_overfull_regions() {
4949

5050
const auto& overfull_regions = floorplanning_ctx.overfull_regions;
5151
PartitionRegion overfull_regions_pr;
52-
for (const auto & overfull_region : overfull_regions) {
52+
for (const auto& overfull_region : overfull_regions) {
5353
overfull_regions_pr.add_to_part_region(overfull_region);
5454
}
5555
/*

vpr/src/pack/cluster_util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void echo_clusters(char* filename) {
7676
cluster_atoms[clb_index].push_back(atom_blk_id);
7777
}
7878

79-
for (auto & cluster_atom : cluster_atoms) {
79+
for (auto& cluster_atom : cluster_atoms) {
8080
const std::string& cluster_name = cluster_ctx.clb_nlist.block_name(cluster_atom.first);
8181
fprintf(fp, "Cluster %s Id: %zu \n", cluster_name.c_str(), size_t(cluster_atom.first));
8282
fprintf(fp, "\tAtoms in cluster: \n");
@@ -96,7 +96,7 @@ static void echo_clusters(char* filename) {
9696
const std::vector<Region>& regions = floorplanning_ctx.cluster_constraints[clb_id].get_regions();
9797
if (!regions.empty()) {
9898
fprintf(fp, "\nRegions in Cluster %zu:\n", size_t(clb_id));
99-
for (const auto & region : regions) {
99+
for (const auto& region : regions) {
100100
print_region(fp, region);
101101
}
102102
}

vpr/src/place/place_constraints.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool is_macro_constrained(const t_pl_macro& pl_macro) {
4141
bool is_macro_constrained = false;
4242
bool is_member_constrained = false;
4343

44-
for (const auto & member : pl_macro.members) {
44+
for (const auto& member : pl_macro.members) {
4545
ClusterBlockId iblk = member.blk_index;
4646
is_member_constrained = is_cluster_constrained(iblk);
4747

@@ -61,7 +61,7 @@ PartitionRegion update_macro_head_pr(const t_pl_macro& pl_macro, const Partition
6161
int num_constrained_members = 0;
6262
auto& floorplanning_ctx = g_vpr_ctx.floorplanning();
6363

64-
for (const auto & member : pl_macro.members) {
64+
for (const auto& member : pl_macro.members) {
6565
ClusterBlockId iblk = member.blk_index;
6666
is_member_constrained = is_cluster_constrained(iblk);
6767

@@ -75,7 +75,7 @@ PartitionRegion update_macro_head_pr(const t_pl_macro& pl_macro, const Partition
7575
const PartitionRegion& block_pr = floorplanning_ctx.cluster_constraints[iblk];
7676
const std::vector<Region>& block_regions = block_pr.get_regions();
7777

78-
for (const auto & block_region : block_regions) {
78+
for (const auto& block_region : block_regions) {
7979
Region modified_reg;
8080
auto offset = member.offset;
8181

@@ -118,7 +118,7 @@ PartitionRegion update_macro_member_pr(PartitionRegion& head_pr, const t_pl_offs
118118
const std::vector<Region>& block_regions = head_pr.get_regions();
119119
PartitionRegion macro_pr;
120120

121-
for (const auto & block_region : block_regions) {
121+
for (const auto& block_region : block_regions) {
122122
Region modified_reg;
123123

124124
const auto block_reg_coord = block_region.get_region_rect();
@@ -153,7 +153,7 @@ void print_macro_constraint_error(const t_pl_macro& pl_macro) {
153153
VTR_LOG(
154154
"Feasible floorplanning constraints could not be calculated for the placement macro. \n"
155155
"The placement macro contains the following blocks: \n");
156-
for (const auto & member : pl_macro.members) {
156+
for (const auto& member : pl_macro.members) {
157157
std::string blk_name = cluster_ctx.clb_nlist.block_name((member.blk_index));
158158
VTR_LOG("Block %s (#%zu) ", blk_name.c_str(), size_t(member.blk_index));
159159
}
@@ -371,7 +371,7 @@ int region_tile_cover(const Region& reg, t_logical_block_type_ptr block_type, t_
371371
}
372372

373373
/*
374-
* Used when marking fixed blocks to check whether the ParitionRegion associated with a block
374+
* Used when marking fixed blocks to check whether the PartitionRegion associated with a block
375375
* covers one tile. If it covers one tile, it is marked as fixed. If it covers 0 tiles or
376376
* more than one tile, it will not be marked as fixed. As soon as it is known that the
377377
* PartitionRegion covers more than one tile, there is no need to check further regions
@@ -441,7 +441,7 @@ int get_part_reg_size(PartitionRegion& pr, t_logical_block_type_ptr block_type,
441441
const std::vector<Region>& regions = pr.get_regions();
442442
int num_tiles = 0;
443443

444-
for (const auto & region : regions) {
444+
for (const auto& region : regions) {
445445
num_tiles += grid_tiles.region_tile_count(region, block_type);
446446
}
447447

0 commit comments

Comments
 (0)