Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
ef412d9
Add Singularity support to existing run script
fpjentzsch Aug 1, 2023
8adee81
Add GHA to build & test singularity container
fpjentzsch Aug 3, 2023
39e88cd
[Singularity] Add documentation
fpjentzsch Aug 3, 2023
7d7d061
[Singularity] Fixes for GHA
fpjentzsch Aug 3, 2023
ed1a325
[Singularity] Fixes for GHA
fpjentzsch Aug 3, 2023
5aa85d0
[Singularity] Increase build space for GHA
fpjentzsch Aug 4, 2023
71259c5
[Singularity] Adjust build space for GHA
fpjentzsch Aug 4, 2023
3ed04b8
[Singularity] GHA fixes
fpjentzsch Aug 4, 2023
8f263bc
[Singularity] Adjust GHA
fpjentzsch Aug 4, 2023
be61c31
[Singularity] Adjust GHA
fpjentzsch Aug 4, 2023
a61ac9b
[Singularity] Adjust GHA
fpjentzsch Aug 4, 2023
c80c03c
Merge remote-tracking branch 'upstream/dev' into feature/apptainer
fpjentzsch Aug 6, 2023
cbf9f48
Skeleton for C driver generation
bwintermann Aug 15, 2023
f0bdea2
Creating templates for C and C++ drivers
bwintermann Aug 15, 2023
634ef9f
C++ kernel wip
bwintermann Aug 15, 2023
24a8066
Fixes for C++ driver
bwintermann Aug 15, 2023
201011a
Fixes for driver creation
bwintermann Aug 16, 2023
60640dd
C++ driver buffers and memory initialization
bwintermann Aug 16, 2023
c0b390c
Compilation fix
bwintermann Aug 16, 2023
89e3ff3
Inclusion of cpp drivers per submodule. Fixes for MakeCPPDriver
bwintermann Aug 17, 2023
820e8f8
Fixes for c++ driver generation
bwintermann Aug 17, 2023
ea554b5
Fixed driver export
bwintermann Aug 18, 2023
c5225e1
Temporary debugging print statements
bwintermann Sep 6, 2023
50b04d2
Updated to write out header and config files for updated cpp driver
bwintermann Oct 4, 2023
2145749
Updated finn-cpp-driver submodule to track dev branch
bwintermann Oct 4, 2023
b5aaa2d
Some path fixing
bwintermann Oct 6, 2023
cacbd55
Transfer run-docker update for singularity from PR
bwintermann Oct 17, 2023
7c39ad5
Fixed path errors during cpp driver step
bwintermann Oct 18, 2023
9b521f5
Fixed pathing issues and type name conversion
bwintermann Oct 19, 2023
1e2aea6
Datatype parser fix
bwintermann Oct 19, 2023
da51f97
Add support for U55C to FINN
LinusJungemann Oct 30, 2023
dcc0f14
Update gitignore
LinusJungemann Oct 30, 2023
b179136
Merge branch 'singularity_support' into dev
LinusJungemann Oct 30, 2023
40f9495
Periodic merge of Xilinx FINN into Eki FINN
LinusJungemann Dec 15, 2023
f4552e8
Change HBM bank allocation to use different banks for input and output
LinusJungemann Jan 16, 2024
e1303d2
Merge dev into c_driver to get c_driver up to newest version
LinusJungemann Jan 16, 2024
9e65299
Update finn integration of C++ driver
LinusJungemann Feb 1, 2024
1428ca9
Add C++ driver integration to FINN
LinusJungemann Feb 21, 2024
cd2e82f
Remove some merge artifacts#
LinusJungemann Feb 21, 2024
8bf469e
Update documentation
LinusJungemann Feb 21, 2024
fa7cef9
Remove debug printing
LinusJungemann Feb 21, 2024
7c5b3fd
Merge branch 'dev' into feature/integrateCppDriver
LinusJungemann Jun 26, 2024
6dbe116
Move high performance driver version to v1.1
LinusJungemann Jun 26, 2024
46cceaa
Merge remote-tracking branch 'upstream/dev' into feature/integrateCpp…
auphelia Feb 21, 2025
faba00a
Unify Python and C++ driver generation
LinusJungemann Mar 14, 2025
ac6e2ed
Update repo checkout and dependency building
LinusJungemann Mar 14, 2025
8b4c26d
Remove C++ driver as a submodule, because it is now cloned during run…
LinusJungemann Mar 14, 2025
113b8ea
Remove finn-plus code that is unneccesary for finn
LinusJungemann Mar 28, 2025
9c9b195
Fix small issues
LinusJungemann Apr 7, 2025
8ed6263
Fix output to shell
LinusJungemann Apr 9, 2025
7e1d6ce
Fix linting
LinusJungemann Apr 9, 2025
c709777
Fix linting
LinusJungemann Apr 9, 2025
75d5b77
Merge branch 'feature/integrateCppDriver' of github.com:LinusJungeman…
LinusJungemann Apr 9, 2025
5b63111
Revert changes to notebooks
LinusJungemann Apr 9, 2025
e2a217f
Merge remote-tracking branch 'origin/dev' into feature/integrateCppDr…
LinusJungemann Apr 9, 2025
2c2a33a
Remove replicated code
LinusJungemann Apr 9, 2025
aec60db
Add missing import
LinusJungemann Apr 17, 2025
808798a
Add license
LinusJungemann Apr 17, 2025
a3a3d38
Merge remote-tracking branch 'upstream/dev' into feature/integrateCpp…
auphelia May 21, 2025
030feeb
Remove unsused gitmodules files
auphelia May 21, 2025
d06d17e
[MakeCPPDriver] Small changes to input arguments and model metadata s…
auphelia May 21, 2025
d131907
[Deps] Remove obsolete ending from gitignore
auphelia May 26, 2025
398be02
[Transform] Update copyright header
auphelia May 26, 2025
369f003
[Driver] Move util functions
auphelia May 26, 2025
3949169
[MakeDriver] Add docstring and check for platform
auphelia May 26, 2025
ced9f82
[NBs] Change last occurrences of pynq driver import
auphelia May 26, 2025
52e230c
[Docs] Change make_pynq_driver to make_driver
auphelia May 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/finn/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ as it goes through numerous steps:
Running step: step_measure_rtlsim_performance [15/19]
Running step: step_out_of_context_synthesis [16/19]
Running step: step_synthesize_bitfile [17/19]
Running step: step_make_pynq_driver [18/19]
Running step: step_make_driver [18/19]
Running step: step_deployment_package [19/19]


