-
Notifications
You must be signed in to change notification settings - Fork 860
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
Add partition
command to do balanced hypergraph partitioning on a gate-level module
#2172
Draft
boqwxp
wants to merge
14
commits into
YosysHQ:main
Choose a base branch
from
boqwxp:partition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whitequark
requested changes
Jun 18, 2020
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.
The core data structure changes (iterator and selection) are good and can be merged right away as a separate PR.
24ec292
to
83056b0
Compare
whitequark
reviewed
Jun 19, 2020
partition
command to do balanced hypergraph partitioning on a techmapped modulepartition
command to do balanced hypergraph partitioning on a gate-level module
Co-Authored-By: whitequark <whitequark@whitequark.org>
Co-Authored-By: whitequark <whitequark@whitequark.org>
Co-Authored-By: whitequark <whitequark@whitequark.org>
Co-Authored-By: whitequark <whitequark@whitequark.org>
…s and using `continue`. Co-Authored-By: whitequark <whitequark@whitequark.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the
partition
command to do balanced hypergraph partitioning on a flattened gate-level module. Finding an optimal partitioning is generally an NP-hard problem, but fortunately there are good heuristics for it.Miscellaneous changes:
This PR makes a few various enabling changes around the code base:
Add a(See PR rtlil: AddDesign::select()
interface for selecting whole modulesDesign::select()
for selecting whole modules #2178 )Add(See PR hashlib, rtlil: Addoperator+=()
todict<>::iterator
anddict<>::const_iterator
and addoperator+()
andoperator+=()
toObjIterator
. This enables indexing intodict
s with an iterator, likeauto value = *(dict.begin() + offset)
, which helps reduce memory by avoiding the need for a node number -> celldict<int, Cell *>
operator+()
andoperator+=()
todict
iterators #2177 )Break outstatdata_t
to the Yosys namespace. This is to support the-s
option, where we need to measure the size of our moduleunit_gate_cost()
, where all gates except NOT and BUF have a unit cost. This is the default cell type cost used for node weights in the hypergraphand for determining module size in the-s
optionSolvers, interface, integration:
hMETIS seems to be the most performant solver, but has a very restrictive license. KaHIP has an MIT license but seems to have a nasty dependency on an old version of OpenMPI. minipart is also MIT licensed, but brings in boost dependencies.
@daveshah1 has indicated that he is developing hypergraph partitioning in-tree in nextpnr, so when that is done, I think we all agree to bring that in-tree, and I will update this PR and mark it as ready for review.
Until then, this command makes a temporary directory, writes a
.hgr
file (spec in this document), invokesminipart
(which must be on thePATH
), and reads a.sol
file with the partition assignments.Depends:
PerformanceTimer::query()
and report the time for each call to the QBF-SAT solver #2135operator+()
andoperator+=()
todict
iterators #2177Design::select()
for selecting whole modules #2178