Commit 06b486f
committed
grt: O(1) coordinate dedup in setTreeNodesVariables (FastRoute)
setTreeNodesVariables() was the largest measured global-route hotspot
(~41% of routing instructions). It deduplicated tree-node coordinates
with an O(numpoints^2) linear scan, dominated by a few very large
multi-pin nets. Instrumentation on medium03 showed ~12.4 billion inner
iterations (~99.7% of the function's work) across only ~8.1K calls.
Replace the linear scan with a reused hash-map keyed by the packed (x,y)
grid position, mapping to the dcor index of the first node inserted at
that position. This reproduces the original first-match aliasing exactly
(identical stackAlias values and identical xcor_/ycor_/dcor_ contents),
so routing results are unchanged.
Results (timed region = global_route only, interleaved base vs opt):
medium03 (98.6K cells): 20529 ms -> 10314 ms (1.99x, -49.8%)
medium04 (135K cells): 268179 ms -> 84948 ms (3.16x, -68.3%)
Correctness: all 131 grt ctest pass; wirelength / via count / routed
nets / congestion / overflow byte-for-byte identical on both designs.
Signed-off-by: Saurav Singh <saurav.singh@fermions.co>1 parent ec10d06 commit 06b486f
2 files changed
Lines changed: 32 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
811 | 816 | | |
812 | 817 | | |
813 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2996 | 2996 | | |
2997 | 2997 | | |
2998 | 2998 | | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
2999 | 3011 | | |
3000 | 3012 | | |
3001 | 3013 | | |
| |||
3006 | 3018 | | |
3007 | 3019 | | |
3008 | 3020 | | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
3009 | 3026 | | |
3010 | 3027 | | |
3011 | 3028 | | |
3012 | 3029 | | |
3013 | 3030 | | |
3014 | 3031 | | |
3015 | 3032 | | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
3016 | 3038 | | |
3017 | 3039 | | |
3018 | 3040 | | |
3019 | 3041 | | |
3020 | 3042 | | |
3021 | | - | |
3022 | | - | |
3023 | | - | |
3024 | | - | |
3025 | | - | |
3026 | | - | |
3027 | | - | |
3028 | | - | |
3029 | | - | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
3030 | 3048 | | |
3031 | 3049 | | |
3032 | 3050 | | |
| |||
0 commit comments