Expand Down
2 changes: 1 addition & 1 deletion docs/finn/hw_build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To rapidly test the generated design on PYNQ platforms, FINN is capable of
generating a Python driver for the given design. This driver packs/unpacks the
input/output tensors in the expected format, then uses PYNQ APIs to initiate
data movement and transfer back the results to the host CPU. The generation of
the driver is done by transformation pass :py:mod:`finn.transformation.fpgadataflow.make_pynq_driver.MakePYNQDriver`.
the driver is done by transformation pass :py:mod:`finn.transformation.fpgadataflow.make_driver.MakePYNQDriver`.

DMA and DWC Node Insertion
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/finn/source_code/finn.transformation.fpgadataflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ finn.transformation.fpgadataflow.insert\_tlastmarker
finn.transformation.fpgadataflow.make\_pynq\_driver
----------------------------------------------------------

.. automodule:: finn.transformation.fpgadataflow.make_pynq_driver
.. automodule:: finn.transformation.fpgadataflow.make_driver
:members:
:undoc-members:
:show-inheritance:
Expand Down
4 changes: 2 additions & 2 deletions notebooks/advanced/4_advanced_builder_settings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@
"metadata": {},
"source": [
"You can see that after the generation of the estimate reports, the code generation and the ip generation is invoked (`step_hw_codegen` and `step_hw_ipgen`). The FIFO depths are determined and the FIFOs are inserted in the network (`step_set_fifo_depths`), we can then create an IP design of our whole network by stitching the IPs from each layer together (`step_create_stitched_ip`). At this point we have an implementation of the neural network that we can integrate within a bigger FPGA design, we can run performance measurements using simulation (`step_measure_rtlsim_performance`) and out-of-context synthesis (`step_out_of_context_synthesis`) for it.\n",
"The FINN builder also provides automatic system integration for Zynq and Alveo devices, this can be invoked by running `step_synthesize_bitfile`, `step_make_pynq_driver` and `step_deployment_package`."
"The FINN builder also provides automatic system integration for Zynq and Alveo devices, this can be invoked by running `step_synthesize_bitfile`, `step_make_driver` and `step_deployment_package`."
]
},
{
Expand Down Expand Up @@ -1782,7 +1782,7 @@
" \"step_measure_rtlsim_performance\",\n",
" \"step_out_of_context_synthesis\",\n",
" \"step_synthesize_bitfile\",\n",
" \"step_make_pynq_driver\",\n",
" \"step_make_driver\",\n",
" \"step_deployment_package\",\n",
"]\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
"metadata": {},
"outputs": [],
"source": [
"from finn.transformation.fpgadataflow.make_pynq_driver import MakePYNQDriver\n",
"from finn.transformation.fpgadataflow.make_driver import MakePYNQDriver\n",
"model = model.transform(MakePYNQDriver(\"zynq-iodma\"))"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@
"metadata": {},
"outputs": [],
"source": [
"from finn.transformation.fpgadataflow.make_pynq_driver import MakePYNQDriver\n",
"from finn.transformation.fpgadataflow.make_driver import MakePYNQDriver\n",
"model = model.transform(MakePYNQDriver(\"zynq-iodma\"))"
]
},
Expand Down
8 changes: 7 additions & 1 deletion src/finn/builder/build_dataflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class DataflowOutputType(str, Enum):
RTLSIM_PERFORMANCE = "rtlsim_performance"
BITFILE = "bitfile"
PYNQ_DRIVER = "pynq_driver"
CPP_DRIVER = "cpp_driver"
DEPLOYMENT_PACKAGE = "deployment_package"


Expand Down Expand Up @@ -123,7 +124,7 @@ class VerificationStepType(str, Enum):
"step_measure_rtlsim_performance",
"step_out_of_context_synthesis",
"step_synthesize_bitfile",
"step_make_pynq_driver",
"step_make_driver",
"step_deployment_package",
]

