Modelsim Directory

A

ALuPin

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
 
N

Nicolas Matringe

ALuPin a écrit:
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 ?

It stands to reason that you can't execute a script before telling
ModelSim where this script is.
The only way I can think of is to create a ModelSim project with a
default directory in which you'll put your scripts, work library...
When ModelSim starts it opens the last project automatically.
 
J

jtw

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
 
J

Jim Lewis

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:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top