Modelsim Tcl script Problem

O

Olaf

Hi,

this time a start to use tcl/tk scripts in modelsim :)

Well, the following doesn't work:

noview wave
add wave dut_clk
configure wave -signalnamewidth 1
wm geometry .wave [winfo screenwidth .]x330+0-20

and I get the error:

# bad window path name ".wave"

Should the window not named .wave in the TK path?

Thanks
Olaf
 
J

Jonathan Bromley

noview wave
add wave dut_clk
configure wave -signalnamewidth 1
wm geometry .wave [winfo screenwidth .]x330+0-20

and I get the error:

# bad window path name ".wave"

Should the window not named .wave in the TK path?

Back in older, simpler times (ModelSim 5.6???) it *was*.
Today, though, its name is something like

..main_pane.mdi.interior.cs.vm.paneset.cli_0.wf.clip.cs.pw.wf

And no, you're not supposed to KNOW that. You get the
wave window's name from the result of the command
view wave

But you're then trying to manipulate the window using
[wm], which means that it's essential to undock the window.
And then you need to discover the name of the wave window's
toplevel container window, so you can use [wm] on it.
So here's a version of your script that is nearer to working:

noview wave
add wave dut_clk
configure wave -signalnamewidth 1
set waveWinName [view wave -undock]
set waveTopLevel [winfo toplevel $waveWinName]
wm geometry $waveTopLevel [winfo screenwidth .]x330+0-20

It's all a LOT more complicated in the fast-moving, high-flying
world of ModelSim version 6 dockable windows :)
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
O

Olaf

Should the window not named .wave in the TK path?
Back in older, simpler times (ModelSim 5.6???) it *was*.
Today, though, its name is something like

.main_pane.mdi.interior.cs.vm.paneset.cli_0.wf.clip.cs.pw.wf

Oh dear, therefore 90% of the resources in the web are outdated :(
So here's a version of your script that is nearer to working:

noview wave
add wave dut_clk
configure wave -signalnamewidth 1
set waveWinName [view wave -undock]
set waveTopLevel [winfo toplevel $waveWinName]
wm geometry $waveTopLevel [winfo screenwidth .]x330+0-20

It's all a LOT more complicated in the fast-moving, high-flying
world of ModelSim version 6 dockable windows :)

:)

Anyway,

set waveWinName [view wave -undock]
set waveTopLevel [winfo toplevel $waveWinName]
$waveTopLevel zoomfull

won't work as well:

# bad option "zoomfull": must be cget or configure

help cget isn't known by mdelsim's help and by using configure it's
seemes to be more to involved. I thought TCL/TK is easy (as the book
from library promised) ... As you mentioned, modelsim seems to go their
own way ..

Thanks
Olaf
 
J

Jonathan Bromley

$waveTopLevel zoomfull

won't work as well:

# bad option "zoomfull": must be cget or configure

yes, that's because you're trying to do the zoomfull on the
wrong component of the wave window...

Take a look at the wave.do file that is written when you do
"save format" from the wave window menu. It contains lots
of VERY useful hints :)
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
O

Olaf

Jonathan said:
yes, that's because you're trying to do the zoomfull on the
wrong component of the wave window...

Take a look at the wave.do file that is written when you do
"save format" from the wave window menu. It contains lots
of VERY useful hints :)

Thank you for your answer. zoomfull doesn't seems to be used; I found

WaveRestoreZoom {0 ns} {84 ns}

at the end of this file. Therefore the problem is to determine the end
of time. The TB uses a variable to stop the clock and therefore the TB
too (ideas from Mike Treseler's web page :)
A simple 'now' returns an empty string. It seems not to be a real TCL/Tk
problem any more :)

Thanks
Olaf
 
J

Jonathan Bromley

Thank you for your answer. zoomfull doesn't seems to be used; I found

WaveRestoreZoom {0 ns} {84 ns}

Olaf, take a look at ModelSim's extensive and lucid docs on the
[wave] command where you'll find [wave zoomfull] among many others.
Not only does it do the zoom-100% for you, but it also returns a
Tcl list of the start and end times.

Generally, I agree that the new docking window machinery has
broken very many existing scripts. However, all those scripts
were broken anyhow because they made bad, undocumented assumptions
about the names of various windows (I should know, I suffered a
lot of embarrassment about this in one of the examples on our
website). ModelSim provides a bunch of proxy functions through
the [wave] command (and other related ideas) so that you don't
need to know any window names. Make the effort to trawl through
the online reference docs. You'll never remember all of it
(unless you have a *much* better memory than I do) but you'll
soon get the right idea about where to look in future.

--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
(e-mail address removed)
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top