cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
saurav2480
Visitor
Visitor
3,309 Views
Registered: ‎02-27-2019

want to create a batch mode project

I am using VCU108 board, I want to create a batch mode project.

what I need a tcl script which can source my filelist and add it to vivado, and generate Bitfile.

I have TCL file from which I can add_file *.v to project, but I need a TCL script which source filelist 

where my filelist include *.v file

 

 

0 Kudos
8 Replies
syedz
Moderator
Moderator
3,305 Views
Registered: ‎01-16-2013

@saurav2480 

 

In the following user guide Table 4-1 at page 80 has all the TCL command for non-project mode. You can have a look at sample script at page 82.

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_3/ug892-vivado-design-flows-overview.pdf#page=80

 

--Syed 

 

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

Did you check our new quick reference timing closure guide (UG1292)?
---------------------------------------------------------------------------------------------
Tags (2)
saurav2480
Visitor
Visitor
3,297 Views
Registered: ‎02-27-2019

Thanks Syed,

 

I have seen this script too, what I need a TCL script which can source Filelist

my file list has all sourc file added, this filelist I have too add in TCL script so that in 1 touch, project will be craeted and bit file generated, 

I hope I made myself clear.

 

~Saurav

0 Kudos
evant_nq
Explorer
Explorer
3,266 Views
Registered: ‎07-18-2018

@saurav2480,

 

Are you trying to do this in project mode or non project mode?

The easiest way to to this for project mode is to do write_project_tcl.

This will give you a script that will rebuild the project from scratch. it will add all your sources the way you had them in the project, and set all the settings.

Now what you will do is remove the start_gui commands,

and add a synth_design

Impl_design

and generate_bitsream

tcl command at the end of the commans in the script that build the project.

So now when you run it, it will without launching a GUI, setup the project, import all the source. Set your settings. And then build your design through to bitstream generation.

If you want to do this in a Non project flow, you will need to write your own script.

You can actually do this with a little tcl to save time as well.

Something like set files get_files *vhd

foreach x in $files

puts add_vhdl $x

And you'll end up with all the add VHDL lines you need to add your source. Repeat for everything else.

Then it's more or less the same steps. Add the synth, impl, and bitstream commands afterwards. And call the script

 

0 Kudos
surajc
Xilinx Employee
Xilinx Employee
3,241 Views
Registered: ‎01-30-2019

@saurav2480 

what I understand is: for example, you have a main.txt which contains the name fileset1 and fileset2 and so on...

and fileset1 contains a list of one set of design sources and fileset2 contains a list of other design sources and so on...

and you want a Tcl script which can read main.txt and add the design sources from respective file sets accordingly

I have attached a Tcl script "custom.tcl" and files as I said earlier store them in a  directory and use "vivado -mode batch -source custom.tcl"

 

--Suraj

----------------------------------------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------------------------------------

chinmays
Xilinx Employee
Xilinx Employee
3,196 Views
Registered: ‎06-27-2018

Hi @saurav2480,

Can you show us a sample of your filelist?

You can create file called "filelist.tcl" and have follwing lines in it :-

add_files -norecurse "./sub3.vhd"\

"./sub2.vhd"\

"./sub1.vhd"\

"./Top.vhd"

and then simply source the "filelist.tcl" in Vivado, this will add all the files listed in filelist that are in current location, if files are in different location you can add paths also along with files in filelist.tcl (AR#67847)

~Chinmay

 

 

 

 

 

 

 

 

0 Kudos
saurav2480
Visitor
Visitor
3,180 Views
Registered: ‎02-27-2019

@surajc  

Thanks for your reply, it help partially. what I noticed script doesn't take multiple filelist.

assume you have 3 filelist, only 1st list from script added to vivado. 

not sure whay it happening, if you can explain or correct it that would be great help

 

0 Kudos
hemangd
Moderator
Moderator
3,166 Views
Registered: ‎03-16-2017

Hi @saurav2480 ,

Give it a try for two filelists skeleton project mode script :

 

samplee.JPG 

 

Full testcase attached here in 10462913.zip - Try it at your end.

 

Regards,
hemangd

Don't forget to give kudos and mark it as accepted solution if your issue gets resolved.
mniyas
Observer
Observer
1,787 Views
Registered: ‎05-21-2018

Even though, thread is old I think my solution may help somebody!

I've all the constraints stored in order in ../_scripts/_design_xdc.lst.

I've included the following code in my project.tcl which can be sourced in vivado or can be called in -batch mode.


#@@ add constraints - Read line by line from _design_xdc.lst
set fp [open "../_scripts/_design_xdc.lst" r]
while {[gets $fp line] >= 0} {
add_files -fileset constrs_1 -norecurse $line
}
close $fp

Similar way, you can add v, sv, vhd, xci etc. also