Vitis Unified Backend#1376
Conversation
…i wrapper for vitisUnified partial backend and build the skeleton code for other generation section
| #include <hls_stream.h> | ||
| #include <iostream> | ||
| #include <stdint.h> | ||
| //#include "ap_axi_sdata.h" |
There was a problem hiding this comment.
Here ap_axi_sdata.h is commented out, so probably is not necessary
| if found != 0: | ||
| raise Exception('Vitis installation not found. Make sure "vitis" is on PATH.') | ||
|
|
||
| if csim: |
There was a problem hiding this comment.
csim seems to be supported, see line 100
|
|
||
| if csim: | ||
| raise Exception("Current Vitis Unified not support csim. Please set csim=False to run Vitis Unified.") | ||
| if validation: |
There was a problem hiding this comment.
If validation is not supported I think we should remove the parameter in the signature of the build() function
| raise Exception( | ||
| "Current Vitis Unified not support validation. Please set validation=False to run Vitis Unified." | ||
| ) | ||
| if export: |
There was a problem hiding this comment.
I think export and package are the same thing
| from pynq import allocate # import for CMA (contingeous memory allocation) | ||
|
|
||
|
|
||
| class MyDfxCtrl(DefaultIP): |
There was a problem hiding this comment.
I think Dfx term is referring to partial reconfiguration. I think we should rename this class. Also, why did you extend DefaultIP and not Overlay class?
See this one for example:
| PROJECT=myprojectBaseName | ||
| WRAPPER_NAME=myprojectWrapName |
There was a problem hiding this comment.
I think myproject is a variable, the user can change it to a different name. I think ${PROJECT} should be used instead
There was a problem hiding this comment.
Hi, I think myprojectBaseName and myprojectWrapName will be overwrited to user-defined project-name at hls4ml/writer/vitis_unified_writer/build_gen.py line 18 - 21.
| ORIGINAL_PROJECT=myproject | ||
| PROJECT=myproject_stitched |
There was a problem hiding this comment.
same here, as previously mentioned
There was a problem hiding this comment.
I think we should rename this file to myproject_axi.cpp, for consistency with VivadoAccelerator backend
There was a problem hiding this comment.
Since we support both AXI Master and AXI Stream, I think we may have separate files myproject_axim.cpp and myproject_axis.cpp—to clearly distinguish between the two wrapper implementations.
There was a problem hiding this comment.
I think we should rename this file to myproject_axi.cpp, for consistency with VivadoAccelerator backend
Co-authored-by: Cursor <cursoragent@cursor.com>
…cing with upstream main. This consolidates the writer structure, updates workspace/template naming, and harmonizes backend/test configuration keys and paths for consistency with hls4ml conventions. Co-authored-by: Cursor <cursoragent@cursor.com>
…ns and driver templates. - Added support for the Vitis Unified backend to include a new JSON file for supported boards. - Updated the VitisUnifiedBackend class to dynamically load board configurations from the new JSON file. - Introduced new driver templates for both AXI Master and AXI Stream modes. - Refactored existing code to accommodate the new configuration structure and ensure compatibility with the updated driver templates. - Updated test cases. This commit makes VitisUnified backend more similar to VivadoAccelerator.
Vitis Unified PR ready changes
Description
VitisUnified backend
Motivation
Summarized features
/tools/Xilinx/Vitis/2023.2/base_platformshttps://github.com/Xilinx/Vitis-Tutorials/tree/2025.1/Vitis_Platform_Creation/Design_Tutorials/01-Edge-KV260Type of change
For a new feature or function, please create an issue first to discuss it
with us before submitting a pull request.
Note: Please delete options that are not relevant.
Tests
test/pytest/test_backend/vitis_unified.pywith 4 main aspectbridge test
VitisUnifiedwithVitiscosimulation
fifo test optimization
hardware test
test_gen_unifiedintest reproduce
test/pytest/test_backend/vitis_unified.pyfiletest_gen_unified), you should specify XPFM_PATH(path to xpfm file) to the correct place.LOG_STD == True, HLS4ML will give the HLS+linker compiling message @ console.<output_project_dir>/<prefix>_err.logor<output_project_dir>/<prefix>_out.logTest Configuration:
Checklist
pre-commiton the files I edited or added.implementation detail
file generation(HLS4ML generated file) prepare file for system Generation and pynq driversynthesis Kernel(Synthesis Kernel (v++)) do c-synthesis for HLS4ML modellinker(Linker+vivado+Bitfile+hwh)File structure
template structure
hls4ml/templates/vitis_unifiedoutput file structure
configuration
input_typeandoutput_typeare support only float and double. And it must be match{in/out}_stream_buf_sizeunit is in amount elements of thennet::arrayxpfmPath
note to developer
unifiedWorkspace. The IDE will automatically detect your projectinput_type/output_typewas set totype x(double or float), you cannot predict with numpy array with different input/output typedepthargument @axi_master write@<project_name>_dm.cppmust be match of the array size generated the output array@ ````myproject_test.cpp``` for cosim and csim.<project_folder>/unifiedWorkspace/linker/_x/link/vivado/vpl/prjnote to tutorial
https://github.com/Tanawin1701d/vitisUnifiedTutorialgenerated warning
unused parameter,deprecated pragma,dataflow conflict