electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

how to run a Tcl script with argument in windows Modelsim?


Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital) -> how to run a Tcl script with argument in windows Modelsim?
Author Message
wwfhm2002



Joined: 07 Dec 2003
Posts: 96
Helped: 1


Post01 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
Google Adsense




Post01 Nov 2005 11:18   

Ads




Back to top
aji_vlsi



Joined: 10 Sep 2004
Posts: 640
Helped: 72
Location: Bangalore, India


Post01 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


Post02 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
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital) -> how to run a Tcl script with argument in windows Modelsim?
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
How to run tcl in ActiveTcl Windows? (3)
TCL Script for Modelsim (5)
A TCL script run in PrimeTime that help you trace your desig (3)
Can Modelsim PE (Windows) be installed and run on Linux? (4)
How to use my tcl/tk script in cadence? (3)
How to write a TCL script to automate fpga editor (1)
How to source a CSH file from inside a TCL script ? (8)
How to run perl script? (5)
How to use TCL/TK for simulation in modelsim? (9)
Perl Script or TCL script (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS