Skip to content

Commit 1c67315

Browse files
authored
Merge pull request #10192 from The-OpenROAD-Project-staging/pdn-tidy-naming
pdn: adjust naming to Google-style (excluding method names)
2 parents daf5356 + 7abbefb commit 1c67315

24 files changed

Lines changed: 285 additions & 284 deletions

src/pdn/include/pdn/PdnGen.hh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ namespace pdn {
1818

1919
enum ExtensionMode
2020
{
21-
CORE,
22-
RINGS,
23-
BOUNDARY,
24-
FIXED
21+
kCore,
22+
kRings,
23+
kBoundary,
24+
kFixed
2525
};
2626

2727
enum StartsWith
2828
{
29-
GRID,
30-
POWER,
31-
GROUND
29+
kGrid,
30+
kPower,
31+
kGround
3232
};
3333

3434
enum PowerSwitchNetworkType
3535
{
36-
STAR,
37-
DAISY
36+
kStar,
37+
kDaisy
3838
};
3939

4040
class VoltageDomain;
@@ -164,7 +164,7 @@ class PdnGen
164164
void repairVias(const std::set<odb::dbNet*>& nets);
165165

166166
void createSrouteWires(const char* net,
167-
const char* outerNet,
167+
const char* outer_net,
168168
odb::dbTechLayer* layer0,
169169
odb::dbTechLayer* layer1,
170170
int cut_pitch_x,
@@ -174,7 +174,7 @@ class PdnGen
174174
int max_rows,
175175
int max_columns,
176176
const std::vector<odb::dbTechLayer*>& ongrid,
177-
const std::vector<int>& metalWidths,
177+
const std::vector<int>& metal_widths,
178178
const std::vector<int>& metalspaces,
179179
const std::vector<odb::dbInst*>& insts);
180180

src/pdn/src/PdnGen.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void PdnGen::trimShapes()
203203
std::map<odb::dbTechLayer*, std::unique_ptr<TechLayer>> tech_layers;
204204

205205
for (auto* grid : grids) {
206-
if (grid->type() == Grid::Existing) {
206+
if (grid->type() == Grid::kExisting) {
207207
// fixed shapes, so nothing to do
208208
continue;
209209
}
@@ -458,10 +458,10 @@ void PdnGen::makeCoreGrid(
458458
const std::vector<odb::dbTechLayer*>& pad_pin_layers)
459459
{
460460
auto grid = std::make_unique<CoreGrid>(
461-
domain, name, starts_with == POWER, generate_obstructions);
461+
domain, name, starts_with == kPower, generate_obstructions);
462462
grid->setPinLayers(pin_layers);
463463

464-
PowerSwitchNetworkType control_network = PowerSwitchNetworkType::DAISY;
464+
PowerSwitchNetworkType control_network = PowerSwitchNetworkType::kDaisy;
465465
if (strlen(powercontrolnetwork) > 0) {
466466
control_network
467467
= GridSwitchedPower::fromString(powercontrolnetwork, logger_);
@@ -549,7 +549,7 @@ void PdnGen::makeInstanceGrid(
549549
grid = std::make_unique<BumpGrid>(domain, name, inst);
550550
} else {
551551
grid = std::make_unique<InstanceGrid>(
552-
domain, name, starts_with == POWER, inst, generate_obstructions);
552+
domain, name, starts_with == kPower, inst, generate_obstructions);
553553
}
554554
if (!std::ranges::all_of(halo, [](int v) { return v == 0; })) {
555555
grid->addHalo(halo);
@@ -599,15 +599,15 @@ void PdnGen::makeRing(Grid* grid,
599599
ring->setPadOffset(pad_offset);
600600
}
601601
ring->setExtendToBoundary(extend);
602-
if (starts_with != GRID) {
603-
ring->setStartWithPower(starts_with == POWER);
602+
if (starts_with != kGrid) {
603+
ring->setStartWithPower(starts_with == kPower);
604604
}
605605
if (allow_out_of_die) {
606606
ring->setAllowOutsideDieArea();
607607
}
608608
ring->setNets(nets);
609609
grid->addRing(std::move(ring));
610-
if (!pad_pin_layers.empty() && grid->type() == Grid::Core) {
610+
if (!pad_pin_layers.empty() && grid->type() == Grid::kCore) {
611611
auto* core_grid = static_cast<CoreGrid*>(grid);
612612
core_grid->setupDirectConnect(pad_pin_layers);
613613
for (const auto& comp : core_grid->getStraps()) {
@@ -649,8 +649,8 @@ void PdnGen::makeStrap(Grid* grid,
649649
strap->setExtend(extend);
650650
strap->setOffset(offset);
651651
strap->setSnapToGrid(snap);
652-
if (starts_with != GRID) {
653-
strap->setStartWithPower(starts_with == POWER);
652+
if (starts_with != kGrid) {
653+
strap->setStartWithPower(starts_with == kPower);
654654
}
655655
strap->setNets(nets);
656656
strap->setAllowOutsideCoreArea(allow_out_of_core);
@@ -736,7 +736,7 @@ void PdnGen::updateRenderer(bool reset) const
736736

737737
void PdnGen::createSrouteWires(
738738
const char* net,
739-
const char* outerNet,
739+
const char* outer_net,
740740
odb::dbTechLayer* layer0,
741741
odb::dbTechLayer* layer1,
742742
int cut_pitch_x,
@@ -751,7 +751,7 @@ void PdnGen::createSrouteWires(
751751
const std::vector<odb::dbInst*>& insts)
752752
{
753753
sroute_->createSrouteWires(net,
754-
outerNet,
754+
outer_net,
755755
layer0,
756756
layer1,
757757
cut_pitch_x,

src/pdn/src/PdnGen.i

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ using utl::PDN;
3333
%typemap(in) pdn::ExtensionMode {
3434
char *str = Tcl_GetStringFromObj($input, 0);
3535
if (strcasecmp(str, "Core") == 0) {
36-
$1 = pdn::ExtensionMode::CORE;
36+
$1 = pdn::ExtensionMode::kCore;
3737
} else if (strcasecmp(str, "Rings") == 0) {
38-
$1 = pdn::ExtensionMode::RINGS;
38+
$1 = pdn::ExtensionMode::kRings;
3939
} else if (strcasecmp(str, "Boundary") == 0) {
40-
$1 = pdn::ExtensionMode::BOUNDARY;
40+
$1 = pdn::ExtensionMode::kBoundary;
4141
} else {
42-
$1 = pdn::ExtensionMode::CORE;
42+
$1 = pdn::ExtensionMode::kCore;
4343
}
4444
}
4545

@@ -88,9 +88,9 @@ void make_core_grid(pdn::VoltageDomain* domain,
8888
const std::vector<odb::dbTechLayer*>& pad_pin_layers)
8989
{
9090
PdnGen* pdngen = ord::getPdnGen();
91-
StartsWith starts_with = POWER;
91+
StartsWith starts_with = kPower;
9292
if (!starts_with_power) {
93-
starts_with = GROUND;
93+
starts_with = kGround;
9494
}
9595
pdngen->makeCoreGrid(domain,
9696
name,
@@ -117,9 +117,9 @@ void make_instance_grid(pdn::VoltageDomain* domain,
117117
bool is_bump)
118118
{
119119
PdnGen* pdngen = ord::getPdnGen();
120-
StartsWith starts_with = POWER;
120+
StartsWith starts_with = kPower;
121121
if (!starts_with_power) {
122-
starts_with = GROUND;
122+
starts_with = kGround;
123123
}
124124

125125
std::array<int, 4> halo{x0, y0, x1, y1};
@@ -156,12 +156,12 @@ void make_ring(const char* grid_name,
156156
bool allow_outside_of_die)
157157
{
158158
PdnGen* pdngen = ord::getPdnGen();
159-
StartsWith starts_with = GRID;
159+
StartsWith starts_with = kGrid;
160160
if (!use_grid_power_order) {
161161
if (starts_with_power) {
162-
starts_with = POWER;
162+
starts_with = kPower;
163163
} else {
164-
starts_with = GROUND;
164+
starts_with = kGround;
165165
}
166166
}
167167
for (auto* grid : pdngen->findGrid(grid_name)) {
@@ -238,12 +238,12 @@ void make_strap(const char* grid_name,
238238
bool allow_out_of_core)
239239
{
240240
PdnGen* pdngen = ord::getPdnGen();
241-
StartsWith starts_with = GRID;
241+
StartsWith starts_with = kGrid;
242242
if (!use_grid_power_order) {
243243
if (starts_with_power) {
244-
starts_with = POWER;
244+
starts_with = kPower;
245245
} else {
246-
starts_with = GROUND;
246+
starts_with = kGround;
247247
}
248248
}
249249
for (auto* grid : pdngen->findGrid(grid_name)) {

src/pdn/src/connect.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ void Connect::makeVia(odb::dbSWire* wire,
620620
}
621621

622622
if (shapes.bottom.empty() && shapes.top.empty()) {
623-
addFailedVia(failedViaReason::RECHECK, intersection, wire->getNet());
623+
addFailedVia(FailedViaReason::kRecheck, intersection, wire->getNet());
624624
}
625625
}
626626

@@ -974,7 +974,7 @@ void Connect::printViaReport() const
974974
}
975975
}
976976

977-
void Connect::addFailedVia(failedViaReason reason,
977+
void Connect::addFailedVia(FailedViaReason reason,
978978
const odb::Rect& rect,
979979
odb::dbNet* net)
980980
{
@@ -999,22 +999,22 @@ void Connect::recordFailedVias() const
999999
for (const auto& [reason, shapes] : failed_vias_) {
10001000
std::string reason_str;
10011001
switch (reason) {
1002-
case failedViaReason::OBSTRUCTED:
1002+
case FailedViaReason::kObstructed:
10031003
reason_str = "Obstructed";
10041004
break;
1005-
case failedViaReason::OVERLAPPING:
1005+
case FailedViaReason::kOverlapping:
10061006
reason_str = "Overlapping";
10071007
break;
1008-
case failedViaReason::BUILD:
1008+
case FailedViaReason::kBuild:
10091009
reason_str = "Build";
10101010
break;
1011-
case failedViaReason::RIPUP:
1011+
case FailedViaReason::kRipup:
10121012
reason_str = "Ripup";
10131013
break;
1014-
case failedViaReason::RECHECK:
1014+
case FailedViaReason::kRecheck:
10151015
// Do not report recheck vias
10161016
continue;
1017-
case failedViaReason::OTHER:
1017+
case FailedViaReason::kOther:
10181018
reason_str = "Other";
10191019
break;
10201020
}

src/pdn/src/connect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Connect
9090

9191
void printViaReport() const;
9292

93-
void addFailedVia(failedViaReason reason,
93+
void addFailedVia(FailedViaReason reason,
9494
const odb::Rect& rect,
9595
odb::dbNet* net);
9696
void recordFailedVias() const;
@@ -120,7 +120,7 @@ class Connect
120120
std::vector<odb::dbTechLayer*> intermediate_layers_;
121121
std::vector<odb::dbTechLayer*> intermediate_routing_layers_;
122122

123-
std::map<failedViaReason, std::set<std::pair<odb::dbNet*, odb::Rect>>>
123+
std::map<FailedViaReason, std::set<std::pair<odb::dbNet*, odb::Rect>>>
124124
failed_vias_;
125125

126126
DbVia* makeSingleLayerVia(

0 commit comments

Comments
 (0)