-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drt: Flip map keys in graph init #6161
drt: Flip map keys in graph init #6161
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
@kbieganski you might want to push something to restart the CI it looks like the C++20 action might have had a problem unrelated to this PR |
e685c4f
to
96295ad
Compare
clang-tidy review says "All clean, LGTM! 👍" |
What motived flipping the keys? Since we only have data for flipping + flat_map it is hard to see what benefit was had from each. |
|
a38fb86
to
b5aa75d
Compare
clang-tidy review says "All clean, LGTM! 👍" |
Please merge master into this PR. I suspect that will solve the pr-head issue. |
b5aa75d
to
ef1c920
Compare
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
ef1c920
to
1aaeafd
Compare
clang-tidy review says "All clean, LGTM! 👍" |
Signed-off-by: Krzysztof Bieganski <[email protected]>
1aaeafd
to
6dbb628
Compare
clang-tidy review says "All clean, LGTM! 👍" |
// add edge for preferred direction | ||
if (dir == dbTechLayerDir::HORIZONTAL && yFound) { | ||
auto& yLayerMap = yMap[layerNum]; | ||
auto& yLayer2Map = yMap[layerNum + 2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if layerNum is the top routing layer? Wouldn't that insert layerNum+2 as a new entry to the flatmap and possible reallocate memory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it's cheap:
- it only happens once at most,
- it may not reallocate,
- even if it does, it's on the order of 10 elements,
- and all the inner maps are just moved so they themselves don't reallocate.
In the original code this can happen for each coordinate.
@osamahammad21 Any further feedback? |
Also use Boost's
flat_map
instead ofstd::map
.aes
-asap7
-5_2_route
- 8 thread(s)drt-graph-init-flip-keys
ibex
-asap7
-5_2_route
- 8 thread(s)drt-graph-init-flip-keys
ibex
-nangate45
-5_2_route
- 8 thread(s)drt-graph-init-flip-keys
black_parrot
-nangate45
-5_2_route
- 8 thread(s)drt-graph-init-flip-keys
I observed up to 10% speedup on some designs that I cannot share. I believe this scales nicely for bigger designs.