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

TCL Script for Modelsim

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital)
Author Message
vcnvcc



Joined: 21 Jul 2006
Posts: 88
Helped: 1


Post08 Aug 2006 14:01   TCL Script for Modelsim
tags: writing tcl scripts for modelsim

I want to know how TCL Scripts helps for design while working in Modelsim..
Could you send an example TCL script, to get an idea and which helps me to start writing TCL script for the same..

Regards.
Back to top
maksya



Joined: 02 Jun 2005
Posts: 172
Helped: 13


Post08 Aug 2006 14:56   TCL Script for Modelsim

Search at www.doulos.com by keyword "ModelSim"
Back to top
anilkumarv



Joined: 23 Apr 2006
Posts: 45
Helped: 1


Post10 Aug 2006 11:24   Re: TCL Script for Modelsim

Go to www.model.com and you can find documents relating to that.

Also you get into the Help files of modelsim
Back to top
bestwonbin



Joined: 11 Aug 2006
Posts: 6
Helped: 2


Post12 Aug 2006 8:33   TCL Script for Modelsim
tags: modelsim pattern tcl

puts {
ModelSimSE general compile script version 1.1
Copyright (c) Doulos June 2004, SD
}

# Simply change the project settings in this section
# for each new project. There should be no need to
# modify the rest of the script.

set library_file_list {
design_library {counter.vhd}
test_library {countertb.vhd
countercf.vhd}
}
set top_level test_library.Cfg_CounterTB
set wave_patterns {
/*
}
set wave_radices {
hexadecimal {data q}
}


# After sourcing the script from ModelSim for the
# first time use these commands to recompile.

proc r {} {uplevel #0 source compile.tcl}
proc rr {} {global last_compile_time
set last_compile_time 0
r }
proc q {} {quit -force }

#Does this installation support Tk?
set tk_ok 1
if [catch {package require Tk}] {set tk_ok 0}

# Prefer a fixed point font for the transcript
set PrefMain(font) {Courier 10 roman normal}

# Compile out of date files
set time_now [clock seconds]
if [catch {set last_compile_time}] {
set last_compile_time 0
}
foreach {library file_list} $library_file_list {
vlib $library
vmap work $library
foreach file $file_list {
if { $last_compile_time < [file mtime $file] } {
if [regexp {.vhdl?$} $file] {
vcom -93 $file
} else {
vlog $file
}
set last_compile_time 0
}
}
}
set last_compile_time $time_now

# Load the simulation
eval vsim $top_level

# If waves are required
if [llength $wave_patterns] {
noview wave
foreach pattern $wave_patterns {
add wave $pattern
}
configure wave -signalnamewidth 1
foreach {radix signals} $wave_radices {
foreach signal $signals {
catch {property wave -radix $radix $signal}
}
}
if $tk_ok {wm geometry .wave [winfo screenwidth .]x330+0-20}
}

# Run the simulation
run -all

# If waves are required
if [llength $wave_patterns] {
if $tk_ok {.wave.tree zoomfull}
}

puts {
Script commands are:

r = Recompile changed and dependent files
rr = Recompile everything
q = Quit without confirmation
}

# How long since project began?
if {[file isfile start_time.txt] == 0} {
set f [open start_time.txt w]
puts $f "Start time was [clock seconds]"
close $f
} else {
set f [open start_time.txt r]
set line [gets $f]
close $f
regexp {\d+} $line start_time
set total_time [expr ([clock seconds]-$start_time)/60]
puts "Project time is $total_time minutes"
}
Back to top
xiexie57



Joined: 04 Jul 2006
Posts: 32


Post18 Aug 2006 2:53   TCL Script for Modelsim

Use dos batch
vlog -work auto_pre D:/pe61c/ch8.tf
vsim -c +nowarnTFMPC +nowarnTSCALE auto_pre.MODULE NAME -do "run -all" -l log_pre/ch8.log
Back to top
alpeshchokshi



Joined: 05 Mar 2006
Posts: 145
Helped: 4
Location: San Jose, CA


Post18 Aug 2006 3:12   Re: TCL Script for Modelsim

u will have also examples on modelsim webpage
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital)
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap