Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vpr/src/pack/cluster_legalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* externally to the Packer in VPR.
*/

#include <string>
#include <vector>
#include "atom_netlist_fwd.h"
#include "noc_data_types.h"
Expand Down Expand Up @@ -433,6 +434,13 @@ class ClusterLegalizer {
return cluster.pb;
}

/// @brief Gets the name of the given cluster.
inline std::string get_cluster_name(LegalizationClusterId cluster_id) const {
VTR_ASSERT_SAFE(cluster_id.is_valid() && (size_t)cluster_id < legalization_clusters_.size());
const LegalizationCluster& cluster = legalization_clusters_[cluster_id];
return cluster.pb->name;
}

/// @brief Gets the logical block type of the given cluster.
inline t_logical_block_type_ptr get_cluster_type(LegalizationClusterId cluster_id) const {
VTR_ASSERT_SAFE(cluster_id.is_valid() && (size_t)cluster_id < legalization_clusters_.size());
Expand Down
5 changes: 3 additions & 2 deletions vpr/src/pack/cluster_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ static void echo_clusters(char* filename, const ClusterLegalizer& cluster_legali
}

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

int num_atoms = cluster_atom.second.size();
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/pack/greedy_clusterer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ LegalizationClusterId GreedyClusterer::start_new_cluster(

VTR_LOGV(log_verbosity_ > 2,
"Complex block %zu: '%s' (%s) ", size_t(new_cluster_id),
cluster_legalizer.get_cluster_pb(new_cluster_id)->name,
cluster_legalizer.get_cluster_name(new_cluster_id).c_str(),
cluster_legalizer.get_cluster_type(new_cluster_id)->name.c_str());
VTR_LOGV(log_verbosity_ > 2, ".");
//Progress dot for seed-block
Expand Down