Если только вы не хотите найти правильный компилятор gcc для запуска Vivado Synthesis без ошибок, я рекомендую для этой задачи использовать Linux.
Я пытаюсь запустить пример кода, как показано на странице документации hls4ml, но выполним следующее:
Код: Выделить всё
import hls4ml
#Fetch a keras model from our example repository
#This will download our example model to your working directory and return an example configuration file
config = hls4ml.utils.fetch_example_model('KERAS_3layer.json')
print(config) #You can print it to see some default parameters
#Convert it to a hls project
hls_model = hls4ml.converters.keras_to_hls(config)
#Use Vivado HLS to synthesize the model
#This might take several minutes
hls_model.build()
#Print out the report if you want
hls4ml.report.read_vivado_report('my-hls-test')
Код: Выделить всё
Downloading example model files ...
{'OutputDir': 'my-hls-test', 'ProjectName': 'myproject', 'XilinxPart': 'xcku115-flvb2104-2-i', 'ClockPeriod': 5, 'Backend': 'Vivado', 'IOType': 'io_parallel', 'HLSConfig': {'Model': {'Precision': 'ap_fixed', 'ReuseFactor': '1'}}, 'KerasJson': 'KERAS_3layer.json', 'KerasH5': 'KERAS_3layer_weights.h5'}
Interpreting Model
Topology:
Layer name: input_1, layer type: InputLayer, current shape: [[None, 16]]
Layer name: fc1_relu, layer type: Dense, current shape: [[None, 16]]
Layer name: fc2_relu, layer type: Dense, current shape: [[None, 64]]
Layer name: fc3_relu, layer type: Dense, current shape: [[None, 32]]
Layer name: output_softmax, layer type: Dense, current shape: [[None, 32]]
Creating HLS model
Synthesis report not found.
Found 1 solution(s) in my-hls-test/myproject_prj.
Reports for solution "solution1":
C SIMULATION RESULT:
INFO: [SIM 2] *************** CSIM start ***************
INFO: [SIM 4] CSIM will launch GCC as the compiler.
make: 'csim.exe' is up to date.
INFO: Unable to open input/predictions file, using default input.
0.0292969 0.756836 0.0546875 0.139648 0.0371094
INFO: Saved inference results to file: tb_data/csim_results.log
INFO: [SIM 1] CSim done with 0 errors.
INFO: [SIM 3] *************** CSIM finish ***************
Synthesis report not found.
Co-simulation report not found.
Я запускаю это на Jupyter Notebook (6.0.3) через Anaconda Navigator, версия Python — 3.6.9, а версия hls4ml — 0.5.0
Я не могу понять, является ли это ошибкой из-за установки или из-за кода и так далее.
Есть мысли о том, что является причиной этого?
Я думаю, что это специфично для hls4ml, но, к сожалению, он не существует в качестве тега в StackOverflow.
Обновить
Первоначальная проблема, с которой я столкнулся (а именно: в каталоге был пробел ' ', который является недопустимым символом) заставил меня запустить vivado_hls -f build_prj.tcl "csim=1 Synth=1 cosim=1 Export=1", который показал мне новый хост проблемы. А именно, я получаю следующие ошибки:
Код: Выделить всё
***** C/RTL SYNTHESIS *****
INFO: [SCHED 204-61] Option 'relax_ii_for_timing' is enabled, will increase II to preserve clock frequency constraints.
INFO: [HLS 200-10] Analyzing design file 'firmware/myproject.cpp' ...
ERROR: [HLS 200-70] Compilation errors found: In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:19:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\iostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ios:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\exception:151:
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\exception_ptr.h:132:13: error: unknown type name 'type_info'
const type_info*
^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:19:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\iostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ostream:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\ios:39:
In file included from D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\exception:151:
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:62:5: error: the parameter for this explicitly-defaulted copy constructor is const, but a member or base requires it to be non-const
nested_exception(const nested_exception&) = default;
^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:64:23: error: the parameter for this explicitly-defaulted copy assignment operator is const, but a member or base requires it to be non-const
nested_exception& operator=(const nested_exception&) = default;
^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:77:28: error: exception specification in declaration does not match previous declaration
inline nested_exception::~nested_exception() = default;
^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:66:20: note: previous declaration is here
inline virtual ~nested_exception();
^
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:122:61: error: redefinition of default argument
__throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
^ ~
D:/Tools/Xilinx/Vivado/2019.2/win64/tools/clang/bin\..\lib\clang\3.1/../../../include/c++/4.5.2\nested_exception.h:110:56: note: previous definition is here
__throw_with_nested(_Ex&&, const nested_exception* = 0)
^ ~
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:21:
In file included from firmware/myproject.h:23:
In file included from D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_int.h:367:
In file included from D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed.h:55:
D:/Tools/Xilinx/Vivado/2019.2/common/technology/autopilot\ap_fixed_base.h:838:13: warning: shift count is negative [-Wshift-count-negative]
ret.V
Подробнее здесь: [url]https://stackoverflow.com/questions/66919012/how-can-this-issue-with-hls4ml-be-resolved[/url]