Magic VLSI Layout Tool Version 7.3 *

gmacro


General-purpose macro implementation allowing embedded Tcl command and procedure calls.

Usage:

gmacro key value

where key is the name of a key that implements the single-key macro, and value is the procedure that is executed when the key is pressed. key follows the syntax outlined in the macro function reference. value may be any Tcl or magic procedure, or a combination of both.

Summary:

The gmacro command is functionally like the macro command. It binds the command or set of commands in the value argument to the key name key. When key is pressed in the layout window, it executes the procedure bound to the key. Unlike the macro command, both magic and Tcl commands and procedures may be implemented in the value argument.

Note that magic "commands" implemented as Tcl scripts are functionally Tcl procedures. Macros that execute these procedures must use the gmacro command. On the other hand, the imacro command only prints the contents of the macro to the console, but the command itself is exectuted by the Tcl interpreter; therefore, imacro commands, like gmacro commands, may contain both magic and Tcl command and procedure calls.

Implementation Notes:

gmacro is implemented as a Tcl procedure in the GUI wrapper script. It works by setting up a macro with the macro command that is attached to a "fake" command name. The command then has a tag callback attached to it with the tag function. The tag callback procedure implements the macro call, as tag callbacks may contain both Tcl and magic commands.

See Also:

macro
imacro

Return to command index

Last updated: October, 2004