Modelsim Directory

A

ALuPin

Guest
Hi,

I have written a little .do-script with which
the VHDL files are compiled and the simulation is performed.

When I open Modelsim I have to go to
FILE --> CHANGE DIRECTORY and then I have to enter
the path of my simulation directory including my script.

How can I do this directory changing automatically at the beginning
of my script ? Is there any command ?

I would appreciate your help.

Here is the script

vlib work
# Compile base libraries
vcom util1164.vhd
vcom stdlogar.vhd
vcom io_utils.vhd
vcom mti_pkg.vhd
# Compile test vectors
vcom vec_gen.vhd
vcom ed_comnd.vhd

vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
fraction_sdram_numbers_fifo.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
mux_fraction_fifo_outputs.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/sdram_pos_arbiter.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
sdram_positions_arbitration.vhd

vcom -93 ../../../sdram_ctrl/valid_bytes_in_row.vhd
vcom -93 ../../../sdram_ctrl/tristate_buffer.vhd
vcom -93 ../../../sdram_ctrl/sdram_controller.vhd
vcom -93 ../../../sdram_ctrl/sdram_ctrl.vhd
vcom -93 ./mt48lc8m16a2.vhd
vcom -93 ../../../sie_trans_fs/read_burst_fifo.vhd
vcom -93 ../../../sie_trans_fs/crc16_8bit_in.vhd
vcom -93 ../../../sie_trans_fs/sie_trans_fs.vhd

vcom -93 ./tb_sdram_ctrl_sie_fs.vhd
vsim tb_sdram_ctrl_sie_fs
do Simulationsplot_sdram_ctrl_sie_fs.do
run 1200us -all

configure wave -signalnamewidth 1
set StdArithNoWarnings 1
set IgnoreWarning 1
set DefaultRadix unsigned
 
Assuming you are using windows (if not, things may be simpler), you could
either modify your shortcut icon to open in the directory of interest, or,
as I tend to do, create a short batch file that calls modelsim with all the
relevant parameters, including paths to scripts, pattern files, log files,
etc.

I tend to separate the compile batch file from the simulation batch file,
but that's just my habit. I've had problems with make on my PC, but if that
works properly, it's better than a batch file for recompiling.

You can change directories inside the batch file.

If you are in unix/linux, you could just write a command script that calls
modelsim. The format would be nearly identical to the windows/dos batch
file.

Jason

"ALuPin" <ALuPin@web.de> wrote in message
news:b8a9a7b0.0412080507.3b7ec4c3@posting.google.com...
Hi,

I have written a little .do-script with which
the VHDL files are compiled and the simulation is performed.

When I open Modelsim I have to go to
FILE --> CHANGE DIRECTORY and then I have to enter
the path of my simulation directory including my script.

How can I do this directory changing automatically at the beginning
of my script ? Is there any command ?

I would appreciate your help.

Here is the script

vlib work
# Compile base libraries
vcom util1164.vhd
vcom stdlogar.vhd
vcom io_utils.vhd
vcom mti_pkg.vhd
# Compile test vectors
vcom vec_gen.vhd
vcom ed_comnd.vhd

vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
fraction_sdram_numbers_fifo.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
mux_fraction_fifo_outputs.vhd
vcom -93
../../../sdram_ctrl/sdram_positions_arbitration/sdram_pos_arbiter.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
sdram_positions_arbitration.vhd

vcom -93 ../../../sdram_ctrl/valid_bytes_in_row.vhd
vcom -93 ../../../sdram_ctrl/tristate_buffer.vhd
vcom -93 ../../../sdram_ctrl/sdram_controller.vhd
vcom -93 ../../../sdram_ctrl/sdram_ctrl.vhd
vcom -93 ./mt48lc8m16a2.vhd
vcom -93 ../../../sie_trans_fs/read_burst_fifo.vhd
vcom -93 ../../../sie_trans_fs/crc16_8bit_in.vhd
vcom -93 ../../../sie_trans_fs/sie_trans_fs.vhd

vcom -93 ./tb_sdram_ctrl_sie_fs.vhd
vsim tb_sdram_ctrl_sie_fs
do Simulationsplot_sdram_ctrl_sie_fs.do
run 1200us -all

configure wave -signalnamewidth 1
set StdArithNoWarnings 1
set IgnoreWarning 1
set DefaultRadix unsigned
 
ALuPin,
Windows can start you to the right project directory
by setting your "Start In" directory to your project.

You can also cd around in your scripts using the cd
command. For the format for it, do a change directory
from the menu and look at the corresponding output in
the transcript window.

Modelsim Do files are TCL, so you can abstract
some of this using variables:

set SRC_DIR "../vhdl_src"

vcom ${SRC_DIR}/file1.vhd
vcom ${SRC_DIR}/file2.vhd

In your file, I would probably create variables for
SDRAM_SRC and SIE_SRC rather than using cd.

Cheers,
Jim


Hi,

I have written a little .do-script with which
the VHDL files are compiled and the simulation is performed.

When I open Modelsim I have to go to
FILE --> CHANGE DIRECTORY and then I have to enter
the path of my simulation directory including my script.

How can I do this directory changing automatically at the beginning
of my script ? Is there any command ?

I would appreciate your help.

Here is the script

vlib work
# Compile base libraries
vcom util1164.vhd
vcom stdlogar.vhd
vcom io_utils.vhd
vcom mti_pkg.vhd
# Compile test vectors
vcom vec_gen.vhd
vcom ed_comnd.vhd

vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
fraction_sdram_numbers_fifo.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
mux_fraction_fifo_outputs.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/sdram_pos_arbiter.vhd
vcom -93 ../../../sdram_ctrl/sdram_positions_arbitration/
sdram_positions_arbitration.vhd

vcom -93 ../../../sdram_ctrl/valid_bytes_in_row.vhd
vcom -93 ../../../sdram_ctrl/tristate_buffer.vhd
vcom -93 ../../../sdram_ctrl/sdram_controller.vhd
vcom -93 ../../../sdram_ctrl/sdram_ctrl.vhd
vcom -93 ./mt48lc8m16a2.vhd
vcom -93 ../../../sie_trans_fs/read_burst_fifo.vhd
vcom -93 ../../../sie_trans_fs/crc16_8bit_in.vhd
vcom -93 ../../../sie_trans_fs/sie_trans_fs.vhd

vcom -93 ./tb_sdram_ctrl_sie_fs.vhd
vsim tb_sdram_ctrl_sie_fs
do Simulationsplot_sdram_ctrl_sie_fs.do
run 1200us -all

configure wave -signalnamewidth 1
set StdArithNoWarnings 1
set IgnoreWarning 1
set DefaultRadix unsigned

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training mailto:Jim@SynthWorks.com
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Welcome to EDABoard.com

Sponsor

Back
Top