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
32 changes: 16 additions & 16 deletions src/web/src/clock_tree_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ namespace web {
const char* ClockTreeNode::typeToString(Type t)
{
switch (t) {
case ROOT:
case kRoot:
return "root";
case BUFFER:
case kBuffer:
return "buffer";
case INVERTER:
case kInverter:
return "inverter";
case CLOCK_GATE:
case kClockGate:
return "clock_gate";
case REGISTER:
case kRegister:
return "register";
case MACRO:
case kMacro:
return "macro";
default:
return "unknown";
Expand Down Expand Up @@ -198,22 +198,22 @@ ClockTreeNode::Type classifyDriver(const sta::Pin* pin, sta::dbNetwork* network)
{
sta::Instance* inst = network->instance(pin);
if (!inst) {
return ClockTreeNode::ROOT;
return ClockTreeNode::kRoot;
}
sta::LibertyCell* cell = network->libertyCell(inst);
if (!cell) {
return ClockTreeNode::UNKNOWN;
return ClockTreeNode::kUnknown;
}
if (cell->isClockGate()) {
return ClockTreeNode::CLOCK_GATE;
return ClockTreeNode::kClockGate;
}
if (cell->isInverter()) {
return ClockTreeNode::INVERTER;
return ClockTreeNode::kInverter;
}
if (cell->isBuffer()) {
return ClockTreeNode::BUFFER;
return ClockTreeNode::kBuffer;
}
return ClockTreeNode::UNKNOWN;
return ClockTreeNode::kUnknown;
}

struct ResolvedPin
Expand All @@ -234,16 +234,16 @@ ClockTreeNode::Type classifyLeaf(const sta::Pin* pin, sta::dbNetwork* network)
{
sta::Instance* inst = network->instance(pin);
if (!inst) {
return ClockTreeNode::UNKNOWN;
return ClockTreeNode::kUnknown;
}
auto [iterm, bterm] = resolveStaPin(pin, network);
if (iterm) {
odb::dbInst* db_inst = iterm->getInst();
if (db_inst->getMaster()->getType().isBlock()) {
return ClockTreeNode::MACRO;
return ClockTreeNode::kMacro;
}
}
return ClockTreeNode::REGISTER;
return ClockTreeNode::kRegister;
}

void getPinLocation(const sta::Pin* pin,
Expand Down Expand Up @@ -320,7 +320,7 @@ void flattenNode(const TreeNode* tree,
root_node.id = static_cast<int>(data.nodes.size());
root_node.parent_id = -1;
root_node.name = clock_name;
root_node.type = ClockTreeNode::ROOT;
root_node.type = ClockTreeNode::kRoot;
root_node.level = 0;
root_node.fanout
= static_cast<int>(tree->fanout.size() + tree->leaves.size());
Expand Down
16 changes: 8 additions & 8 deletions src/web/src/clock_tree_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ struct ClockTreeNode

enum Type
{
ROOT,
BUFFER,
INVERTER,
CLOCK_GATE,
REGISTER,
MACRO,
UNKNOWN
kRoot,
kBuffer,
kInverter,
kClockGate,
kRegister,
kMacro,
kUnknown
};
Type type = UNKNOWN;
Type type = kUnknown;

float arrival = 0.0f; // input arrival (user time units)
float delay = 0.0f; // cell delay (user time units)
Expand Down
6 changes: 3 additions & 3 deletions src/web/src/hierarchy_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static void emitLeafNodes(odb::dbModule* module,
leaf.id = leaf_id;
leaf.parent_id = parent_id;
leaf.inst_name = "Leaf instances";
leaf.node_kind = HierarchyNodeKind::LEAF_GROUP;
leaf.node_kind = HierarchyNodeKind::kLeafGroup;

// Aggregate totals for the leaf group
for (const auto& [name, bucket] : buckets) {
Expand All @@ -165,7 +165,7 @@ static void emitLeafNodes(odb::dbModule* module,
type_node.id = type_id;
type_node.parent_id = leaf_id;
type_node.inst_name = type_name;
type_node.node_kind = HierarchyNodeKind::TYPE_GROUP;
type_node.node_kind = HierarchyNodeKind::kTypeGroup;
type_node.area = static_cast<double>(bucket.area_dbu2);
if (bucket.is_macro) {
type_node.macros = bucket.count;
Expand All @@ -185,7 +185,7 @@ static void emitLeafNodes(odb::dbModule* module,
inst_node.parent_id = type_id;
inst_node.inst_name = inst->getConstName();
inst_node.module_name = inst->getMaster()->getConstName();
inst_node.node_kind = HierarchyNodeKind::INSTANCE;
inst_node.node_kind = HierarchyNodeKind::kInstance;
inst_node.macros = 1;
inst_node.local_macros = 1;
inst_node.area = static_cast<double>(inst->getBBox()->getBox().area());
Expand Down
10 changes: 5 additions & 5 deletions src/web/src/hierarchy_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ namespace web {
// Node types in the hierarchy tree
enum class HierarchyNodeKind
{
MODULE = 0, // Module (default)
LEAF_GROUP = 1, // "Leaf instances" folder
TYPE_GROUP = 2, // Instance type sub-group (e.g. "Standard cell", "Macro")
INSTANCE = 3, // Individual instance row (only for macros)
kModule = 0, // Module (default)
kLeafGroup = 1, // "Leaf instances" folder
kTypeGroup = 2, // Instance type sub-group (e.g. "Standard cell", "Macro")
kInstance = 3, // Individual instance row (only for macros)
};

struct HierarchyNode
Expand All @@ -38,7 +38,7 @@ struct HierarchyNode
int local_insts = 0; // direct stdcell count
int local_macros = 0; // direct macro count
int local_modules = 0; // direct child module count
HierarchyNodeKind node_kind = HierarchyNodeKind::MODULE;
HierarchyNodeKind node_kind = HierarchyNodeKind::kModule;
unsigned int odb_id = 0; // dbModule::getId() for MODULE nodes
};

Expand Down
12 changes: 6 additions & 6 deletions src/web/src/request_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,23 +516,23 @@ WebSocketResponse dispatch_request(
resp.id = req.id;

switch (req.type) {
case WebSocketRequest::BOUNDS: {
case WebSocketRequest::kBounds: {
resp.type = 0;
JsonBuilder builder;
serializeBoundsResponse(builder, gen, gen.shapesReady());
const std::string& json = builder.str();
resp.payload.assign(json.begin(), json.end());
break;
}
case WebSocketRequest::TECH: {
case WebSocketRequest::kTech: {
resp.type = 0;
JsonBuilder builder;
serializeTechResponse(builder, gen);
const std::string& json = builder.str();
resp.payload.assign(json.begin(), json.end());
break;
}
case WebSocketRequest::TILE: {
case WebSocketRequest::kTile: {
resp.type = 1;
resp.payload = gen.generateTile(req.layer,
req.z,
Expand Down Expand Up @@ -1908,10 +1908,10 @@ WebSocketResponse TileHandler::handleModuleHierarchy(
builder.field("local_insts", n.local_insts);
builder.field("local_macros", n.local_macros);
builder.field("local_modules", n.local_modules);
if (n.node_kind != HierarchyNodeKind::MODULE) {
if (n.node_kind != HierarchyNodeKind::kModule) {
builder.field("node_kind", static_cast<int>(n.node_kind));
}
if (n.node_kind == HierarchyNodeKind::MODULE) {
if (n.node_kind == HierarchyNodeKind::kModule) {
builder.field("odb_id", static_cast<int>(n.odb_id));
}
builder.endObject();
Expand All @@ -1938,7 +1938,7 @@ WebSocketResponse TileHandler::handleSetModuleColors(

// Parse compact format: "id:r,g,b,a;id:r,g,b,a;..."
std::map<uint32_t, Color> colors;
const std::string data = extract_string(req.vis.raw_json_, "colors");
const std::string data = extract_string(req.vis.raw_json, "colors");
if (!data.empty()) {
size_t pos = 0;
while (pos < data.size()) {
Expand Down
72 changes: 36 additions & 36 deletions src/web/src/request_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,45 +62,45 @@ struct WebSocketRequest
{
enum Type
{
TILE,
BOUNDS,
TECH,
SELECT,
INSPECT,
INSPECT_BACK,
HOVER,
TCL_EVAL,
TCL_COMPLETE,
TIMING_REPORT,
TIMING_HIGHLIGHT,
CLOCK_TREE,
CLOCK_TREE_HIGHLIGHT,
SLACK_HISTOGRAM,
CHART_FILTERS,
MODULE_HIERARCHY,
SET_MODULE_COLORS,
SET_FOCUS_NETS,
SET_ROUTE_GUIDES,
HEATMAPS,
SET_ACTIVE_HEATMAP,
SET_HEATMAP,
HEATMAP_TILE,
LIST_DIR,
SNAP,
SCHEMATIC_CONE,
SCHEMATIC_FULL,
SCHEMATIC_INSPECT,
DRC_CATEGORIES,
DRC_MARKERS,
DRC_LOAD_REPORT,
DRC_UPDATE_MARKER,
DRC_UPDATE_CATEGORY_VISIBILITY,
DRC_HIGHLIGHT,
UNKNOWN
kTile,
kBounds,
kTech,
kSelect,
kInspect,
kInspectBack,
kHover,
kTclEval,
kTclComplete,
kTimingReport,
kTimingHighlight,
kClockTree,
kClockTreeHighlight,
kSlackHistogram,
kChartFilters,
kModuleHierarchy,
kSetModuleColors,
kSetFocusNets,
kSetRouteGuides,
kHeatmaps,
kSetActiveHeatmap,
kSetHeatmap,
kHeatmapTile,
kListDir,
kSnap,
kSchematicCone,
kSchematicFull,
kSchematicInspect,
kDrcCategories,
kDrcMarkers,
kDrcLoadReport,
kDrcUpdateMarker,
kDrcUpdateCategoryVisibility,
kDrcHighlight,
kUnknown
};

uint32_t id = 0;
Type type = UNKNOWN;
Type type = kUnknown;
std::string layer;
int z = 0;
int x = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/web/src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ void Search::updateShapes(odb::dbBlock* block)
continue;
}
odb::dbTechLayer* layer = box->getTechLayer();
net_shapes[layer].emplace_back(box->getBox(), BTERM, term->getNet());
net_shapes[layer].emplace_back(box->getBox(), kBterm, term->getNet());
}
}
}
Expand Down Expand Up @@ -604,14 +604,14 @@ void Search::addVia(
for (odb::dbBox* box : via->getBoxes()) {
odb::Rect bbox = box->getBox();
bbox.moveDelta(x, y);
tree_shapes[box->getTechLayer()].emplace_back(bbox, VIA, net);
tree_shapes[box->getTechLayer()].emplace_back(bbox, kVia, net);
}
} else {
odb::dbVia* via = shape->getVia();
for (odb::dbBox* box : via->getBoxes()) {
odb::Rect bbox = box->getBox();
bbox.moveDelta(x, y);
tree_shapes[box->getTechLayer()].emplace_back(bbox, VIA, net);
tree_shapes[box->getTechLayer()].emplace_back(bbox, kVia, net);
}
}
}
Expand Down Expand Up @@ -660,7 +660,7 @@ void Search::addNet(
if (s.isVia()) {
addVia(net, &s, itr.prev_x_, itr.prev_y_, tree_shapes);
} else {
tree_shapes[s.getTechLayer()].emplace_back(s.getBox(), WIRE, net);
tree_shapes[s.getTechLayer()].emplace_back(s.getBox(), kWire, net);
}
}
}
Expand Down Expand Up @@ -1128,13 +1128,13 @@ Search::SnapResult Search::searchNearestEdge(
search_box.yMin(),
search_box.xMax(),
search_box.yMax())) {
if (!vis.routing && type == WIRE) {
if (!vis.routing && type == kWire) {
continue;
}
if (!vis.routing && type == VIA) {
if (!vis.routing && type == kVia) {
continue;
}
if (!vis.pins && type == BTERM) {
if (!vis.pins && type == kBterm) {
continue;
}
if (vis.isNetVisible(net)) {
Expand Down
6 changes: 3 additions & 3 deletions src/web/src/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class Search : public odb::dbBlockCallBackObj
public:
enum RouteBoxType
{
WIRE,
VIA,
BTERM
kWire,
kVia,
kBterm
};

template <typename T>
Expand Down
Loading
Loading