-
Notifications
You must be signed in to change notification settings - Fork 414
RRGraphView::node_capacity() Implementation #1780
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
RRGraphView::node_capacity() Implementation #1780
Conversation
Signed-off-by: Ethan Rogers <[email protected]>
Signed-off-by: Ethan Rogers <[email protected]>
Signed-off-by: Ethan Rogers <[email protected]>
Signed-off-by: Ethan Rogers <[email protected]>
Signed-off-by: Ethan Rogers <[email protected]>
rr_graph.node_capacity(RRNodeId(inode)) Signed-off-by: Ethan Rogers <[email protected]>
@vaughnbetz, @hzeller, @tangxifan, here is my next PR for the RRGraphView API. This one implements node_capacity(). If you could review it when you have some time, that would be great! Thanks! |
@@ -801,7 +801,8 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> { | |||
} | |||
|
|||
inline unsigned int get_node_capacity(const t_rr_node& node) final { |
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.
How much is this function used? We could deprecate it and replace the call sites, since it just gets an id from the node and then calls another function.
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 have now removed it. I added include "globals.h"
to the top of some of the files in order to access the rr_graph, so hopefully that won't cause any issues. I am going to run qor testing again now.
QoR and the changes both look good. I just have one comment/question above. |
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.
@ethanroj23 This pull request looks clean to me. The number of modified lines matches well with my results on 'grep capacity'. Just some minor changes required, and I think it is ready to merge.
function; Signed-off-by: Ethan Rogers <[email protected]>
vpr/src/route/gen/rr_graph_uxsdcxx.h
Outdated
@@ -23,6 +23,7 @@ | |||
#include <stddef.h> | |||
#include <stdint.h> | |||
#include "pugixml.hpp" | |||
#include "globals.h" |
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.
Actually, introducing global variable is a critical concern to me. It makes the code hard to maintain because it is hard to know what are the required data structure for each function.
This motivates me to review what the rr_graph_uxsdcxx.h
is doing. It actually creates its own context in this file, being independent from the RRGraph and other VPR data structure. This looks clean to me. It makes sense that it should have it own node_capacity()
function so that they are isolated from RRGraph data structure.
vtr-verilog-to-routing/vpr/src/route/rr_graph_uxsdcxx_serializer.h
Lines 803 to 805 in 6e442d1
inline unsigned int get_node_capacity(const t_rr_node& node) final { | |
return node.capacity(); | |
} |
So, I suggest not to introduce the global variables to this file. But we should update the API in the rr_graph_uxsdcxx_serializer.h
. Actually, I found how they access the rr_graph inside. We can update the get_node_capacity()
like this:
vtr-verilog-to-routing/vpr/src/route/rr_graph_uxsdcxx_serializer.h
Lines 809 to 812 in 6e442d1
inline uxsd::enum_node_type get_node_type(const t_rr_node& node) final { | |
const auto& rr_graph = (*rr_graph_); | |
return to_uxsd_node_type(rr_graph.node_type(node.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.
@vaughnbetz I found something in the RRGraph serializer which may conflicts with your previous comments. See if my suggestion makes sense or not.
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.
OK, I agree with you @tangxifan . I missed that they weren't accessing the same rr_graph data structure, but were instead accessing their own local version. In that case, I agree my earlier comments are wrong and we should revert to what Ethan had (which I think is basically the same code as what you propose above).
Sorry for the churn @ethanroj23
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.
No worries! I have now replaced the code, with the commented out sections of code still removed, so we should be good to go! @vaughnbetz let me know if there is anything else that should be altered here. Thanks!
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.
@vaughnbetz Thanks for double-check!
@ethanroj23 I have no concerns on the PR. Look good to me.
Signed-off-by: Ethan Rogers <[email protected]>
Description
In this PR, I have implemented
RRGraphView::node_capacity()
throughout VTR. Every timedevice_ctx.rr_nodes[index].capacity()
was called has been replaced withrr_graph.node_capacity(RRNodeId(index))
. In order to do this, I followed a pattern similar to that in the last PR.Motivation and Context
These changes are a continuation of the RRGraphView API implementation effort.
How Has This Been Tested?
I have run the regression tests for
vtr_reg_strong
along with the QoR testing found at$ ../scripts/run_vtr_task.py regression_tests/vtr_reg_nightly_test3/vtr_reg_qor_chain
. Results from these QoR tests can be found below. The file containing all results can be found hereOnly rows that are different are shown in the table below.
Types of changes
Checklist: