-
Notifications
You must be signed in to change notification settings - Fork 60
AreaExtract — tool to extract and process area data from different sources #2576
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
base: main
Are you sure you want to change the base?
Conversation
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.
Mostly looks good, great work!!! Edit: Nvm fixed! As mentioned via DM I'm having some trouble running Otherwise I left some minor comments.aext - if I can get some help on this that would be very appreciated :)
Also before you merge, if you can write some tests for aext (one with maybe an input JSON and another with input yosys files) with the output being in the CDF, that would be super helpful!
This can be post-merge but just a question: Do you think we can produce area (tree map) visualizations via information given to us via the CDF? I'm also curious whether it might be better to have Petal make the visualization for us. We can also get aext to do this as initially planned, but this could be an alternative!
|
|
||
| type YosysRsrc = dict[str, int] | ||
| """ | ||
| Yosys resources for a cell. |
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.
Might be worth describing what the int value is referring to here!
| type ModuleCellTypes = dict[str, dict[str, CellWithParams]] | ||
|
|
||
|
|
||
| def parse_il_file_old(path: str) -> ModuleCellTypes: |
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.
This seems like an unused function! Please remove :)
| Using the OSS-CAD suite, IL and statistics files can be obtained as follows: | ||
|
|
||
| ``` | ||
| yosys -p "read_verilog -sv <VERILOG_FILE>.sv; hierarchy -top main; opt; write_rtlil <IL_FILE>.il; tee -o <STAT_FILE>.json stat -json" |
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.
As discussed on slack, it would be great just to add a sentence here saying that the user should run fud2 with --through calyx-to-synth-verilog to generate <VERILOG_FILE>.sv.
|
|
||
| This tool is not yet a full replacement of its technology-specific predecessors, | ||
| `synthrep` for Vivado and `aprof` for Yosys, as it is not able to produce area-only | ||
| visualizations, which is a desirable feature. In addition, some of `synthrep`'s |
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.
Area visualizations seem like a great next step :) I think it's ok to keep synthrep for the other functionalities, but it would make sense for us to remove aprof.
| type DesignRsrc = dict[str, CellRsrc] | ||
|
|
||
|
|
||
| def parse_il_file_old(path: str) -> ModuleCellTypes: |
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.
Same deal with parse_il_file_old in AreaExtract!
| import pandas as pd | ||
| import plotly.express as px | ||
| from profiler.classes.tracedata import UtilizationCycleTrace | ||
| from profiler.classes.tracedata import PTrace |
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.
What was the reason for the switch? Just curious!
| @@ -0,0 +1,195 @@ | |||
| import pathlib | |||
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 think the code duplication here is ok for now since our plan is to deprecate this once aext gets visualization capabilities, but just wanted to flag this!
| Hierarchical area wrapper. | ||
| """ | ||
|
|
||
| map: dict[str, dict[str, str]] |
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.
What's this map a nested dictionary between again? A comment here would be super helpful!
|
|
||
| - Vivado, as hierarchical area synthesis reports | ||
| - Yosys, as both IL and statistics files | ||
|
|
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.
Can you add the uv install command here too? (I think that was the issue) Thanks!
This PR adds AreaExtract as a tool in the repo, combining functionality that was previously split between technology-specific tools. I wrote a README and pasted it below. The PR also updates the profiler, Petal, to parse the new common data format and produce its area visualizations with it, independently of the source.
AreaExtract
AreaExtract is a tool that replaces previous technology-specific frontends for the Calyx profiler, Petal. It offers a combined frontend for several sources of area data for accelerator designs, and outputs processed data in a common data format that is parseable by Petal. Currently, the following technologies are supported:
Usage
Obtaining area data
This section provides instructions to obtain area data for designs from supported technologies, to use as input for AreaExtract.
Vivado
The simplest way to obtain a hierarchical area RPT file is to use Fud2 to run synthesis on a Calyx design:
Alternatively, it is possible to use Fud2 to obtain a synthesis-ready Verilog file, and then use Vivado directly to conduct synthesis. The relevant TCL command for Vivado is:
Yosys
Using the OSS-CAD suite, IL and statistics files can be obtained as follows:
It is also possible to pass Liberty files to the
statcommand through the flag-liberty <file>.Future work
This tool is not yet a full replacement of its technology-specific predecessors,
synthrepfor Vivado andaproffor Yosys, as it is not able to produce area-only visualizations, which is a desirable feature. In addition, some ofsynthrep's functionality is unrelated to area, and is not in scope for AreaExtract. Another area that is being explored is the addition of other technologies, especially OpenROAD as it targets ASICs instead of FPGAs. While Yosys also offers ASIC capabilities, it is primarily oriented towards FPGAs; Vivado exclusively targets AMD FPGAs.