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# 53165

Vivado - Is there a way to change the file type of a source file based on the extension?


I would like to add several files with a unique extension to my project and have them all associated with a particular source view.

For example, I have a design which include files that have a .inc extension. I would like to have all files with the .inc extension automatically added as Verilog header files.

Is there any way to add/change file extension associations in Vivado tools?


Vivado does not have a way to do user-defined file type association.

However, you could change the association of a group of source files using a Tcl command.

For example, set_property file_type {Verilog Header} [get_files  *.inc]

If this is a common practice, you might want to define a proc such as the one that follows that changes the file type and binds it to a GUI user-defined button. To create a user defined button on the tool bar, go to Tools -> Custom Commands.

proc setIncFilesVerilogHeader {} {
set_property file_type {Verilog Header} [get_files *.inc]

Other options would be to include the proc in your init.tcl file, allowing the proc to be available for any project, or to put it in a Tcl file and source the file whenever you want to convert the file types.

Note: The init.tcl file will be found if it is located in one of the following locations:
  • For Linux: $HOME/.Xilinx/Vivado/init.tcl 
  • For Windows: %APPDATA%\Xilinx/Vivado\init.tcl
  • <install_dir>/Vivado/<version>/scripts directories (For example, C:/Xilinx/Vivado/2012.3/scripts/init.tcl)

To add a file of an unknown type, add the file as an individual file, using the "All Files" filter in place of "HDL Source Files". This places it in the "Unknown" grouping of design sources, but allows synthesis to complete successfully and allows the source to be selected to change the file type.

AR# 53165
Date 10/21/2013
Status Active
Type General Article
  • Vivado Design Suite