-
Notifications
You must be signed in to change notification settings - Fork 414
Improved parallel router: add NetlistRouter #2411
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 all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#pragma once | ||
|
||
/** @file Parallel case for NetlistRouter. Builds a \ref PartitionTree from the | ||
* netlist according to net bounding boxes. Tree nodes are then routed in parallel | ||
* using tbb::task_group. Each task routes the nets inside a node serially and then adds | ||
* its child nodes to the task queue. This approach is serially equivalent & deterministic, | ||
* but it can reduce QoR in congested cases [0]. | ||
* | ||
* Note that the parallel router does not support graphical router breakpoints. | ||
* | ||
* [0]: F. Koşar, "A net-decomposing parallel FPGA router", MS thesis, UofT ECE, 2023 */ | ||
#include "netlist_routers.h" | ||
|
||
#include <tbb/task_group.h> | ||
|
||
/** Parallel impl for NetlistRouter. | ||
* Holds enough context members to glue together ConnectionRouter and net routing functions, | ||
* such as \ref route_net. Keeps the members in thread-local storage where needed, | ||
* i.e. ConnectionRouters and RouteIterResults-es. | ||
* See \ref route_net. */ | ||
template<typename HeapType> | ||
class ParallelNetlistRouter : public NetlistRouter { | ||
public: | ||
ParallelNetlistRouter( | ||
const Netlist<>& net_list, | ||
const RouterLookahead* router_lookahead, | ||
const t_router_opts& router_opts, | ||
CBRR& connections_inf, | ||
NetPinsMatrix<float>& net_delay, | ||
const ClusteredPinAtomPinsLookup& netlist_pin_lookup, | ||
std::shared_ptr<SetupHoldTimingInfo> timing_info, | ||
NetPinTimingInvalidator* pin_timing_invalidator, | ||
route_budgets& budgeting_inf, | ||
const RoutingPredictor& routing_predictor, | ||
const vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>>& choking_spots, | ||
bool is_flat) | ||
: _routers_th(_make_router(router_lookahead, is_flat)) | ||
, _net_list(net_list) | ||
, _router_opts(router_opts) | ||
, _connections_inf(connections_inf) | ||
, _net_delay(net_delay) | ||
, _netlist_pin_lookup(netlist_pin_lookup) | ||
, _timing_info(timing_info) | ||
, _pin_timing_invalidator(pin_timing_invalidator) | ||
, _budgeting_inf(budgeting_inf) | ||
, _routing_predictor(routing_predictor) | ||
, _choking_spots(choking_spots) | ||
, _is_flat(is_flat) {} | ||
~ParallelNetlistRouter() {} | ||
|
||
/** Run a single iteration of netlist routing for this->_net_list. This usually means calling | ||
* \ref route_net for each net, which will handle other global updates. | ||
* \return RouteIterResults for this iteration. */ | ||
RouteIterResults route_netlist(int itry, float pres_fac, float worst_neg_slack); | ||
duck2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void set_rcv_enabled(bool x); | ||
void set_timing_info(std::shared_ptr<SetupHoldTimingInfo> timing_info); | ||
|
||
private: | ||
/** A single task to route nets inside a PartitionTree node and add tasks for its child nodes to task group \p g. */ | ||
void route_partition_tree_node(tbb::task_group& g, PartitionTreeNode& node, int itry, float pres_fac, float worst_neg_slack); | ||
duck2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ConnectionRouter<HeapType> _make_router(const RouterLookahead* router_lookahead, bool is_flat) { | ||
auto& device_ctx = g_vpr_ctx.device(); | ||
auto& route_ctx = g_vpr_ctx.mutable_routing(); | ||
|
||
return ConnectionRouter<HeapType>( | ||
device_ctx.grid, | ||
*router_lookahead, | ||
device_ctx.rr_graph.rr_nodes(), | ||
&device_ctx.rr_graph, | ||
device_ctx.rr_rc_data, | ||
device_ctx.rr_graph.rr_switch(), | ||
route_ctx.rr_node_route_inf, | ||
is_flat); | ||
} | ||
|
||
/* Context fields */ | ||
tbb::enumerable_thread_specific<ConnectionRouter<HeapType>> _routers_th; | ||
const Netlist<>& _net_list; | ||
const t_router_opts& _router_opts; | ||
CBRR& _connections_inf; | ||
tbb::enumerable_thread_specific<RouteIterResults> _results_th; | ||
NetPinsMatrix<float>& _net_delay; | ||
const ClusteredPinAtomPinsLookup& _netlist_pin_lookup; | ||
std::shared_ptr<SetupHoldTimingInfo> _timing_info; | ||
NetPinTimingInvalidator* _pin_timing_invalidator; | ||
route_budgets& _budgeting_inf; | ||
const RoutingPredictor& _routing_predictor; | ||
const vtr::vector<ParentNetId, std::vector<std::unordered_map<RRNodeId, int>>>& _choking_spots; | ||
bool _is_flat; | ||
}; | ||
|
||
#include "ParallelNetlistRouter.tpp" |
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.