pythonmachine-learninggoogle-colaboratoryvivado-hls

Why do i get error when using HLS4ML with Vivado HLS, Vivado installation not found


i have installed Vivado 2019.2 on my computer running on Ubuntu 20.04.3 LTS. I have installed hls4ml on Google colab.

i have also specified the Vivado installation path

os.environ['PATH'] = '/home/gegerin/Vivado_HLS/Vivado/2019.2/bin' + os.environ['PATH']

i followed the tutorial here: hls4ml github tutorial/ Code i ran

https://github.com/fastmachinelearning/hls4ml

However, when i run the command : hls_model.build() i get the following output

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Exception Traceback (most recent call last)

in ()
4 os.environ['PATH'] = '/home/gegerin/Vivado_HLS/Vivado/2019.2/bin' + os.environ['PATH']
5
----> 6 hls_model.build()
7
8 #Print out the report if you want

/usr/local/lib/python3.7/dist-packages/hls4ml/model/hls_model.py in build(self, reset, csim, synth, cosim, validation, export, vsynth)
548 found = os.system('command -v vivado_hls > /dev/null')
549 if found != 0:
--> 550 raise Exception('Vivado HLS installation not found. Make sure "vivado_hls" is on PATH.')
551
552 elif backend == 'Intel':

Exception: Vivado HLS installation not found. Make sure "vivado_hls" is on PATH.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Solution

  • If you are running Colab on some Google cloud server, then you won't have Vivado HLS available (since it's not installed there, but just locally on your machine).

    Maybe you can try running Colab locally (guide).

    Please also check this github issue.

    Edit

    Now I see it. I think you're wrongly appending the Vivado path to PATH, as it's missing the path separator:

    os.environ['PATH'] += os.pathsep + '/home/gegerin/Vivado_HLS/Vivado/2019.2/bin'
    

    Please check this stackoverflow question.