cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
736 Views
Registered: ‎02-25-2020

Post bitstream TCL script cannot find BIT file

Jump to solution

I wrote a TCL script to convert a BIT file to a BIN file in SelectMAP format.

The script works great when I run it manually from the Vivado TCL console after write_bitstream is complete.

The same script fails when used as tcl.post in the write_bitstream process.The error given was that the BIT file could be found (but it was in fact generated in write_bitstream).

The TCL script is

 

set DIR [get_property DIRECTORY [current_project] ]
cd $DIR
write_cfgmem -format bin -size 64 -interface SMAPx32 -loadbit {up 0x00000000 "./project_1.runs/impl_1/FPGA_TOP.bit" } -force -disablebitswap -file ./project_1.runs/impl_1/FPGA_TOP.bin

 

 

Do you see a way to change this script so that it will find the BIT file when I run it both manually and also as a tcl.post to write_bitstream?

Thanks!
John

 

0 Kudos
1 Solution

Accepted Solutions
driesd
Xilinx Employee
Xilinx Employee
618 Views
Registered: ‎11-28-2007

Hi John

the problem is that all Vivado runs are actually run out of the context of the Vivado project.

So, what you run in the Tcl console is not the same as in the context of the run. For example "current_project" does not exist in your "write bitstream" run.

However, in this case, you actually don't need it. The "write bitstream" run is in fact run in the impl_1 folder already, so your Tcl script is simply:

write_cfgmem -format bin -size 64 -interface SMAPx32 -loadbit {up 0x00000000 "FPGA_TOP.bit" } -force -disablebitswap -file FPGA_TOP.bin

 

 

Best regards

Dries

--------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented by clicking the star next to the post.

View solution in original post

0 Kudos
3 Replies
driesd
Xilinx Employee
Xilinx Employee
619 Views
Registered: ‎11-28-2007

Hi John

the problem is that all Vivado runs are actually run out of the context of the Vivado project.

So, what you run in the Tcl console is not the same as in the context of the run. For example "current_project" does not exist in your "write bitstream" run.

However, in this case, you actually don't need it. The "write bitstream" run is in fact run in the impl_1 folder already, so your Tcl script is simply:

write_cfgmem -format bin -size 64 -interface SMAPx32 -loadbit {up 0x00000000 "FPGA_TOP.bit" } -force -disablebitswap -file FPGA_TOP.bin

 

 

Best regards

Dries

--------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented by clicking the star next to the post.

View solution in original post

0 Kudos
610 Views
Registered: ‎02-25-2020

Thanks for the excellent tip. That completely resolved my issue.

0 Kudos
driesd
Xilinx Employee
Xilinx Employee
601 Views
Registered: ‎11-28-2007

Great to hear that!

--------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented by clicking the star next to the post.
0 Kudos