-
Notifications
You must be signed in to change notification settings - Fork 415
Now rr_graph -related source files are placed in a separated library librrgraph
#1972
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
Conversation
…_graph_storage to RRGraphBuilder
librrgraph
librrgraph
@umariqbal-rs Can you look into the doc errors: Also if CI is green, can you run QoR tests? This time, it is better to test on different machines and see if there are any degradation. We are very sensitive to performance degradation in this PR. |
@tangxifan |
@mithro Yes. It will be great. I have requested their review. |
@tangxifan |
Emm. Weird that CI does not capture it. Can you show your CMake version? |
@tangxifan |
Thanks It works after commenting line 11. |
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.
LGTM, I think that SymbiFlow won't be affected by these changes, also confirmed by the passing symbiflow tests
edge_idx_range configurable_edges(const RRNodeId& id) const { | ||
return vtr::make_range(edge_idx_iterator(0), edge_idx_iterator(num_edges(id) - num_non_configurable_edges(id))); | ||
|
||
edge_idx_range configurable_edges(const RRNodeId& id, const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const { | ||
return vtr::make_range(edge_idx_iterator(0), edge_idx_iterator(num_edges(id) - num_non_configurable_edges(id, rr_switches))); | ||
} | ||
edge_idx_range non_configurable_edges(const RRNodeId& id) const { | ||
return vtr::make_range(edge_idx_iterator(num_edges(id) - num_non_configurable_edges(id)), edge_idx_iterator(num_edges(id))); | ||
edge_idx_range non_configurable_edges(const RRNodeId& id, const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const { | ||
return vtr::make_range(edge_idx_iterator(num_edges(id) - num_non_configurable_edges(id, rr_switches)), edge_idx_iterator(num_edges(id))); |
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.
I suppose that the call to the edge partitioning in configurable/non-configurable edges has already been executed before calling these functions. Even though this change does not modify the previous behavior, it may be worth adding assertions here though, to check that the partitioned_
flag has been set, and put it under an assert_safe
if we want to avoid any kind of overhead (not sure how often these are called).
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.
@acomodi Agree. I just double check the APIs.
When calling num_configurable_edges()
and num_non_configurable_edges()
, the internal flags are checked to ensure edges are already partitioned. It is not exactly the partition_
flag but something equivalent (assigned during partition_edges()
API call).
Let me know if this is sufficient or not.
vtr-verilog-to-routing/libs/librrgraph/src/base/rr_graph_storage.cpp
Lines 515 to 516 in f91b728
t_edge_size t_rr_graph_storage::num_configurable_edges(RRNodeId id, const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) const { | |
VTR_ASSERT(!node_first_edge_.empty() && remapped_edges_); |
vtr-verilog-to-routing/libs/librrgraph/src/base/rr_graph_storage.cpp
Lines 491 to 513 in f91b728
void t_rr_graph_storage::partition_edges(const vtr::vector<RRSwitchId, t_rr_switch_inf>& rr_switches) { | |
if (partitioned_) { | |
return; | |
} | |
edges_read_ = true; | |
VTR_ASSERT(remapped_edges_); | |
// This sort ensures two things: | |
// - Edges are stored in ascending source node order. This is required | |
// by assign_first_edges() | |
// - Edges within a source node have the configurable edges before the | |
// non-configurable edges. | |
std::sort( | |
edge_sort_iterator(this, 0), | |
edge_sort_iterator(this, edge_src_node_.size()), | |
edge_compare_src_node_and_configurable_first(rr_switches)); | |
partitioned_ = true; | |
assign_first_edges(); | |
VTR_ASSERT_SAFE(validate(rr_switches)); | |
} |
@tangxifan |
@umariqbal-rs Can you upload the spreadsheets? Is it on a machine or two machines? |
I already did . |
@umariqbal-rs We have discussed the PR today with @vaughnbetz
Then we can merge this PR. |
typedef enum e_rr_type : unsigned char { | ||
SOURCE = 0, ///<A dummy node that is a logical output within a block -- i.e., the gate that generates a signal. | ||
SINK, ///<A dummy node that is a logical input within a block -- i.e. the gate that needs a signal. | ||
IPIN, |
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.
Suggest adding comment for each enum.
IPIN: input pin to a block
OPIN: output pin of a block
CHANX: x-directed routing wire, or an x-directed segment of a channel for global routing
CHANY: y-directed routing wire, or a y-directed segment of a channel for global routing
float C; | ||
}; | ||
|
||
//[0..num_rr_types-1][0..grid_width-1][0..grid_height-1][0..NUM_SIDES-1][0..max_ptc-1] |
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.
Should comment what this is for (fast lookups of an rr-node given an (rr_type, x, y, and the side).
Code looks good; I had a few minor suggestions on commenting above; can address after merging if you prefer. |
@vaughnbetz No worries @umariqbal-rs Please refine code comments as suggested. |
librrgraph
librrgraph
@tangxifan |
Thanks @behzadmehmood-rs for the updates. QoR looks good to me. @vaughnbetz I have updated the comments and fixed the broken links in documentation on the RRGraph APIs. |
Description
This PR creates a C++ library of routing resource graph -related data structures.
Related Issue
Address issue #1868
Motivation and Context
Previously, data structures are tightly integrated with the VPR source codes (part of the router)
However, we see a strong motivation in creating a C++ library for the routing resource graph data structures.
This is because the routing resource graph is part of device modeling which should be decoupled with any EDA engines.
The benefits include
How Has This Been Tested?
This PR includes the following changes
vpr/src
tolibs/librrgraph
rr_node_types.h
. (Name of the file can be changed)VPR_FATAL_ERROR
toVTR_LOG_ERROR
libs/librrgraph
Types of changes
Checklist: