Skip to content

Commit 9c92944

Browse files
authored
Merge pull request #9021 from gudeh/gpl-routability-plot
gpl: debug changes, new routability plot
2 parents f5747e7 + d9a5f16 commit 9c92944

17 files changed

+343
-216
lines changed

src/gpl/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if the RC is not decreasing for three consecutive iterations.
5757

5858
Routability-driven arguments
5959
- They begin with `-routability`.
60-
- `-routability_target_rc_metric`, `-routability_check_overflow`, `-routability_max_density`, `-routability_max_inflation_iter`, `-routability_inflation_ratio_coef`, `-routability_max_inflation_ratio`, `-routability_rc_coefficients`
60+
- `-routability_target_rc_metric`, `-routability_snapshot_overflow`, `-routability_check_overflow`, `-routability_max_density`, `-routability_inflation_ratio_coef`, `-routability_max_inflation_ratio`, `-routability_rc_coefficients`
6161

6262
Timing-driven arguments
6363
- They begin with `-timing_driven`.
@@ -85,9 +85,9 @@ global_placement
8585
[-skip_nesterov_place]
8686
[-routability_use_grt]
8787
[-routability_target_rc_metric routability_target_rc_metric]
88+
[-routability_snapshot_overflow routability_snapshot_overflow]
8889
[-routability_check_overflow routability_check_overflow]
89-
[-routability_max_density routability_max_density]
90-
[-routability_max_inflation_iter routability_max_inflation_iter]
90+
[-routability_max_density routability_max_density]
9191
[-routability_inflation_ratio_coef routability_inflation_ratio_coef]
9292
[-routability_max_inflation_ratio routability_max_inflation_ratio]
9393
[-routability_rc_coefficients routability_rc_coefficients]
@@ -112,12 +112,12 @@ global_placement
112112
| `-init_density_penalty` | Set initial density penalty. The default value is `8e-5`. Allowed values are floats `[1e-6, 1e6]`. |
113113
| `-init_wirelength_coef` | Set initial wirelength coefficient. The default value is `0.25`. Allowed values are floats. |
114114
| `-min_phi_coef` | Set `pcof_min` ($\mu_k$ Lower Bound). The default value is `0.95`. Allowed values are floats `[0.95, 1.05]`. |
115-
| `-max_phi_coef` | Set `pcof_max` ($\mu_k$ Upper Bound). Default value is 1.05. Allowed values are `[1.00-1.20, float]`. |
115+
| `-max_phi_coef` | Set `pcof_max` ($\mu_k$ Upper Bound). Default value is `1.05`. Allowed values are `[1.00-1.20, float]`. |
116116
| `-overflow` | Set target overflow for termination condition. The default value is `0.1`. Allowed values are floats `[0, 1]`. |
117-
| `-initial_place_max_iter` | Set maximum iterations in the initial place. The default value is 20. Allowed values are integers `[0, MAX_INT]`. |
117+
| `-initial_place_max_iter` | Set maximum iterations in the initial place. The default value is `20`. Allowed values are integers `[0, MAX_INT]`. |
118118
| `-initial_place_max_fanout` | Set net escape condition in initial place when $fanout \geq initial\_place\_max\_fanout$. The default value is 200. Allowed values are integers `[1, MAX_INT]`. |
119-
| `-pad_left` | Set left padding in terms of number of sites. The default value is 0, and the allowed values are integers `[1, MAX_INT]` |
120-
| `-pad_right` | Set right padding in terms of number of sites. The default value is 0, and the allowed values are integers `[1, MAX_INT]` |
119+
| `-pad_left` | Set left padding in terms of number of sites. The default value is `0`, and the allowed values are integers `[1, MAX_INT]` |
120+
| `-pad_right` | Set right padding in terms of number of sites. The default value is `0`, and the allowed values are integers `[1, MAX_INT]` |
121121
| `-skip_io` | Flag to ignore the IO ports when computing wirelength during placement. The default value is False, allowed values are boolean. |
122122
| `-disable_revert_if_diverge` | Flag to make gpl store the placement state along iterations, if a divergence is detected, gpl reverts to the snapshot state. The default value is disabled. |
123123
| `-enable_routing_congestion` | Flag to run global routing after global placement, enabling the Routing Congestion Heatmap.|
@@ -128,12 +128,12 @@ global_placement
128128
| ----- | ----- |
129129
| `-routability_use_grt` | Use this tag to execute routability using FastRoute from grt for routing congestion, which is more precise but has a high runtime cost. By default, routability mode uses RUDY, which is faster. |
130130
| `-routability_target_rc_metric` | Set target RC metric for routability mode. The algorithm will try to reach this RC value. The default value is `1.01`, and the allowed values are floats. |
131+
| `-routability_snapshot_overflow` | Set the overflow threshold for saving a snapshot during routability-driven placement. The default value is `0.6` and the allowed values are floats `[0, 1]`. |
131132
| `-routability_check_overflow` | Set overflow threshold for routability mode. The default value is `0.3`, and the allowed values are floats `[0, 1]`. |
132133
| `-routability_max_density` | Set density threshold for routability mode. The default value is `0.99`, and the allowed values are floats `[0, 1]`. |
133-
| `-routability_max_inflation_iter` | Set inflation iteration threshold for routability mode. The default value is `4`, and the allowed values are integers `[1, MAX_INT]`. |
134134
| `-routability_inflation_ratio_coef` | Set inflation ratio coefficient for routability mode. The default value is `2`, and the allowed values are floats. |
135135
| `-routability_max_inflation_ratio` | Set inflation ratio threshold for routability mode to prevent overly aggressive adjustments. The default value is `3`, and the allowed values are floats. |
136-
| `-routability_rc_coefficients` | Set routability RC coefficients for calculating the final RC. They relate to the 0.5%, 1%, 2%, and 5% most congested tiles. It comes in the form of a Tcl List `{k1, k2, k3, k4}`. The default value for each coefficient is `{1.0, 1.0, 0.0, 0.0}` respectively, and the allowed values are floats. |
136+
| `-routability_rc_coefficients` | Set routability RC coefficients for calculating the averate routing congestion. They relate to the 0.5%, 1%, 2%, and 5% most congested tiles. It comes in the form of a Tcl List `{k1, k2, k3, k4}`. The default value for each coefficient is `{1.0, 1.0, 0.0, 0.0}` respectively, and the allowed values are floats. |
137137

