Skip to content

Commit 240185e

Browse files
committed
mpl: remove old debug function and add new one for connections
Signed-off-by: Arthur Koucher <[email protected]>
1 parent 20419b3 commit 240185e

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

src/mpl/src/object.cpp

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -678,32 +678,6 @@ int Cluster::getCloseCluster(const std::vector<int>& candidate_clusters,
678678
return -1;
679679
}
680680

681-
// Print Basic Information
682-
// Normally we call this after macro placement is done
683-
void Cluster::printBasicInformation(utl::Logger* logger) const
684-
{
685-
std::string line = "\n";
686-
line += std::string(80, '*') + "\n";
687-
line += "[INFO] cluster_name : " + name_ + " ";
688-
line += "cluster_id : " + std::to_string(id_) + " \n";
689-
line += "num_std_cell : " + std::to_string(getNumStdCell()) + " ";
690-
line += "num_macro : " + std::to_string(getNumMacro()) + "\n";
691-
line += "width : " + std::to_string(getWidth()) + " ";
692-
line += "height : " + std::to_string(getHeight()) + " ";
693-
line += "location : ( " + std::to_string((getLocation()).first) + " , ";
694-
line += std::to_string((getLocation()).second) + " )\n";
695-
for (const auto& hard_macro : hard_macros_) {
696-
line += "\t macro_name : " + hard_macro->getName();
697-
line += "\t width : " + std::to_string(hard_macro->getRealWidth());
698-
line += "\t height : " + std::to_string(hard_macro->getRealHeight());
699-
line += "\t lx : " + std::to_string(hard_macro->getRealX());
700-
line += "\t ly : " + std::to_string(hard_macro->getRealY());
701-
line += "\n";
702-
}
703-
704-
logger->report(line);
705-
}
706-
707681
// Macro Placement Support
708682
void Cluster::setSoftMacro(std::unique_ptr<SoftMacro> soft_macro)
709683
{
@@ -1374,4 +1348,15 @@ void SoftMacro::setShapeF(float width, float height)
13741348
area_ = width * height;
13751349
}
13761350

1351+
void Cluster::reportConnections() const
1352+
{
1353+
logger_->report("{} ({}) Connections:", name_, id_);
1354+
logger_->report("\n Cluster Id | Connection Weight ");
1355+
logger_->report("------------------------------------");
1356+
for (const auto& [cluster_id, connections_weight] : connections_map_) {
1357+
logger_->report(" {:>12d} | {:>19.2f}", cluster_id, connections_weight);
1358+
}
1359+
logger_->report("");
1360+
}
1361+
13771362
} // namespace mpl

src/mpl/src/object.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,16 @@ class Cluster
222222
std::vector<std::pair<int, int>> getVirtualConnections() const;
223223
void addVirtualConnection(int src, int target);
224224

225-
// Print Basic Information
226-
void printBasicInformation(utl::Logger* logger) const;
227-
228225
// Macro Placement Support
229226
void setSoftMacro(std::unique_ptr<SoftMacro> soft_macro);
230227
SoftMacro* getSoftMacro() const;
231228

232229
void setTilings(const TilingList& tilings);
233230
const TilingList& getTilings() const;
234231

232+
// For Debug
233+
void reportConnections() const;
234+
235235
private:
236236
int id_{-1};
237237
std::string name_;

0 commit comments

Comments
 (0)