Skip to content

Commit b614897

Browse files
committed
web: adjust naming to Google-style (excluding method names)
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent 248e73e commit b614897

14 files changed

Lines changed: 333 additions & 333 deletions

src/web/src/clock_tree_report.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ namespace web {
3636
const char* ClockTreeNode::typeToString(Type t)
3737
{
3838
switch (t) {
39-
case ROOT:
39+
case kRoot:
4040
return "root";
41-
case BUFFER:
41+
case kBuffer:
4242
return "buffer";
43-
case INVERTER:
43+
case kInverter:
4444
return "inverter";
45-
case CLOCK_GATE:
45+
case kClockGate:
4646
return "clock_gate";
47-
case REGISTER:
47+
case kRegister:
4848
return "register";
49-
case MACRO:
49+
case kMacro:
5050
return "macro";
5151
default:
5252
return "unknown";
@@ -198,22 +198,22 @@ ClockTreeNode::Type classifyDriver(const sta::Pin* pin, sta::dbNetwork* network)
198198
{
199199
sta::Instance* inst = network->instance(pin);
200200
if (!inst) {
201-
return ClockTreeNode::ROOT;
201+
return ClockTreeNode::kRoot;
202202
}
203203
sta::LibertyCell* cell = network->libertyCell(inst);
204204
if (!cell) {
205-
return ClockTreeNode::UNKNOWN;
205+
return ClockTreeNode::kUnknown;
206206
}
207207
if (cell->isClockGate()) {
208-
return ClockTreeNode::CLOCK_GATE;
208+
return ClockTreeNode::kClockGate;
209209
}
210210
if (cell->isInverter()) {
211-
return ClockTreeNode::INVERTER;
211+
return ClockTreeNode::kInverter;
212212
}
213213
if (cell->isBuffer()) {
214-
return ClockTreeNode::BUFFER;
214+
return ClockTreeNode::kBuffer;
215215
}
216-
return ClockTreeNode::UNKNOWN;
216+
return ClockTreeNode::kUnknown;
217217
}
218218

219219
struct ResolvedPin
@@ -234,16 +234,16 @@ ClockTreeNode::Type classifyLeaf(const sta::Pin* pin, sta::dbNetwork* network)
234234
{
235235
sta::Instance* inst = network->instance(pin);
236236
if (!inst) {
237-
return ClockTreeNode::UNKNOWN;
237+
return ClockTreeNode::kUnknown;
238238
}
239239
auto [iterm, bterm] = resolveStaPin(pin, network);
240240
if (iterm) {
241241
odb::dbInst* db_inst = iterm->getInst();
242242
if (db_inst->getMaster()->getType().isBlock()) {
243-
return ClockTreeNode::MACRO;
243+
return ClockTreeNode::kMacro;
244244
}
245245
}
246-
return ClockTreeNode::REGISTER;
246+
return ClockTreeNode::kRegister;
247247
}
248248

249249
void getPinLocation(const sta::Pin* pin,
@@ -320,7 +320,7 @@ void flattenNode(const TreeNode* tree,
320320
root_node.id = static_cast<int>(data.nodes.size());
321321
root_node.parent_id = -1;
322322
root_node.name = clock_name;
323-
root_node.type = ClockTreeNode::ROOT;
323+
root_node.type = ClockTreeNode::kRoot;
324324
root_node.level = 0;
325325
root_node.fanout
326326
= static_cast<int>(tree->fanout.size() + tree->leaves.size());

src/web/src/clock_tree_report.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ struct ClockTreeNode
2121

2222
enum Type
2323
{
24-
ROOT,
25-
BUFFER,
26-
INVERTER,
27-
CLOCK_GATE,
28-
REGISTER,
29-
MACRO,
30-
UNKNOWN
24+
kRoot,
25+
kBuffer,
26+
kInverter,
27+
kClockGate,
28+
kRegister,
29+
kMacro,
30+
kUnknown
3131
};
32-
Type type = UNKNOWN;
32+
Type type = kUnknown;
3333

3434
float arrival = 0.0f; // input arrival (user time units)
3535
float delay = 0.0f; // cell delay (user time units)

src/web/src/hierarchy_report.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static void emitLeafNodes(odb::dbModule* module,
143143
leaf.id = leaf_id;
144144
leaf.parent_id = parent_id;
145145
leaf.inst_name = "Leaf instances";
146-
leaf.node_kind = HierarchyNodeKind::LEAF_GROUP;
146+
leaf.node_kind = HierarchyNodeKind::kLeafGroup;
147147

148148
// Aggregate totals for the leaf group
149149
for (const auto& [name, bucket] : buckets) {
@@ -165,7 +165,7 @@ static void emitLeafNodes(odb::dbModule* module,
165165
type_node.id = type_id;
166166
type_node.parent_id = leaf_id;
167167
type_node.inst_name = type_name;
168-
type_node.node_kind = HierarchyNodeKind::TYPE_GROUP;
168+
type_node.node_kind = HierarchyNodeKind::kTypeGroup;
169169
type_node.area = static_cast<double>(bucket.area_dbu2);
170170
if (bucket.is_macro) {
171171
type_node.macros = bucket.count;
@@ -185,7 +185,7 @@ static void emitLeafNodes(odb::dbModule* module,
185185
inst_node.parent_id = type_id;
186186
inst_node.inst_name = inst->getConstName();
187187
inst_node.module_name = inst->getMaster()->getConstName();
188-
inst_node.node_kind = HierarchyNodeKind::INSTANCE;
188+
inst_node.node_kind = HierarchyNodeKind::kInstance;
189189
inst_node.macros = 1;
190190
inst_node.local_macros = 1;
191191
inst_node.area = static_cast<double>(inst->getBBox()->getBox().area());

src/web/src/hierarchy_report.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace web {
1919
// Node types in the hierarchy tree
2020
enum class HierarchyNodeKind
2121
{
22-
MODULE = 0, // Module (default)
23-
LEAF_GROUP = 1, // "Leaf instances" folder
24-
TYPE_GROUP = 2, // Instance type sub-group (e.g. "Standard cell", "Macro")
25-
INSTANCE = 3, // Individual instance row (only for macros)
22+
kModule = 0, // Module (default)
23+
kLeafGroup = 1, // "Leaf instances" folder
24+
kTypeGroup = 2, // Instance type sub-group (e.g. "Standard cell", "Macro")
25+
kInstance = 3, // Individual instance row (only for macros)
2626
};
2727

2828
struct HierarchyNode
@@ -38,7 +38,7 @@ struct HierarchyNode
3838
int local_insts = 0; // direct stdcell count
3939
int local_macros = 0; // direct macro count
4040
int local_modules = 0; // direct child module count
41-
HierarchyNodeKind node_kind = HierarchyNodeKind::MODULE;
41+
HierarchyNodeKind node_kind = HierarchyNodeKind::kModule;
4242
unsigned int odb_id = 0; // dbModule::getId() for MODULE nodes
4343
};
4444

src/web/src/request_handler.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,23 +516,23 @@ WebSocketResponse dispatch_request(
516516
resp.id = req.id;
517517

518518
switch (req.type) {
519-
case WebSocketRequest::BOUNDS: {
519+
case WebSocketRequest::kBounds: {
520520
resp.type = 0;
521521
JsonBuilder builder;
522522
serializeBoundsResponse(builder, gen, gen.shapesReady());
523523
const std::string& json = builder.str();
524524
resp.payload.assign(json.begin(), json.end());
525525
break;
526526
}
527-
case WebSocketRequest::TECH: {
527+
case WebSocketRequest::kTech: {
528528
resp.type = 0;
529529
JsonBuilder builder;
530530
serializeTechResponse(builder, gen);
531531
const std::string& json = builder.str();
532532
resp.payload.assign(json.begin(), json.end());
533533
break;
534534
}
535-
case WebSocketRequest::TILE: {
535+
case WebSocketRequest::kTile: {
536536
resp.type = 1;
537537
resp.payload = gen.generateTile(req.layer,
538538
req.z,
@@ -1908,10 +1908,10 @@ WebSocketResponse TileHandler::handleModuleHierarchy(
19081908
builder.field("local_insts", n.local_insts);
19091909
builder.field("local_macros", n.local_macros);
19101910
builder.field("local_modules", n.local_modules);
1911-
if (n.node_kind != HierarchyNodeKind::MODULE) {
1911+
if (n.node_kind != HierarchyNodeKind::kModule) {
19121912
builder.field("node_kind", static_cast<int>(n.node_kind));
19131913
}
1914-
if (n.node_kind == HierarchyNodeKind::MODULE) {
1914+
if (n.node_kind == HierarchyNodeKind::kModule) {
19151915
builder.field("odb_id", static_cast<int>(n.odb_id));
19161916
}
19171917
builder.endObject();
@@ -1938,7 +1938,7 @@ WebSocketResponse TileHandler::handleSetModuleColors(
19381938

19391939
// Parse compact format: "id:r,g,b,a;id:r,g,b,a;..."
19401940
std::map<uint32_t, Color> colors;
1941-
const std::string data = extract_string(req.vis.raw_json_, "colors");
1941+
const std::string data = extract_string(req.vis.raw_json, "colors");
19421942
if (!data.empty()) {
19431943
size_t pos = 0;
19441944
while (pos < data.size()) {

src/web/src/request_handler.h

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -62,45 +62,45 @@ struct WebSocketRequest
6262
{
6363
enum Type
6464
{
65-
TILE,
66-
BOUNDS,
67-
TECH,
68-
SELECT,
69-
INSPECT,
70-
INSPECT_BACK,
71-
HOVER,
72-
TCL_EVAL,
73-
TCL_COMPLETE,
74-
TIMING_REPORT,
75-
TIMING_HIGHLIGHT,
76-
CLOCK_TREE,
77-
CLOCK_TREE_HIGHLIGHT,
78-
SLACK_HISTOGRAM,
79-
CHART_FILTERS,
80-
MODULE_HIERARCHY,
81-
SET_MODULE_COLORS,
82-
SET_FOCUS_NETS,
83-
SET_ROUTE_GUIDES,
84-
HEATMAPS,
85-
SET_ACTIVE_HEATMAP,
86-
SET_HEATMAP,
87-
HEATMAP_TILE,
88-
LIST_DIR,
89-
SNAP,
90-
SCHEMATIC_CONE,
91-
SCHEMATIC_FULL,
92-
SCHEMATIC_INSPECT,
93-
DRC_CATEGORIES,
94-
DRC_MARKERS,
95-
DRC_LOAD_REPORT,
96-
DRC_UPDATE_MARKER,
97-
DRC_UPDATE_CATEGORY_VISIBILITY,
98-
DRC_HIGHLIGHT,
99-
UNKNOWN
65+
kTile,
66+
kBounds,
67+
kTech,
68+
kSelect,
69+
kInspect,
70+
kInspectBack,
71+
kHover,
72+
kTclEval,
73+
kTclComplete,
74+
kTimingReport,
75+
kTimingHighlight,
76+
kClockTree,
77+
kClockTreeHighlight,
78+
kSlackHistogram,
79+
kChartFilters,
80+
kModuleHierarchy,
81+
kSetModuleColors,
82+
kSetFocusNets,
83+
kSetRouteGuides,
84+
kHeatmaps,
85+
kSetActiveHeatmap,
86+
kSetHeatmap,
87+
kHeatmapTile,
88+
kListDir,
89+
kSnap,
90+
kSchematicCone,
91+
kSchematicFull,
92+
kSchematicInspect,
93+
kDrcCategories,
94+
kDrcMarkers,
95+
kDrcLoadReport,
96+
kDrcUpdateMarker,
97+
kDrcUpdateCategoryVisibility,
98+
kDrcHighlight,
99+
kUnknown
100100
};
101101

102102
uint32_t id = 0;
103-
Type type = UNKNOWN;
103+
Type type = kUnknown;
104104
std::string layer;
105105
int z = 0;
106106
int x = 0;

src/web/src/search.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void Search::updateShapes(odb::dbBlock* block)
344344
continue;
345345
}
346346
odb::dbTechLayer* layer = box->getTechLayer();
347-
net_shapes[layer].emplace_back(box->getBox(), BTERM, term->getNet());
347+
net_shapes[layer].emplace_back(box->getBox(), kBterm, term->getNet());
348348
}
349349
}
350350
}
@@ -604,14 +604,14 @@ void Search::addVia(
604604
for (odb::dbBox* box : via->getBoxes()) {
605605
odb::Rect bbox = box->getBox();
606606
bbox.moveDelta(x, y);
607-
tree_shapes[box->getTechLayer()].emplace_back(bbox, VIA, net);
607+
tree_shapes[box->getTechLayer()].emplace_back(bbox, kVia, net);
608608
}
609609
} else {
610610
odb::dbVia* via = shape->getVia();
611611
for (odb::dbBox* box : via->getBoxes()) {
612612
odb::Rect bbox = box->getBox();
613613
bbox.moveDelta(x, y);
614-
tree_shapes[box->getTechLayer()].emplace_back(bbox, VIA, net);
614+
tree_shapes[box->getTechLayer()].emplace_back(bbox, kVia, net);
615615
}
616616
}
617617
}
@@ -660,7 +660,7 @@ void Search::addNet(
660660
if (s.isVia()) {
661661
addVia(net, &s, itr.prev_x_, itr.prev_y_, tree_shapes);
662662
} else {
663-
tree_shapes[s.getTechLayer()].emplace_back(s.getBox(), WIRE, net);
663+
tree_shapes[s.getTechLayer()].emplace_back(s.getBox(), kWire, net);
664664
}
665665
}
666666
}
@@ -1128,13 +1128,13 @@ Search::SnapResult Search::searchNearestEdge(
11281128
search_box.yMin(),
11291129
search_box.xMax(),
11301130
search_box.yMax())) {
1131-
if (!vis.routing && type == WIRE) {
1131+
if (!vis.routing && type == kWire) {
11321132
continue;
11331133
}
1134-
if (!vis.routing && type == VIA) {
1134+
if (!vis.routing && type == kVia) {
11351135
continue;
11361136
}
1137-
if (!vis.pins && type == BTERM) {
1137+
if (!vis.pins && type == kBterm) {
11381138
continue;
11391139
}
11401140
if (vis.isNetVisible(net)) {

src/web/src/search.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class Search : public odb::dbBlockCallBackObj
5454
public:
5555
enum RouteBoxType
5656
{
57-
WIRE,
58-
VIA,
59-
BTERM
57+
kWire,
58+
kVia,
59+
kBterm
6060
};
6161

6262
template <typename T>

0 commit comments

Comments
 (0)