ModelSim (SE or PE) and Tcl/Tk demonstration
============================================

This demonstration shows how to use the free wish (Window Shell) Tcl/Tk interpreter to add graphical functionality to a Tcl only application.

Assuming the present working directory contains all the demonstration files. Start the Tcl only application, such as ModelSim PE, and source the script "buttons.tcl". From the command line:

  vsim -gui -do buttons.tcl

Or, start ModelSim and type this into the main window:

  source buttons.tcl

This also assumes that the free "wish" interpreter (version 8.3 or newer) is installed and is in the path environment variable. You can download ActiveTcl (it includes wish) from here:

  http://www.activestate.com/Products/ActiveTcl/

The line in buttons.tcl containing this command substitution may need modifying, perhaps wish should be changed to wish83 or wish84.

  [open "|wish buttons.tcl buttons_gui" r+]

Looking at buttons.tcl it is easy to see where the panel labels and button names/commands come from. The very first procedure is the only part that will need to be modified for different projects:

  proc include_these_buttons {} {
    . . .

    panel_add   "Simulate"
    buttons_add "Run 10"   {run 10}
    buttons_add "Run 100"  {run 100}
    buttons_add "Run 1000" {run 1000}
    buttons_add "Run all"  {run -all}
    buttons_add "Restart"  {restart -force}

    . . .
  }

speaks for itself.



For more tips and advice:

  http://www.doulos.com/knowhow/
