Skip to content

Use loops instead of recursion in the router's bbox tree - #317

Merged
mguthaus merged 1 commit into
VLSIDA:devfrom
7FM:iterative-bbox-insert
Oct 2, 2026
Merged

mguthaus merged 1 commit into
VLSIDA:devfrom
7FM:iterative-bbox-insert

Conversation

@7FM

@7FM 7FM commented Oct 1, 2026

Copy link
Copy Markdown

bbox_node.insert(), iterate_point() and iterate_shape() recursed down the tree. Inserting shapes one by one can make the tree very deep, and in large designs (e.g. sky130 macros with 1024 columns) it got deeper than Python's recursion limit, so routing failed with "RecursionError: maximum recursion depth exceeded". Walk the tree with a loop and an explicit stack instead. The tree, and the order in which shapes are found, stay the same.

bbox_node.insert(), iterate_point() and iterate_shape() recursed down the
tree. Inserting shapes one by one can make the tree very deep, and in large
designs (e.g. sky130 macros with 1024 columns) it got deeper than Python's
recursion limit, so routing failed with "RecursionError: maximum recursion
depth exceeded". Walk the tree with a loop and an explicit stack instead.
The tree, and the order in which shapes are found, stay the same.
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