@@ -47,9 +47,9 @@ static t_physical_tile_type_ptr pick_placement_type(t_logical_block_type_ptr log
47
47
vtr::vector<ClusterBlockId, t_block_score> assign_block_scores ();
48
48
49
49
// Sort the blocks according to how difficult they are to place, prior to initial placement
50
- std::vector<ClusterBlockId> sort_blocks (vtr::vector<ClusterBlockId, t_block_score> block_scores);
50
+ std::vector<ClusterBlockId> sort_blocks (const vtr::vector<ClusterBlockId, t_block_score>& block_scores);
51
51
52
- void print_sorted_blocks (std::vector<ClusterBlockId> sorted_blocks, vtr::vector<ClusterBlockId, t_block_score> block_scores);
52
+ void print_sorted_blocks (const std::vector<ClusterBlockId>& sorted_blocks, const vtr::vector<ClusterBlockId, t_block_score>& block_scores);
53
53
54
54
static int get_free_sub_tile (std::vector<std::vector<int >>& free_locations, int itype, std::vector<int > possible_sub_tiles) {
55
55
for (int sub_tile : possible_sub_tiles) {
@@ -359,6 +359,12 @@ vtr::vector<ClusterBlockId, t_block_score> assign_block_scores() {
359
359
360
360
block_scores.resize (blocks.size ());
361
361
362
+ /*
363
+ * For the blocks with no floorplan constraints, and the blocks that are not part of macros,
364
+ * the block scores will remain at their default values assigned by the constructor
365
+ * (macro_size = 0; floorplan_constraints = 0; num_equivalent_tiles =1;
366
+ */
367
+
362
368
// go through all blocks and store floorplan constraints and num equivalent tiles
363
369
for (auto blk_id : blocks) {
364
370
if (is_cluster_constrained (blk_id)) {
@@ -380,7 +386,7 @@ vtr::vector<ClusterBlockId, t_block_score> assign_block_scores() {
380
386
return block_scores;
381
387
}
382
388
383
- std::vector<ClusterBlockId> sort_blocks (vtr::vector<ClusterBlockId, t_block_score> block_scores) {
389
+ std::vector<ClusterBlockId> sort_blocks (const vtr::vector<ClusterBlockId, t_block_score>& block_scores) {
384
390
auto & cluster_ctx = g_vpr_ctx.clustering ();
385
391
386
392
auto blocks = cluster_ctx.clb_nlist .blocks ();
@@ -400,7 +406,7 @@ std::vector<ClusterBlockId> sort_blocks(vtr::vector<ClusterBlockId, t_block_scor
400
406
return sorted_blocks;
401
407
}
402
408
403
- void print_sorted_blocks (std::vector<ClusterBlockId> sorted_blocks, vtr::vector<ClusterBlockId, t_block_score> block_scores) {
409
+ void print_sorted_blocks (const std::vector<ClusterBlockId>& sorted_blocks, const vtr::vector<ClusterBlockId, t_block_score>& block_scores) {
404
410
VTR_LOG (" \n Printing sorted blocks: \n " );
405
411
for (unsigned int i = 0 ; i < sorted_blocks.size (); i++) {
406
412
VTR_LOG (" Block_Id: %zu, Macro size: %d, Num floorplan constraints: %d, Num equivalent tiles %d \n " , sorted_blocks[i], block_scores[sorted_blocks[i]].macro_size , block_scores[sorted_blocks[i]].floorplan_constraints , block_scores[sorted_blocks[i]].num_equivalent_tiles );
0 commit comments