hls4ml使用记录

安装

1
pip3 install --break-system-packages hls4ml

onnx转hls

hls4ml/test/hls4ml-onnx-test.sh at main · fastmachinelearning/hls4ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

VIVADO_INSTALL_DIR=/opt/Xilinx
VIVADO_VERSION=2017.2

# If running in docker image we would first need to activate the proper conda environment
#. activate hls4ml-py36

# Convert models in onnx-models.txt
./convert-onnx-models.sh -x -p 3 -f onnx-models.txt

# Same for Python 2
#. activate hls4ml-py27
./convert-onnx-models.sh -x -p 2 -f onnx-models.txt

# Alternatively, onnx-to-hls script can be called, with the model name(s) specified, i.e.:
#./onnx-to-hls.sh -p 3 three_layer_keras conv1d_small_keras
#./onnx-to-hls.sh -p 2 three_layer_keras conv1d_small_keras

# Check if there is any difference between files generated by Python 2 and Python 3
# Not needed if there were no changes in onnx-to-hls.py or hls-writer.py
./py-diff.sh -r 2

# Build the projects generated by onnx-to-hls script.
# Remove parameter -s to disable synthesis. -p controls the number of parallel tasks
./build-prj.sh -i ${VIVADO_INSTALL_DIR} -v ${VIVADO_VERSION} -c -s -p 2

# Go through the generated reports and print out basic information.
# Reports are available if synthesis is enabled.
./gather-reports.sh -b

# Clean-up at the end
#./cleanup.sh

hls4ml使用记录
http://blog.uanet.cn/EMBEDDED/hls4ml使用记录.html
作者
dnsnat
发布于
2025年2月13日
许可协议