09-01-2013 02:04 AM
I wanted to automate the synthesis of Vivado HLS projects. I have written a Python script... which first starts the Vivado HLS in command line prompt and then executes the script.tcl
This is how my Python script look like...
os.system(r'D:\Xilinx\Vivado_HLS\2013.1\bin\vivado_hls_cmd.bat') # Start Vivado HLS
os.system(r'vivado_hls -f <project_name>\solution1\script.tcl') # Run tcl script
but, after command 2 (#Start Vivado HLS), it moves to command line prompt and don't execute rest of the commands in Python script.
If I don't run this command, the system couldn't recognize 'vivado_hls' command for running tcl script. I have added the path "D:\Xilinx\Vivado_HLS\2013.1\bin\" in PATH env variable, but still it couldn't recognize 'vivado_hls'
Is there any way I can start vivado_hls and directly run tcl script or if there is any mistake in my Python script?
Thanks in advance.
09-01-2013 10:45 AM
09-01-2013 11:12 AM
I already tried the 1st option. Changing line #2 to:
os.system(r'D:\Xilinx\Vivado_HLS\2013.1\bin\vivado_hls_cmd.bat vivado_hls -f <project_name>\solution1\script.tcl')
os.system(r'D:\Xilinx\Vivado_HLS\2013.1\bin\vivado_hls_cmd.bat -f <project_name>\solution1\script.tcl')
But this did not worked. It just opens the command prompt after starting vivado_hls.
09-01-2013 01:38 PM
09-01-2013 10:25 PM
That's precisely the problem I am facing. In general, Python keeps the same shell for multiple os.system calls.
But, in this case, when I make the function call
the control moves from Python script to command prompt, and it do not execute further commands (of Python script), which is
os.system(vivado_hls -f script.tcl)
in this case.
09-02-2013 12:34 AM
09-02-2013 12:43 AM
Tried this as well... doesn't work :(
As soon as it executes the bat file, it just moves control from Python script to command prompt (even if there are more commands in the same string), and wait for further commands on command prompt.
Also tried running os.system("START /K vivado_hls_cmd.bat") and some other similar commands... not working.
09-02-2013 01:57 AM
09-24-2013 06:27 AM
Have you tried add "D:\Xilinx\Vivado_HLS\2013.1\bin\..\Win_x86\bin" to PATH, and call "vivado_hls_bin.exe -f script.tcl"?
09-05-2017 04:25 AM
Were you able to perform this task? if yes, how?
I want to do something similar. I am unable to execute TCL script even from the command prompt.
I am using command prompt on windows 8
Following what you have done:
First I enter this command:
Vivado HLS command prompt open
then I enter
The TCL apparently does start but it gives me error:
invalid command name "open_hw"
I am unable to resolve this error. once this work on cmd line, I would like to move to python. If you have done it already it will be great.
Another way of running script:
In order to execute my TCL file I follow these steps:
E:\Xilinx\Vivado\2016.2\bin\vivado.bat -mode tcl
once the vivado terminal is ready I enter this command
this works perfectly but I am not sure how to automate this from python as the first line moves into vivado tcl mode and expect some command on the terminal. the next line never executes before exiting vivado.
Kindly help me out
05-15-2018 08:22 AM
This can be done by using a subprocess.call api in python which has the path of a batch script as the argument.
process = subprocess.call([<FPGAHLSAutomationPath>])
The batch script could be something like this:
vivado_hls -f <path to script>.tcl
This works perfectly fine. No hassles.