Skip to content

Commit 4f26ea7

Browse files
authored
Merge branch 'master' into xt_direct_inport_double_check
2 parents 77debe2 + c22df01 commit 4f26ea7

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

vpr/src/pack/cluster_legalizer.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* externally to the Packer in VPR.
1212
*/
1313

14+
#include <string>
1415
#include <vector>
1516
#include "atom_netlist_fwd.h"
1617
#include "noc_data_types.h"
@@ -433,6 +434,13 @@ class ClusterLegalizer {
433434
return cluster.pb;
434435
}
435436

437+
/// @brief Gets the name of the given cluster.
438+
inline std::string get_cluster_name(LegalizationClusterId cluster_id) const {
439+
VTR_ASSERT_SAFE(cluster_id.is_valid() && (size_t)cluster_id < legalization_clusters_.size());
440+
const LegalizationCluster& cluster = legalization_clusters_[cluster_id];
441+
return cluster.pb->name;
442+
}
443+
436444
/// @brief Gets the logical block type of the given cluster.
437445
inline t_logical_block_type_ptr get_cluster_type(LegalizationClusterId cluster_id) const {
438446
VTR_ASSERT_SAFE(cluster_id.is_valid() && (size_t)cluster_id < legalization_clusters_.size());

vpr/src/pack/cluster_util.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ static void echo_clusters(char* filename, const ClusterLegalizer& cluster_legali
3939
}
4040

4141
for (auto& cluster_atom : cluster_atoms) {
42-
const std::string& cluster_name = cluster_legalizer.get_cluster_pb(cluster_atom.first)->name;
43-
fprintf(fp, "Cluster %s Id: %zu \n", cluster_name.c_str(), size_t(cluster_atom.first));
42+
fprintf(fp, "Cluster %s Id: %zu \n",
43+
cluster_legalizer.get_cluster_name(cluster_atom.first).c_str(),
44+
size_t(cluster_atom.first));
4445
fprintf(fp, "\tAtoms in cluster: \n");
4546

4647
int num_atoms = cluster_atom.second.size();

vpr/src/pack/greedy_clusterer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ LegalizationClusterId GreedyClusterer::start_new_cluster(
443443

444444
VTR_LOGV(log_verbosity_ > 2,
445445
"Complex block %zu: '%s' (%s) ", size_t(new_cluster_id),
446-
cluster_legalizer.get_cluster_pb(new_cluster_id)->name,
446+
cluster_legalizer.get_cluster_name(new_cluster_id).c_str(),
447447
cluster_legalizer.get_cluster_type(new_cluster_id)->name.c_str());
448448
VTR_LOGV(log_verbosity_ > 2, ".");
449449
//Progress dot for seed-block

vpr/src/pack/pack.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -580,22 +580,9 @@ bool try_pack(const t_packer_opts& packer_opts,
580580

581581
VTR_ASSERT(current_packer_state == e_packer_state::SUCCESS);
582582

583-
/* Packing iterative improvement can be done here */
584-
/* Use the re-cluster API to edit it */
585-
/******************* Start *************************/
586-
VTR_LOG("Start the iterative improvement process\n");
587-
//iteratively_improve_packing(*packer_opts, clustering_data, 2);
588-
VTR_LOG("the iterative improvement process is done\n");
589-
590-
/*
591-
* auto& cluster_ctx = g_vpr_ctx.clustering();
592-
* for (auto& blk_id : g_vpr_ctx.clustering().clb_nlist.blocks()) {
593-
* free_pb_stats_recursive(cluster_ctx.clb_nlist.block_pb(blk_id));
594-
* }
595-
*/
596-
/******************** End **************************/
597583
g_vpr_ctx.mutable_atom().mutable_lookup().set_atom_pb_bimap_lock(false);
598584
g_vpr_ctx.mutable_atom().mutable_lookup().set_atom_to_pb_bimap(cluster_legalizer.atom_pb_lookup());
585+
599586
//check clustering and output it
600587
check_and_output_clustering(cluster_legalizer, packer_opts, is_clock, &arch);
601588

0 commit comments

Comments
 (0)