How xilinx/finn works
Project type and purpose
• FINN is an open-source compiler framework for generating FPGA dataflow accelerators from quantized neural networks (ONNX / Brevitas).
• It spans multiple abstraction levels: Python front-end, model transformations (QONNX → FINN IR), HLS code generation, Vivado/Vitis build, and optional runtime simulation or deployment on PYNQ/Zynq devices.
File structure
• Top-level directories & files:
• src/finn: core Python packages (analysis, builder, custom_op, transformation, util, qnn-data)
• custom_hls & finn-rtllib: custom C++ HLS sources and Verilog/Project IP library for generated accelerators
• docker & run-docker.sh: containerized execution environment & CI pipelines
• notebooks & tutorials: Jupyter-based examples illustrating usage and end-to-end FPGA flow
• docs: Sphinx documentation and READTHEDOCS config
• tests: unit and integration tests covering all functional layers
• Key patterns:
• Modular Python packages for transformation passes (QONNX → FPGA-DFG)
• Builder pattern orchestrating HLS code generation & IP stitching
• Layer-by-layer custom operator backends (HLS and RTL)
• External toolchain integration (Vitis HLS, Vivado) via configuration scripts
README for additional insights
• Emphasis on Docker‐only execution, Jupyter tutorials, and the “FINN stack” spanning ONNX import, dataflow IR, HLS, hardware IP libraries, and deployment.