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!

Page Bookmarked

AR# 25247

9.1i ISE - Is there a way to remove multiple source files from a Project Navigator project at one time?


Keywords: Tcl, add, HDL, select

Multiple source files can be added to a Project Navigator project using either the GUI or the Tcl "xfile add" command. However, there does not seem to be a way to remove multiple files with one command.
The "xfile add" command allows me to add multiple files and use wildcards in its interface (e.g. "xfile add *.vhd /mydir/*.vhd timing.ucf"). However, the "xfile remove" command allows me to remove one file at a time.

Is it possible to remove multiple source files at one time?


The functionality for selecting and removing (or moving) multiple source files in a Project Navigator project is scheduled for the ISE 10.1i release. You will be able to select multiple source files in the GUI at one time and remove them from your project. The "xfile remove" command will also be enhanced to accept wild card characters.

To work around this issue in the 9.xi design tools, you can use the following Tcl commands:

To remove all source files from a project:
foreach file [search * -type file] {xfile remove [lindex [split $file \/] [expr [llength [split $file \/]]-1]]}

To remove a specific type, change the search string; for example, to remove all .v files:
foreach file [search *.v -type file] {xfile remove [lindex [split $file \/] [expr [llength [split $file \/]]-1]]}
AR# 25247
Date 04/17/2009
Status Archive
Type General Article