138138
#### Timing-Driven Arguments
139139

@@ -142,7 +142,7 @@ global_placement
142142
| `-timing_driven_net_reweight_overflow` | Set overflow threshold for timing-driven net reweighting. Allowed value is a Tcl list of integers where each number is `[0, 100]`. Default values are [64, 20] |
143143
| `-timing_driven_net_weight_max` | Set the multiplier for the most timing-critical nets. The default value is `5`, and the allowed values are floats. |
144144
| `-timing_driven_nets_percentage` | Set the reweighted percentage of nets in timing-driven mode. The default value is 10. Allowed values are floats `[0, 100]`. |
145-
| `-keep_resize_below_overflow` | When the overflow is below the set value, timing-driven iterations will retain the resizer changes instead of reverting them. The default value is 0.3. Allowed values are floats `[0, 1]`. |
145+
| `-keep_resize_below_overflow` | When the overflow is below the value, timing-driven iterations will retain (non-virtual) the resizer changes instead of reverting them (virtual). The default value is `1.0`, making all timing-driven iterations non-virtual. Allowed values are floats `[0, 1]`. |
146146

147147
### Cluster Flops
148148

@@ -200,7 +200,7 @@ global_placement_debug
200200
| `-draw_bins` | Activates visualization of placement bins, showcasing their density (indicated by the shade of white) and the direction of forces acting on them (depicted in red). The default setting is disabled. |
201201
| `-initial` | Pauses the debug process during the initial placement phase. The default setting is disabled. |
202202
| `-start_iter` | Start debug mode from such iteration. |
203-
| `-generate_images` | Generates a GIF animation showing the placement progression. Also generates snapshot images at the end of each routability and timing-driven iteration, including heatmaps. |
203+
| `-generate_images` | Generates a GIF animation showing the placement progression and a GIF composed of images right before each routability revert. Also saves snapshot images at the end of each routability and timing-driven iteration, including heatmaps. |
204204

