Skip to content

AreaExtract — tool to extract and process area data from different sources#2576

Open
pedropontesgarcia wants to merge 26 commits intomainfrom
area-profiler/AreaExtract
Open

AreaExtract — tool to extract and process area data from different sources#2576
pedropontesgarcia wants to merge 26 commits intomainfrom
area-profiler/AreaExtract

Conversation

@pedropontesgarcia
Copy link
Collaborator

@pedropontesgarcia pedropontesgarcia commented Oct 26, 2025

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:

  • Vivado, as hierarchical area synthesis reports
  • Yosys, as both IL and statistics files

Usage

$ aext -h 
usage: aext [-h] [-o OUTPUT] {vivado,yosys} ...

Parse FPGA synthesis reports into a Common Data Format.

Supported origins:
  - Vivado: single hierarchical .rpt file
  - Yosys: .il (intermediate language) and .json (stat) file

Output is a JSON serialization of the Common Data Format.

positional arguments:
  {vivado,yosys}
    vivado              parse a Vivado utilization .rpt file
    yosys               parse Yosys IL and stat JSON files

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        optional output file for JSON (defaults to stdout)

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:

fud2 <design>.futil --to area-report > <report>.rpt

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:

report_utilization -hierarchical -file <report>.rpt

Yosys

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"

It is also possible to pass Liberty files to the stat command through the flag -liberty <file>.

Future work

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 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.

Copy link
Contributor

@ayakayorihiro ayakayorihiro left a 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 aext - if I can get some help on this that would be very appreciated :) Otherwise I left some minor comments.

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!

@pedropontesgarcia
Copy link
Collaborator Author

@ayakayorihiro I slashed all the previous iterations of area extraction and visualization, and added the area-only visualizations to AreaExtract. I updated all the readmes and resolved (I think) all your comments! I will write some tests (I already have test files so it should not be terribly hard)

Copy link
Collaborator Author

@pedropontesgarcia pedropontesgarcia left a comment

Choose a reason for hiding this comment

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

Done!

@pedropontesgarcia
Copy link
Collaborator Author

pedropontesgarcia commented Dec 3, 2025

@ayakayorihiro I think we're ready for a merge unless you notice anything weird! (in which case do lmk and I'll fix it). Area project should be stable atp :)

EDIT: Idk why the tests are not passing... they pass when I run runt on my end

Copy link
Contributor

@ayakayorihiro ayakayorihiro left a comment

Choose a reason for hiding this comment

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

Mostly looking good - let's see if changing the Dockerfile will fix the CI!

@pedropontesgarcia
Copy link
Collaborator Author

@ayakayorihiro oh no, python versioning is at it again... (type aliases)

@ayakayorihiro ayakayorihiro force-pushed the area-profiler/AreaExtract branch from 3d31be6 to 1e2d553 Compare January 5, 2026 18:46
@ayakayorihiro ayakayorihiro force-pushed the area-profiler/AreaExtract branch from 1e2d553 to 29b65ae Compare January 5, 2026 18:47
@ayakayorihiro ayakayorihiro force-pushed the area-profiler/AreaExtract branch from 29b65ae to e0e814b Compare January 5, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants