| Author |
Message |
wwfhm2002
Joined: 07 Dec 2003 Posts: 96 Helped: 1
|
01 Nov 2005 11:18 how to run tcl script modelsim |
|
|
|
|
I have a Tcl script to run simulation on modelsim as below (test.tcl):
# Setting library directory, 1
vlib work
# Loading configuration
set vlogdumpon 0
foreach arg $argv {
switch -regexp -- $arg {
-TC {set vsimtc 1}
}
}
if {$vsimtc == 1} {
vsim work.mpx2_tb
} else {
vsim work.mpx2_tb +notimingchecks
}
# Run
run -all
Now in Win2000 modelsim command window, I run: source test.tcl -TC
The modelsim give me: # wrong # args: should be "source fileName"
How can I run test.tcl with argument, or other equivalent solution?
|
|
| Back to top |
|
 |
Google AdSense

|
01 Nov 2005 11:18 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
aji_vlsi
Joined: 10 Sep 2004 Posts: 640 Helped: 72 Location: Bangalore, India
|
01 Nov 2005 16:30 tcl script to run modelsim |
|
|
|
|
| wwfhm2002 wrote: |
Now in Win2000 modelsim command window, I run: source test.tcl -TC
The modelsim give me: # wrong # args: should be "source fileName"
How can I run test.tcl with argument, or other equivalent solution? |
That's a classical TCL problem, with some google you can find several solutions. One I like is here:
| Code: |
proc src {file args} {
set argv $::argv
set argc $::argc
set ::argv $args
set ::argc [llength $args]
set error [catch {uplevel [list source $file]} return]
if { $error } { set code error } { set code ok }
set ::argv $argv
set ::argc $argc
return -code $code $return
}
|
Say, put this in a file named "src_with_args.tcl". First source it inside TCL Shell first, then this new proc becomes visible. Now one can do:
src arg.tcl -TC
I tried it in tclsh under Cygwin, not sure how MTI handles it.
HTH
Ajeetha
www.noveldv.com
|
|
| Back to top |
|
 |
simcc90
Joined: 02 Nov 2005 Posts: 1
|
02 Nov 2005 13:15 execute tcl script windows |
|
|
|
|
Hi
Thanks for the tcl script src_with_args. I just tried this on ModelSim 6.1 using the test.tcl file posted earlier and it works a treat.
src test.tcl -TC
|
|
| Back to top |
|
 |