Skip to content

Comments

grt: infinite resources for testing purpose#9500

Open
openroad-ci wants to merge 18 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-infinite-resources
Open

grt: infinite resources for testing purpose#9500
openroad-ci wants to merge 18 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:grt-infinite-resources

Conversation

@openroad-ci
Copy link
Collaborator

Global route flag to enable "infinite" capacity for testing purpose

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
…oject-private/OpenROAD into grt-infinite-resources
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces an -infinite_cap flag for testing purposes, which is a useful addition for debugging congestion-related issues. The implementation correctly integrates the flag into the Tcl interface and the core routing logic. However, there are opportunities to improve the efficiency of the capacity setting logic and to avoid magic numbers. Specifically, the value used for "infinite" capacity (1000) might be too small for very large designs, and the geometric capacity calculations are still performed even when the infinite capacity flag is enabled.

int x_grids = grid_->getXGrids();
int y_grids = grid_->getYGrids();
const int BIG_INT = std::numeric_limits<int>::max();
const int16_t big_cap = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The value 1000 is a magic number and might not be large enough to represent "infinite" capacity in designs with very high track density (e.g., where a GCell could physically accommodate more than 1000 tracks). Using a value that is too small could lead to unexpected congestion even when this flag is enabled. Consider using the maximum value for the underlying data type (int16_t).

  const int16_t big_cap = std::numeric_limits<int16_t>::max();
References
  1. Define tunable parameters as named constants instead of using hardcoded magic numbers.

int min_cap = BIG_INT;
for (int y = 1; y <= y_grids; y++) {
for (int x = 1; x < x_grids; x++) {
const int cap = inside_layer_range ? computeGCellCapacity(x - 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When infinite_capacity_ is enabled, the call to computeGCellCapacity is unnecessary as its result is ignored in favor of big_cap. Since this function performs geometric calculations and is called inside a nested loop over all GCells and layers, avoiding it can improve performance. This applies to both the horizontal and vertical capacity loops.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@jfgava jfgava requested a review from eder-matheus February 22, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants