Jun 4, 2018 #1 N nsgil85 Member level 4 Joined Dec 11, 2012 Messages 73 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,288 Activity points 1,833 Hi I'v batch file that run modelsim: Code: set a="%~dp0" set a=%a:\=/% vsim -gui -do "cd %a%" -do compile.tcl Pause&Exit The directory path in modelsim is where the batch file is located ("C:\HDL\Blocks\simulate\open_modelsim.bat") compile.tcl file is: Code: vlib lib vmap work lib vcom -novopt -O0 tb_file.vhd #vcom -novopt -O0 C:\HDL\file.vhd #i want to use more generic like this: vcom -novopt -O0 file.vhd i'm trying to figure out how do i write tcl script to compile a vhd file that located on parent of the current directory. ("C:\HDL\file.vhd") Thanks Gil
Hi I'v batch file that run modelsim: Code: set a="%~dp0" set a=%a:\=/% vsim -gui -do "cd %a%" -do compile.tcl Pause&Exit The directory path in modelsim is where the batch file is located ("C:\HDL\Blocks\simulate\open_modelsim.bat") compile.tcl file is: Code: vlib lib vmap work lib vcom -novopt -O0 tb_file.vhd #vcom -novopt -O0 C:\HDL\file.vhd #i want to use more generic like this: vcom -novopt -O0 file.vhd i'm trying to figure out how do i write tcl script to compile a vhd file that located on parent of the current directory. ("C:\HDL\file.vhd") Thanks Gil
Jun 4, 2018 #2 S sherif123 Member level 3 Joined Nov 8, 2006 Messages 64 Helped 7 Reputation 14 Reaction score 7 Trophy points 1,288 Activity points 1,804 vcom ../file.vhd ".." is like a folder but it indicates the previous folder "." indicates the current folder
vcom ../file.vhd ".." is like a folder but it indicates the previous folder "." indicates the current folder
Jun 4, 2018 #3 ads-ee Super Moderator Staff member Joined Sep 10, 2013 Messages 7,944 Helped 1,822 Reputation 3,654 Reaction score 1,808 Trophy points 1,393 Location USA Activity points 60,207 It should be noted that \ in modelsim do files (tcl) are escapes, not directory hierarchy. The directory separator is /. The original posted tcl do file could have used C:/HDL/file.vhd and it would have worked.
It should be noted that \ in modelsim do files (tcl) are escapes, not directory hierarchy. The directory separator is /. The original posted tcl do file could have used C:/HDL/file.vhd and it would have worked.