I am trying to automate code generation.
My TCL script needs to do the following:
1) Locate the file settings64.bat/settings32.bat on the hardrive
2) I need to run settings.bat before calling xilperl to run a perl script that parses a file
3) Go through setting up a planahead project with all files and generate bitstream.
I am stuck at step 1
I use to do it easily in perl by looking at registry entries so I wanted to do the same in tcl.
I tried to use the registry tcl commands
but the tcl script fails at this line:
package require registry
can't find package registry
Is the package not included in the xilinx 14.4 TCL installation?
Within a script you can use the general Tcl builtins to query the location of the executable - and you can find the settings batch file or shell script relative to that:
set bin [info nameofexecutable]C:/Xilinx/Vivado/2013.1/bin/unwrapped/win64.o/vivado.exe
The settings*.bat file is 3 levels up from there.
In addition, you can use some environment variables that we define on your behalf when you invoke the tool to get there direction - this is probably more reliable:
array names envRDI_PREPEND_PATH HOME RDI_PATASK PROCESSOR_IDENTIFIER RDI_BINROOT .....puts $env(XILINX)C:/Xilinx/Vivado/2013.1/ids_lite/ISEputs $env(HDI_APPROOT)C:/Xilinx/Vivado/2013.1
I would invest in ways to parse your files with Tcl - and not depend upon xilperl being available indefinitely. Tcl is the future. ;-)