Improve Vivado/Vitis build flow, report generation, and VivadoAccelerator refactor#1448
Open
nghielme wants to merge 10 commits intofastmachinelearning:mainfrom
Open
Improve Vivado/Vitis build flow, report generation, and VivadoAccelerator refactor#1448nghielme wants to merge 10 commits intofastmachinelearning:mainfrom
nghielme wants to merge 10 commits intofastmachinelearning:mainfrom
Conversation
…tis and Vivado builds Made-with: Cursor
- Introduced a new `statistics.tcl` script for parsing utilization, power, and timing reports into JSON format. - Updated existing TCL scripts for AXI Lite and AXI Stream designs to include the new statistics reporting functionality. - Refactored the `vivado_report.py` to utilize path templates for improved file handling and maintainability. Power reports has been added. - Modified `.gitignore` to exclude specific test files from version control.
- Updated the Vivado backend to generate build options in a separate `build_opt.tcl` file, improving maintainability and readability, as it happens for Vitis backend - Modified the `build_prj.tcl` to source the new `build_opt.tcl` for configuration settings. - Enhanced the CLI to accept a new `--fifo-opt` argument for FIFO optimization. - Adjusted the build scripts across various backends to ensure consistent handling of build options. - Added new templates for `build_opt.tcl` in both Vivado and Vivado Accelerator directories.
…n and organization - Updated `build_prj.tcl` for Vivado and Vitis to create a dedicated `vivado_reports` directory for RTL simulation JSON reports. - Enhanced the handling of compiler flags by introducing a `common_cflags` variable to fix an error with Vivado 2020.1. - Removed the deprecated `build_prj.tcl` for the Vivado Accelerator, streamlining the project structure. - Added a new bitfile generation block in `vivado_accelerator_writer.py`. The part concerning bitfile is now run inside the tcl file that is generated by Vivado backend and modified by VivadoAccelerator writer. This way it's possible to just run the tcl file to get the bitstream file, while previously the only way to invoke vivado bitstream generation was by calling `build(bitfile=1)`.
- Added parsing for dynamic and static power metrics in the `dump_statistics` procedure. - Updated JSON output to include new power statistics for improved reporting and analysis.
…_statistics` procedure and improve readability of the script.
… function defined in that file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the Vivado and Vitis backend build flow, report generation, and consistency across backends.
Summary of changes
Build configuration
build_opt.tclfile for build options (similar to Vitis), improving maintainability.build_prj.tcltemplate. VivadoAccelerator now modifies the shared Vivadobuild_prj.tcland uses a single source. Bitfile generation is now integrated into the generated TCL script, so running the TCL file alone can produce the bitstream (previously requiredbuild(bitfile=1)).Report generation
rtl_sim_${project_name}_report.jsonwith latency, initiation interval, and transaction count from the cosim transaction file. Report is saved undervivado_reports/.statistics.tclfor parsing utilization, power, and timing reports into JSON. VivadoAccelerator design scripts (AXI Lite, AXI Stream) now use this shared procedure.vivado_synth.tcl'sdump_statisticsto includeXILINX_POWER_DYNAMICandXILINX_POWER_STATIC(previously only in the system-level report).vivado_report.pyto use path templates for improved file handling. Power reports have been added.common_cflags: Introducedcommon_cflagsinbuild_prj.tclto fix Vivado 2020.1 compatibility and ensure consistent compiler flags across synthesis and cosim.CLI and backend
--fifo-opt: New CLI argument for FIFO optimization.Type of change
Tests
Tests were run using the existing pytest suite with Vivado, Vitis, and VivadoAccelerator backends.
To reproduce:
Test Configuration:
Checklist
pre-commiton the files I edited or added.