Expand Down Expand Up @@ -356,6 +357,11 @@ class DataflowBuildConfig:
#: rtlsim, otherwise they will be replaced by RTL implementations.
rtlsim_use_vivado_comps: Optional[bool] = True

#: Determine if the C++ driver should be generated instead of the PYNQ driver
#: If set to latest newest version will be used
#: If set to commit hash specified version will be used
cpp_driver_version: Optional[str] = "latest"

def _resolve_hls_clk_period(self):
if self.hls_clk_period_ns is None:
# use same clk for synth and hls if not explicitly specified
Expand Down
29 changes: 23 additions & 6 deletions src/finn/builder/build_dataflow_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import numpy as np
import os
import shutil
import warnings
from copy import deepcopy
from functools import partial
from qonnx.core.modelwrapper import ModelWrapper
Expand Down Expand Up @@ -87,7 +88,7 @@
from finn.transformation.fpgadataflow.hlssynth_ip import HLSSynthIP
from finn.transformation.fpgadataflow.insert_dwc import InsertDWC
from finn.transformation.fpgadataflow.insert_fifo import InsertFIFO
from finn.transformation.fpgadataflow.make_pynq_driver import MakePYNQDriver
from finn.transformation.fpgadataflow.make_driver import MakeCPPDriver, MakePYNQDriver
from finn.transformation.fpgadataflow.make_zynq_proj import ZynqBuild
from finn.transformation.fpgadataflow.minimize_accumulator_width import (
MinimizeAccumulatorWidth,
Expand Down Expand Up @@ -732,15 +733,31 @@ def step_measure_rtlsim_performance(model: ModelWrapper, cfg: DataflowBuildConfi
return model


def step_make_pynq_driver(model: ModelWrapper, cfg: DataflowBuildConfig):
"""Create a PYNQ Python driver that can be used to interface the generated
accelerator."""
def step_make_driver(model: ModelWrapper, cfg: DataflowBuildConfig):
"""Create a driver that can be used to interface the generated accelerator.
Use DataflowBuildConfig to select PYNQ Python or C++ driver."""

driver_dir = os.path.join(cfg.output_dir, "driver")
if DataflowOutputType.PYNQ_DRIVER in cfg.generate_outputs:
driver_dir = cfg.output_dir + "/driver"
# generate PYNQ driver
model = model.transform(MakePYNQDriver(cfg._resolve_driver_platform()))
shutil.copytree(model.get_metadata_prop("pynq_driver_dir"), driver_dir, dirs_exist_ok=True)
print("PYNQ Python driver written into " + driver_dir)
elif DataflowOutputType.CPP_DRIVER in cfg.generate_outputs:
# generate C++ Driver
model = model.transform(
MakeCPPDriver(
cfg._resolve_driver_platform(),
version=cfg.cpp_driver_version,
)
)
shutil.copytree(model.get_metadata_prop("cpp_driver_dir"), driver_dir, dirs_exist_ok=True)
print("C++ driver written into " + driver_dir)
else:
warnings.warn(
"The step step_make_driver is in the build list but will not be executed"
+ " since no driver is selected in generate_outputs in your build.py file!"
)
return model


Expand Down Expand Up @@ -862,7 +879,7 @@ def step_deployment_package(model: ModelWrapper, cfg: DataflowBuildConfig):
"step_set_fifo_depths": step_set_fifo_depths,
"step_create_stitched_ip": step_create_stitched_ip,
"step_measure_rtlsim_performance": step_measure_rtlsim_performance,
"step_make_pynq_driver": step_make_pynq_driver,
"step_make_driver": step_make_driver,
"step_out_of_context_synthesis": step_out_of_context_synthesis,
"step_synthesize_bitfile": step_synthesize_bitfile,
"step_deployment_package": step_deployment_package,
Expand Down
Loading