UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar ronnywebers
Scholar
8,033 Views
Registered: ‎10-10-2014

Vivado - automatically set working directory to the current (opened) project directory

Whenever I open a project via the Vivado IDE (2015.4) , the 'working directory' is set to C:/Users/MyName/AppData/Roaming/Xilinx/Vivado (using the tcl command 'pwd')

 

Can this working directory be changed automatically to the open project directory? Is there some IDE option for this? I.e. the location of the .xpr file? For example .jou files are written to this location etc.

 

However when executing for example write_project_tcl, it writes the file to C:/Users/MyName/AppData/Roaming/Xilinx/Vivado, which is not what you want. And it's quiet annoying to change it each through the tcl window...

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
4 Replies
Moderator
Moderator
8,030 Views
Registered: ‎01-16-2013

Re: Vivado - automatically set working directory to the current (opened) project directory

@ronnywebers,

 

 

Some ways of changing the CWD to the current project directory are listed below:

    • Invoke Vivado tools from command line while in the project directory .
    • Double-click on the .xpr project file in Windows Explorer. This will open the project in Vivado IDE and the project directory will be used as the working directory.
    • A command to CD to the current project directory could be added as a proc in the init.tcl file.
      • Example: after adding the following proc to the init.tcl, a user can type cdp from the Tcl console to change the CWD to the project t to the current working directory.
        proc cdp { } {
        cd [get_property DIRECTORY [current_project]]
        }
      • One user suggests creating a button (Tools > Custom Commands) to generate report files.
# SETS THE WORKING DIRECTORY TO THE PROJECT SO THAT IF YOU GENERATE FILES THEY ARE WRITEN TO THE DIR
set work_directory [get_property DIRECTORY [current_project]] ; cd $work_directory ; puts -nonewline "Changing Directory to " ; pwd

See also (Xilinx Answer 55459)

 

--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)?
---------------------------------------------------------------------------------------------
Xilinx Employee
Xilinx Employee
8,022 Views
Registered: ‎07-31-2012

Re: Vivado - automatically set working directory to the current (opened) project directory

This can be done from Vivado GUI as shown below.This can be accessed from Tools-> Options

 

delete.PNG

 

 

Thanks,
Anirudh

PS: Please MARK this as an answer in case it helped resolve your query.Give kudos in case the post guided you to a solution.
Scholar ronnywebers
Scholar
8,007 Views
Registered: ‎10-10-2014

Re: Vivado - automatically set working directory to the current (opened) project directory

thanks @athandr, I think that is what I'm looking for - didn't know about these options. 

 

However, I would expect that 'last project's directory' would mean just this ... or that there would be an option like 'current project directory'.

 

I asume if I go for 'specify project directory', I still need to adjust this when I switch from project A to project B ...?

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
Moderator
Moderator
7,241 Views
Registered: ‎01-16-2013

Re: Vivado - automatically set working directory to the current (opened) project directory

@ronnywebers

 

For 'specify project directory' The setting will be stored and it will remain same for the directory specified. 

 

From UG893:

Default Project Directory: Specifies where the Vivado IDE searches for existing projects, and where it writes newly created projects.

 

--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)?
---------------------------------------------------------------------------------------------
0 Kudos