Technical data
do
CR-68  ModelSim Commands ModelSim EE/SE Command Reference
Using other VSIM commands with macros
If you are executing a macro (DO file) when your simulation hits a breakpoint or 
causes a run-time error, VSIM interrupts the macro and returns control to the 
command line, where the following commands may be useful. (Any other legal 
command may be executed as well.)
Using the Tcl source command with DO files
Either the do command or Tcl source command can execute a DO file, but they 
behave differently.
With the source command, the DO file is executed exactly as if the commands in 
it were typed in by hand at the prompt. Each time a breakpoint is hit the Source 
window is updated to show the breakpoint. This behavior could be inconvenient 
with a large DO file containing many breakpoints.
When a do commmand is interrupted by an error or breakpoint, it does not update 
any windows, and keeps the DO file "locked". This keeps the Source window from 
flashing, scrolling, and moving the arrow when a complex DO file is executed. 
Typically an onbreak resume command is used to keep the macro running as it 
hits breakpoints. Add an onbreak abort, command to the DO file if you want to 
exit the macro and update the Source window.
command result
 run 
(CR-139) -continue  continue as if the breakpoint had not been executed, completes the run command 
(CR-139) that was interrupted
restore 
(CR-134) continue running the macro
onbreak (CR-106) specify a command to run when you hit a breakpoint within a macro
onElabError 
(CR-107) specify a command to run when an error is encountered during elaboration
onerror 
(CR-108) specify a command to run when an error is encountered within a macro
status 
(CR-150) get a traceback of nested macro calls when a macro is interrupted
abort 
(CR-19) terminate a macro once the macro has been interrupted or paused
pause 
(CR-109) cause the macro to be interrupted, the macro can be resumed by entering a resume 
command 
(CR-135) via the command line
toggle add 
(CR-154) control echoing of macro commands to the Transcript window










