if {!0} {
vlib work
}
vmap work work
vcom \
filename_1.vhd\
filename_2.vhd\
filename_3.vhd\
filename_4.vhd\
filename_testbench.vhd
vsim -t 1ps -novopt testbench_entity_name
if {[catch [set StdArithNoWarnings 1] temp ]} {}
if {[catch [set NumericStdNoWarnings 1] temp ]} {}
if {[catch [set IgnoreWarning 1] temp ]} {}
add wave -r -radix hex sim:/testbench_entity_name/*
run -all
## you can also use the "run 10 us", or "run 100 ns" commands instead of "run -all"
## just write these things to your " file.do " file and put it in the simulation folder and change the modelsim directory as the simulation folder then, type these commands
"do file.do"
then the modelsim will compile those specified files and simulate the testbench then will added the waves and finally it run the simulation...