title: How to modify Vivado 2018.3 generated tcl script for version control
body: <p>I am trying to modify a Vivado 2018.3 created tcl script for version control. As soon as I try to put all VHDL files in one directory (and modify the script accordingly), the script can't find all files when calling source build.tcl</p>
  
  <p>I tried to follow version control instructions for older Vivadoversions like this one: <a href="https://github.com/tobiasrj20/Vivado-Version-Control-Example" rel="nofollow noreferrer">https://github.com/tobiasrj20/Vivado-Version-Control-Example</a>. </p>
  
  <p>Unfortunately I couldn't find instructions for Vivado 2018.3, since the example script looks different to what I get from Vivado.</p>
  
  <p>The structure of the Vivado Project.srcs folder looks as follows.</p>
  
  <ul>
  <li>constr_1</li>
  <li><ul>
  <li>imports</li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li>project_1 &lt;--Here is the constraints file</li>
  </ul></li>
  </ul></li>
  <li><p>sim_1</p></li>
  <li><ul>
  <li>sources_1</li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li>bd</li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li><ul>
  <li>contains some stuff I don't use</li>
  </ul></li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li>imports</li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li><ul>
  <li>Downloads &lt;-- contains a part of vhd files</li>
  </ul></li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li><ul>
  <li>new &lt;-- contains another part of vhd files</li>
  </ul></li>
  </ul></li>
  </ul></li>
  <li><ul>
  <li><ul>
  <li>new &lt;-- contains other vhd files</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>My goal is to move all the vhd files to one folder, for example called "src". And to modify the tcl script accordingly. </p>
  
  <p>I changed the parts in the script according to the tutorial given above. And replaced all absolute paths with relative paths. For example like this:</p>
  
  <p>Original script</p>
  
  <pre><code>set files [list \
   [file normalize "${origin_dir}/fpga_top_v2.srcs/sources_1/new/clk_gen_25M.vhd" ]\
  </code></pre>
  
  <p>Modified:</p>
  
  <pre><code>set files [list \
   [file normalize "$
  $origin_dir/src/clk_gen_25M.vhd" ]\
  </code></pre>
  
  <p>Then there is this part, where I am not sure if I need to change it</p>
  
  <pre><code># Set 'sources_1' fileset file properties for local files
  set file "new/clk_gen_25M.vhd"
  set file_obj [get_files -of_objects [get_filesets sources_1] [list "*$file"]]
  set_property -name "file_type" -value "VHDL" -objects $file_obj
  </code></pre>
  
  <p>Because the tcl console says the following during the source process:</p>
  
  <pre><code># set file "new/clk_gen_25M.vhd"
  WARNING: [Vivado 12-818] No files matched '*new/clk_gen_25M.vhd'
  # set file_obj [get_files -of_objects [get_filesets sources_1] [list "*$file"]]
  # set_property -name "file_type" -value "VHDL" -objects $file_obj
  ERROR: [Common 17-55] 'set_property' expects at least one object.
  Resolution: If [get_&lt;value&gt;] was used to populate the object, check to make sure this command returns at least one valid object.
  </code></pre>
  
  <p>Apologies, if this question has been asked before but I couldn't find any answers for this kind of question and especially for the Vivado 2018.3 version.</p>