From 6f5bc4b58459f533ac387fb7982d5d18bf47e754 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 30 Jul 2024 13:41:10 +0200 Subject: [PATCH] drc: Display layer name instead of num in DRT-0119 message. Signed-off-by: Christian Costa --- src/drt/src/pa/FlexPA_graphics.cpp | 18 +++++++++++++----- src/drt/src/pa/FlexPA_graphics.h | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/drt/src/pa/FlexPA_graphics.cpp b/src/drt/src/pa/FlexPA_graphics.cpp index 5697b49a9b7..750c01d3a67 100644 --- a/src/drt/src/pa/FlexPA_graphics.cpp +++ b/src/drt/src/pa/FlexPA_graphics.cpp @@ -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()); } } @@ -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; @@ -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; } @@ -268,6 +269,13 @@ 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 {}:", @@ -275,7 +283,7 @@ void FlexPAGraphics::setViaAP( bbox.yMin(), bbox.xMax(), bbox.yMax(), - marker->getLayerNum()); + layer_name); marker->getConstraint()->report(logger_); } diff --git a/src/drt/src/pa/FlexPA_graphics.h b/src/drt/src/pa/FlexPA_graphics.h index 3a41bd01d33..2baca54a1f1 100644 --- a/src/drt/src/pa/FlexPA_graphics.h +++ b/src/drt/src/pa/FlexPA_graphics.h @@ -111,7 +111,7 @@ class FlexPAGraphics : public gui::Renderer frBlock* top_block_; std::vector aps_; // maps odb layerIdx -> tr layerIdx, with -1 for no equivalent - std::vector layer_map_; + std::vector> layer_map_; const frAccessPoint* pa_ap_; std::vector pa_vias_; std::vector pa_segs_;