Skip to content

Commit

Permalink
drc: Display layer name instead of num in DRT-0119 message.
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Costa <[email protected]>
  • Loading branch information
titan73 committed Jul 30, 2024
1 parent c2be161 commit 6f5bc4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions src/drt/src/pa/FlexPA_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ FlexPAGraphics::FlexPAGraphics(frDebugSettings* settings,
// Build the layer map between opendb & tr
auto odb_tech = db->getTech();

layer_map_.resize(odb_tech->getLayerCount(), -1);
layer_map_.resize(odb_tech->getLayerCount(), std::make_pair(-1, "none"));

for (auto& tr_layer : design->getTech()->getLayers()) {
auto odb_layer = tr_layer->getDbLayer();
if (odb_layer) {
layer_map_[odb_layer->getNumber()] = tr_layer->getLayerNum();
layer_map_[odb_layer->getNumber()]
= std::make_pair(tr_layer->getLayerNum(), odb_layer->getName());
}
}

Expand Down Expand Up @@ -95,7 +96,7 @@ void FlexPAGraphics::drawLayer(odb::dbTechLayer* layer, gui::Painter& painter)
{
frLayerNum layerNum;
if (!shapes_.empty()) {
layerNum = layer_map_.at(layer->getNumber());
layerNum = layer_map_.at(layer->getNumber()).first;
for (auto& b : shapes_) {
if (b.second != layerNum) {
continue;
Expand All @@ -109,7 +110,7 @@ void FlexPAGraphics::drawLayer(odb::dbTechLayer* layer, gui::Painter& painter)
return;
}

layerNum = layer_map_.at(layer->getNumber());
layerNum = layer_map_.at(layer->getNumber()).first;
if (layerNum < 0) {
return;
}
Expand Down Expand Up @@ -268,14 +269,21 @@ void FlexPAGraphics::setViaAP(
pa_markers_ = &markers;
for (auto& marker : markers) {
Rect bbox = marker->getBBox();
std::string layer_name = "";
for (auto& layer : layer_map_) {
if (layer.first == marker->getLayerNum()) {
layer_name = layer.second;
break;
}
}
logger_->info(DRT,
119,
"Marker ({}, {}) ({}, {}) on {}:",
bbox.xMin(),
bbox.yMin(),
bbox.xMax(),
bbox.yMax(),
marker->getLayerNum());
layer_name);
marker->getConstraint()->report(logger_);
}

Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/pa/FlexPA_graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class FlexPAGraphics : public gui::Renderer
frBlock* top_block_;
std::vector<frAccessPoint> aps_;
// maps odb layerIdx -> tr layerIdx, with -1 for no equivalent
std::vector<frLayerNum> layer_map_;
std::vector<std::pair<frLayerNum, std::string>> layer_map_;
const frAccessPoint* pa_ap_;
std::vector<const frVia*> pa_vias_;
std::vector<const frPathSeg*> pa_segs_;
Expand Down

0 comments on commit 6f5bc4b

Please sign in to comment.