Skip to content

Commit 23d8380

Browse files
authored
Merge pull request #7733 from The-OpenROAD-Project-staging/naming-style2
Naming style2
2 parents 12d9602 + e33f79f commit 23d8380

78 files changed

Lines changed: 1003 additions & 1007 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/dft/src/architect/Opt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ void OptimizeScanWirelength(std::vector<std::unique_ptr<ScanCell>>& cells,
4444
size_t start_index = 0;
4545
int64_t lowest_dist = std::numeric_limits<int64_t>::max();
4646
// Get points in a form ready to insert into index
47-
using bg_point = bg::model::point<int, 2, bg::cs::cartesian>;
48-
std::vector<std::pair<bg_point, size_t>> transformed;
47+
using Point = bg::model::point<int, 2, bg::cs::cartesian>;
48+
std::vector<std::pair<Point, size_t>> transformed;
4949

5050
for (size_t i = 0; i < cells.size(); i++) {
5151
// Find the lower leftmost cell by looking for the cell with the lowest
@@ -57,10 +57,10 @@ void OptimizeScanWirelength(std::vector<std::unique_ptr<ScanCell>>& cells,
5757
lowest_dist = dist;
5858
}
5959
// Add the point to the set of points
60-
transformed.emplace_back(bg_point(origin.x(), origin.y()), i);
60+
transformed.emplace_back(Point(origin.x(), origin.y()), i);
6161
}
6262
// Update the index
63-
bgi::rtree<std::pair<bg_point, size_t>, bgi::rstar<4>> rtree(transformed);
63+
bgi::rtree<std::pair<Point, size_t>, bgi::rstar<4>> rtree(transformed);
6464
auto cursor = transformed[start_index];
6565

6666
// Search nearest neighbours

src/dft/src/architect/ScanArchitect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ uint64_t ScanCellsBucket::numberOfCells(size_t hash_domain) const
110110
std::unique_ptr<ScanArchitect> ScanArchitect::ConstructScanScanArchitect(
111111
const ScanArchitectConfig& config,
112112
std::unique_ptr<ScanCellsBucket> scan_cells_bucket,
113-
utl::Logger* logger_)
113+
utl::Logger* logger)
114114
{
115115
return std::make_unique<ScanArchitectHeuristic>(
116-
config, std::move(scan_cells_bucket), logger_);
116+
config, std::move(scan_cells_bucket), logger);
117117
}
118118

