Skip to content

Add a new API validate() to RRGraphBuilder #1899

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 4 commits into from
Nov 1, 2021
Merged

Add a new API validate() to RRGraphBuilder #1899

merged 4 commits into from
Nov 1, 2021

Conversation

m-hariszafar
Copy link

Description
This PR focuses on updating routing resource graph builder functions, where we use the refactored data structure RRGraphBuilder to shadow the discrete data structure rr_graph_storage.
This PR aims to fully refactored/deprecate the direct use of the legacy API validate() from the rr_node data structure.

After this PR, the validate() from the refactored data structure RRGraphBuilder is the only way to use it.

Checklist:

  • Removed the legacy API validate() from rr_node.cpp and rr_node.h (if present)
  • Added new API validate() to data structures RRGraphBuilder, whose comments are Doxygen compatible
  • Replaced all the use of validate() in respective functions (if needed)

Related Issue
This pull request is a follow-up PR on the routing resource graph refactoring effort #1805, #1868

Motivation and Context
This PR is a continuation of the refactoring effort with a focus on shadowing the rr_graph_storage APIs in the RRGraphBuilder data structure.
This PR refactored the validate() API among the other APIs in #1847, #1868

How Has This Been Tested?

  • All vtr basic and strong tests are passing.

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@github-actions github-actions bot added the VPR VPR FPGA Placement & Routing Tool label Oct 27, 2021
@m-hariszafar
Copy link
Author

QoR tests are completed and a quick summary is given below. QoR comparison files are also attached.

titan_quick_qor test:
flow run time -3.21% on average.
critical path delays 0% on average.
Peak memory usage -0.17% on average

vtr_reg_qor_chain_depop test:
Flow run time 6.41% on average.
critical path delays 0% on average.
Peak memory usage is -17.4% on average.

Here are the attached files
vtr_chain_depop.xlsx
titan_quick_qor.xlsx

@m-hariszafar m-hariszafar marked this pull request as ready for review October 28, 2021 09:57
Copy link
Contributor

@tangxifan tangxifan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hariszafar-lm I cannot find validate() used by any client functions. Can you double check?

@m-hariszafar
Copy link
Author

@hariszafar-lm I cannot find validate() used by any client functions. Can you double check?

Well, this function is only calling in rr_graph_storage.cpp where it defines. That's why I didn't change them.
And there is no other client function that is calling validate() through some hierarchy.

VTR_ASSERT_SAFE(validate());

VTR_ASSERT_SAFE(validate());

VTR_ASSERT_SAFE(validate());

Let me know if something needs to change.

@tangxifan
Copy link
Contributor

tangxifan commented Oct 29, 2021

@hariszafar-lm I see. It means that the validate() is currently used as an internal method in the rr_graph_storage class. But I think it is needed to be a method in the public method of rr_graph_builder. We need the validator() to be called by the end of rr_graph building function.

Can you add the following comments to this API:

@note This function is used to validate the correctness of the routing resource graph in terms of graph attributes. Strongly recommend to call it when you finish the building a routing resource graph. If you need more advanced checks, which are related to architecture features, you should consider to use the check_rr_graph() function or build your own check_rr_graph() function.

@vaughnbetz Let me know if the comments make sense. Feel free to suggest.

@vaughnbetz
Copy link
Contributor

Yes, those comments make sense to me.

@tangxifan tangxifan merged commit bbaefca into verilog-to-routing:master Nov 1, 2021
@tangxifan tangxifan deleted the api_validate branch November 1, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants