Skip to content

Commit b958964

Browse files
committed
[vpr][place] remove the parts for reclustering
1 parent 4af56aa commit b958964

23 files changed

+0
-737
lines changed

libs/libarchfpga/src/physical_types_util.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -524,39 +524,6 @@ bool is_sub_tile_compatible(t_physical_tile_type_ptr physical_tile, t_logical_bl
524524
return capacity_compatible && is_tile_compatible(physical_tile, logical_block);
525525
}
526526

527-
bool is_atom_compatible(t_logical_block_type_ptr logical_block, const t_pb_graph_node* atom_pb_graph_node, int loc_primitive_num) {
528-
VTR_ASSERT(loc_primitive_num != OPEN);
529-
const t_pb_graph_node* loc_pb_graph_node = nullptr;
530-
531-
// Check whether the atom
532-
const t_pb_graph_node* parent_pb_graph_node = atom_pb_graph_node->parent_pb_graph_node;
533-
while (parent_pb_graph_node->parent_pb_graph_node != nullptr) {
534-
parent_pb_graph_node = parent_pb_graph_node->parent_pb_graph_node;
535-
}
536-
537-
if (logical_block->pb_graph_head != parent_pb_graph_node) {
538-
return false;
539-
}
540-
/**
541-
* Iterate over the data structure that maps primitive_pb_graph_node to their respective class range,
542-
* and retrieve the primitive_pb_graph_node from that map. If the primitive number assigned to that
543-
* primitive_pb_graph_node is equal to loc_primitive_num, then we have found the desired primitive_pb_graph_node.
544-
*/
545-
for (const auto& primitive_node_class_pair : logical_block->primitive_pb_graph_node_class_range) {
546-
const auto& primitive_node = primitive_node_class_pair.first;
547-
VTR_ASSERT_SAFE(primitive_node->primitive_num != OPEN);
548-
if (primitive_node->primitive_num == loc_primitive_num) {
549-
loc_pb_graph_node = primitive_node;
550-
break;
551-
}
552-
}
553-
VTR_ASSERT_SAFE(loc_pb_graph_node != nullptr);
554-
if (loc_pb_graph_node->pb_type == atom_pb_graph_node->pb_type)
555-
return true;
556-
else
557-
return false;
558-
}
559-
560527
int get_physical_pin_at_sub_tile_location(t_physical_tile_type_ptr physical_tile,
561528
t_logical_block_type_ptr logical_block,
562529
int sub_tile_capacity,

libs/libarchfpga/src/physical_types_util.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ bool is_tile_compatible(t_physical_tile_type_ptr physical_tile, t_logical_block_
187187
///@brief Verifies whether a logical block and a relative placement location is compatible with a given physical tile
188188
bool is_sub_tile_compatible(t_physical_tile_type_ptr physical_tile, t_logical_block_type_ptr logical_block, int sub_tile_loc);
189189

190-
///@brief Verifies whether the given atom_pb_graph_node can be mapped to the primitive that loc_primitive_num is pointing to.
191-
bool is_atom_compatible(t_logical_block_type_ptr logical_block, const t_pb_graph_node* atom_pb_graph_node, int loc_primitive_num);
192-
193190
/**
194191
* @brief Returns the first physical tile type that matches the logical block
195192
*

vpr/src/base/SetupVPR.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts)
693693
PlacerOpts->place_constraint_subtile = Options.place_constraint_subtile;
694694
PlacerOpts->floorplan_num_horizontal_partitions = Options.floorplan_num_horizontal_partitions;
695695
PlacerOpts->floorplan_num_vertical_partitions = Options.floorplan_num_vertical_partitions;
696-
PlacerOpts->place_re_cluster = Options.place_re_cluster;
697696

698697
PlacerOpts->seed = Options.Seed;
699698

vpr/src/base/read_options.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,15 +2200,6 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
22002200
.choices({"move_type", "move_block_type"})
22012201
.show_in(argparse::ShowIn::HELP_ONLY);
22022202

2203-
place_grp.add_argument<bool, ParseOnOff>(args.place_re_cluster, "--place_re_cluster")
2204-
.help(
2205-
"Use this option to determine whether reclustering occurs during placement. "
2206-
""
2207-
"When this option is set to 'on,' the placement stage may change some clusters. "
2208-
"Conversely, if the option is set to 'off,' the clustering determined by the packer will remain unchanged")
2209-
.default_value("off")
2210-
.show_in(argparse::ShowIn::HELP_ONLY);
2211-
22122203
place_grp.add_argument(args.placer_debug_block, "--placer_debug_block")
22132204
.help(
22142205
" Controls when placer debugging is enabled for blocks.\n"

vpr/src/base/read_options.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ struct t_options {
151151
argparse::ArgValue<bool> place_constraint_subtile;
152152
argparse::ArgValue<int> floorplan_num_horizontal_partitions;
153153
argparse::ArgValue<int> floorplan_num_vertical_partitions;
154-
argparse::ArgValue<bool> place_re_cluster;
155154

156155
argparse::ArgValue<int> placer_debug_block;
157156
argparse::ArgValue<int> placer_debug_net;

vpr/src/base/vpr_types.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -557,31 +557,4 @@ void t_cluster_placement_stats::free_primitives() {
557557
delete primitive.second;
558558
}
559559
}
560-
}
561-
562-
/**
563-
* @brief Get the atom block id at the given location. Since we currently don't have any array to retrieve this information directly,
564-
* we first find the cluster mapped to that location, and then find the atom inside that cluster that is mapped to the given location.
565-
*/
566-
AtomBlockId GridBlock::block_at_location(const t_pl_atom_loc& loc) const {
567-
const auto& atom_lookup = g_vpr_ctx.atom().lookup;
568-
t_pl_loc cluster_loc(loc.x, loc.y, loc.sub_tile, loc.layer);
569-
ClusterBlockId cluster_at_loc = block_at_location(cluster_loc);
570-
if (cluster_at_loc == EMPTY_BLOCK_ID) {
571-
return EMPTY_PRIMITIVE_BLOCK_ID;
572-
} else if (cluster_at_loc == INVALID_BLOCK_ID) {
573-
return INVALID_PRIMITIVE_BLOCK_ID;
574-
} else {
575-
VTR_ASSERT(cluster_at_loc.is_valid());
576-
const auto& cluster_atoms = g_vpr_ctx.cl_helper().atoms_lookup;
577-
const auto& atom_list = cluster_atoms.at(cluster_at_loc);
578-
for (const auto& atom : atom_list) {
579-
int primitive_pin = atom_lookup.atom_pb_graph_node(atom)->primitive_num;
580-
t_pl_atom_loc atom_loc(primitive_pin, cluster_loc.x, cluster_loc.y, cluster_loc.sub_tile, cluster_loc.layer);
581-
if (atom_loc == loc) {
582-
return atom;
583-
}
584-
}
585-
return EMPTY_PRIMITIVE_BLOCK_ID;
586-
}
587560
}

vpr/src/base/vpr_types.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ enum class ScreenUpdatePriority {
9898

9999
/* Defining macros for the placement_ctx t_grid_blocks. Assumes that ClusterBlockId's won't exceed positive 32-bit integers */
100100
constexpr auto EMPTY_BLOCK_ID = ClusterBlockId(-1);
101-
constexpr auto EMPTY_PRIMITIVE_BLOCK_ID = AtomBlockId(-1);
102101
constexpr auto INVALID_BLOCK_ID = ClusterBlockId(-2);
103-
constexpr auto INVALID_PRIMITIVE_BLOCK_ID = AtomBlockId(-2);
104102

105103
/*
106104
* Files
@@ -814,40 +812,6 @@ struct hash<t_pl_loc> {
814812
};
815813
} // namespace std
816814

817-
struct t_pl_atom_loc {
818-
t_pl_atom_loc() = default;
819-
t_pl_atom_loc(int primitive_id_, int x_, int y_, int sub_tile_, int layer_)
820-
: primitive_id(primitive_id_)
821-
, x(x_)
822-
, y(y_)
823-
, sub_tile(sub_tile_)
824-
, layer(layer_) {}
825-
826-
int primitive_id = OPEN;
827-
int x = OPEN;
828-
int y = OPEN;
829-
int sub_tile = OPEN;
830-
int layer = OPEN;
831-
};
832-
833-
inline bool operator==(const t_pl_atom_loc& lhs, const t_pl_atom_loc& rhs) {
834-
return std::tie(lhs.primitive_id, lhs.x, lhs.y, lhs.sub_tile, lhs.layer) == std::tie(rhs.primitive_id, rhs.x, rhs.y, rhs.sub_tile, rhs.layer);
835-
}
836-
837-
namespace std {
838-
template<>
839-
struct hash<t_pl_atom_loc> {
840-
std::size_t operator()(const t_pl_atom_loc& v) const noexcept {
841-
std::size_t seed = std::hash<int>{}(v.x);
842-
vtr::hash_combine(seed, v.y);
843-
vtr::hash_combine(seed, v.sub_tile);
844-
vtr::hash_combine(seed, v.layer);
845-
vtr::hash_combine(seed, v.primitive_id);
846-
return seed;
847-
}
848-
};
849-
} // namespace std
850-
851815
struct t_place_region {
852816
float capacity; ///<Capacity of this region, in tracks.
853817
float inv_capacity;
@@ -912,8 +876,6 @@ class GridBlock {
912876
return grid_blocks_[loc.layer][loc.x][loc.y].blocks[loc.sub_tile];
913877
}
914878

915-
AtomBlockId block_at_location(const t_pl_atom_loc& loc) const;
916-
917879
inline size_t num_blocks_at_location(const t_physical_tile_loc& loc) const {
918880
return grid_blocks_[loc.layer_num][loc.x][loc.y].blocks.size();
919881
}
@@ -1316,7 +1278,6 @@ struct t_placer_opts {
13161278
int floorplan_num_horizontal_partitions;
13171279
int floorplan_num_vertical_partitions;
13181280

1319-
bool place_re_cluster;
13201281
int placer_debug_block;
13211282
int placer_debug_net;
13221283

vpr/src/place/atom_critical_uniform_move_generator.cpp

Lines changed: 0 additions & 62 deletions
This file was deleted.

vpr/src/place/atom_critical_uniform_move_generator.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

vpr/src/place/move_transactions.cpp

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,6 @@
33
#include "globals.h"
44
#include "place_util.h"
55

6-
e_block_move_result record_block_move(t_pl_atom_blocks_to_be_moved& blocks_affected, AtomBlockId blk, t_pl_atom_loc to) {
7-
auto res = blocks_affected.moved_to.emplace(to);
8-
if (!res.second) {
9-
log_move_abort("duplicate block move to location");
10-
return e_block_move_result::ABORT;
11-
}
12-
13-
const auto& place_ctx = g_vpr_ctx.placement();
14-
15-
t_pl_atom_loc from = get_atom_loc(blk);
16-
17-
auto res2 = blocks_affected.moved_from.emplace(from);
18-
if (!res2.second) {
19-
log_move_abort("duplicate block move from location");
20-
return e_block_move_result::ABORT;
21-
}
22-
23-
VTR_ASSERT_SAFE(to.sub_tile < int(place_ctx.grid_blocks.num_blocks_at_location({to.x, to.y, to.layer})));
24-
25-
// Sets up the blocks moved
26-
int imoved_blk = blocks_affected.num_moved_blocks;
27-
blocks_affected.moved_blocks[imoved_blk].block_num = blk;
28-
blocks_affected.moved_blocks[imoved_blk].old_loc = from;
29-
blocks_affected.moved_blocks[imoved_blk].new_loc = to;
30-
blocks_affected.num_moved_blocks++;
31-
32-
return e_block_move_result::VALID;
33-
}
34-
356
//Records that block 'blk' should be moved to the specified 'to' location
367
e_block_move_result record_block_move(t_pl_blocks_to_be_moved& blocks_affected, ClusterBlockId blk, t_pl_loc to) {
378
auto res = blocks_affected.moved_to.emplace(to);
@@ -62,21 +33,6 @@ e_block_move_result record_block_move(t_pl_blocks_to_be_moved& blocks_affected,
6233
return e_block_move_result::VALID;
6334
}
6435

65-
//Moves the blocks in blocks_affected to their new locations
66-
void apply_move_blocks(const t_pl_atom_blocks_to_be_moved& blocks_affected) {
67-
const auto& atom_lookup = g_vpr_ctx.atom().lookup;
68-
std::set<ClusterBlockId> seen_clusters;
69-
const int num_moved_blocks = blocks_affected.num_moved_blocks;
70-
for (int blk_idx = 0; blk_idx < num_moved_blocks; blk_idx++) {
71-
AtomBlockId atom_blk = blocks_affected.moved_blocks[blk_idx].block_num;
72-
ClusterBlockId cluster_blk = atom_lookup.atom_clb(atom_blk);
73-
if (seen_clusters.find(cluster_blk) == seen_clusters.end()) {
74-
seen_clusters.insert(cluster_blk);
75-
place_sync_external_block_connections(cluster_blk);
76-
}
77-
}
78-
}
79-
8036
//Moves the blocks in blocks_affected to their new locations
8137
void apply_move_blocks(const t_pl_blocks_to_be_moved& blocks_affected) {
8238
auto& place_ctx = g_vpr_ctx.mutable_placement();
@@ -135,10 +91,6 @@ void commit_move_blocks(const t_pl_blocks_to_be_moved& blocks_affected) {
13591
} // Finish updating clb for all blocks
13692
}
13793

138-
void revert_move_blocks(t_pl_atom_blocks_to_be_moved& blocks_affected) {
139-
//TODO: this function needs to be implemented
140-
}
141-
14294
//Moves the blocks in blocks_affected to their old locations
14395
void revert_move_blocks(const t_pl_blocks_to_be_moved& blocks_affected) {
14496
auto& place_ctx = g_vpr_ctx.mutable_placement();

0 commit comments

Comments
 (0)