Skip to content
Merged
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
22 changes: 11 additions & 11 deletions src/pdn/include/pdn/PdnGen.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ namespace pdn {

enum ExtensionMode
{
CORE,
RINGS,
BOUNDARY,
FIXED
kCore,
kRings,
kBoundary,
kFixed
};

enum StartsWith
{
GRID,
POWER,
GROUND
kGrid,
kPower,
kGround
};

enum PowerSwitchNetworkType
{
STAR,
DAISY
kStar,
kDaisy
};

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

void createSrouteWires(const char* net,
const char* outerNet,
const char* outer_net,
odb::dbTechLayer* layer0,
odb::dbTechLayer* layer1,
int cut_pitch_x,
Expand All @@ -174,7 +174,7 @@ class PdnGen
int max_rows,
int max_columns,
const std::vector<odb::dbTechLayer*>& ongrid,
const std::vector<int>& metalWidths,
const std::vector<int>& metal_widths,
const std::vector<int>& metalspaces,
const std::vector<odb::dbInst*>& insts);

Expand Down
22 changes: 11 additions & 11 deletions src/pdn/src/PdnGen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void PdnGen::trimShapes()
std::map<odb::dbTechLayer*, std::unique_ptr<TechLayer>> tech_layers;

for (auto* grid : grids) {
if (grid->type() == Grid::Existing) {
if (grid->type() == Grid::kExisting) {
// fixed shapes, so nothing to do
continue;
}
Expand Down Expand Up @@ -458,10 +458,10 @@ void PdnGen::makeCoreGrid(
const std::vector<odb::dbTechLayer*>& pad_pin_layers)
{
auto grid = std::make_unique<CoreGrid>(
domain, name, starts_with == POWER, generate_obstructions);
domain, name, starts_with == kPower, generate_obstructions);
grid->setPinLayers(pin_layers);

PowerSwitchNetworkType control_network = PowerSwitchNetworkType::DAISY;
PowerSwitchNetworkType control_network = PowerSwitchNetworkType::kDaisy;
if (strlen(powercontrolnetwork) > 0) {
control_network
= GridSwitchedPower::fromString(powercontrolnetwork, logger_);
Expand Down Expand Up @@ -549,7 +549,7 @@ void PdnGen::makeInstanceGrid(
grid = std::make_unique<BumpGrid>(domain, name, inst);
} else {
grid = std::make_unique<InstanceGrid>(
domain, name, starts_with == POWER, inst, generate_obstructions);
domain, name, starts_with == kPower, inst, generate_obstructions);
}
if (!std::ranges::all_of(halo, [](int v) { return v == 0; })) {
grid->addHalo(halo);
Expand Down Expand Up @@ -599,15 +599,15 @@ void PdnGen::makeRing(Grid* grid,
ring->setPadOffset(pad_offset);
}
ring->setExtendToBoundary(extend);
if (starts_with != GRID) {
ring->setStartWithPower(starts_with == POWER);
if (starts_with != kGrid) {
ring->setStartWithPower(starts_with == kPower);
}
if (allow_out_of_die) {
ring->setAllowOutsideDieArea();
}
ring->setNets(nets);
grid->addRing(std::move(ring));
if (!pad_pin_layers.empty() && grid->type() == Grid::Core) {
if (!pad_pin_layers.empty() && grid->type() == Grid::kCore) {
auto* core_grid = static_cast<CoreGrid*>(grid);
core_grid->setupDirectConnect(pad_pin_layers);
for (const auto& comp : core_grid->getStraps()) {
Expand Down Expand Up @@ -649,8 +649,8 @@ void PdnGen::makeStrap(Grid* grid,
strap->setExtend(extend);
strap->setOffset(offset);
strap->setSnapToGrid(snap);
if (starts_with != GRID) {
strap->setStartWithPower(starts_with == POWER);
if (starts_with != kGrid) {
strap->setStartWithPower(starts_with == kPower);
}
strap->setNets(nets);
strap->setAllowOutsideCoreArea(allow_out_of_core);
Expand Down Expand Up @@ -736,7 +736,7 @@ void PdnGen::updateRenderer(bool reset) const

void PdnGen::createSrouteWires(
const char* net,
const char* outerNet,
const char* outer_net,
odb::dbTechLayer* layer0,
odb::dbTechLayer* layer1,
int cut_pitch_x,
Expand All @@ -751,7 +751,7 @@ void PdnGen::createSrouteWires(
const std::vector<odb::dbInst*>& insts)
{
sroute_->createSrouteWires(net,
outerNet,
outer_net,
layer0,
layer1,
cut_pitch_x,
Expand Down
28 changes: 14 additions & 14 deletions src/pdn/src/PdnGen.i
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ using utl::PDN;
%typemap(in) pdn::ExtensionMode {
char *str = Tcl_GetStringFromObj($input, 0);
if (strcasecmp(str, "Core") == 0) {
$1 = pdn::ExtensionMode::CORE;
$1 = pdn::ExtensionMode::kCore;
} else if (strcasecmp(str, "Rings") == 0) {
$1 = pdn::ExtensionMode::RINGS;
$1 = pdn::ExtensionMode::kRings;
} else if (strcasecmp(str, "Boundary") == 0) {
$1 = pdn::ExtensionMode::BOUNDARY;
$1 = pdn::ExtensionMode::kBoundary;
} else {
$1 = pdn::ExtensionMode::CORE;
$1 = pdn::ExtensionMode::kCore;
}
}

Expand Down Expand Up @@ -88,9 +88,9 @@ void make_core_grid(pdn::VoltageDomain* domain,
const std::vector<odb::dbTechLayer*>& pad_pin_layers)
{
PdnGen* pdngen = ord::getPdnGen();
StartsWith starts_with = POWER;
StartsWith starts_with = kPower;
if (!starts_with_power) {
starts_with = GROUND;
starts_with = kGround;
}
pdngen->makeCoreGrid(domain,
name,
Expand All @@ -117,9 +117,9 @@ void make_instance_grid(pdn::VoltageDomain* domain,
bool is_bump)
{
PdnGen* pdngen = ord::getPdnGen();
StartsWith starts_with = POWER;
StartsWith starts_with = kPower;
if (!starts_with_power) {
starts_with = GROUND;
starts_with = kGround;
}

std::array<int, 4> halo{x0, y0, x1, y1};
Expand Down Expand Up @@ -156,12 +156,12 @@ void make_ring(const char* grid_name,
bool allow_outside_of_die)
{
PdnGen* pdngen = ord::getPdnGen();
StartsWith starts_with = GRID;
StartsWith starts_with = kGrid;
if (!use_grid_power_order) {
if (starts_with_power) {
starts_with = POWER;
starts_with = kPower;
} else {
starts_with = GROUND;
starts_with = kGround;
}
}
for (auto* grid : pdngen->findGrid(grid_name)) {
Expand Down Expand Up @@ -238,12 +238,12 @@ void make_strap(const char* grid_name,
bool allow_out_of_core)
{
PdnGen* pdngen = ord::getPdnGen();
StartsWith starts_with = GRID;
StartsWith starts_with = kGrid;
if (!use_grid_power_order) {
if (starts_with_power) {
starts_with = POWER;
starts_with = kPower;
} else {
starts_with = GROUND;
starts_with = kGround;
}
}
for (auto* grid : pdngen->findGrid(grid_name)) {
Expand Down
16 changes: 8 additions & 8 deletions src/pdn/src/connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void Connect::makeVia(odb::dbSWire* wire,
}

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

Expand Down Expand Up @@ -974,7 +974,7 @@ void Connect::printViaReport() const
}
}

void Connect::addFailedVia(failedViaReason reason,
void Connect::addFailedVia(FailedViaReason reason,
const odb::Rect& rect,
odb::dbNet* net)
{
Expand All @@ -999,22 +999,22 @@ void Connect::recordFailedVias() const
for (const auto& [reason, shapes] : failed_vias_) {
std::string reason_str;
switch (reason) {
case failedViaReason::OBSTRUCTED:
case FailedViaReason::kObstructed:
reason_str = "Obstructed";
break;
case failedViaReason::OVERLAPPING:
case FailedViaReason::kOverlapping:
reason_str = "Overlapping";
break;
case failedViaReason::BUILD:
case FailedViaReason::kBuild:
reason_str = "Build";
break;
case failedViaReason::RIPUP:
case FailedViaReason::kRipup:
reason_str = "Ripup";
break;
case failedViaReason::RECHECK:
case FailedViaReason::kRecheck:
// Do not report recheck vias
continue;
case failedViaReason::OTHER:
case FailedViaReason::kOther:
reason_str = "Other";
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/pdn/src/connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Connect

void printViaReport() const;

void addFailedVia(failedViaReason reason,
void addFailedVia(FailedViaReason reason,
const odb::Rect& rect,
odb::dbNet* net);
void recordFailedVias() const;
Expand Down Expand Up @@ -120,7 +120,7 @@ class Connect
std::vector<odb::dbTechLayer*> intermediate_layers_;
std::vector<odb::dbTechLayer*> intermediate_routing_layers_;

std::map<failedViaReason, std::set<std::pair<odb::dbNet*, odb::Rect>>>
std::map<FailedViaReason, std::set<std::pair<odb::dbNet*, odb::Rect>>>
failed_vias_;

DbVia* makeSingleLayerVia(
Expand Down
Loading
Loading