24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Tcl Debugger<br />

Starting the debugger<br />

How it works<br />

The Chooser<br />

The Tcl Debugger UM-493<br />

We would like to thank Gregor Schmid for making TDebug available for use in the public<br />

domain.<br />

This program is distributed in the hope that it will be useful, but WITHOUT ANY<br />

WARRANTY; without even the implied warranty of FITNESS FOR A PARTICULAR<br />

PURPO<strong>SE</strong>.<br />

Select Tools > Tcl Debugger to run the debugger. Make sure you use the <strong>ModelSim</strong> <strong>and</strong><br />

TDebug menu selections to invoke <strong>and</strong> close the debugger. If you would like more<br />

information on the configuration of TDebug see Help > Technotes > tdebug.<br />

The following text is an edited summary of the README file distributed with TDebug.<br />

TDebug works by parsing <strong>and</strong> redefining Tcl/Tk-procedures, inserting calls to `td_eval' at<br />

certain points, which takes care of the display, stepping, breakpoints, variables etc. The<br />

advantages are that TDebug knows which statement in which procedure is currently being<br />

executed <strong>and</strong> can give visual feedback by highlighting it. All currently accessible variables<br />

<strong>and</strong> their values are displayed as well. Code can be evaluated in the context of the current<br />

procedure. Breakpoints can be set <strong>and</strong> deleted with the mouse.<br />

Unfortunately there are drawbacks to this approach. Preparation of large procedures is slow<br />

<strong>and</strong> due to Tcl's dynamic nature there is no guarantee that a procedure can be prepared at<br />

all. This problem has been alleviated somewhat with the introduction of partial preparation<br />

of procedures. There is still no possibility to get at code running in the global context.<br />

Select Tools > Tcl Debugger to open the TDebug chooser.<br />

The TDebug chooser has three parts. At<br />

the top the current interpreter, vsim.op_,<br />

is shown. In the main section there are<br />

two list boxes. All currently defined<br />

procedures are shown in the left list<br />

box. By clicking the left mouse button<br />

on a procedure name, the procedure<br />

gets prepared for debugging <strong>and</strong> its<br />

name is moved to the right list box.<br />

Clicking a name in the right list box<br />

returns a procedure to its normal state.<br />

Press the right mouse button on a<br />

procedure in either list box to get its<br />

program code displayed in the main<br />

debugger window.<br />

The three buttons at the bottom let you<br />

force a Rescan of the available<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!