Skip to content

Commit d0a54ac

Browse files
committed
grt: change draw_route_guides to draw_route_segments
Signed-off-by: Rafael Moresco <[email protected]>
1 parent 90d89cf commit d0a54ac

File tree

5 files changed

+21
-42
lines changed

5 files changed

+21
-42
lines changed

src/grt/src/AbstractGrouteRenderer.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ class AbstractGrouteRenderer
1212
public:
1313
virtual ~AbstractGrouteRenderer() = default;
1414

15-
virtual void highlightRoute(odb::dbNet* net,
16-
bool show_segments,
17-
bool show_pin_locations)
18-
= 0;
15+
virtual void highlightRoute(odb::dbNet* net, bool show_pin_locations) = 0;
1916

2017
virtual void clearRoute() = 0;
2118
};

src/grt/src/GlobalRouter.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ add_net_to_route(odb::dbNet* net)
178178
}
179179

180180
void
181-
highlight_net_route(odb::dbNet *net, bool show_segments, bool show_pin_locations)
181+
highlight_net_route(odb::dbNet *net, bool show_pin_locations)
182182
{
183183
if (!gui::Gui::enabled()) {
184184
return;
@@ -189,7 +189,7 @@ highlight_net_route(odb::dbNet *net, bool show_segments, bool show_pin_locations
189189
router->setRenderer(std::make_unique<GrouteRenderer>(router, router->db()->getTech()));
190190
}
191191

192-
router->getRenderer()->highlightRoute(net, show_segments, show_pin_locations);
192+
router->getRenderer()->highlightRoute(net, show_pin_locations);
193193
}
194194

195195
void

src/grt/src/GlobalRouter.tcl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,14 @@ proc read_guides { args } {
330330
grt::read_guides $file_name
331331
}
332332

333-
sta::define_cmd_args "draw_route_guides" { net_names \
334-
[-show_segments]
333+
sta::define_cmd_args "draw_route_segments" { net_names \
335334
[-show_pin_locations] }
336335

337-
proc draw_route_guides { args } {
338-
sta::parse_key_args "draw_route_guides" args \
336+
proc draw_route_segments { args } {
337+
sta::parse_key_args "draw_route_segments" args \
339338
keys {} \
340-
flags {-show_pin_locations -show_segments}
341-
sta::check_argc_eq1 "draw_route_guides" $args
339+
flags {-show_pin_locations}
340+
sta::check_argc_eq1 "draw_route_segments" $args
342341
set net_names [lindex $args 0]
343342
set block [ord::get_db_block]
344343
if { $block == "NULL" } {
@@ -347,10 +346,9 @@ proc draw_route_guides { args } {
347346

348347
grt::clear_route_guides
349348
set show_pins [info exists flags(-show_pin_locations)]
350-
set show_segments [info exists flags(-show_segments)]
351349
foreach net [get_nets $net_names] {
352350
if { $net != "NULL" } {
353-
grt::highlight_net_route [sta::sta_to_db_net $net] $show_segments $show_pins
351+
grt::highlight_net_route [sta::sta_to_db_net $net] $show_pins
354352
}
355353
}
356354
}

src/grt/src/GrouteRenderer.cpp

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ GrouteRenderer::GrouteRenderer(GlobalRouter* groute, odb::dbTech* tech)
1616
gui::Gui::get()->registerRenderer(this);
1717
}
1818

19-
void GrouteRenderer::highlightRoute(odb::dbNet* net,
20-
bool show_segments,
21-
bool show_pin_locations)
19+
void GrouteRenderer::highlightRoute(odb::dbNet* net, bool show_pin_locations)
2220
{
2321
nets_.insert(net);
24-
show_segments_[net] = show_segments;
2522
show_pin_locations_[net] = show_pin_locations;
2623
redraw();
2724
}
@@ -52,16 +49,12 @@ void GrouteRenderer::drawLayer(odb::dbTechLayer* layer, gui::Painter& painter)
5249
int layer1 = seg.init_layer;
5350
int layer2 = seg.final_layer;
5451
if (layer1 != layer2) {
55-
if (show_segments_[net]) {
56-
odb::dbTechLayer* via_layer1 = tech_->findRoutingLayer(layer1);
57-
odb::dbTechLayer* via_layer2 = tech_->findRoutingLayer(layer2);
58-
if (via_layer1 == layer) {
59-
drawViaRect(seg, via_layer1, painter);
60-
} else if (via_layer2 == layer) {
61-
drawViaRect(seg, via_layer2, painter);
62-
} else {
63-
continue;
64-
}
52+
odb::dbTechLayer* via_layer1 = tech_->findRoutingLayer(layer1);
53+
odb::dbTechLayer* via_layer2 = tech_->findRoutingLayer(layer2);
54+
if (via_layer1 == layer) {
55+
drawViaRect(seg, via_layer1, painter);
56+
} else if (via_layer2 == layer) {
57+
drawViaRect(seg, via_layer2, painter);
6558
} else {
6659
continue;
6760
}
@@ -70,17 +63,10 @@ void GrouteRenderer::drawLayer(odb::dbTechLayer* layer, gui::Painter& painter)
7063
if (seg_layer != layer) {
7164
continue;
7265
}
73-
if (show_segments_[net]) {
74-
odb::Point pt1(seg.init_x, seg.init_y);
75-
odb::Point pt2(seg.final_x, seg.final_y);
76-
painter.setPenWidth(layer->getMinWidth() * 2);
77-
painter.drawLine(pt1, pt2);
78-
} else {
79-
// Draw rect because drawLine does not have a way to set the pen
80-
// thickness.
81-
odb::Rect rect = groute_->globalRoutingToBox(seg);
82-
painter.drawRect(rect);
83-
}
66+
odb::Point pt1(seg.init_x, seg.init_y);
67+
odb::Point pt2(seg.final_x, seg.final_y);
68+
painter.setPenWidth(layer->getMinWidth() * 2);
69+
painter.drawLine(pt1, pt2);
8470
}
8571
}
8672
}

src/grt/src/GrouteRenderer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ class GrouteRenderer : public gui::Renderer, public AbstractGrouteRenderer
1818
public:
1919
GrouteRenderer(GlobalRouter* groute, odb::dbTech* tech);
2020

21-
void highlightRoute(odb::dbNet* net,
22-
bool show_segments,
23-
bool show_pin_locations) override;
21+
void highlightRoute(odb::dbNet* net, bool show_pin_locations) override;
2422

2523
void clearRoute() override;
2624

0 commit comments

Comments
 (0)