-
Notifications
You must be signed in to change notification settings - Fork 414
Chan x/y placement cost factors using prefix sum #2799
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0d94503
initial implementation of prefix sum for chanx and chany
soheilshahrouz 68ecb55
use effective inted in operator[] of NdOffsetMatrix<T, 1>
soheilshahrouz cf73987
change DimRange from {-1, grid_height} to {-2, grid_height}
soheilshahrouz 5de882b
exclude left and bottom channels in average channel width factor comp…
soheilshahrouz 464dd62
multiply `crossing` at the end
soheilshahrouz 3690af8
Merge branch 'master' into temp_chan_w_factors_prefix_sum
soheilshahrouz a6c8688
don't use default values for member variables initialized in constructor
soheilshahrouz 49d4396
add comments
soheilshahrouz 9307ef3
remove place_cost_exp and calls to pow()
soheilshahrouz a1fe8e1
Merge branch 'master' into temp_chan_w_factors_prefix_sum
soheilshahrouz 1d4c4d6
update basic golden results
soheilshahrouz 044148b
update golden results for strong tests
soheilshahrouz dbe9903
update golden results
soheilshahrouz db3f7ae
fix the remaining failure in strong tests
soheilshahrouz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,8 +193,9 @@ class NetCostHandler { | |
* number of tracks in that direction; for other cost functions they | ||
* will never be used. | ||
*/ | ||
vtr::NdOffsetMatrix<float, 2> chanx_place_cost_fac_; // [-1...device_ctx.grid.width()-1] | ||
vtr::NdOffsetMatrix<float, 2> chany_place_cost_fac_; // [-1...device_ctx.grid.height()-1] | ||
vtr::NdOffsetMatrix<int, 1> acc_chanx_width_; // [-1...device_ctx.grid.width()-1] | ||
vtr::NdOffsetMatrix<int, 1> acc_chany_width_; // [-1...device_ctx.grid.height()-1] | ||
|
||
/** | ||
@brief This data structure functions similarly to the matrices described above | ||
but is applied to 3D connections linking different FPGA layers. It is used in the | ||
|
@@ -511,4 +512,17 @@ class NetCostHandler { | |
*/ | ||
double get_net_wirelength_from_layer_bb_(ClusterNetId net_id); | ||
|
||
template<typename BBT> | ||
std::pair<double, double> get_chan_place_fac_(const BBT& bb) { | ||
soheilshahrouz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const int total_chanx_width = acc_chanx_width_[bb.ymax] - acc_chanx_width_[bb.ymin - 2]; | ||
soheilshahrouz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const double inverse_average_chanx_width = (bb.ymax - bb.ymin + 2.0) / total_chanx_width; | ||
const double inverse_average_chanx_width_sharpened = std::pow(inverse_average_chanx_width, (double)placer_opts_.place_cost_exp); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could try experimenting with removing the pow and see if it yields any cpu speedup; we run with a place_cost_exp of 1 pretty much all the time so if the pow is costing us we could remove it. |
||
|
||
const int total_chany_width = acc_chany_width_[bb.xmax] - acc_chany_width_[bb.xmin - 2]; | ||
const double inverse_average_chany_width = (bb.xmax - bb.xmin + 2.0) / total_chany_width; | ||
const double inverse_average_chany_width_sharpened = std::pow(inverse_average_chany_width, (double)placer_opts_.place_cost_exp); | ||
|
||
return {inverse_average_chanx_width_sharpened, inverse_average_chany_width_sharpened}; | ||
} | ||
|
||
}; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.