205205
Example: `global_placement_debug -pause 100 -update 1 -initial -draw_bins -inst _614_`
206206
This command configures the debugger to pause every 100 iterations, with layout updates occurring every iteration. It enables initial placement stage visualization, bin drawing, and specifically highlights instance 614.

src/gpl/include/gpl/Replace.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ struct PlaceOptions
7575
float density = 0.7;
7676

7777
float routabilityCheckOverflow = 0.3;
78+
float routabilitySnapshotOverflow = 0.6;
7879
float routabilityMaxDensity = 0.99;
7980
float routabilityTargetRcMetric = 1.01;
8081
float routabilityInflationRatioCoef = 2;
8182
float routabilityMaxInflationRatio = 3;
82-
int routabilityMaxInflationIter = 4;
8383

8484
// routability RC metric coefficients
8585
float routabilityRcK1 = 1.0;
@@ -135,6 +135,8 @@ class Replace
135135
bool initial,
136136
odb::dbInst* inst,
137137
int start_iter,
138+
int start_rudy,
139+
int rudy_stride,
138140
bool generate_images,
139141
const std::string& images_path);
140142

@@ -171,6 +173,8 @@ class Replace
171173
int gui_debug_initial_ = false;
172174
odb::dbInst* gui_debug_inst_ = nullptr;
173175
int gui_debug_start_iter_ = 0;
176+
int gui_debug_rudy_start_ = 0;
177+
int gui_debug_rudy_stride_ = 0;
174178
bool gui_debug_generate_images_ = false;
175179
std::string gui_debug_images_path_ = "REPORTS_DIR";
176180
};

src/gpl/src/AbstractGraphics.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "odb/db.h"
1313
#include "odb/geom.h"
14+
#include "routeBase.h"
1415

1516
namespace gpl {
1617

@@ -48,6 +49,7 @@ class AbstractGraphics
4849
NesterovPlace* np,
4950
std::shared_ptr<PlacerBaseCommon> pbc,
5051
std::shared_ptr<NesterovBaseCommon> nbc,
52+
std::shared_ptr<RouteBase> rb,
5153
std::vector<std::shared_ptr<PlacerBase>>& pbVec,
5254
std::vector<std::shared_ptr<NesterovBase>>& nbVec,
5355
bool draw_bins,
@@ -103,16 +105,19 @@ class AbstractGraphics
103105
}
104106

105107
// Gui functions.
106-
virtual void gifStart(std::string_view path) = 0;
107-
void gifAddFrame(const odb::Rect& region = odb::Rect(),
108+
// Gui functions.
109+
virtual int gifStart(std::string_view path) = 0;
110+
void gifAddFrame(int key,
111+
const odb::Rect& region = odb::Rect(),
108112
int width_px = 0,
109113
double dbu_per_pixel = 0,
110114
std::optional<int> delay = std::nullopt)
111115
{
112-
gifAddFrameImpl(region, width_px, dbu_per_pixel, delay);
116+
gifAddFrameImpl(key, region, width_px, dbu_per_pixel, delay);
113117
}
114118
virtual void deleteLabel(std::string_view label_name) = 0;
115-
virtual void gifEnd() = 0;
119+
virtual void gifEnd(int key) = 0;
120+
virtual void setDisplayControl(std::string_view name, bool value) = 0;
116121

117122
protected:
118123
virtual void cellPlotImpl(bool pause) = 0;
@@ -128,7 +133,8 @@ class AbstractGraphics
128133
std::string_view heatmap_control,
129134
int image_width_px)
130135
= 0;
131-
virtual void gifAddFrameImpl(const odb::Rect& region,
136+
virtual void gifAddFrameImpl(int key,
137+
const odb::Rect& region,
132138
int width_px,
133139
double dbu_per_pixel,
134140
std::optional<int> delay)

0 commit comments

Comments
 (0)