-
Notifications
You must be signed in to change notification settings - Fork 585
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: Bidirectional A* #6486
base: master
Are you sure you want to change the base?
drt: Bidirectional A* #6486
Conversation
7bf2d83
to
e20cd68
Compare
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.
clang-tidy made some suggestions
@@ -30,6 +30,7 @@ | |||
|
|||
#include <boost/container/flat_map.hpp> | |||
#include <boost/container/flat_set.hpp> | |||
#include <boost/unordered/unordered_flat_map.hpp> |
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.
warning: 'boost/unordered/unordered_flat_map.hpp' file not found [clang-diagnostic-error]
#include <boost/unordered/unordered_flat_map.hpp>
^
src/drt/src/dr/FlexWavefront.h
Outdated
@@ -49,7 +49,8 @@ class FlexWavefrontGrid | |||
frCoord distIn, | |||
frCost pathCostIn, | |||
frCost costIn, | |||
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {}) | |||
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {}, |
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.
warning: use of undeclared identifier 'WAVEFRONTBITSIZE' [clang-diagnostic-error]
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {},
^
src/drt/src/dr/FlexWavefront.h
Outdated
@@ -49,7 +49,8 @@ | |||
frCoord distIn, | |||
frCost pathCostIn, | |||
frCost costIn, | |||
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {}) | |||
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {}, | |||
const std::array<frCost, WAVEFRONTBUFFERSIZE>& backTraceCostsIn = {}) |
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.
warning: use of undeclared identifier 'WAVEFRONTBUFFERSIZE' [clang-diagnostic-error]
const std::array<frCost, WAVEFRONTBUFFERSIZE>& backTraceCostsIn = {})
^
@@ -87,6 +89,10 @@ | |||
{ | |||
return backTraceBuffer_; | |||
} | |||
const std::array<frCost, WAVEFRONTBUFFERSIZE>& getBackTraceCosts() const |
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.
warning: use of undeclared identifier 'WAVEFRONTBUFFERSIZE' [clang-diagnostic-error]
const std::array<frCost, WAVEFRONTBUFFERSIZE>& getBackTraceCosts() const
^
@@ -115,14 +121,19 @@ | |||
std::bitset<WAVEFRONTBITSIZE> mask = WAVEFRONTBUFFERHIGHMASK; |
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.
warning: use of undeclared identifier 'WAVEFRONTBITSIZE' [clang-diagnostic-error]
std::bitset<WAVEFRONTBITSIZE> mask = WAVEFRONTBUFFERHIGHMASK;
^
} | ||
frCost prevCost = backTraceCosts_[0]; | ||
backTraceCosts_[0] = cost; | ||
return {retBS, prevCost}; | ||
} | ||
void setSrcTaperBox(const frBox3D* b) { srcTaperBox = b; } | ||
const frBox3D* getSrcTaperBox() const { return srcTaperBox; } |
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.
warning: unknown type name 'frBox3D' [clang-diagnostic-error]
const frBox3D* getSrcTaperBox() const { return srcTaperBox; }
^
@@ -139,6 +150,7 @@ | |||
bool prevViaUp_; | |||
frCoord tLength_; // length since last turn | |||
std::bitset<WAVEFRONTBITSIZE> backTraceBuffer_; |
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.
warning: use of undeclared identifier 'WAVEFRONTBITSIZE' [clang-diagnostic-error]
std::bitset<WAVEFRONTBITSIZE> backTraceBuffer_;
^
@@ -139,6 +150,7 @@ | |||
bool prevViaUp_; | |||
frCoord tLength_; // length since last turn | |||
std::bitset<WAVEFRONTBITSIZE> backTraceBuffer_; | |||
std::array<frCost, WAVEFRONTBUFFERSIZE> backTraceCosts_; |
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.
warning: use of undeclared identifier 'WAVEFRONTBUFFERSIZE' [clang-diagnostic-error]
std::array<frCost, WAVEFRONTBUFFERSIZE> backTraceCosts_;
^
@@ -139,6 +150,7 @@ | |||
bool prevViaUp_; | |||
frCoord tLength_; // length since last turn | |||
std::bitset<WAVEFRONTBITSIZE> backTraceBuffer_; | |||
std::array<frCost, WAVEFRONTBUFFERSIZE> backTraceCosts_; |
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.
warning: private field 'backTraceCosts_' is not used [clang-diagnostic-unused-private-field]
std::array<frCost, WAVEFRONTBUFFERSIZE> backTraceCosts_;
^
@@ -139,6 +150,7 @@ | |||
bool prevViaUp_; | |||
frCoord tLength_; // length since last turn | |||
std::bitset<WAVEFRONTBITSIZE> backTraceBuffer_; | |||
std::array<frCost, WAVEFRONTBUFFERSIZE> backTraceCosts_; | |||
const frBox3D* srcTaperBox = nullptr; |
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.
warning: unknown type name 'frBox3D' [clang-diagnostic-error]
const frBox3D* srcTaperBox = nullptr;
^
16f0600
to
8f74934
Compare
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.
clang-tidy made some suggestions
frCoord distIn, | ||
frCost pathCostIn, | ||
frCost costIn, | ||
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {}, |
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.
warning: use of undeclared identifier 'WAVEFRONTBITSIZE' [clang-diagnostic-error]
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {},
^
frCost pathCostIn, | ||
frCost costIn, | ||
const std::bitset<WAVEFRONTBITSIZE>& backTraceBufferIn = {}, | ||
const std::array<frCost, WAVEFRONTBUFFERSIZE>& backTraceCostsIn = {}) |
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.
warning: use of undeclared identifier 'WAVEFRONTBUFFERSIZE' [clang-diagnostic-error]
const std::array<frCost, WAVEFRONTBUFFERSIZE>& backTraceCostsIn = {})
^
I believe bidirectional A* was tried several years ago and dropped also because there was no performance benefit. Same for a line search approach that was tried. |
Great work! Just some drive-by comments. One of the major challenges of applying bidirectional A* search is that when the two waves meet, they don't necessarily meet in a DRC-free way. One simple example is that, they could meet where they haven't travelled long enough on the layer thus causing minimum area violation (this is just the simplest example I can think of and there can be many other such design rules). With unidirectional A* search, there are heuristics to help avoid such violations. With bidirectional A*, we probably need some new heuristics (sorry if you already have it in the code because I have not read in details). That being said, the runtime comparison here may not reflect the performance of uni/bidirectional A* searches themselves because bidirectional A* may be dealing with more DRCs for the reason above. Without a search algorithm benchmarking utility, the closest thing I can think of is to run one iteration of detail route and only allow each net to be routed once. If the DRC numbers do not differ too much, then the comparison probably can better reflect the raw performance between uni/bidirectional. |
Co-authored-by: Maciej Torhan <[email protected]> Signed-off-by: Krzysztof Bieganski <[email protected]> Signed-off-by: Maciej Torhan <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
Signed-off-by: Krzysztof Bieganski <[email protected]>
8f74934
to
bf4cb1e
Compare
Implements bidirectional A* for DRT.
Unfortunately, usually this doesn't improve run time. I think the main problem performance-wise is the cost map which wasn't there in the original A*. But the approach seems promising:
asap7/aes
asap7/aes
asap7/ibex
asap7/ibex
nangate45/aes
nangate45/aes
nangate45/black_parrot
nangate45/black_parrot
nangate45/ibex
nangate45/ibex
What's interesting is that it often produces slightly shorter wirelength.
I probably won't be working on this for now, but putting it out there so that perhaps other people could expand on it, or share some ideas.