Skip to content

Commit dad7402

Browse files
committed
[vpr][place] read initial placement from a file
1 parent d20f162 commit dad7402

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

vpr/src/place/initial_placement.cpp

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,12 +1187,12 @@ void initial_placement(const t_placer_opts& placer_opts,
11871187
clear_all_grid_locs();
11881188

11891189
/* Go through cluster blocks to calculate the tightest placement
1190-
* floorplan constraint for each constrained block
1191-
*/
1190+
* floorplan constraint for each constrained block
1191+
*/
11921192
propagate_place_constraints();
11931193

11941194
/*Mark the blocks that have already been locked to one spot via floorplan constraints
1195-
* as fixed, so they do not get moved during initial placement or later during the simulated annealing stage of placement*/
1195+
* as fixed, so they do not get moved during initial placement or later during the simulated annealing stage of placement*/
11961196
mark_fixed_blocks();
11971197

11981198
// Compute and store compressed floorplanning constraints
@@ -1204,17 +1204,22 @@ void initial_placement(const t_placer_opts& placer_opts,
12041204
read_constraints(constraints_file);
12051205
}
12061206

1207-
if (noc_opts.noc) {
1208-
// NoC routers are placed before other blocks
1209-
initial_noc_placement(noc_opts, placer_opts);
1210-
propagate_place_constraints();
1211-
}
1207+
if(!placer_opts.read_initial_place_file.empty()) {
1208+
const auto& grid = g_vpr_ctx.device().grid;
1209+
read_place(nullptr, placer_opts.read_initial_place_file.c_str(), false, grid);
1210+
} else {
1211+
if (noc_opts.noc) {
1212+
// NoC routers are placed before other blocks
1213+
initial_noc_placement(noc_opts, placer_opts);
1214+
propagate_place_constraints();
1215+
}
12121216

1213-
//Assign scores to blocks and placement macros according to how difficult they are to place
1214-
vtr::vector<ClusterBlockId, t_block_score> block_scores = assign_block_scores();
1217+
//Assign scores to blocks and placement macros according to how difficult they are to place
1218+
vtr::vector<ClusterBlockId, t_block_score> block_scores = assign_block_scores();
12151219

1216-
//Place all blocks
1217-
place_all_blocks(placer_opts, block_scores, placer_opts.pad_loc_type, constraints_file);
1220+
//Place all blocks
1221+
place_all_blocks(placer_opts, block_scores, placer_opts.pad_loc_type, constraints_file);
1222+
}
12181223

12191224
alloc_and_load_movable_blocks();
12201225

0 commit comments

Comments
 (0)