Modelsim Tcl script Problem

Discussion in 'VHDL' started by Olaf, May 5, 2007.

  1. Olaf

    Olaf Guest

    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
    Olaf, May 5, 2007
    #1
    1. Advertising

  2. On Sat, 05 May 2007 08:50:23 +0200, Olaf <> wrote:

    > 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

    http://www.MYCOMPANY.com

    The contents of this message may contain personal views which
    are not the views of Doulos Ltd., unless specifically stated.
    Jonathan Bromley, May 5, 2007
    #2
    1. Advertising

  3. Olaf

    Olaf Guest

    >> 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
    Olaf, May 5, 2007
    #3
  4. On Sat, 05 May 2007 14:25:33 +0200, Olaf <> wrote:

    > $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

    http://www.MYCOMPANY.com

    The contents of this message may contain personal views which
    are not the views of Doulos Ltd., unless specifically stated.
    Jonathan Bromley, May 5, 2007
    #4
  5. Olaf

    Olaf Guest

    Jonathan Bromley schrieb:
    > On Sat, 05 May 2007 14:25:33 +0200, Olaf <> wrote:
    >
    >> $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 :)


    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
    Olaf, May 5, 2007
    #5
  6. On Sat, 05 May 2007 19:02:58 +0200, Olaf
    <> wrote:


    >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

    http://www.MYCOMPANY.com

    The contents of this message may contain personal views which
    are not the views of Doulos Ltd., unless specifically stated.
    Jonathan Bromley, May 7, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Niv

    ModelSim & tcl testbench

    Niv, Oct 7, 2003, in forum: VHDL
    Replies:
    2
    Views:
    7,520
    Mike Treseler
    Oct 7, 2003
  2. Riyaz
    Replies:
    1
    Views:
    1,016
    Jonathan Bromley
    Apr 23, 2004
  3. Dave
    Replies:
    0
    Views:
    883
  4. jadwin79
    Replies:
    0
    Views:
    1,159
    jadwin79
    Aug 31, 2006
  5. Mumia W.

    Inline::Tcl vs. Inline::Tcl

    Mumia W., Aug 23, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    128
    Mumia W.
    Aug 23, 2006
Loading...

Share This Page