cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dominduke
Visitor
Visitor
1,017 Views
Registered: ‎07-04-2018

Can I convert Vivado project into tcl commands?

Jump to solution

The designs take up a lot to save them on the computer. So you would want to work only with tcl commands. Is there a way to convert the whole project into tcl command lines?

I know it can be done by copying them while creating it. But having the project already done. Any ideas?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
amaccre
Moderator
Moderator
687 Views
Registered: ‎04-24-2013

Hi @ronnywebers ,

When you run write_project_tcl from the tcl console then it also includes the commands to recreate the block design i.e.:

write_project_tcl project.tcl

There are multiple switches for the write_project_tcl which you can see using: write_project_tcl -help

The write_bd_tcl will write out the block_design and a wrapper project so that it can be opened easily, you can use the -no_project_wrapper option to remove this.

I've attached a sample project and the two tcl files that I generated from it. You can see the all_proj.tcl references both the RTL and the BD while block.tcl only references the BD.

Early versions of Vivado did not write out the block design as part of the project tcl, but this changed in about the 2016 / 2017 version. I'd need to try a run to test which version.

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------

View solution in original post

6 Replies
drjohnsmith
Teacher
Teacher
1,007 Views
Registered: ‎07-09-2009

You seem to want to save space , "designs take up a lot"

Most of that is going to be your code, IP blocks ,

   Which can't be made into TCL.

Have you looked at what your saving though ?

    in particular IP blocks can be re made on th efly , but it will add may be considerable time to a compile , 

 

With the size / speed / low cost of SSD drives relative to FPGAs, not much call for size reduction.

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
Hrishikesh
Adventurer
Adventurer
975 Views
Registered: ‎09-26-2020

Hello,

Once the project is completed you can export the block design as tcl file.

File > Export > Export Block Design

 

amaccre
Moderator
Moderator
821 Views
Registered: ‎04-24-2013

Hi @dominduke ,

Have a look at the write_project_tcl command to create a script that will let you rebuild the entire project and the write_bd_tcl if you only want to regenerate the block design.

You can get further information on these by typing -help after them in the tcl console e.g.

write_project_tcl -help.

If you are going down this route instead of using the project folder then you may also want to look revision control to work out the minimum number of files you need.

There is a quick take video on best revision control practice available here:

https://www.xilinx.com/video/hardware/vivado-design-suite-revision-control.html

Chapter 5 of User Guide 892 has a good section on Revision Control along with a list of the minimum files needed to rebuild a project.

User Guide 1118 also has information of revision control of IP.

Best Regards

AIdan

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
ronnywebers
Advisor
Advisor
732 Views
Registered: ‎10-10-2014

@amaccre with the write_project_tcl and write_bd_tcl, we end up with 2 files.

1) if I'm correct, the write_bd_tcl needs to be called somewhere from the write_project_tcl ? If so at what point? Or does one first run the generated project.tcl, and then run the bd.tcl?

2) I thought to have read there was some 'combined' command to export project and bd in one script, but I might be wrong ... ?

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
chinmays
Xilinx Employee
Xilinx Employee
702 Views
Registered: ‎06-27-2018

Hi @ronnywebers ,

write_bd_tcl is the command that generates combined script for regenerating BD also. If you write project tcl from gui (File > project > Write tcl), in the opened dialogue box, you will see an option "Recreate Block designs using Tcl". If you select this option, write_bd_tcl is the command that runs in the background and generates a script that will create the project and recreate the BD.

Capture.PNG
However, if you don't want the tool to recreate BD, instead you want to import already generated BD, you can use command: write_bd_tcl -use_bd_files to generate the script.

~Chinmay

amaccre
Moderator
Moderator
688 Views
Registered: ‎04-24-2013

Hi @ronnywebers ,

When you run write_project_tcl from the tcl console then it also includes the commands to recreate the block design i.e.:

write_project_tcl project.tcl

There are multiple switches for the write_project_tcl which you can see using: write_project_tcl -help

The write_bd_tcl will write out the block_design and a wrapper project so that it can be opened easily, you can use the -no_project_wrapper option to remove this.

I've attached a sample project and the two tcl files that I generated from it. You can see the all_proj.tcl references both the RTL and the BD while block.tcl only references the BD.

Early versions of Vivado did not write out the block design as part of the project tcl, but this changed in about the 2016 / 2017 version. I'd need to try a run to test which version.

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------

View solution in original post