Skip to content

Commit a81f97e

Browse files
authored
Merge pull request #10186 from The-OpenROAD-Project-staging/ant-tidy-naming
ant: adjust naming to Google-style (excluding method names)
2 parents 4de4328 + 8e1ba6a commit a81f97e

4 files changed

Lines changed: 126 additions & 152 deletions

File tree

src/ant/src/AntennaChecker.cc

Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,18 @@ void AntennaChecker::Impl::initAntennaRules()
172172
gate_plus_diff_idx = pwl.indices;
173173
gate_plus_diff_ratios = pwl.ratios;
174174

175-
const double PSR_ratio = antenna_rule->getPSR();
176-
const odb::dbTechLayerAntennaRule::pwl_pair diffPSR
175+
const double psr_ratio = antenna_rule->getPSR();
176+
const odb::dbTechLayerAntennaRule::pwl_pair diff_psr
177177
= antenna_rule->getDiffPSR();
178178

179179
uint32_t wire_thickness_dbu = 0;
180180
tech_layer->getThickness(wire_thickness_dbu);
181181

182-
const odb::dbTechLayerType layerType = tech_layer->getType();
182+
const odb::dbTechLayerType layer_type = tech_layer->getType();
183183

184184
// If there is a SIDE area antenna rule, then make sure thickness exists.
185-
if ((PSR_ratio != 0 || !diffPSR.indices.empty())
186-
&& layerType == odb::dbTechLayerType::ROUTING
185+
if ((psr_ratio != 0 || !diff_psr.indices.empty())
186+
&& layer_type == odb::dbTechLayerType::ROUTING
187187
&& wire_thickness_dbu == 0) {
188188
logger_->warn(utl::ANT,
189189
13,
@@ -411,8 +411,8 @@ void AntennaChecker::Impl::calculateWirePar(odb::dbTechLayer* tech_layer,
411411

412412
if (info.iterm_diff_area != 0) {
413413
// Calculate PAR
414-
info.PAR = (diff_metal_factor * info.area) / info.iterm_gate_area;
415-
info.PSR = (diff_side_metal_factor * info.side_area) / info.iterm_gate_area;
414+
info.par = (diff_metal_factor * info.area) / info.iterm_gate_area;
415+
info.psr = (diff_side_metal_factor * info.side_area) / info.iterm_gate_area;
416416

417417
double plus_diff_protect = plus_diff_factor * info.iterm_diff_area;
418418
if (!layer_info_[tech_layer].gate_plus_diff_idx.empty()) {
@@ -423,22 +423,22 @@ void AntennaChecker::Impl::calculateWirePar(odb::dbTechLayer* tech_layer,
423423
}
424424

425425
// Calculate PSR
426-
info.diff_PAR = (diff_metal_factor * info.area * diff_metal_reduce_factor
426+
info.diff_par = (diff_metal_factor * info.area * diff_metal_reduce_factor
427427
- minus_diff_factor * info.iterm_diff_area)
428428
/ (info.iterm_gate_area + plus_diff_protect);
429-
info.diff_PSR
429+
info.diff_psr
430430
= (diff_side_metal_factor * info.side_area * diff_metal_reduce_factor
431431
- minus_diff_factor * info.iterm_diff_area)
432432
/ (info.iterm_gate_area + plus_diff_protect);
433433
} else {
434434
// Calculate PAR
435-
info.PAR = (metal_factor * info.area) / info.iterm_gate_area;
436-
info.PSR = (side_metal_factor * info.side_area) / info.iterm_gate_area;
435+
info.par = (metal_factor * info.area) / info.iterm_gate_area;
436+
info.psr = (side_metal_factor * info.side_area) / info.iterm_gate_area;
437437

438438
// Calculate PSR
439-
info.diff_PAR = (metal_factor * info.area * diff_metal_reduce_factor)
439+
info.diff_par = (metal_factor * info.area * diff_metal_reduce_factor)
440440
/ info.iterm_gate_area;
441-
info.diff_PSR
441+
info.diff_psr
442442
= (side_metal_factor * info.side_area * diff_metal_reduce_factor)
443443
/ info.iterm_gate_area;
444444
}
@@ -463,7 +463,7 @@ void AntennaChecker::Impl::calculateViaPar(odb::dbTechLayer* tech_layer,
463463

464464
if (info.iterm_diff_area != 0) {
465465
// Calculate PAR
466-
info.PAR = (diff_cut_factor * info.area) / info.iterm_gate_area;
466+
info.par = (diff_cut_factor * info.area) / info.iterm_gate_area;
467467

468468
double plus_diff_protect = plus_diff_factor * info.iterm_diff_area;
469469
if (!layer_info_[tech_layer].gate_plus_diff_idx.empty()) {
@@ -474,14 +474,14 @@ void AntennaChecker::Impl::calculateViaPar(odb::dbTechLayer* tech_layer,
474474
}
475475

476476
// Calculate diff_PAR
477-
info.diff_PAR = (diff_cut_factor * info.area * diff_metal_reduce_factor
477+
info.diff_par = (diff_cut_factor * info.area * diff_metal_reduce_factor
478478
- minus_diff_factor * info.iterm_diff_area)
479479
/ (info.iterm_gate_area + plus_diff_protect);
480480
} else {
481481
// Calculate PAR
482-
info.PAR = (cut_factor * info.area) / info.iterm_gate_area;
482+
info.par = (cut_factor * info.area) / info.iterm_gate_area;
483483
// Calculate diff_PAR
484-
info.diff_PAR = (cut_factor * info.area * diff_metal_reduce_factor)
484+
info.diff_par = (cut_factor * info.area * diff_metal_reduce_factor)
485485
/ info.iterm_gate_area;
486486
}
487487
}
@@ -501,7 +501,7 @@ void AntennaChecker::Impl::calculateAreas(
501501
int gates_count = 0;
502502
std::vector<odb::dbITerm*> iterms;
503503
for (const auto& gate : node_it->gates) {
504-
if (!gate.isITerm) {
504+
if (!gate.is_iterm) {
505505
continue;
506506
}
507507

@@ -526,7 +526,7 @@ void AntennaChecker::Impl::calculateAreas(
526526
}
527527
// put values on struct
528528
for (const auto& gate : node_it->gates) {
529-
if (!gate.isITerm) {
529+
if (!gate.is_iterm) {
530530
continue;
531531
}
532532
if (!isValidGate(gate.iterm->getMTerm())) {
@@ -566,7 +566,7 @@ void AntennaChecker::Impl::calculateCAR(GateToLayerToNodeInfo& gate_info)
566566
{
567567
for (auto& [gate, layer_to_node_info] : gate_info) {
568568
// Variables to store the accumulated values for vias and wires
569-
NodeInfo sumWire, sumVia;
569+
NodeInfo sum_wire, sum_via;
570570
// iterate from first_layer -> last layer, cumulate sum for wires and vias
571571
odb::dbTech* tech = db_->getTech();
572572
odb::dbTechLayer* iter_layer = tech->findRoutingLayer(1);
@@ -575,20 +575,20 @@ void AntennaChecker::Impl::calculateCAR(GateToLayerToNodeInfo& gate_info)
575575
NodeInfo& node_info = layer_to_node_info[iter_layer];
576576
if (iter_layer->getRoutingLevel() == 0) {
577577
// Accumulating the PAR of vias in sumVia
578-
sumVia += node_info;
578+
sum_via += node_info;
579579
// Updating the node with the accumulated values
580-
node_info.CAR += sumVia.PAR;
581-
node_info.CSR += sumVia.PSR;
582-
node_info.diff_CAR += sumVia.diff_PAR;
583-
node_info.diff_CSR += sumVia.diff_PSR;
580+
node_info.car += sum_via.par;
581+
node_info.csr += sum_via.psr;
582+
node_info.diff_car += sum_via.diff_par;
583+
node_info.diff_csr += sum_via.diff_psr;
584584
} else {
585585
// Accumulating the PAR of wires in sumWire
586-
sumWire += node_info;
586+
sum_wire += node_info;
587587
// Updating the node with the accumulated values
588-
node_info.CAR += sumWire.PAR;
589-
node_info.CSR += sumWire.PSR;
590-
node_info.diff_CAR += sumWire.diff_PAR;
591-
node_info.diff_CSR += sumWire.diff_PSR;
588+
node_info.car += sum_wire.par;
589+
node_info.csr += sum_wire.psr;
590+
node_info.diff_car += sum_wire.diff_par;
591+
node_info.diff_csr += sum_wire.diff_psr;
592592
}
593593
}
594594
iter_layer = iter_layer->getUpperLayer();
@@ -607,36 +607,36 @@ bool AntennaChecker::Impl::checkPAR(odb::dbNet* db_net,
607607
// get rules
608608
const odb::dbTechLayerAntennaRule* antenna_rule
609609
= tech_layer->getDefaultAntennaRule();
610-
double PAR_ratio = antenna_rule->getPAR();
611-
odb::dbTechLayerAntennaRule::pwl_pair diffPAR = antenna_rule->getDiffPAR();
612-
double diff_PAR_PWL_ratio = getPwlFactor(diffPAR, info.iterm_diff_area, 0.0);
610+
double par_ratio = antenna_rule->getPAR();
611+
odb::dbTechLayerAntennaRule::pwl_pair diff_par = antenna_rule->getDiffPAR();
612+
double diff_par_pwl_ratio = getPwlFactor(diff_par, info.iterm_diff_area, 0.0);
613613

614614
// apply ratio_margin
615-
PAR_ratio *= (1.0 - ratio_margin / 100.0);
616-
diff_PAR_PWL_ratio *= (1.0 - ratio_margin / 100.0);
615+
par_ratio *= (1.0 - ratio_margin / 100.0);
616+
diff_par_pwl_ratio *= (1.0 - ratio_margin / 100.0);
617617

618618
bool violation = false;
619619
double calculated_value = 0.0;
620620
double required_value = 0.0;
621621
// If node is connected to diffusion area or ANTENNAAREARATIO is not
622622
// defined, compare with ANTENNADIFFAREARATIO. Otherwise compare with
623623
// ANTENNAAREARATIO.
624-
if (info.iterm_diff_area != 0 || PAR_ratio == 0) {
625-
if (diff_PAR_PWL_ratio != 0) {
626-
violation = info.diff_PAR > diff_PAR_PWL_ratio;
627-
info.excess_ratio_PAR
628-
= std::max(info.excess_ratio_PAR, info.diff_PAR / diff_PAR_PWL_ratio);
624+
if (info.iterm_diff_area != 0 || par_ratio == 0) {
625+
if (diff_par_pwl_ratio != 0) {
626+
violation = info.diff_par > diff_par_pwl_ratio;
627+
info.excess_ratio_par
628+
= std::max(info.excess_ratio_par, info.diff_par / diff_par_pwl_ratio);
629629
}
630-
calculated_value = info.diff_PAR;
631-
required_value = diff_PAR_PWL_ratio;
630+
calculated_value = info.diff_par;
631+
required_value = diff_par_pwl_ratio;
632632
} else {
633-
if (PAR_ratio != 0) {
634-
violation = info.PAR > PAR_ratio;
635-
info.excess_ratio_PAR
636-
= std::max(info.excess_ratio_PAR, info.PAR / PAR_ratio);
633+
if (par_ratio != 0) {
634+
violation = info.par > par_ratio;
635+
info.excess_ratio_par
636+
= std::max(info.excess_ratio_par, info.par / par_ratio);
637637
}
638-
calculated_value = info.PAR;
639-
required_value = PAR_ratio;
638+
calculated_value = info.par;
639+
required_value = par_ratio;
640640
}
641641

642642
if (report) {
@@ -664,37 +664,37 @@ bool AntennaChecker::Impl::checkPSR(odb::dbNet* db_net,
664664
// get rules
665665
const odb::dbTechLayerAntennaRule* antenna_rule
666666
= tech_layer->getDefaultAntennaRule();
667-
double PSR_ratio = antenna_rule->getPSR();
668-
const odb::dbTechLayerAntennaRule::pwl_pair diffPSR
667+
double psr_ratio = antenna_rule->getPSR();
668+
const odb::dbTechLayerAntennaRule::pwl_pair diff_psr
669669
= antenna_rule->getDiffPSR();
670-
double diff_PSR_PWL_ratio = getPwlFactor(diffPSR, info.iterm_diff_area, 0.0);
670+
double diff_psr_pwl_ratio = getPwlFactor(diff_psr, info.iterm_diff_area, 0.0);
671671

672672
// apply ratio_margin
673-
PSR_ratio *= (1.0 - ratio_margin / 100.0);
674-
diff_PSR_PWL_ratio *= (1.0 - ratio_margin / 100.0);
673+
psr_ratio *= (1.0 - ratio_margin / 100.0);
674+
diff_psr_pwl_ratio *= (1.0 - ratio_margin / 100.0);
675675

676676
bool violation = false;
677677
double calculated_value = 0.0;
678678
double required_value = 0.0;
679679
// If node is connected to diffusion area or ANTENNASIDEAREARATIO is not
680680
// defined, compare with ANTENNADIFFSIDEAREARATIO. Otherwise compare with
681681
// ANTENNASIDEAREARATIO.
682-
if (info.iterm_diff_area != 0 || PSR_ratio == 0) {
683-
if (diff_PSR_PWL_ratio != 0) {
684-
violation = info.diff_PSR > diff_PSR_PWL_ratio;
685-
info.excess_ratio_PSR
686-
= std::max(info.excess_ratio_PSR, info.diff_PSR / diff_PSR_PWL_ratio);
682+
if (info.iterm_diff_area != 0 || psr_ratio == 0) {
683+
if (diff_psr_pwl_ratio != 0) {
684+
violation = info.diff_psr > diff_psr_pwl_ratio;
685+
info.excess_ratio_psr
686+
= std::max(info.excess_ratio_psr, info.diff_psr / diff_psr_pwl_ratio);
687687
}
688-
calculated_value = info.diff_PSR;
689-
required_value = diff_PSR_PWL_ratio;
688+
calculated_value = info.diff_psr;
689+
required_value = diff_psr_pwl_ratio;
690690
} else {
691-
if (PSR_ratio != 0) {
692-
violation = info.PSR > PSR_ratio;
693-
info.excess_ratio_PSR
694-
= std::max(info.excess_ratio_PSR, info.PSR / PSR_ratio);
691+
if (psr_ratio != 0) {
692+
violation = info.psr > psr_ratio;
693+
info.excess_ratio_psr
694+
= std::max(info.excess_ratio_psr, info.psr / psr_ratio);
695695
}
696-
calculated_value = info.PSR;
697-
required_value = PSR_ratio;
696+
calculated_value = info.psr;
697+
required_value = psr_ratio;
698698
}
699699

700700
if (report) {
@@ -720,30 +720,30 @@ bool AntennaChecker::Impl::checkCAR(odb::dbNet* db_net,
720720
// get rules
721721
const odb::dbTechLayerAntennaRule* antenna_rule
722722
= tech_layer->getDefaultAntennaRule();
723-
const double CAR_ratio = antenna_rule->getCAR();
724-
const odb::dbTechLayerAntennaRule::pwl_pair diffCAR
723+
const double car_ratio = antenna_rule->getCAR();
724+
const odb::dbTechLayerAntennaRule::pwl_pair diff_car
725725
= antenna_rule->getDiffCAR();
726-
const double diff_CAR_PWL_ratio
727-
= getPwlFactor(diffCAR, info.iterm_diff_area, 0);
726+
const double diff_car_pwl_ratio
727+
= getPwlFactor(diff_car, info.iterm_diff_area, 0);
728728

729729
bool violation = false;
730730
double calculated_value = 0.0;
731731
double required_value = 0.0;
732732
// If node is connected to diffusion area or ANTENNACUMAREARATIO is not
733733
// defined, compare with ANTENNACUMDIFFAREARATIO. Otherwise compare with
734734
// ANTENNACUMAREARATIO.
735-
if (info.iterm_diff_area != 0 || CAR_ratio == 0) {
736-
if (diff_CAR_PWL_ratio != 0) {
737-
violation = info.diff_CAR > diff_CAR_PWL_ratio;
735+
if (info.iterm_diff_area != 0 || car_ratio == 0) {
736+
if (diff_car_pwl_ratio != 0) {
737+
violation = info.diff_car > diff_car_pwl_ratio;
738738
}
739-
calculated_value = info.diff_CAR;
740-
required_value = diff_CAR_PWL_ratio;
739+
calculated_value = info.diff_car;
740+
required_value = diff_car_pwl_ratio;
741741
} else {
742-
if (CAR_ratio != 0) {
743-
violation = info.CAR > CAR_ratio;
742+
if (car_ratio != 0) {
743+
violation = info.car > car_ratio;
744744
}
745-
calculated_value = info.CAR;
746-
required_value = CAR_ratio;
745+
calculated_value = info.car;
746+
required_value = car_ratio;
747747
}
748748

749749
if (report) {
@@ -769,30 +769,30 @@ bool AntennaChecker::Impl::checkCSR(odb::dbNet* db_net,
769769
// get rules
770770
const odb::dbTechLayerAntennaRule* antenna_rule
771771
= tech_layer->getDefaultAntennaRule();
772-
const double CSR_ratio = antenna_rule->getCSR();
773-
const odb::dbTechLayerAntennaRule::pwl_pair diffCSR
772+
const double csr_ratio = antenna_rule->getCSR();
773+
const odb::dbTechLayerAntennaRule::pwl_pair diff_csr
774774
= antenna_rule->getDiffCSR();
775-
const double diff_CSR_PWL_ratio
776-
= getPwlFactor(diffCSR, info.iterm_diff_area, 0);
775+
const double diff_csr_pwl_ratio
776+
= getPwlFactor(diff_csr, info.iterm_diff_area, 0);
777777

778778
bool violation = false;
779779
double calculated_value = 0.0;
780780
double required_value = 0.0;
781781
// If node is connected to diffusion area or ANTENNACUMSIDEAREARATIO is not
782782
// defined, compare with ANTENNACUMDIFFSIDEAREARATIO. Otherwise compare with
783783
// ANTENNACUMSIDEAREARATIO.
784-
if (info.iterm_diff_area != 0 || CSR_ratio == 0) {
785-
if (diff_CSR_PWL_ratio != 0) {
786-
violation = info.diff_CSR > diff_CSR_PWL_ratio;
784+
if (info.iterm_diff_area != 0 || csr_ratio == 0) {
785+
if (diff_csr_pwl_ratio != 0) {
786+
violation = info.diff_csr > diff_csr_pwl_ratio;
787787
}
788-
calculated_value = info.diff_CSR;
789-
required_value = diff_CSR_PWL_ratio;
788+
calculated_value = info.diff_csr;
789+
required_value = diff_csr_pwl_ratio;
790790
} else {
791-
if (CSR_ratio != 0) {
792-
violation = info.CSR > CSR_ratio;
791+
if (csr_ratio != 0) {
792+
violation = info.csr > csr_ratio;
793793
}
794-
calculated_value = info.CSR;
795-
required_value = CSR_ratio;
794+
calculated_value = info.csr;
795+
required_value = csr_ratio;
796796
}
797797

798798
if (report) {
@@ -947,8 +947,8 @@ int AntennaChecker::Impl::checkGates(odb::dbNet* db_net,
947947
bool violated = par_violation || psr_violation;
948948
double excess_ratio = 1.0;
949949
if (violated) {
950-
excess_ratio = std::max(violation_info.excess_ratio_PAR,
951-
violation_info.excess_ratio_PSR);
950+
excess_ratio = std::max(violation_info.excess_ratio_par,
951+
violation_info.excess_ratio_psr);
952952
}
953953
// while it has violation, increase iterm_diff_area
954954
if (diode_mterm) {
@@ -980,15 +980,15 @@ int AntennaChecker::Impl::checkGates(odb::dbNet* db_net,
980980
false,
981981
net_report);
982982
}
983-
if (diode_count_per_gate > max_diode_count_per_gate) {
983+
if (diode_count_per_gate > kMaxDiodeCountPerGate) {
984984
debugPrint(logger_,
985985
utl::ANT,
986986
"check_gates",
987987
1,
988988
"Net {} requires more than {} diodes per gate to "
989989
"repair violations.",
990990
db_net->getConstName(),
991-
max_diode_count_per_gate);
991+
kMaxDiodeCountPerGate);
992992
break;
993993
}
994994
}
@@ -1059,9 +1059,9 @@ void AntennaChecker::Impl::buildLayerMaps(odb::dbNet* db_net,
10591059
int node_count = 0;
10601060
for (const auto& layer_it : set_by_layer) {
10611061
for (const auto& pol_it : layer_it.second) {
1062-
bool isVia = layer_it.first->getRoutingLevel() == 0;
1062+
bool is_via = layer_it.first->getRoutingLevel() == 0;
10631063
node_by_layer_map[layer_it.first].push_back(
1064-
std::make_unique<GraphNode>(node_count, isVia, pol_it));
1064+
std::make_unique<GraphNode>(node_count, is_via, pol_it));
10651065
node_count++;
10661066
}
10671067
}

0 commit comments

Comments
 (0)