119119
ScanArchitect::ScanArchitect(const ScanArchitectConfig& config,

src/dft/src/cells/ScanCellFactory.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ namespace {
2424

2525
enum class TypeOfCell
2626
{
27-
OneBitCell,
28-
NotSupported
27+
kOneBitCell,
28+
kNotSupported
2929
};
3030

3131
sta::LibertyCell* GetLibertyCell(odb::dbMaster* master,
@@ -63,9 +63,9 @@ TypeOfCell IdentifyCell(odb::dbInst* inst, sta::dbSta* sta)
6363
if (liberty_cell->hasSequentials() && !inst->getMaster()->isBlock()) {
6464
// we assume that we are only dealing with one bit cells, but in the future
6565
// we could deal with multibit cells too
66-
return TypeOfCell::OneBitCell;
66+
return TypeOfCell::kOneBitCell;
6767
}
68-
return TypeOfCell::NotSupported;
68+
return TypeOfCell::kNotSupported;
6969
}
7070

7171
std::unique_ptr<ClockDomain> GetClockDomainFromClock(
@@ -163,7 +163,7 @@ std::unique_ptr<ScanCell> ScanCellFactory(odb::dbInst* inst,
163163
TypeOfCell type_of_cell = IdentifyCell(inst, sta);
164164

165165
switch (type_of_cell) {
166-
case TypeOfCell::OneBitCell:
166+
case TypeOfCell::kOneBitCell:
167167
return CreateOneBitCell(inst, sta, logger);
168168
default:
169169
return nullptr;

src/dft/src/utils/Utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ std::optional<sta::Clock*> GetClock(sta::dbSta* sta, odb::dbITerm* iterm)
121121
return std::nullopt;
122122
}
123123

124-
bool IsScanCell(const sta::LibertyCell* libertyCell)
124+
bool IsScanCell(const sta::LibertyCell* liberty_cell)
125125
{
126-
const sta::TestCell* test_cell = libertyCell->testCell();
126+
const sta::TestCell* test_cell = liberty_cell->testCell();
127127
if (test_cell) {
128128
return getLibertyScanIn(test_cell) != nullptr
129129
&& getLibertyScanEnable(test_cell) != nullptr;

src/drt/src/TritonRoute.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,9 @@ void TritonRoute::sendDesignDist()
849849

850850
db_->write(utl::OutStreamHandler(design_path.c_str(), true).getStream());
851851
writeGlobals(router_cfg_path);
852-
dst::JobMessage msg(dst::JobMessage::UPDATE_DESIGN,
853-
dst::JobMessage::BROADCAST),
854-
result(dst::JobMessage::NONE);
852+
dst::JobMessage msg(dst::JobMessage::kUpdateDesign,
853+
dst::JobMessage::kBroadcast),
854+
result(dst::JobMessage::kNone);
855855
std::unique_ptr<dst::JobDescription> desc
856856
= std::make_unique<RoutingJobDescription>();
857857
RoutingJobDescription* rjd
@@ -885,9 +885,9 @@ void TritonRoute::sendGlobalsUpdates(const std::string& router_cfg_path,
885885
return;
886886
}
887887
ProfileTask task("DIST: SENDING GLOBALS");
888-
dst::JobMessage msg(dst::JobMessage::UPDATE_DESIGN,
889-
dst::JobMessage::BROADCAST),
890-
result(dst::JobMessage::NONE);
888+
dst::JobMessage msg(dst::JobMessage::kUpdateDesign,
889+
dst::JobMessage::kBroadcast),
890+
result(dst::JobMessage::kNone);
891891
std::unique_ptr<dst::JobDescription> desc
892892
= std::make_unique<RoutingJobDescription>();
893893
RoutingJobDescription* rjd = static_cast<RoutingJobDescription*>(desc.get());
@@ -931,9 +931,9 @@ void TritonRoute::sendDesignUpdates(const std::string& router_cfg_path,
931931
} else {
932932
task = std::make_unique<ProfileTask>("DIST: SENDING_UDPATES");
933933
}
934-
dst::JobMessage msg(dst::JobMessage::UPDATE_DESIGN,
935-
dst::JobMessage::BROADCAST),
936-
result(dst::JobMessage::NONE);
934+
dst::JobMessage msg(dst::JobMessage::kUpdateDesign,
935+
dst::JobMessage::kBroadcast),
936+
result(dst::JobMessage::kNone);
937937
std::unique_ptr<dst::JobDescription> desc
938938
= std::make_unique<RoutingJobDescription>();
939939
RoutingJobDescription* rjd = static_cast<RoutingJobDescription*>(desc.get());
@@ -976,8 +976,8 @@ int TritonRoute::main()
976976
if (router_cfg_->DO_PA) {
977977
pa_thread = std::make_unique<std::thread>([this]() {
978978
sendDesignDist();
979-
dst::JobMessage msg(dst::JobMessage::PIN_ACCESS,
980-
dst::JobMessage::BROADCAST),
979+
dst::JobMessage msg(dst::JobMessage::kPinAccess,
980+
dst::JobMessage::kBroadcast),
981981
result;
982982
auto uDesc = std::make_unique<PinAccessJobDescription>();
983983
uDesc->setType(PinAccessJobDescription::INIT_PA);
@@ -1021,8 +1021,8 @@ int TritonRoute::main()
10211021
}
10221022
if (distributed_) {
10231023
asio::post(*dist_pool_, [this]() {
1024-
dst::JobMessage msg(dst::JobMessage::GRDR_INIT,
1025-
dst::JobMessage::BROADCAST),
1024+
dst::JobMessage msg(dst::JobMessage::kGrdrInit,
1025+
dst::JobMessage::kBroadcast),
10261026
result;
10271027
dist_->sendJob(msg, dist_ip_.c_str(), dist_port_, result);
10281028
});
@@ -1062,8 +1062,8 @@ void TritonRoute::pinAccess(const std::vector<odb::dbInst*>& target_insts)
10621062
if (distributed_) {
10631063
asio::post(*dist_pool_, [this]() {
10641064
sendDesignDist();
1065-
dst::JobMessage msg(dst::JobMessage::PIN_ACCESS,
1066-
dst::JobMessage::BROADCAST),
1065+
dst::JobMessage msg(dst::JobMessage::kPinAccess,
1066+
dst::JobMessage::kBroadcast),
10671067
result;
10681068
auto uDesc = std::make_unique<PinAccessJobDescription>();
10691069
uDesc->setType(PinAccessJobDescription::INIT_PA);

src/drt/src/distributed/RoutingCallBack.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class RoutingCallBack : public dst::JobCallBack
5151
router->getRouterConfiguration())
5252
{
5353
}
54-
void onRoutingJobReceived(dst::JobMessage& msg, dst::socket& sock) override
54+
void onRoutingJobReceived(dst::JobMessage& msg, dst::Socket& sock) override
5555
{
56-
if (msg.getJobType() != dst::JobMessage::ROUTING) {
56+
if (msg.getJobType() != dst::JobMessage::kRouting) {
5757
return;
5858
}
5959
RoutingJobDescription* desc
@@ -96,12 +96,12 @@ class RoutingCallBack : public dst::JobCallBack
9696
sendResult(results, sock, true, cnt);
9797
}
9898

99-
void onFrDesignUpdated(dst::JobMessage& msg, dst::socket& sock) override
99+
void onFrDesignUpdated(dst::JobMessage& msg, dst::Socket& sock) override
100100
{
101-
if (msg.getJobType() != dst::JobMessage::UPDATE_DESIGN) {
101+
if (msg.getJobType() != dst::JobMessage::kUpdateDesign) {
102102
return;
103103
}
104-
dst::JobMessage result(dst::JobMessage::UPDATE_DESIGN);
104+
dst::JobMessage result(dst::JobMessage::kUpdateDesign);
105105
RoutingJobDescription* desc
106106
= static_cast<RoutingJobDescription*>(msg.getJobDescription());
107107
if (!desc->getGlobalsPath().empty()) {
@@ -134,15 +134,15 @@ class RoutingCallBack : public dst::JobCallBack
134134
sock.close();
135135
}
136136

137-
void onPinAccessJobReceived(dst::JobMessage& msg, dst::socket& sock) override
137+
void onPinAccessJobReceived(dst::JobMessage& msg, dst::Socket& sock) override
138138
{
139-
if (msg.getJobType() != dst::JobMessage::PIN_ACCESS) {
139+
if (msg.getJobType() != dst::JobMessage::kPinAccess) {
140140
return;
141141
}
142142
PinAccessJobDescription* desc
143143
= static_cast<PinAccessJobDescription*>(msg.getJobDescription());
144144
logger_->report("Received PA Job");
145-
dst::JobMessage result(dst::JobMessage::SUCCESS);
145+
dst::JobMessage result(dst::JobMessage::kSuccess);
146146
switch (desc->getType()) {
147147
case PinAccessJobDescription::UPDATE_PA: {
148148
paUpdate update;
@@ -191,30 +191,30 @@ class RoutingCallBack : public dst::JobCallBack
191191
dist_->sendResult(result, sock);
192192
sock.close();
193193
}
194-
void onGRDRInitJobReceived(dst::JobMessage& msg, dst::socket& sock) override
194+
void onGRDRInitJobReceived(dst::JobMessage& msg, dst::Socket& sock) override
195195
{
196-
if (msg.getJobType() != dst::JobMessage::GRDR_INIT) {
196+
if (msg.getJobType() != dst::JobMessage::kGrdrInit) {
197197
return;
198198
}
199199
router_->initGuide();
200200
router_->prep();
201201
router_->getDesign()->getRegionQuery()->initDRObj();
202-
dst::JobMessage result(dst::JobMessage::SUCCESS);
202+
dst::JobMessage result(dst::JobMessage::kSuccess);
203203
dist_->sendResult(result, sock);
204204
sock.close();
205205
}
206206

207207
private:
208208
void sendResult(const std::vector<std::pair<int, std::string>>& results,
209-
dst::socket& sock,
209+
dst::Socket& sock,
210210
bool finish,
211211
int cnt)
212212
{
213213
dst::JobMessage result;
214214
if (finish) {
215-
result.setJobType(dst::JobMessage::SUCCESS);
215+
result.setJobType(dst::JobMessage::kSuccess);
216216
} else {
217-
result.setJobType(dst::JobMessage::NONE);
217+
result.setJobType(dst::JobMessage::kNone);
218218
}
219219
auto uResultDesc = std::make_unique<RoutingJobDescription>();
220220
auto resultDesc = static_cast<RoutingJobDescription*>(uResultDesc.get());

src/drt/src/dr/FlexDR.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,8 +1903,8 @@ void FlexDR::sendWorkers(
19031903
std::string remote_ip = dist_ip_;
19041904
uint16_t remote_port = dist_port_;
19051905
if (router_->getCloudSize() > 1) {
1906-
dst::JobMessage msg(dst::JobMessage::BALANCER),
1907-
result(dst::JobMessage::NONE);
1906+
dst::JobMessage msg(dst::JobMessage::kBalancer),
1907+
result(dst::JobMessage::kNone);
19081908
bool ok = dist_->sendJob(msg, dist_ip_.c_str(), dist_port_, result);
19091909
if (!ok) {
19101910
logger_->error(utl::DRT, 7461, "Balancer failed");
@@ -1917,8 +1917,8 @@ void FlexDR::sendWorkers(
19171917
}
19181918
}
19191919
{
1920-
dst::JobMessage msg(dst::JobMessage::ROUTING),
1921-
result(dst::JobMessage::NONE);
1920+
dst::JobMessage msg(dst::JobMessage::kRouting),
1921+
result(dst::JobMessage::kNone);
19221922
std::unique_ptr<dst::JobDescription> desc
19231923
= std::make_unique<RoutingJobDescription>();
19241924
RoutingJobDescription* rjd

src/drt/src/pa/FlexPA.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ void FlexPA::prep()
189189
}
190190
}
191191

192-
dst::JobMessage msg(dst::JobMessage::PIN_ACCESS,
193-
dst::JobMessage::BROADCAST),
192+
dst::JobMessage msg(dst::JobMessage::kPinAccess,
193+
dst::JobMessage::kBroadcast),
194194
result;
195195
std::unique_ptr<PinAccessJobDescription> uDesc
196196
= std::make_unique<PinAccessJobDescription>();
@@ -249,8 +249,8 @@ void FlexPA::prepPattern()
249249
logger_->info(DRT, 81, " Complete {} unique inst patterns.", cnt);
250250
}
251251
if (isDistributed()) {
252-
dst::JobMessage msg(dst::JobMessage::PIN_ACCESS,
253-
dst::JobMessage::BROADCAST),
252+
dst::JobMessage msg(dst::JobMessage::kPinAccess,
253+
dst::JobMessage::kBroadcast),
254254
result;
255255
std::unique_ptr<PinAccessJobDescription> uDesc
256256
= std::make_unique<PinAccessJobDescription>();

src/drt/src/pa/FlexPA_row_pattern.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ void FlexPA::prepPatternInstRows(std::vector<std::vector<frInst*>> inst_rows)
140140
std::vector<std::vector<frInst*>> batch(start, end);
141141
std::string path = fmt::format("{}/batch_{}.bin", shared_vol_, i);
142142
serializeInstRows(batch, path);
143-
dst::JobMessage msg(dst::JobMessage::PIN_ACCESS,
144-
dst::JobMessage::UNICAST),
143+
dst::JobMessage msg(dst::JobMessage::kPinAccess,
144+
dst::JobMessage::kUnicast),
145145
result;
146146
std::unique_ptr<PinAccessJobDescription> uDesc
147147
= std::make_unique<PinAccessJobDescription>();
@@ -179,8 +179,8 @@ void FlexPA::prepPatternInstRows(std::vector<std::vector<frInst*>> inst_rows)
179179
}
180180
}
181181
// send updates back to workers
182-
dst::JobMessage msg(dst::JobMessage::PIN_ACCESS,
183-
dst::JobMessage::BROADCAST),
182+
dst::JobMessage msg(dst::JobMessage::kPinAccess,
183+
dst::JobMessage::kBroadcast),
184184
result;
185185
const std::string updates_path
186186
= fmt::format("{}/final_updates.bin", shared_vol_);

src/dst/include/dst/Distributed.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace dst {
1616

1717
namespace asio = boost::asio;
1818
using asio::ip::tcp;
19-
using socket = asio::basic_stream_socket<tcp>;
19+
using Socket = asio::basic_stream_socket<tcp>;
2020

2121
class JobMessage;
2222
class JobCallBack;
@@ -41,7 +41,7 @@ class Distributed
4141
const char* ip,
4242
unsigned short port,
4343
JobMessage& result);
44-
bool sendResult(JobMessage& msg, socket& sock);
44+
bool sendResult(JobMessage& msg, Socket& sock);
4545
void addCallBack(JobCallBack* cb);
4646
const std::vector<JobCallBack*>& getCallBacks() const { return callbacks_; }
4747

0 commit comments

Comments
 (0)