Skip to content

Improve Vivado/Vitis build flow, report generation, and VivadoAccelerator refactor#1448

Open
nghielme wants to merge 10 commits intofastmachinelearning:mainfrom
nghielme:vivado-based-report-pr
Open

Improve Vivado/Vitis build flow, report generation, and VivadoAccelerator refactor#1448
nghielme wants to merge 10 commits intofastmachinelearning:mainfrom
nghielme:vivado-based-report-pr

Conversation

@nghielme
Copy link
Contributor

@nghielme nghielme commented Mar 5, 2026

Description

This PR improves the Vivado and Vitis backend build flow, report generation, and consistency across backends.

Summary of changes

Build configuration

  • TCL configuration files: Vivado backend now uses a separate build_opt.tcl file for build options (similar to Vitis), improving maintainability.
  • VivadoAccelerator refactor: Removed the deprecated standalone build_prj.tcl template. VivadoAccelerator now modifies the shared Vivado build_prj.tcl and 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 required build(bitfile=1)).

Report generation

  • RTL simulation JSON report: Added automatic generation of rtl_sim_${project_name}_report.json with latency, initiation interval, and transaction count from the cosim transaction file. Report is saved under vivado_reports/.
  • Shared statistics parsing: Introduced statistics.tcl for parsing utilization, power, and timing reports into JSON. VivadoAccelerator design scripts (AXI Lite, AXI Stream) now use this shared procedure.
  • Power report parity: Extended vivado_synth.tcl's dump_statistics to include XILINX_POWER_DYNAMIC and XILINX_POWER_STATIC (previously only in the system-level report).
  • Report path templates: Refactored vivado_report.py to use path templates for improved file handling. Power reports have been added.
  • common_cflags: Introduced common_cflags in build_prj.tcl to 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.
  • VivadoAccelerator backend: Now delegates build to the Vivado backend instead of duplicating logic.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • A new research paper code implementation
  • Other (Specify)

Tests

Tests were run using the existing pytest suite with Vivado, Vitis, and VivadoAccelerator backends.

To reproduce:

cd test/pytest
RUN_SYNTHESIS=true pytest test_keras_api.py -v -k "activations" --tb=short

Test Configuration:

  • Vivado: 2020.1
  • Vitis: 2024.1
  • VivadoAccelerator: Vivado 2020.1

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

nghielme added 8 commits March 2, 2026 19:11
- 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.
@nghielme nghielme added the please test Trigger testing by creating local PR branch label Mar 5, 2026
@JanFSchulte JanFSchulte added please test Trigger testing by creating local PR branch and removed please test Trigger testing by creating local PR branch labels Mar 6, 2026
@JanFSchulte JanFSchulte added please test Trigger testing by creating local PR branch and removed please test Trigger testing by creating local PR branch labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please test Trigger testing by creating local PR branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants