Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


onerror

The onerror command is used within a macro; it specifies one or more commands to be executed when a running macro encounters an error. Using the onerror command without arguments will return the current onerror command string. Use an empty string to change the onerror command back to its default behavior (i.e., onerror ""). Use onerror with a resume command to allow an error message to be printed without halting the execution of the macro file.

Syntax

onerror

{[<command> [; <command>] ...]}

Arguments

<command>

Any command can be used as an argument to onerror. If you want to use more than one command, use a semicolon to separate the commands, or place them on multiple lines. The entire command string must be placed in curly braces. Optional.

Example

onerror {quit -f}

Forces the simulator to quit if an error is encountered while the macro is running.

See also

abort, do, onbreak, resume, status


Note: You can also set the global OnErrorDefaultAction Tcl variable in the pref.tcl file to dictate what action ModelSim takes when an error occurs. The onerror command is invoked only when an error occurs in the macro file that contains the onerror command. Conversely, OnErrorDefaultAction will run even if the macro does not contain a local onerror command. This can be useful when you run a series of macros from one script, and you want the same behavior across all macros.


Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase