-
Notifications
You must be signed in to change notification settings - Fork 415
Remove legacy data structure rr_node_indices
from DeviceContext
#1828
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
… in place of the legacy data structure ``rr_node_indices``
…eContext, as it is now fully shadowed by the data structure ``RRSpatialLookup``
As required for QoR checks, I finished the QoR runs on the
Attached spreadsheet for the detailed QoR of each test: vtr_reg_basic_timing_sanity_comp.xlsx |
@vaughnbetz @hzeller This pull request is ready for your review. QoR results updated and CI is green. |
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
@@ -17,7 +18,7 @@ class RRSpatialLookup { | |||
/* -- Constructors -- */ | |||
public: | |||
/* Explicitly define the only way to create an object */ | |||
explicit RRSpatialLookup(t_rr_node_indices& rr_node_indices); | |||
explicit RRSpatialLookup(); |
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.
Since we don't take a parameter anymore, the explicit
is not needed anymore.
The explicit
is only needed to tell the compiler to not consider this constructor in an automatic type-conversion, but if there are zero parameters, that is not an issue anymore.
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.
Make sense to me. Will remove it.
@@ -273,3 +272,26 @@ void RRSpatialLookup::resize_nodes(int x, | |||
std::max(rr_node_indices_[type].dim_size(2), size_t(side) + 1)}); | |||
} | |||
} | |||
|
|||
void RRSpatialLookup::reorder(const vtr::vector<RRNodeId, RRNodeId> dest_order) { |
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'd expect some sort of unit-test for this method ?
(I know it is moved from some other place without change, so ok not adding a test for now; but now, it is actually a nicely testable functionality)
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.
You are right. This feature is already under testing in one of the test case in vtr_reg_basic
:
vtr-verilog-to-routing/vtr_flow/tasks/regression_tests/vtr_reg_basic/basic_timing/config/config.txt
Line 32 in 29a9fd5
script_params_list_add = --reorder_rr_graph_nodes_algorithm random_shuffle |
I am not sure if this can be categorized as a unit-test. If not, we should think about it once we can extract the RRGraphBuilder
and RRGraphView
as an independent library.
Let me know what you think. I think unit test is a good idea.
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.
Looks good to me. A few suggestions for commenting improvements, which could be done after merge if more convenient then.
@@ -63,7 +65,7 @@ class RRGraphBuilder { | |||
/* node-level storage including edge storages */ | |||
t_rr_graph_storage& node_storage_; | |||
/* Fast look-up for rr nodes */ | |||
RRSpatialLookup& node_lookup_; | |||
RRSpatialLookup node_lookup_; | |||
}; | |||
|
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.
Now that we have the RRGraphView and RRGraphBuilder APIs, we should make doxygen documentation for them. Best done as a follow-up issue, so I'll file an issue for that (make doxygen-compatible comments, and add to the VPR API on the read-the-docs page).
* If pointers are used, it may cause many codes in client functions | ||
* or inside the data structures to be changed later. | ||
* That explains why the reference is used here temporarily | ||
*/ | ||
/* Fast look-up: TODO: Should rework the data type. Currently it is based on a 3-dimensional arrqay mater where some dimensions must always be accessed with a specific index. Such limitation should be overcome */ |
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.
typo to fix: 3-dimensional array matrix
Merging since CI is green, but please see the commenting suggestions above (typo and doxygen) for a future PR. |
Thanks @vaughnbetz I will create a follow-up pull request to address your comment today. |
Description
This PR focuses on updating routing resource graph builder functions, where we use the refactored data structure
RRGraphBuilder
to replace the legacy data structurerr_node_indices
.This PR aims to fully deprecate the direct use of the legacy data structure
rr_node_indices
in builder as well as client functions.After this PR, the
rr_node_indices
data structure is fully shadowed and encapsulated in the refactored data structureRRGraphBuilder
.This is the first milestone achieved in the refactoring effort on routing resource graph data structures.
Checklist:
rr_node_indices
fromDeviceContext
verify_rr_node_indices()
to useRRGraphBuilder
rather thanrr_node_indices
clear()
to data structuresRRGraphBuilder
andRRSpatialLookup
to reset the data storage; As a result, thefree_rr_graph()
is reworked to use the new API.reorder()
toRRSpatialLookup
to support graph reordering. As a result, the reordering algorithm is reworked to use the new API.TODO: May consider to implement the API
reorder()
inRRGraphBuilder
so that the current reordering function can be fully internal.Related Issue
This pull request is a follow-up PR on the routing resource graph refactoring effort #1805
Motivation and Context
After the previous PR #1805 , we start reworking all the source files that use the legacy data structure
rr_node_indices
in a high priority, in order to deprecate the legacy data structure as soon as possible.Current statistics on the files that use
rr_node_indices
:./route/rr_graph2.cpp
./route/rr_graph2.h
./base/vpr_context.h
This PR will remove the use in
./route/rr_graph.cpp
./route/rr_graph2.cpp
./base/vpr_context.h
How Has This Been Tested?
Types of changes
Checklist: