Skip to content
Merged

Tidy3 #9196

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
3 changes: 1 addition & 2 deletions src/ant/src/AntennaChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,7 @@ int AntennaChecker::Impl::checkAntennas(odb::dbNet* net,
}
omp_set_num_threads(num_threads);
#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < nets_.size(); i++) {
odb::dbNet* net = nets_[i];
for (auto net : nets_) {
Violations antenna_violations;
int pin_viol_count
= checkNet(net, verbose, true, nullptr, 0, antenna_violations);
Expand Down
11 changes: 7 additions & 4 deletions src/ant/src/Polygon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

namespace ant {

using gtl::operators::operator+=;
using gtl::operators::operator-=;
using gtl::operators::operator&;

Polygon rectToPolygon(const odb::Rect& rect)
{
std::vector<Point> points{{gtl::construct<Point>(rect.xMin(), rect.yMin()),
Expand All @@ -34,6 +30,9 @@ Polygon rectToPolygon(const odb::Rect& rect)
std::vector<int> findNodesWithIntersection(const GraphNodes& graph_nodes,
const Polygon& pol)
{
using gtl::operators::operator+=;
using gtl::operators::operator&;

// expand object by 1
PolygonSet obj;
obj += pol;
Expand All @@ -53,6 +52,8 @@ std::vector<int> findNodesWithIntersection(const GraphNodes& graph_nodes,
void wiresToPolygonSetMap(odb::dbWire* wires,
std::map<odb::dbTechLayer*, PolygonSet>& set_by_layer)
{
using gtl::operators::operator+=;

odb::dbShape shape;
odb::dbWireShapeItr shapes_it;
std::vector<odb::dbShape> via_boxes;
Expand Down Expand Up @@ -85,6 +86,8 @@ void wiresToPolygonSetMap(odb::dbWire* wires,
void avoidPinIntersection(odb::dbNet* db_net,
std::map<odb::dbTechLayer*, PolygonSet>& set_by_layer)
{
using gtl::operators::operator-=;

// iterate all instance pin
for (odb::dbITerm* iterm : db_net->getITerms()) {
odb::dbMTerm* mterm = iterm->getMTerm();
Expand Down
13 changes: 8 additions & 5 deletions src/cts/src/HTreeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ void HTreeBuilder::initSinkRegion()
logger_->info(CTS, 26, " Height: {:.4f}.", sinkRegion_.getHeight());
}

void plotBlockage(std::ofstream& file, odb::dbDatabase* db_, int scalingFactor)
static void plotBlockage(std::ofstream& file,
odb::dbDatabase* db_,
int scalingFactor)
{
unsigned i = 0;
for (odb::dbBlockage* blockage : db_->getChip()->getBlock()->getBlockages()) {
Expand Down Expand Up @@ -351,7 +353,8 @@ double HTreeBuilder::weightedDistance(const Point<double>& newLoc,
return dist;
}

void plotSinks(std::ofstream& file, const std::vector<Point<double>>& sinks)
static void plotSinks(std::ofstream& file,
const std::vector<Point<double>>& sinks)
{
unsigned cnt = 0;
for (const Point<double>& pt : sinks) {
Expand Down Expand Up @@ -407,9 +410,9 @@ void HTreeBuilder::scalePosition(Point<double>& loc,
loc.setY(y);
}

void setSiblingPosition(const Point<double>& a,
Point<double>& b,
const Point<double>& parLoc)
static void setSiblingPosition(const Point<double>& a,
Point<double>& b,
const Point<double>& parLoc)
{
double px = parLoc.getX();
double py = parLoc.getY();
Expand Down
11 changes: 2 additions & 9 deletions src/cts/src/TritonCTS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,6 @@ void TritonCTS::setBufferList(const char* buffers)
options_->setBufferList(bufferList);
}

std::string toLowerCase(std::string str)
{
std::ranges::transform(
str, str.begin(), [](unsigned char c) { return std::tolower(c); });
return str;
}

std::string TritonCTS::getRootBufferToString()
{
std::ostringstream buffer_names;
Expand Down Expand Up @@ -2235,7 +2228,7 @@ double TritonCTS::computeInsertionDelay(const std::string& name,
return insDelayPerMicron;
}

float getInputCap(const sta::LibertyCell* cell)
static float getInputCap(const sta::LibertyCell* cell)
{
sta::LibertyPort *in, *out;
cell->bufferPorts(in, out);
Expand All @@ -2245,7 +2238,7 @@ float getInputCap(const sta::LibertyCell* cell)
return 0.0;
}

sta::LibertyCell* findBestDummyCell(
static sta::LibertyCell* findBestDummyCell(
const std::vector<sta::LibertyCell*>& dummyCandidates,
float deltaCap)
{
Expand Down
8 changes: 4 additions & 4 deletions src/dbSta/src/SpefWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ SpefWriter::SpefWriter(Logger* logger,
writePorts();
}

std::string escapeSpecial(const std::string& name)
static std::string escapeSpecial(const std::string& name)
{
std::string result = name;
size_t pos = 0;
Expand All @@ -49,7 +49,7 @@ std::string escapeSpecial(const std::string& name)
return result;
}

std::string escapeSpecial(const char* name)
static std::string escapeSpecial(const char* name)
{
if (!name) {
return "";
Expand All @@ -60,7 +60,7 @@ std::string escapeSpecial(const char* name)
// Quick fix for wrong pin delimiter.
// TODO: save the parasitics data to odb and use the existing write_spef
// mechanism to produce the spef files from estimate_parasitics.
std::string fixPinDelimiter(const std::string& name)
static std::string fixPinDelimiter(const std::string& name)
{
const char delimiter = '/';
std::string result = name;
Expand Down Expand Up @@ -104,7 +104,7 @@ void SpefWriter::writeHeader()
}
}

char getIoDirectionText(const odb::dbIoType& io_type)
static char getIoDirectionText(const odb::dbIoType& io_type)
{
if (io_type == odb::dbIoType::INPUT) {
return 'I';
Expand Down
2 changes: 1 addition & 1 deletion src/dbSta/src/dbSta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ void dbSta::countPhysicalOnlyInstancesByType(InstTypeMap& inst_type_stats,
}
}

std::string toLowerCase(std::string str)
static std::string toLowerCase(std::string str)
{
std::ranges::transform(
str, str.begin(), [](unsigned char c) { return std::tolower(c); });
Expand Down
39 changes: 23 additions & 16 deletions src/dbSta/test/cpp/TestHconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@
namespace odb {

static const std::string prefix("_main/src/dbSta/test/");
static constexpr bool kDebugMsgs = false;

/*
Extract the hierarchical information in human readable format.
Shows the dbNet and dbModNet view of the database.
*/

void DbStrDebugHierarchy(dbBlock* block, std::stringstream& str_db)
static void DbStrDebugHierarchy(dbBlock* block, std::stringstream& str_db)
{
str_db << fmt::format("Debug: Data base tables for block at {}:\n",
block->getName());
Expand Down Expand Up @@ -527,9 +528,11 @@ class TestHconn : public ::tst::Fixture
inv4_3_op_->connect(op2_net_);
inv4_4_op_->connect(op3_net_);

// std::stringstream str_str;
// DbStrDebugHierarchy(block_, str_str);
// printf("The Flat design created %s\n", str_str.str().c_str());
if (kDebugMsgs) {
std::stringstream str_str;
DbStrDebugHierarchy(block_, str_str);
printf("The Flat design created %s\n", str_str.str().c_str());
}

// Now build the hierarchical "overlay"
// What we are doing here is adding the modnets which hook up
Expand Down Expand Up @@ -645,11 +648,12 @@ class TestHconn : public ::tst::Fixture
inv4_mod_level2_inst_o3_miterm_->connect(inv4_mod_level2_inst_o3_mnet_);
inv4_mod_level1_master_o3_port_->connect(inv4_mod_level2_inst_o3_mnet_);

// Uncomment this to see the full design
// std::stringstream full_design;
// DbStrDebugHierarchy(block_, full_design);
// printf("The design created (flat and hierarchical) %s\n",
// full_design.str().c_str());
if (kDebugMsgs) {
std::stringstream full_design;
DbStrDebugHierarchy(block_, full_design);
printf("The design created (flat and hierarchical) %s\n",
full_design.str().c_str());
}
}

sta::LibertyLibrary* library_;
Expand Down Expand Up @@ -788,9 +792,11 @@ class TestHconn : public ::tst::Fixture

TEST_F(TestHconn, ConnectionMade)
{
// std::stringstream str_str_initial;
// DbStrDebugHierarchy(block_, str_str_initial);
// printf("The initial design: %s\n", str_str_initial.str().c_str());
if (kDebugMsgs) {
std::stringstream str_str_initial;
DbStrDebugHierarchy(block_, str_str_initial);
printf("The initial design: %s\n", str_str_initial.str().c_str());
}

// ECO test: get initial state before we start modifying
// the design. Then at end we undo everything and
Expand Down Expand Up @@ -896,10 +902,11 @@ TEST_F(TestHconn, ConnectionMade)
db_network_->hierarchicalConnect(
inv1_2_inst_op0, inv4_4_ip_, hier_net_name.c_str());

// Uncomment this to see the final design
// std::stringstream str_str_final;
// DbStrDebugHierarchy(block_, str_str_final);
// printf("The final design: %s\n", str_str_final.str().c_str());
if (kDebugMsgs) {
std::stringstream str_str_final;
DbStrDebugHierarchy(block_, str_str_final);
printf("The final design: %s\n", str_str_final.str().c_str());
}

// Example of how to turn on the call backs for all the bterms/iterms
// used by the sta
Expand Down
2 changes: 1 addition & 1 deletion src/dpl/src/CheckPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using std::vector;

using utl::DPL;

using utl::format_as;
using utl::format_as; // NOLINT(misc-unused-using-decls)

void Opendp::checkPlacement(const bool verbose,
const std::string& report_file_name)
Expand Down
2 changes: 1 addition & 1 deletion src/dpl/src/FillerPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using utl::DPL;
using odb::dbMaster;
using odb::dbPlacementStatus;

using utl::format_as;
using utl::format_as; // NOLINT(misc-unused-using-decls)

static odb::dbTechLayer* getImplant(dbMaster* master)
{
Expand Down
1 change: 0 additions & 1 deletion src/dpl/src/OptMirror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace dpl {

using utl::DPL;

using std::sort;
using std::unordered_set;

using odb::dbITerm;
Expand Down
3 changes: 1 addition & 2 deletions src/dpl/src/Place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ namespace dpl {
using std::max;
using std::min;
using std::numeric_limits;
using std::sort;
using std::string;
using std::vector;

using utl::DPL;

using utl::format_as;
using utl::format_as; // NOLINT(misc-unused-using-decls)

std::string Opendp::printBgBox(
const boost::geometry::model::box<bgPoint>& queryBox)
Expand Down
2 changes: 1 addition & 1 deletion src/dpl/src/infrastructure/Grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using utl::DPL;
using odb::dbBox;
using odb::dbRow;

using utl::format_as;
using utl::format_as; // NOLINT(misc-unused-using-decls)

PixelPt::PixelPt(Pixel* pixel1, GridX grid_x, GridY grid_y)
: pixel(pixel1), x(grid_x), y(grid_y)
Expand Down
4 changes: 2 additions & 2 deletions src/dpl/src/optimization/detailed_mis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ void DetailedMis::populateGrid()
// Inserts movable cells into the grid.

for (auto& row : grid_) {
for (size_t j = 0; j < row.size(); j++) {
row[j]->clear();
for (auto& bucket : row) {
bucket->clear();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/gc/FlexGC_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2227,7 +2227,7 @@ bool FlexGCWorker::Impl::checkMetalShape_lef58Area_rectWidth(
gtl::get_max_rectangles(rects, polySet);
if (rects.size() == 1) {
int min_width = db_rule->getRectWidth();
auto rect = rects.back();
const auto& rect = rects.back();
auto xLen = gtl::delta(rect, gtl::HORIZONTAL);
auto yLen = gtl::delta(rect, gtl::VERTICAL);
bool apply_rect_width_area = false;
Expand Down
11 changes: 8 additions & 3 deletions src/dst/include/dst/BalancerJobDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@
// Copyright (c) 2021-2025, The OpenROAD Authors

#pragma once

#include <cstdint>
#include <string>

#include "boost/serialization/base_object.hpp"
#include "dst/JobMessage.h"

namespace boost::serialization {
class access;
}

namespace dst {

class BalancerJobDescription : public JobDescription
{
public:
void setWorkerIP(const std::string& ip) { worker_ip_ = ip; }
void setWorkerPort(unsigned short port) { worker_port_ = port; }
void setWorkerPort(uint16_t port) { worker_port_ = port; }
std::string getWorkerIP() const { return worker_ip_; }
unsigned short getWorkerPort() const { return worker_port_; }
uint16_t getWorkerPort() const { return worker_port_; }

private:
std::string worker_ip_;
unsigned short worker_port_{0};
uint16_t worker_port_{0};

template <class Archive>
void serialize(Archive& ar, const unsigned int version)
Expand All @@ -32,4 +36,5 @@ class BalancerJobDescription : public JobDescription
}
friend class boost::serialization::access;
};

} // namespace dst
12 changes: 9 additions & 3 deletions src/dst/include/dst/BroadcastJobDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@
// Copyright (c) 2022-2025, The OpenROAD Authors

#pragma once

#include <cstdint>

#include "boost/serialization/base_object.hpp"
#include "dst/JobMessage.h"

namespace boost::serialization {
class access;
}

namespace dst {

class BroadcastJobDescription : public JobDescription
{
public:
void setWorkersCount(unsigned short count) { workers_count_ = count; }
unsigned short getWorkersCount() const { return workers_count_; }
void setWorkersCount(uint16_t count) { workers_count_ = count; }
uint16_t getWorkersCount() const { return workers_count_; }

private:
unsigned short workers_count_{0};
uint16_t workers_count_{0};

template <class Archive>
void serialize(Archive& ar, const unsigned int version)
Expand All @@ -26,4 +31,5 @@ class BroadcastJobDescription : public JobDescription
}
friend class boost::serialization::access;
};

} // namespace dst
Loading
Loading