Skip to content

VPR: Add options for writing machine readable summary files #1947

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 6 commits into from
Jan 31, 2022

Conversation

lpawelcz
Copy link
Contributor

@lpawelcz lpawelcz commented Jan 4, 2022

Description

This PR adds 2 new options:

  • --write_block_usage
  • --write_timing_summary
    which enable VPR to write two summary files in JSON format.
    The first one reports the usage of specific blocks of given architecture for implemented design during packing step in format:
{
  "num_nets": "<int>",
  "num_blocks": "<int>",
  "input_pins": "<int>",
  "output_pins": "<int>",
  "blocks": {
    "<block_type_name_0>": <int>,
    "<block_type_name_1>": <int>,
    ...
    "<block_type_name_n>": <int>
  }
}

Second option writes final timing summary for the design evaluated in routing step. It consist of Critical Path Delay (cpd), Max Circuit Frequency (Fmax), setup Worst Negative Slack (sWNS), setup Total Negative Slack (sTNS). The format is as follows:

{
  "cpd": <double>,
  "fmax": <double>,
  "swns": <double>,
  "stns": <double>
}

Related Issue

This feature was suggested in #1944

Motivation and Context

Information provided in generated JSON files is used in SymbiFlow to perform tests that verify the block usage and timings against reference values in order to catch possible regression.
Current way of getting the information from VPR requires parsing the log output in search of timing summary and block usage info. It would be better solution to let VPR prepare the output in easy to read format so that we won't rely on log output that could be changed in the future and cause failures in log parsers.

How Has This Been Tested?

This was tested locally by adding new options to calls to VPR in symbiflow and inspecting the resulting files.

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

@mithro
Copy link
Contributor

mithro commented Jan 4, 2022

@lpawelcz - VPR has generally used XML for all the other file formats, I think it would be better to stick with that file format.

Copy link
Collaborator

@acomodi acomodi left a comment

Choose a reason for hiding this comment

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

LGTM, apart from a small typo.

@mithro regarding the XML vs JSON format, I believe that, for such cases, where the output structure is quite simple, JSON is a better fit.

As an alternative, we may enable to output both, based on the file extensions.

@lpawelcz lpawelcz force-pushed the pcza/write-usage-timing branch from ebe1765 to aa27355 Compare January 5, 2022 10:57
@lpawelcz
Copy link
Contributor Author

lpawelcz commented Jan 5, 2022

New options now are able to select between XML and JSON formats based on the extension of the file passed with those options

Copy link
Contributor

@sfkhalid sfkhalid left a comment

Choose a reason for hiding this comment

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

LGTM.

@mithro
Copy link
Contributor

mithro commented Jan 6, 2022

@lpawelcz lpawelcz force-pushed the pcza/write-usage-timing branch 3 times, most recently from ab27f1a to 709bd7d Compare January 13, 2022 11:40
Copy link
Contributor

@mithro mithro left a comment

Choose a reason for hiding this comment

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

Just two minor comments.

Please check the ReadTheDocs looks good.

Merge if @acomodi and @vaughnbetz are happy.

@lpawelcz lpawelcz force-pushed the pcza/write-usage-timing branch from 709bd7d to aca55c9 Compare January 14, 2022 09:12
@lpawelcz
Copy link
Contributor Author

Code blocks in docs were actually broken, sorry for that, they are OK now. Additionally, I noticed that I didn't update the command line options in docs when I added support for TXT files so I also fixed this.

@lpawelcz
Copy link
Contributor Author

Hi @vaughnbetz, I think this one is ready. Please have a look at it and merge if there is nothing more to change here.

Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

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

Looks good; just a few places where I suggest documenting that these are cluster-level netlist statistics. This can be merged and the commenting updated in another PR if you prefer.

@lpawelcz lpawelcz force-pushed the pcza/write-usage-timing branch from aca55c9 to 0acd071 Compare January 28, 2022 08:09
@lpawelcz
Copy link
Contributor Author

I updated docs, help message and text format as specified so another PR won't be needed.

@mkurc-ant
Copy link
Collaborator

Merging this one, Thanks everybody for reviews and comments.

@mkurc-ant mkurc-ant merged commit e4ea995 into verilog-to-routing:master Jan 31, 2022
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.

7 participants