-
Notifications
You must be signed in to change notification settings - Fork 415
RRGraphView node_cost_index() Implementation #1843
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
Changes from 3 commits
29ef568
c2ee1cb
46a1f6a
57c333b
75018b5
b75944f
32323d1
dcdc95f
8c1d49c
e1058cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -50,7 +50,7 @@ void get_segment_usage_stats(std::vector<t_segment_inf>& segment_inf) { | |||||||||||
|
||||||||||||
for (size_t inode = 0; inode < device_ctx.rr_nodes.size(); inode++) { | ||||||||||||
if (rr_graph.node_type(RRNodeId(inode)) == CHANX || rr_graph.node_type(RRNodeId(inode)) == CHANY) { | ||||||||||||
cost_index = device_ctx.rr_nodes[inode].cost_index(); | ||||||||||||
cost_index = rr_graph.node_cost_index(RRNodeId(inode)); | ||||||||||||
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. Here's an example of where I think we should eventually hide the cost_index. It hides the fact that this seg_type lookup goes through a cost_index (flyweight) for storage efficiency; the caller doesn't care. 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. It's possible there's some cpu time penalty to that in some code, if we ask for a bunch of cost_index data in rapid succession. But in that case we could return a struct with the data that tends to be requested together packed into it. 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. @vaughnbetz I think it is a good idea to streamline the API here. Actually, I am thinking about if we should include the vtr-verilog-to-routing/vpr/src/base/vpr_context.h Lines 173 to 177 in 77a3df8
I said so because these two data structures are modified copies of the original ones in architecture data. They have been updated to accurately model the switches and segments in the context of a specific routing resource graph. However, it may be too complicated to this PR. It can be in a pull request near future (I can take the lead on it; since I have already tried in the rr_graph_obj.h) Let me know what you think. 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. If we decide to add API calls, the following are all a part of t_rr_indexed_data: The 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. I agree, I think both those data structures should go in RRGraphView, and be built in RRGraphBuilder. 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. I think the rr_graph.ortho_seg_type() style would be more clear. |
||||||||||||
size_t seg_type = device_ctx.rr_indexed_data[cost_index].seg_index; | ||||||||||||
|
||||||||||||
if (!segment_inf[seg_type].longline) | ||||||||||||
|
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 may use
rr_graph->node_cost_index
to avoid too many brackets