This Document describes the API (Application Programming Interface) to control the GUI (Graphical User Interface). In combination with the Database API the user can write its own Tcl scripts as extension to SpiceVision PRO.
gui analogWave
APIs to interact with the AnalogWave window.
gui analogWave clearCursor
Remove the marker and cursor from the plot.
Usage:
gui analogWave clearCursor ?-all? ?-plotName plotNameValue? ?-window windowValue?
Parameters:
-all (optional)
-
Remove all cursors on every plot.
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave clearCursor
gui analogWave closeAllFiles
Close all files.
Usage:
gui analogWave closeAllFiles ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave closeAllFiles
gui analogWave closeAllTabs
Close all tabs inside the Analog Waveform window.
Usage:
gui analogWave closeAllTabs ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave closeAllTabs
gui analogWave closeFile
Close the specified file.
Usage:
gui analogWave closeFile ?-window windowValue? fileName
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
fileName
-
The name of the file to be closed.
Example:
gui analogWave closeFile $fileName
gui analogWave getCurrentPlotName
Return the name of the plot currently visible.
Usage:
gui analogWave getCurrentPlotName ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave getCurrentPlotName
gui analogWave getCurveNames
Return the curve names for the given section. The curves are the signals which can be loaded into a plot.
Usage:
gui analogWave getCurveNames ?-sectionName sectionNameValue? ?-window windowValue?
Parameters:
-sectionName sectionNameValue (optional default is "")
-
Specify the section name which corresponds to the file name. In case no section name is specified the first section is used.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave getCurveNames
gui analogWave getPlotNames
Return a list of all plot names currently existing in the AnalogWave window.
Usage:
gui analogWave getPlotNames ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave getPlotNames
gui analogWave getSectionNames
Return the section names of the Analog Waveform window. Each section corresponds to one specific file.
Usage:
gui analogWave getSectionNames ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave getSectionNames
gui analogWave getWidget
Get the path of the BeSpice widget.
Usage:
gui analogWave getWidget ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave getWidget
gui analogWave hideWindow
Hide the default AnalogWave window.
Usage:
gui analogWave hideWindow
Parameters:
Example:
gui analogWave hideWindow
gui analogWave loadCurve
Show a curve in a plot.
Usage:
gui analogWave loadCurve ?-clear? ?-plotName plotNameValue? ?-sectionName sectionNameValue? ?-window windowValue? curveName
Parameters:
-clear (optional)
-
Remove all other curves in the target plot.
-plotName plotNameValue (optional default is "")
-
If no plot name is given, the curve is added to the last plot. In case a plot name is defined, the plot is created if necessary and the curve added.
-sectionName sectionNameValue (optional default is "")
-
Specify the section name which corresponds to the file name. In case no section name is specified the first section is used.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
curveName
-
Specify the curve name to be loaded. Curves in sub-sections are separated by a dot, e.g. 'xopamp.v2'.
Example:
gui analogWave loadCurve $curveName
gui analogWave loadFile
Load a Spice simulation output file.
Usage:
gui analogWave loadFile ?-window windowValue? fileName
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
fileName
-
The name of the file to be loaded.
Example:
gui analogWave loadFile $fileName
gui analogWave setCurrentPlot
Make the given existing plot visible.
Usage:
gui analogWave setCurrentPlot ?-window windowValue? plotName
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
plotName
-
The name of the plot.
Example:
gui analogWave setCurrentPlot $plotName
gui analogWave setCursor
Add a marker/cursor to the plot. If a marker is already set, add a cursor instead. If a marker and a cursor are already set, both are removed first. A second x-value has the same effect.
Usage:
gui analogWave setCursor ?-plotName plotNameValue? ?-window windowValue? x0 ?x1?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
x0
-
The x-value for the marker/cursor position. Can be given as absolute value or as percentage.
x1 (optional)
-
The x-value for the marker/cursor position. Can be given as absolute value or as percentage.
Example:
gui analogWave setCursor 10%
gui analogWave setCursor 60e-9
gui analogWave showOids
Show the curves corresponding to the oids. Multiple oids are shown in the same plot.
Usage:
gui analogWave showOids ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
oidList
-
List of oids.
Example:
gui analogWave showOids $oidList
gui analogWave showWindow
Show the default AnalogWave window.
Usage:
gui analogWave showWindow
Parameters:
Example:
gui analogWave showWindow
gui analogWave zoom
Define the visible range of the plot. The x-axis will be visible from x0 to x1. The first y axis will be visible from y00 to y01 if the values are provided. The values y10 and y11 act on the second y-axis if y00, y01, y10 and y11 are provided.
Usage:
gui analogWave zoom ?-plotName plotNameValue? ?-window windowValue? x0 x1 ?y00? ?y01? ?y10? ?y11?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
x0
-
The start of the visible range on the x-axis. Can be given as absolute value or as percentage.
x1
-
The end of the visible range on the x-axis. Can be given as absolute value or as percentage.
y00 (optional)
-
The start of the visible range on the first y-axis. Can be given as absolute value or as percentage.
y01 (optional)
-
The end of the visible range on the first y-axis. Can be given as absolute value or as percentage.
y10 (optional)
-
The start of the visible range on the second y-axis. Can be given as absolute value or as percentage.
y11 (optional)
-
The end of the visible range on the second y-axis. Can be given as absolute value or as percentage.
Example:
gui analogWave zoomY
gui analogWave zoomFit
Reset the zoom.
Usage:
gui analogWave zoomFit ?-plotName plotNameValue? ?-window windowValue?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave zoomFit
gui analogWave zoomIn
Zoom in one step both in the x and y direction.
Usage:
gui analogWave zoomIn ?-plotName plotNameValue? ?-window windowValue?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave zoomY
gui analogWave zoomOut
Zoom out one step both in the x and y direction.
Usage:
gui analogWave zoomOut ?-plotName plotNameValue? ?-window windowValue?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave zoomY
gui analogWave zoomX
Zoom in one step in the x direction.
Usage:
gui analogWave zoomX ?-plotName plotNameValue? ?-window windowValue?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave zoomX
gui analogWave zoomY
Zoom in one step in the y direction.
Usage:
gui analogWave zoomY ?-plotName plotNameValue? ?-window windowValue?
Parameters:
-plotName plotNameValue (optional default is "")
-
Set the target plot. If not defined, the current plot will be the target.
-window windowValue (optional default is NULL)
-
Path or name of a AnalogWave window, "DEFAULT" or "" for the default AnalogWave window.
Example:
gui analogWave zoomY
gui assertion
APIs to interact with the Assertion window.
gui assertion hideWindow
Hide the Assertion window.
Usage:
gui assertion hideWindow
Parameters:
Example:
gui assertion hideWindow
gui assertion showWindow
Show the Assertion window.
Usage:
gui assertion showWindow
Parameters:
Example:
gui assertion showWindow
gui attribute
The tool maintains module-based and tree-based (flat) attributes.
gui attribute changed
Inform the GUI that attributes in the database have changed.
Usage:
gui attribute changed ?-enableSaveSpice?
Parameters:
-enableSaveSpice (optional)
-
If this switch is set then the Save Spice button in the toolbar and in the main menu will be enabled.
Example:
set oidList {
{inst TOP U2 m1}
{inst TOP U2 m2}
}
set cnt 0
foreach oid $oidList {
$db flatattr $oid set cnt=[incr cnt]
}
##
# Create display attributes to make the $cnt attribute
# visible in Schem and Cone.
#
set nch [$db search primitive "nch"]
set pch [$db search primitive "pch"]
$db attr -db set {@nlv:port=c=$cnt}
$db attr $nch set {@nlv=c=$cnt}
$db attr $pch set {@nlv=c=$cnt}
gui attribute changed
gui attribute registerGetCallback
Register a callback to get attribute values from an external source. This callback is used in OID tooltips and in the attributes list of the Infobox.
Usage:
gui attribute registerGetCallback callback
Parameters:
callback
-
The callback script.
Example:
proc getMyAttributes {oid} {
return {A=1 B=2}
}
gui attribute registerGetCallback "getMyAttributes"
gui attribute removeGetCallback
Remove a previously registered callback to get attribute values from an external source.
Usage:
gui attribute removeGetCallback callback
Parameters:
callback
-
The callback script.
Example:
gui attribute removeGetCallback "getMyAttributes"
gui bookmark
APIs to manage bookmarks.
gui bookmark add
Add a new bookmark for the current contents of the given window. Return the new bookmark’s name.
Usage:
gui bookmark add window ?name?
Parameters:
name (optional)
-
Name of the new bookmark. If no name is given, a unique name is automatically created.
window
-
Path or name of a window of class Cone, Schem, Source, or Wave.
Example:
##
# Add a named bookmark for the default Cone window.
#
set cone [::WindowManager::DefaultWindow Cone]
gui bookmark add $cone "myBookmark"
##
# Add an automatically named bookmark.
#
set bookmark_name [gui bookmark add $cone]
gui bookmark changed
Inform the GUI about changed bookmarks.
Usage:
gui bookmark changed ?-class classValue?
Parameters:
-class classValue (optional default is NULL)
-
Bookmark class that has been changed. Supported classes are "Schem", "Cone", "Source" and "Wave". Omitting the "-class" option means that all bookmark classes have changed.
Example:
##
# Schem bookmarks have changed.
#
gui bookmark changed -class "Schem"
##
# All bookmark classes have changed.
#
gui bookmark changed
gui bookmark delete
Delete the given class bookmark.
Usage:
gui bookmark delete classOrWindow name
Parameters:
classOrWindow
-
Bookmark class (must be Schem, Cone, Source, or Wave) or window path.
name
-
Name of the bookmark to delete.
Example:
##
# Delete a Cone bookmark.
#
gui bookmark delete Cone "myNewBookmark"
gui bookmark get
Retrieve all class bookmarks.
Usage:
gui bookmark get classOrWindow
Parameters:
classOrWindow
-
Bookmark class (must be Schem, Cone, Source, or Wave) or window path.
Example:
##
# Get all Cone bookmarks.
#
set bookmarks [gui bookmark get Cone]
gui bookmark rename
Rename the given class bookmark.
Usage:
gui bookmark rename classOrWindow name new_name
Parameters:
classOrWindow
-
Bookmark class (must be Schem, Cone, Source, or Wave) or window path.
name
-
Name of the bookmark to rename.
new_name
-
New name.
Example:
##
# Rename a Cone bookmark.
#
gui bookmark rename Cone "myBookmark" "myNewBookmark"
gui bookmark select
Select/restore the given bookmark in the given window.
Usage:
gui bookmark select window name
Parameters:
name
-
Name of the bookmark to select.
window
-
Path or name of a window of class Cone, Schem, Source, or Wave.
Example:
##
# Select/restore a bookmark for the default Cone window.
#
set cone [::WindowManager::DefaultWindow Cone]
gui bookmark select $cone "myBookmark"
gui bookmark set
Set all class bookmarks.
Usage:
gui bookmark set classOrWindow bookmark_list
Parameters:
bookmark_list
-
List of bookmarks (as returned by a previous call to 'gui bookmark get …').
classOrWindow
-
Bookmark class (must be Schem, Cone, Source, or Wave) or window path.
Example:
##
# Get all Cone bookmarks.
#
set saved_bookmarks [gui bookmark get Cone]
##
# Restore the previously saved Cone bookmarks.
#
gui bookmark set Cone $saved_bookmarks
gui clipboard
APIs to interact with the clipboard.
gui clipboard get
Returns Windows/X11 primary selection or clipboard.
Usage:
gui clipboard get ?-path pathValue?
Parameters:
-path pathValue (optional default is ".")
-
Specify the window path.
Example:
gui clipboard get
gui clipboard set
Set the Windows/X11 primary selection and store the text in the clipboard.
Usage:
gui clipboard set ?-path pathValue? text
Parameters:
-path pathValue (optional default is ".")
-
Specify the object path.
text
-
The text which should be stored.
Example:
gui clipboard set "test"
gui clockdomain
APIs to interact with the clock domain analyzer.
gui clockdomain hideDialog
Hide the Clock Domain Analyzer window.
Usage:
gui clockdomain hideDialog
Parameters:
No parameters.
Example:
gui clockdomain hideDialog
gui clockdomain highlight
Highlight the given Clock Domain.
Usage:
gui clockdomain highlight ?-color colorValue? ?-domain domainValue?
Parameters:
-color colorValue (optional default is "0")
-
Number of the highlight color to use. If domain number is "all" then this will be the first used highlight color.
-domain domainValue (optional default is "all")
-
Number of the clock domain to highlight or "all". Clock domain numbers can be obtained by the "$db cdc" API commands.
Example:
gui clockdomain highlight
gui clockdomain showDialog
Show the Clock Domain Analyzer window.
Usage:
gui clockdomain showDialog
Parameters:
No parameters.
Example:
gui clockdomain showDialog
gui clockdomain unhighlight
Unhighlight the given Clock Domain.
Usage:
gui clockdomain unhighlight ?-domain domainValue?
Parameters:
-domain domainValue (optional default is "all")
-
Number of the clock domain to highlight or "all". Clock domain numbers can be obtained by the "$db cdc" API commands.
Example:
gui clockdomain unhighlight
gui cone
APIs to interact with the Cone window.
gui cone append
Identical to 'gui cone load' except that the previous contents of the window is not deleted. The objects in oidList will be appended to the Cone window.
Usage:
gui cone append ?-foldModules? ?-highlight? ?-window windowValue? oidList
Parameters:
-foldModules (optional)
-
Fold all module instances.
-highlight (optional)
-
Highlight the loaded objects using the goto color.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
List of objects to append.
Example:
gui cone append -highlight $oids
gui cone clear
Delete all objects from the given Cone window. The Cone window is re-initialized.
Usage:
gui cone clear ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone clear
gui cone complete
Add all objects to the cone.
Usage:
gui cone complete ?-flat? ?-fold? ?-limit limitValue? ?-timeLimit timeLimitValue? ?-window windowValue? oidList
Parameters:
-flat (optional)
-
Use flat instead of hierarchical view.
-fold (optional)
-
Fold all objects.
-limit limitValue (optional default is "-1")
-
Set the size limit for a warning prompt in case more objects are loaded. Set to 0 to disable the default prompt.
-timeLimit timeLimitValue (optional default is "-1")
-
A lower time limit will speed up the generation of the cone while a higher time limit will result in a more optimized schematic.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
Module OID to complete.
Example:
set oidList [gui cone contents]
gui cone complete $oidList
gui cone contents
Returns all objects loaded to the given Cone window.
Usage:
gui cone contents ?-type typeValue? ?-window windowValue?
Parameters:
-type typeValue (optional default is "*")
-
If this parameter is given, the the result is filtered by the given type.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone contents
gui cone customFoldAction
Register a custom procedure for the fold button.
Usage:
gui cone customFoldAction ?-window windowValue? callback
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
callback
-
Name of the callback procedure.
Example:
proc myFoldProc {inst} {
# Do something with the instance to fold.
}
gui cone customFoldAction "myFoldProc"
gui cone customMoreAction
Register a custom procedure for the more command (double click).
Usage:
gui cone customMoreAction ?-window windowValue? callback
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
callback
-
Name of the callback procedure.
Example:
proc myMoreProc {oid} {
set oidList {}
# Use the '$db cone' API to calculate the result.
# set oidList [$db cone <OPTIONS> $oid]
return $oidList
}
gui cone customMoreAction -window "Cone" myMoreProc
gui cone customUnfoldAction
Register a custom procedure for the unfold button.
Usage:
gui cone customUnfoldAction ?-window windowValue? callback
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
callback
-
Name of the callback procedure.
Example:
proc myUnfoldProc {inst} {
# Do something with the instance to unfold.
}
gui cone customUnfoldAction "myUnfoldProc"
gui cone disableUpdate
Disable the update of highlights and attributes in the Cone window.
Usage:
gui cone disableUpdate ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone disableUpdate
gui cone enableUpdate
Re-enable the update of highlights and attributes in the Cone window.
Usage:
gui cone enableUpdate ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone enableUpdate
gui cone fold
Fold the given modules in the Cone window.
Usage:
gui cone fold ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
List of objects to fold.
Example:
set oidList [gui cone contents]
gui cone fold $oidList
gui cone isFolded
Check if the fold flag is set at a module.
Usage:
gui cone isFolded ?-window windowValue? oid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oid
-
Module OID to check.
Example:
set oidList [gui cone contents]
gui cone isFolded [lindex $oidList 0]
gui cone isLoaded
Check if one of the given OID in oidList is loaded to the Cone window. If the oidList is empty then this function can be used to check if the Cone window is filled or empty.
Usage:
gui cone isLoaded ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
List of objects to check.
Example:
set oidList [gui cone contents]
if {[gui cone isLoaded $oidList]} {
# Do something
}
gui cone load
Load the given objects into the given Cone window. The objects are identified by OIDs; the 'oidList' is a Tcl-list of OIDs. If oidList contains nets, then those nets only display the connections to also loaded instances/ports. In other words, just loading a net (without loading at least one connecting instance or port will result in a blank window). An error is returned, if one of the OIDs can’t be found in the database.
Usage:
gui cone load ?-foldModules? ?-highlight? ?-window windowValue? oidList
Parameters:
-foldModules (optional)
-
Fold all module instances.
-highlight (optional)
-
Highlight the loaded objects using the goto color.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
List of objects to load.
Example:
gui cone load $oids
gui cone loadModule
Load a module including the contents to the Cone window.
Usage:
gui cone loadModule ?-window windowValue? module
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
module
-
OID of the module to load.
Example:
gui cone loadModule $moduleOid
gui cone nlv
Get the path of the Nlview widget.
Usage:
gui cone nlv ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone nlv
gui cone openSnapshot
Restore a Cone snapshot file.
Usage:
gui cone openSnapshot ?-greyout? ?-validate? ?-window windowValue? fname
Parameters:
-greyout (optional)
-
If greyout is set then grey out objects that do not match the loaded design database.
-validate (optional)
-
If validate is set then update the displayed connectivity to the loaded design database.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
fname
-
Name of the snapshot file.
Example:
gui cone openSnapshot -window "Cone" "mySnapshot.bm5" -validate
gui cone pages
Get the number of schematic pages displayed in the Cone window.
Usage:
gui cone pages ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone pages -window "Cone"
gui cone regenerate
Regenerate the displayed schematic of the given Cone window.
Usage:
gui cone regenerate ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone regenerate
gui cone registerAddCallback
Register a callback that is called after all objects of a load or append command have been added to a Cone window. The Cone window’s path is appended to the callback.
Usage:
gui cone registerAddCallback callback
Parameters:
callback
-
The callback script.
Example:
proc my_callback {w} {
gui console print "Some objects have been added to the Cone window: $w"
}
gui cone registerAddCallback my_callback
gui cone registerChangedCallback
Register a callback that is called after the contents of a Cone window have change. The Cone window’s path is appended to the callback as well as the list of added and removed objects.
Usage:
gui cone registerChangedCallback callback
Parameters:
callback
-
The callback script.
Example:
proc my_callback {w addedObjects removedObjects} {
set msg "The Cone window has changed: $w\n"
append msg "The following object have been added: '$addedObjects'\n"
append msg "The following object have been removed: '$removedObjects'"
gui console print $msg
}
gui cone registerChangedCallback my_callback
gui cone registerClearCallback
Register a callback that is called before a Cone window is cleared. The Cone window’s path is appended to the callback.
Usage:
gui cone registerClearCallback callback
Parameters:
callback
-
The callback script.
Example:
proc my_callback {w} {
gui console print "The Cone window is about to be cleared: $w"
}
gui cone registerClearCallback my_callback
gui cone registerZoomChangedCallback
Register a callback that is evaluated every time current zoom factor has changed. Before evaluating the callback, the Cone window identifier and the current zoom factor value are appended. The current zoom factor may also be empty.
Usage:
gui cone registerZoomChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc myZoomChanged {w zoomFactor} {
gui console print "Cone window $w: the new zoom factor is $zoomFactor"
}
# add callback
gui cone registerZoomChangedCallback myZoomChanged
# remove callback
gui cone removeZoomChangedCallback myZoomChanged
gui cone remove
Delete the given objects from the given Cone window. An error is returned, if one of the OIDs can’t be found in the database.
Usage:
gui cone remove ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
List of objects to remove.
Example:
gui cone remove $oids
gui cone removeAddCallback
Remove the previously registered callback script.
Usage:
gui cone removeAddCallback callback
Parameters:
callback
-
The callback script.
Example:
gui cone removeAddCallback my_callback
gui cone removeChangedCallback
Remove the previously registered callback script.
Usage:
gui cone removeChangedCallback callback
Parameters:
callback
-
The callback script.
Example:
gui cone removeChangedCallback my_callback
gui cone removeClearCallback
Remove the previously registered callback script.
Usage:
gui cone removeClearCallback callback
Parameters:
callback
-
The callback script.
Example:
gui cone removeClearCallback my_callback
gui cone removeZoomChangedCallback
Remove the callback previously registered with
gui cone registerZoomChangedCallback …
.
Usage:
gui cone removeZoomChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc myZoomChanged {w zoomFactor} {
gui console print "Cone window $w: the new zoom factor is $zoomFactor"
}
# add callback
gui cone registerZoomChangedCallback myZoomChanged
# remove callback
gui cone removeZoomChangedCallback myZoomChanged
gui cone saveAs
Save the contents of the Cone window as a Verilog or Spice netlist or as a ZDB binfile.
Usage:
gui cone saveAs ?-allTopPorts? ?-commonCells? ?-connectHiddenSupplies? ?-functionImplementations? ?-hierarchical? ?-namedConnectivity? ?-portsForUnconnectedPins? ?-topName topNameValue? ?-unconnectedModulePorts? ?-visibleHierarchyOnly? ?-window windowValue? mode fname
Parameters:
-allTopPorts (optional)
-
Create all top-level ports.
-commonCells (optional)
-
Create common cells for empty and full modules.
-connectHiddenSupplies (optional)
-
Connect all hidden connections to supply nets.
-functionImplementations (optional)
-
Add function implementations suitable for simulation (only for 'Verilog' type).
-hierarchical (optional)
-
Save as a hierarchical netlist.
-namedConnectivity (optional)
-
Create netlist with named connectivity (only for 'Verilog' type).
-portsForUnconnectedPins (optional)
-
Create ports for unconnected pins.
-topName topNameValue (optional default is NULL)
-
Name of created top module.
-unconnectedModulePorts (optional)
-
Create unconnected module ports.
-visibleHierarchyOnly (optional)
-
Create only visible hierarchy (only for 'Spice' type).
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
fname
-
Name of the output file. When using '-' as an output file name in 'Binfile' mode, a ZDB handle is returned instead of writing a file.
mode
-
Output mode: 'Verilog', 'Spice', or 'Binfile'.
Example:
##
# Create a hierarchical Verilog netlist with function implementations for
# the current Cone window contents. Save it in the file $fname.
#
gui cone saveAs Verilog $fname -hierarchical -functionImplementations
gui cone saveSnapshot
Save a Cone snapshot file.
Usage:
gui cone saveSnapshot ?-window windowValue? fname
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
fname
-
Name of the snapshot file.
Example:
gui cone saveSnapshot -window "Cone" "mySnapshot.bm5"
gui cone selection
Returns all currently selected objects of the Cone window.
Usage:
gui cone selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui cone selection
gui cone unfold
Unfold the given modules in the Cone window.
Usage:
gui cone unfold ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
oidList
-
List of objects to unfold.
Example:
set oidList [gui cone contents]
gui cone unfold $oidList
gui cone zoom
Changes the zoom factor of the Cone window.
Usage:
gui cone zoom ?-window windowValue? factor
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
factor
-
The argument $factor must be "fullfit" or a number ("fullfit" only works if that window is currently visible).
Example:
gui window show "Cone"
gui cone zoom "fullfit"
gui connectivityBrowser
APIs to interact with the Connectivity Browser window.
gui connectivityBrowser hideWindow
Hide the Connectivity Browser window.
Usage:
gui connectivityBrowser hideWindow
Parameters:
Example:
gui connectivityBrowser hideWindow
gui connectivityBrowser showWindow
Show the Connectivity Browser window.
Usage:
gui connectivityBrowser showWindow ?-oid oidValue?
Parameters:
-oid oidValue (optional default is NULL)
-
Display this OID.
Example:
gui connectivityBrowser showWindow
gui console
APIs to interact with the Console window.
gui console hideWindow
Hide the Console window.
Usage:
gui console hideWindow
Parameters:
Example:
gui console hideWindow
gui console print
Print a message to the Console window.
Usage:
gui console print ?-callback callbackValue? ?-filename filenameValue? ?-line lineValue? ?-type typeValue? message
Parameters:
-callback callbackValue (optional default is NULL)
-
Add a binding on the left mouse button to the printed text. The given callback is evaluated if the user clicks on the message.
-filename filenameValue (optional default is NULL)
-
If a filename is specified then a left mouse button binding is added to jump to the file in the Source window.
-line lineValue (optional default is NULL)
-
If a filename and a line number is specified then a left mouse button binding is added to jump to the file and line in the Source window.
-type typeValue (optional default is "i")
-
Specify the severity type.
message
-
The message to print.
Example:
gui console print "This is a message"
gui console print -type e -filename "myfile.v" -line 123 "This is an error message with a file/line"
gui console print -callback "gui console print clicked" "This is a clickable message"
gui console showWindow
Show the Console window.
Usage:
gui console showWindow
Parameters:
Example:
gui console showWindow
gui database
Get the Database
gui database changed
Update the GUI after loading or opening a new database.
Usage:
gui database changed db
Parameters:
db
-
Name of the new database.
Example:
set db [zdb new]
# load netlist data with '$db load ...'
gui database changed $db
gui database get
Returns the name of the currently loaded design database (or an empty string if no design data is loaded).
Note
|
Only after loading a design the database name is set - see also 'gui database registerChangedCallback'. |
Usage:
gui database get
Parameters:
No parameters.
Example:
set db [gui database get]
gui database modified
Update the GUI after modifying the currently loaded database.
Usage:
gui database modified
Parameters:
No parameters.
Example:
gui database modified
gui database populated
Update the GUI after populating the currently loaded database.
Usage:
gui database populated
Parameters:
No parameters.
Example:
gui database populated
gui database registerChangedCallback
Register a procedure to be executed every time a new database got connected to the GUI. The database handle is appended to the callback before executing. This handle is identical to the return value of 'gui database get' at that time.
Note
|
The registered procedure is called before the schematic is rendered. If the registered Userware procedure accesses the Schem window then 'gui schem setCurrentModule' needs to be called before. |
Usage:
gui database registerChangedCallback callback
Parameters:
callback
-
Name of the callback procedure to be called.
Example:
proc myFunc {db} {
if {$db eq ""} {
return
}
$db foreach top top {
$db foreach inst $top inst {
# Do something with $inst
}
}
}
gui database registerChangedCallback "myFunc"
gui database registerDesignReadyCallback
Register a callback procedure to be executed after the design is ready (all design files have been read). This callback is called only after loading design files which were given on the command line.
Note
|
The registered procedure is called before the schematic is rendered. If the registered procedure accesses the Schem window then 'gui schem setCurrentModule' needs to be called before. |
Usage:
gui database registerDesignReadyCallback callback
Parameters:
callback
-
Name of the callback procedure to be registered.
Example:
proc myProc {} {
set db [gui database get]
# Do something with $db
}
gui database registerDesignReadyCallback "myProc"
gui database removeChangedCallback
Remove a previously registered callback procedure.
Usage:
gui database removeChangedCallback callback
Parameters:
callback
-
Name of the callback procedure to be removed.
Example:
gui database removeChangedCallback "myFunc"
gui database removeDesignReadyCallback
Remove a previously registered callback procedure.
Usage:
gui database removeDesignReadyCallback callback
Parameters:
callback
-
Name of the callback procedure to be removed.
Example:
gui database removeDesignReadyCallback "myProc"
gui database runAndRegisterChangedCallback
If there already is a database, immediately run the callback. Furthermore, register the callback to be executed every time a new database got connected. The database name is appended to the $callback before executing. This pointer is identical to the return value of GetDataBase at that time. If there already is a database, immediately run the callback before registering it.
Note
|
The registered procedure is called before the schematic is rendered. If the registered procedure accesses the Schem window then 'gui schem setCurrentModule' needs to be called before. |
Usage:
gui database runAndRegisterChangedCallback callback
Parameters:
callback
-
Name of the callback procedure.
Example:
proc myFunc {db} {
if {$db == ""} {
return
}
$db foreach top top {
$db foreach inst $top inst {
# Do something with $inst
}
}
}
gui database runAndRegisterChangedCallback "myFunc"
gui database runOrRegisterChangedCallback
If there already is a database, immediately run the callback. Otherwise, register the callback to be executed every time a new database got connected. The database name is appended to the $callback before executing. This pointer is identical to the return value of GetDataBase at that time.
The return value is 0 if the procedure was executed immediately and 1 if the command was registered for database changed callback.
Usage:
gui database runOrRegisterChangedCallback callback
Parameters:
callback
-
Name of the callback procedure.
Example:
proc myFunc {db} {
if {$db == ""} {
return
}
$db foreach top top {
$db foreach inst $top inst {
# Do something with $inst
}
}
}
gui database runOrRegisterChangedCallback "myFunc"
gui dnd
APIs for drag-and-drop.
gui dnd registerCallback
Register a custom drag-and-drop callback which is called just before the drop code is executed. Adds the name of the window where the drop is happening and the dropped data as the last two parameters of the callback.
Usage:
gui dnd registerCallback callback ?only?
Parameters:
callback
-
Name of the callback procedure to be called.
only (optional)
-
Only call the callback for the specified window. Supported values are:
-class <WindowClass>
or-name <WindowName>
.
Example:
proc myFunc {w data} {
# Do something
}
# General callback:
gui dnd registerCallback "myFunc"
# Callback for windows of class Schem (Note the " around "-class Schem"):
gui dnd registerCallback "myFunc" "-class Schem"
gui dnd removeCallback
Remove a previously registered callback. Only works when
-class <WindowClass>
or `-name <WindowName> is exactly set like in the
"registerCallback" call.
Usage:
gui dnd removeCallback callback ?only?
Parameters:
callback
-
The first string of the previously registered callback script.
only (optional)
-
Has to be set like the callback was previously registered. Supported values are:
-class <WindowClass>
or-name <WindowName>
.
Example:
# General callback:
gui extract removeCallback "myFunc"
# Callback for windows of class Schem (Note the " around "-class Schem"):
gui dnd removeCallback "myFunc" "-class Schem"
gui export
Schematic export APIs.
gui export edif
Export a schematic of the given window as an EDIF file.
Usage:
gui export edif ?-libname libnameValue? ?-mono? ?-optimize optimizeValue? ?-view viewValue? what window fname
Parameters:
-libname libnameValue (optional default is NULL)
-
Specifies the created library name.
-mono (optional)
-
If set then the resulting EDIF is in mono color.
-optimize optimizeValue (optional default is NULL)
-
The created EDIF file is in standard EDIF 2.0.0 format. You can optimize the created edif for OrCAD (orcad), ViewDraw (viewdraw), Cadence (cadence) or Tanner SEdit (sedit).
-view viewValue (optional default is NULL)
-
Specifies the view name to create.
fname
-
Name of the created file.
what
-
Specify what to export. This can be tree (exports the whole design), window (exports the content of the window specified by the
window
parameter). window
-
Path or name of a window.
Example:
# export the contents of the window named "Schem"
gui export edif window "Schem" -optimize orcad "schem.edif"
gui export pdf
Create the schematic of the given window as a PDF file.
Usage:
gui export pdf fname window size
Parameters:
fname
-
Name of the created PDF file.
size
-
This is one of the predefined paper sizes (e.g.
Letter
,A4
, etc.) as defined in the GUI Print dialog. window
-
Path or name of a window.
Example:
# export the contents of the window named "Schem"
gui export pdf export.pdf "Schem" A
gui export photo
Create a photo of the given window.
Usage:
gui export photo fname window size type
Parameters:
fname
-
Name of the created image file.
size
-
This is one of the predefined screen resolution sizes (e.g.
Full-HD
,4K-UHD
, etc.) as defined in the GUISave Schematic as Image
dialog, a string specifying the width and height (e.g.640x480
), orauto
for the exact pixel size of the window on screen. type
-
Currently "gif", "png", and "svg" images are supported.
window
-
Path or name of a window.
Example:
# export the contents of the window named "Schem"
gui export photo export.png "Schem" 300x200 png
gui export skill
Export a schematic of the given window as a Skill script which can be loaded into the Cadence environment.
Usage:
gui export skill ?-analog analogValue? ?-disabletrigger? ?-epilog epilogValue? ?-instsuffix instsuffixValue? ?-metric? ?-multifile? ?-netlabel? ?-overwrite? ?-prolog prologValue? ?-technology technologyValue? what window libname fname
Parameters:
-analog analogValue (optional default is "0")
-
Generate the schematic in analog mode.
-disabletrigger (optional)
-
Disable triggers.
-epilog epilogValue (optional default is NULL)
-
Specify the path to a Skill script that is evaluated after the actual schematic generation.
-instsuffix instsuffixValue (optional default is NULL)
-
Append this suffix to all created instances.
-metric (optional)
-
Use metric user units.
-multifile (optional)
-
If true then multiple files are generated.
-netlabel (optional)
-
If true then net name labels are created.
-overwrite (optional)
-
If true then existing cells will be overwritten.
-prolog prologValue (optional default is NULL)
-
Specify the path to a Skill script that is evaluated before the actual schematic generation.
-technology technologyValue (optional default is NULL)
-
Specify the technology.
fname
-
Name of the created file.
libname
-
Specifies the created Cadence library name.
what
-
Specify what to export. This can be tree (exports the whole design), module (exports the current module), cone (exports the contents of the Cone window) or symbol (exports only all symbols).
window
-
Name of the window to export.
Example:
gui export skill tree "" "sv_lib" "design.il"
gui extract
Commands for the interaction with the Result table in the Cone Extraction window.
gui extract addDataColumn
Add a new data column. If you do not specify a name, a default name "DataX" is given where "X" is the column index. The command returns a list containing the column index and the column name, e.g. {1 Data1}.
Usage:
gui extract addDataColumn ?-name nameValue? ?-window windowValue?
Parameters:
-name nameValue (optional default is "")
-
Specify a column name.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui extract addDataColumn
gui extract addDataColumn -name "myDataColumn"
gui extract registerCallback
Add a callback which is called whenever the result is changed. Returns the name of the Cone window as last argument.
Usage:
gui extract registerCallback callback
Parameters:
callback
-
Name of the callback procedure to be called.
Example:
proc myFunc {coneWindow} {
for {set row 0} {$row < [gui extract resultCount]} {incr row} {
# Do something (related to the Cone Extraction
# dialog window of the given $coneWindow)
}
}
gui extract registerCallback "myFunc"
gui extract removeCallback
Remove a previously registered callback.
Usage:
gui extract removeCallback callback
Parameters:
callback
-
The first string of the previously registered callback script.
Example:
gui extract removeCallback "myFunc"
gui extract result
Get the result for the given row.
Usage:
gui extract result ?-window windowValue? row
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
row
-
Specify the row to be returned.
Example:
for {set row 0} {$row < [gui extract resultCount]} {incr row} {
set result [gui extract result $row]
}
gui extract resultCount
Get the number of displayed results in the Cone Extraction dialog.
Usage:
gui extract resultCount ?-row rowValue? ?-window windowValue?
Parameters:
-row rowValue (optional default is "")
-
If row is provided, the number of children of this path entry is returned. If no row is provided, the number of paths is returned.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
Example:
gui extract resultCount
gui extract resultCount -row 1
gui extract setData
Set data in the custom column in the given row. Already existing data will be overwritten.
Usage:
gui extract setData ?-child childValue? ?-column columnValue? ?-window windowValue? row data
Parameters:
-child childValue (optional default is "0")
-
Write to the specified child of the row. Child index 0 is the row itself, child index 1 is the first child of the row.
-column columnValue (optional default is "1")
-
Specify the column you want to write to. Column 0 represents the Result and can not be written to.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
data
-
Data to be written.
row
-
Specify the row to be written to.
Example:
set row 0
set data "some data"
gui extract setData $row $data
gui extract setData -child 1 -column 1 2 "second column, first child of row 1"
gui extract showDataColumn
Toggle the visibility of the data column. Nothing happens in case the desired visibility is already set.
Usage:
gui extract showDataColumn ?-column columnValue? ?-window windowValue? visibility
Parameters:
-column columnValue (optional default is "1")
-
Column index for the column to be changed. Index 0 is the result column.
-window windowValue (optional default is NULL)
-
Path or name of a Cone window, "DEFAULT" or "" for the default Cone window.
visibility
-
0/false → hide column. 1/true → show column.
Example:
# hide the data column with index 2
gui extract showDataColumn -column 2 0
# show the data column with index 1
gui extract showDataColumn 1
gui highlight
The tool maintains global highlight information, common to all windows like Schem, Cone, Source and Mem, via the Flat View API. There are up to 16 different color numbers available (each is associated to a foreground and background color) - the colors can be changed in the Preferences dialog.
gui highlight changed
Inform the GUI that the highlight information in the database has changed.
Usage:
gui highlight changed
Parameters:
No parameters.
Example:
set oidList1 {
{inst TOP U1}
}
set oidList2 {
{inst TOP U2 m1}
{inst TOP U2 m2}
}
set oidList3 {
{port TOP IN}
{net TOP IN}
}
gui window show "Cone"
gui cone append [concat $oidList1 $oidList2 $oidList3]
foreach oid $oidList1 {
$db hilight $oid set 0
}
foreach oid $oidList2 {
$db flathilight $oid set 1
}
foreach oid $oidList3 {
$db hilight $oid set 2
}
gui highlight changed
foreach oid $oidList1 {
$db highlight $oid delete
}
gui highlight changed
$db flathilight * deleteAll 1
gui highlight changed
$db hilight * deleteAll all
gui highlight changed
gui highlight greymode
Toggle "greymode" in the specified window.
Usage:
gui highlight greymode window
Parameters:
window
-
Path or name of a window of class Cone or Schem.
Example:
# Toggle greymode in the default Schem window.
set schem [::WindowManager::DefaultWindow Schem]
gui highlight greymode $schem
gui highlight registerChangedCallback
Register a customer specific callback that is called every time the
highlight in the GUI changes.
To remove a previously registered highlight changed callback use
gui highlight removeChangedCallback …
.
Usage:
gui highlight registerChangedCallback callback
Parameters:
callback
-
Name of the callback procedure.
Example:
proc myHighlightChangedHandler {} {
# Do something
}
gui highlight registerChangedCallback "myHighlightChangedHandler"
gui highlight removeChangedCallback
Remove a previously registered changed callback.
Usage:
gui highlight removeChangedCallback callback
Parameters:
callback
-
Name of the callback procedure.
Example:
gui highlight removeChangedCallback "myHighlightChangedHandler"
gui imageset
APIs to interact with image sets.
gui imageset check
Check if the given $name
refers to a proper image set.
Usage:
gui imageset check name
Parameters:
name
-
The image set’s name.
Example:
if {[gui imageset check "myImageSet"]} {
gui console print "'myImageSet' is a proper image set."
}
gui imageset delete
Delete an image set, i.e. remove all of its Tk images.
Usage:
gui imageset delete name
Parameters:
name
-
The image set’s name.
Example:
gui imageset delete "myImageSet"
gui imageset load
Load an image set, e.g. a collection of 5 images of sizes 16, 24, 32, 48,
and 64, that can be used in toolbars, etc.
The Tk images will be available as UserImage:$name-$size
, where $name
is
the image set’s name, and $size
is one of 16
, 24
, 32
, 48
, 64
.
Usage:
gui imageset load name pattern
Parameters:
name
-
The image set’s name.
pattern
-
The file name pattern. The literal string
SIZE
is replaced with the images sizes (16, 24, 32, 48, 64) when loading the corresponding image. When$pattern
is e.g.myPath/myImage-SIZE.png
, the imagesmyPath/myImage-16.png
,myPath/myImage-24.png
, etc. are loaded.
Example:
# Load "myPath/myImage-16.png", "myPath/myImage-24.png", ....
gui imageset load "myImageSet" "myPath/myImage-SIZE.png"
gui infobox
APIs to interact with the Infobox window.
gui infobox hideWindow
Hide the Infobox window.
Usage:
gui infobox hideWindow
Parameters:
Example:
gui infobox hideWindow
gui infobox showWindow
Show the Infobox window.
Usage:
gui infobox showWindow ?-oids oidsValue?
Parameters:
-oids oidsValue (optional default is "SELECTION")
-
Display these OIDs.
Example:
gui infobox showWindow
gui mem
APIs to interact with the Mem window.
gui mem append
Appends the objects (specified in $oidList) to the given Mem window.
Usage:
gui mem append ?-select? ?-window windowValue? oidList
Parameters:
-select (optional)
-
Select the newly added objects.
-window windowValue (optional default is NULL)
-
Path or name of a Mem window, "DEFAULT" or "" for the default Mem window.
oidList
-
List of objects to append.
Example:
set oidList {
{inst TOP U2 m1}
{inst TOP U2 m2}
{port TOP IN}
{net TOP OUT}
}
gui mem append -select $oidList
gui mem clear
Removes all objects from the given Mem window.
Usage:
gui mem clear ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Mem window, "DEFAULT" or "" for the default Mem window.
Example:
gui mem clear
gui mem contents
Returns all objects loaded to the given Mem window.
Usage:
gui mem contents ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Mem window, "DEFAULT" or "" for the default Mem window.
Example:
gui mem contents
gui mem selection
Returns all currently selected objects of the Mem window.
Usage:
gui mem selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Mem window, "DEFAULT" or "" for the default Mem window.
Example:
gui mem selection
gui menu
Extend the main menu.
gui menu checkbutton
Creates a new menu checkbutton. An existing checkbutton entry with the same name will be updated. Returns the menu ID of the checkbutton entry.
Usage:
gui menu checkbutton ?-position positionValue? path command variableName
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
command
-
The command to be executed if the menu is selected.
path
-
Path to the menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The main menu (the path’s first entry) and the sub-menus corresponding to the other individual path entries are created in case they are not existing. variableName
-
Name of a global variable storing the state of the checkbutton.
Example:
gui menu checkbutton {"Userware" "_Check 1"} "" checkState
gui menu clearSubmenu
Remove the content of the specified sub-menu.
Usage:
gui menu clearSubmenu path
Parameters:
path
-
Path to the sub-menu.
Example:
# Add a sub-menu
gui menu submenu {"Userware" "MySubMenu"}
gui menu command {"Userware" "MySubMenu" "A"} "gui console print A"
gui menu command {"Userware" "MySubMenu" "B"} "gui console print B"
# Remove the sub-menu's children
gui menu clearSubmenu {"Userware" "MySubMenu"}
# Remove the sub-menu
gui menu removeEntry {"Userware" "MySubMenu"}
gui menu command
Creates a new menu command. An existing command entry with the same name will be updated. Returns the menu ID of the command entry.
Usage:
gui menu command ?-position positionValue? path command
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
command
-
The command to be executed if the menu is selected.
path
-
Path to the menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The main menu (the path’s first entry) and the sub-menus corresponding to the other individual path entries are created in case they are not existing.
Example:
gui menu command {"Userware" "MyFunc_1"} "gui console print MyFunc1"
gui menu command {"Userware" "MyFunc_2"} "gui console print MyFunc2"
gui menu command {"Userware" "MyFunc_3"} "gui console print MyFunc3"
gui menu customizeEntry
Register a callback procedure to customize an existing menu entry. Returns the menu ID of the menu entry.
Usage:
gui menu customizeEntry path callback
Parameters:
callback
-
Name of the customization callback procedure.
path
-
Path to the menu entry.
Example:
proc _customizeOption {menuId} {
$menuId entryconfigure end -state disabled
}
gui menu customizeEntry {"Userware" "MySubMenu"} _customizeOption
gui menu exists
Check if the menu with the given path exists.
Usage:
gui menu exists path
Parameters:
path
-
Path to the menu entry.
Example:
if {![gui menu exists {"Userware"}]} {
##
# Create the menu.
#
}
gui menu getCommand
Returns the command and arguments which is called for the menu entry.
Usage:
gui menu getCommand path
Parameters:
path
-
Path to the menu entry.
Example:
gui menu command {"Userware" "MySubMenu" "A"} "gui console print A"
gui menu getCommand {"Userware" "MySubMenu" "A"}
gui menu getPosition
Returns a list with two entries. The first entry is the position of the menu in its sub-menu. The second entry is true if and only if the position is fixed to the end.
Usage:
gui menu getPosition path
Parameters:
path
-
Path to the menu entry.
Example:
gui menu getPosition {"Userware" "MySubMenu" "A"}
gui menu mainMenu
Creates a new menu button including the pull down menu in the main menu. Returns the menu ID of the main menu entry. If a menu button with this name already exists this command will initialize it again at the given position.
Usage:
gui menu mainMenu ?-position positionValue? name
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the menu label in the main menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' items are always right of all other menu items.
name
-
Text displayed as the menu’s label. If an underscore (
_
) is part of the name, the character immediately following the underscore is used as the menu’s hotkey. If no underscore character is part of the name the first suitable character will be used.
Example:
gui menu mainMenu "_Userware"
gui menu moveEntry
Move a menu entry to a different position. The entry is removed from the menu and then inserted at the position. The new position is determined after the removal.
Usage:
gui menu moveEntry ?-position positionValue? path
Parameters:
-position positionValue (optional default is "end")
-
Specify the new position of the entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
path
-
Path to the menu entry to be moved.
Example:
gui menu moveEntry {"Userware" "MyFunc2"} -position 0
gui menu moveEntry {"Userware" "MyFunc2"} -position fixed-end
gui menu radiobutton
Creates a new menu radiobutton. An existing radiobutton entry with the same name will be updated. Returns the menu ID of the radiobutton entry.
Usage:
gui menu radiobutton ?-position positionValue? path command variableName variableValue
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
command
-
The command to be executed if the menu is selected.
path
-
Path to the menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The main menu (the path’s first entry) and the sub-menus corresponding to the other individual path entries are created in case they are not existing. variableName
-
Name of a global variable storing the state of the radiobutton.
variableValue
-
Value to store in the variable associated with the radiobutton.
Example:
gui menu radiobutton {"Userware" "Option _1"} "" radioValue option1
gui menu radiobutton {"Userware" "Option _2"} "" radioValue option2
gui menu removeEntry
Remove a menu entry.
Usage:
gui menu removeEntry path
Parameters:
path
-
Path to the menu entry to be removed.
Example:
gui menu removeEntry {"Userware" "MyFunc1"}
gui menu removeEntry {"Userware" "MyFunc2"}
gui menu removeEntry {"Userware"}
gui menu removeSeparator
Remove a menu separator identified by the menu and separator ID.
Usage:
gui menu removeSeparator path sepId
Parameters:
path
-
Path to the menu containing the separator.
sepId
-
Unique ID to identify the separator.
Example:
gui menu command {"Userware" "Function 1"} "gui console print Function1"
gui menu separator {"Userware"} -sepId "mySep1"
gui menu command {"Userware" "Function 2"} "gui console print Function2"
gui menu removeSeparator {"Userware"} "mySep1"
gui menu separator
Creates a new menu separator. An existing separator with the same ID will be updated. The separator ID is returned.
Usage:
gui menu separator ?-position positionValue? ?-sepId sepIdValue? path
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
-sepId sepIdValue (optional default is NULL)
-
Unique ID to be able to identify the separator.
path
-
Path to the menu entry. The separator is added after the last entry of the given menu. The main menu (the path’s first entry) and the sub-menus corresponding to the other individual path entries are created in case they are not existing.
Example:
gui menu separator {"Userware"}
gui menu separatorIdAfter
Return the ID of the menu separator directly following the menu item indicated by $path; if no such separator exists, return an empty string.
Usage:
gui menu separatorIdAfter path
Parameters:
path
-
Path to the menu entry immediately before the menu separator in question.
Example:
gui menu command {"Userware" "Before"} "gui console print Before"
gui menu separator {"Userware"}
gui menu separatorIdAfter {"Userware" "Before"}
gui menu submenu
Creates a new sub-menu. An existing sub-menu entry with the same name will be updated. Returns the menu ID of the sub-menu entry.
Usage:
gui menu submenu ?-position positionValue? path
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
path
-
Path to the menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The main menu (the path’s first entry) and the sub-menus corresponding to the other individual path entries are created in case they are not existing.
Example:
gui menu submenu {"Userware" "Sub_Menu"}
gui messages
APIs to interact with the Messages window.
gui messages hideWindow
Hide the Messages window.
Usage:
gui messages hideWindow
Parameters:
Example:
gui messages hideWindow
gui messages showWindow
Show the Messages window.
Usage:
gui messages showWindow
Parameters:
Example:
gui messages showWindow
gui nlview
APIs to interact with an Nlview widget.
gui nlview getBoundingBox
Returns the combined bounding box (left, top, right, bottom coordinates) of the given $oids in the Nlview widget referenced by $nlview. If the bounding box cannot be determined, an empty list is returned.
Usage:
gui nlview getBoundingBox nlview oids
Parameters:
nlview
-
Nlview widget path.
oids
-
List of objects.
Example:
set oid1 {inst TOP INST1}
set oid2 {inst TOP INST1}
set nlview [gui schem nlv]
set bbox [gui nlview getBoundingBox $nlview [list $oid1 $oid2]]
lassign $bbox left top right bottom
gui console print "Combined bounding box of $oid1 and $oid2:"
gui console print "left=$left"
gui console print "top=$top"
gui console print "right=$right"
gui console print "bottom=$bottom"
gui nlview getOrientation
Returns the orientation of the instance referenced by $inst_oid in the Nlview widget referenced by $nlview.
Usage:
gui nlview getOrientation nlview inst_oid
Parameters:
inst_oid
-
OID of the instance.
nlview
-
Nlview widget path.
Example:
set oid [$db search inst [$db get_top_design] "instanceName"]
set nlview [gui schem nlv]
set orientation [gui nlview getOrientation $nlview $oid]
gui console print "Orientation of $oid: $orientation"
gui nlview getSymbol
Get the DEF-style symbol string for the given instance.
Usage:
gui nlview getSymbol instance_oid
Parameters:
instance_oid
-
OID of the instance.
Example:
set instance [$db search inst [$db get_top_design] "instanceName"]
set symbol [gui nlview getSymbol $instance]
gui console print "The DEF-style symbol of '$instance' is '$symbol'."
gui nlview isDisplayed
Returns "true" if the object referenced by $oid is currently visible in the Nlview widget referenced by $nlview.
Usage:
gui nlview isDisplayed nlview oid
Parameters:
nlview
-
Nlview widget path.
oid
-
OID of the object to check.
Example:
set oid [$db search inst [$db get_top_design] "instanceName"]
set nlview [gui schem nlv]
if {[gui nlview isDisplayed $nlview $oid]} {
gui console print "$oid is displayed in the default Schem window."
}
gui nlview logFile
Open a log file for the given Nlview widget. If the 'fname' parameter is missing, close the current log file.
Usage:
gui nlview logFile nlview ?fname?
Parameters:
fname (optional)
-
File name of the log file. If this parameter is missing, the current log file is closed.
nlview
-
Nlview widget path.
Example:
set fname "nlview-[pid].log"
set nlview [gui schem nlv]
# open a log file
gui nlview logFile $nlview $fname
# do something with the Schem window
# close the current log file
gui nlview logFile $nlview
gui nlview move
Move the instances in $instance_oids
horizontally relative to the
reference instance $reference_inst_oid
in the Nlview widget $nlview
.
If $direction
is left
, move the instances to the left of the reference,
if it is right
move them to the right, if it is same
move the
instances to the same column as the reference.
All instances must be in the same hierarchy level.
Usage:
gui nlview move nlview reference_inst_oid direction instance_oids
Parameters:
direction
-
Move direction:
left
,right
, orsame
. instance_oids
-
List of instances OIDs to move.
nlview
-
Nlview widget path.
reference_inst_oid
-
OID of the reference instance.
Example:
set reference {inst TOP I1}
set instances {{inst TOP I2} {inst TOP I3}}
set nlview [gui schem nlv]
##
# Move $instances to the left of $reference.
#
gui nlview move $nlview $reference "left" $instances
gui parasitic
APIs to interact with the Parasitic window.
gui parasitic append
Append the parasitic model for the given signal, net or parasitic OID(s).
Usage:
gui parasitic append ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
oidList
-
List of objects to append to the Parasitic window.
Example:
set signalList {{module IN IN} {module OUT OUT}}
gui parasitic append $signalList
gui parasitic clear
Delete all objects from the Parasitic window.
Usage:
gui parasitic clear ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
Example:
gui parasitic clear
gui parasitic hideWindow
Hide the default Parasitic window.
Usage:
gui parasitic hideWindow
Parameters:
Example:
gui parasitic hideWindow
gui parasitic load
Load the parasitic model for the given signal, net or parasitic OID(s).
Usage:
gui parasitic load ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
oidList
-
List of objects to load into the Parasitic window.
Example:
set signalList {{module IN IN} {module OUT OUT}}
gui parasitic load $signalList
gui parasitic nlv
Get the path of the Nlview widget.
Usage:
gui parasitic nlv ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
Example:
gui parasitic nlv
gui parasitic regenerate
Regenerate the displayed schematic of the given Parasitic window.
Usage:
gui parasitic regenerate ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
Example:
gui parasitic regenerate
gui parasitic registerZoomChangedCallback
Register a callback that is evaluated every time current zoom factor has changed. Before evaluating the callback, the Parasitic window identifier and the current zoom factor value are appended. The current zoom factor may also be empty.
Usage:
gui parasitic registerZoomChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc myZoomChanged {w zoomFactor} {
gui console print "Parasitic window $w: the new zoom factor is $zoomFactor"
}
# add callback
gui parasitic registerZoomChangedCallback myZoomChanged
# remove callback
gui parasitic removeZoomChangedCallback myZoomChanged
gui parasitic removeZoomChangedCallback
Remove the callback previously registered with
gui parasitic registerZoomChangedCallback …
.
Usage:
gui parasitic removeZoomChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc myZoomChanged {w zoomFactor} {
gui console print "Parasitic window $w: the new zoom factor is $zoomFactor"
}
# add callback
gui parasitic registerZoomChangedCallback myZoomChanged
# remove callback
gui parasitic removeZoomChangedCallback myZoomChanged
gui parasitic saveAs
Save the contents of the displayed RC network in the Parasitic window as a Spice, DSPF or SPEF file.
Usage:
gui parasitic saveAs ?-window windowValue? what filename
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
filename
-
Specifies the created output filename.
what
-
This can be "Spice", "DSPF" or "SPEF".
Example:
gui parasitic saveAs "Spice" "parasitic.sp"
gui parasitic selection
Returns all currently selected objects of the Parasitic window.
Usage:
gui parasitic selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
Example:
gui parasitic selection
gui parasitic show
Show the RC network of the given signal or net OID(s).
Usage:
gui parasitic show ?-append? ?-window windowValue? signalList
Parameters:
-append (optional)
-
Append the given signals.
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
signalList
-
List of signals to load into the Parasitic window.
Example:
set signalList {{module IN IN} {module OUT OUT}}
gui parasitic show $signalList
gui parasitic showWindow
Show the default Parasitic window.
Usage:
gui parasitic showWindow
Parameters:
Example:
gui parasitic showWindow
gui parasitic zoom
Changes the zoom factor of the Parasitic window.
Usage:
gui parasitic zoom ?-window windowValue? factor
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Parasitic window, "DEFAULT" or "" for the default Parasitic window.
factor
-
The argument $factor must be "fullfit" or a number ("fullfit" only works if that window is currently visible).
Example:
gui window show "Parasitic"
gui parasitic zoom "fullfit"
gui parser
APIs to interact with the Parser.
gui parser getArgs
Get a list of command line arguments that can be used to start the given parser directly.
Usage:
gui parser getArgs type
Parameters:
type
-
The parser type.
Example:
set parser_args [gui parser getArgs Spice]
gui parser setArgs
Set the command line arguments used to invoke the given parser.
Usage:
gui parser setArgs type parserArgs
Parameters:
parserArgs
-
The parser Args.
type
-
The parser type.
Example:
set parser_args [gui parser setArgs Spice {-breakOnErr on}]
gui parser showReadDialog
Show the dialog for the given file type.
Usage:
gui parser showReadDialog type
Parameters:
type
-
The type of the read dialog to display. Depending on the available license this can be "verilog", "edif", "rtl", "spice", "binfile" or "wave".
Example:
# open the binfile read dialog
gui parser showReadDialog binfile
gui plugin
APIs to create Userware plugins.
gui plugin addConfig
Add the configuration option $name of the plugin identified by $namespace with the specified $type, $defaultValue and $doc string.
Usage:
gui plugin addConfig namespace name defaultValue type doc
Parameters:
defaultValue
-
The option’s default value.
doc
-
The documentation string to show in the GUI.
name
-
The name of the configuration option.
namespace
-
The plugin identifier.
type
-
The option’s type (text, bool, number).
Example:
gui plugin addConfig MyPlugin greeting "Hello world!" text "Welcome message"
gui plugin check
Returns true if the current script is loaded from the Plugins dialog, in contrast to being loaded as a plain userware script.
Usage:
gui plugin check
Parameters:
No parameters.
Example:
if {[gui plugin check]} {
# The script is loaded from the Plugins dialog.
} else {
# The script is loaded as an Userware script.
}
gui plugin getConfigValue
Retrieve the current value of the configuration option $name of the plugin identified by $namespace.
Usage:
gui plugin getConfigValue namespace name
Parameters:
name
-
The name of the configuration option.
namespace
-
The plugin identifier.
Example:
set value [gui plugin getConfigValue MyPlugin greeting]
gui plugin registerQuitCallback
Register a callback that is called when the application is about to quit. Multiple callbacks can be registered.
Usage:
gui plugin registerQuitCallback callback
Parameters:
callback
-
Callback script.
Example:
proc my_callback {} {
gui console print "The application will quit now!"
}
##
# Register the callback.
#
gui plugin registerQuitCallback my_callback
gui plugin removeQuitCallback
Remove the previously registered quit callback.
Usage:
gui plugin removeQuitCallback callback
Parameters:
callback
-
Callback script.
Example:
##
# Remove the previously registered callback.
#
gui plugin removeQuitCallback my_callback
gui popup
Extend the popup menu.
gui popup append
Extend the popup menu. The new entry is added at the bottom of the popup
menu.
The popup menu entry is only enabled if one or more objects are
selected, otherwise the entry is disabled.
A custom callback procedure registered by gui popup customize
can be
used to always enable the popup menu entry.
This is a legacy command. Use 'gui popup command …' instead.
Usage:
gui popup append ?-menuname menunameValue? label command ?only?
Parameters:
-menuname menunameValue (optional default is "Userware")
-
Name of the created menu entry.
command
-
If the menu entry is invoked then this $command is executed. The list of selected OIDs is appended to $command.
label
-
Label to display in the sub-menu.
only (optional)
-
Only show the Popup menu in the specified window. Supported values are:
-class <WindowClass>
or-name <WindowName>
.
Example:
proc Userware:CustomCmd {oidList} {
# Do something with $oidList
}
gui popup append "Custom Cmd" Userware:CustomCmd
gui popup checkbutton
Creates a new menu checkbutton. By default the command is affecting all popup menus for all clients. An existing checkbutton entry with the same name will be updated.
Usage:
gui popup checkbutton ?-position positionValue? path command variableName ?only?
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
command
-
The command to be executed if the menu is selected.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The path’s first entry and the sub-menus corresponding to the other individual path entries are created in case they are not existing. variableName
-
Name of a global variable storing the state of the checkbutton.
Example:
gui popup checkbutton {"Userware" "_Check 1"} "" checkState
gui popup clearSubmenu
Remove the content of the specified sub-menu. By default the command is affecting all popup menus for all clients.
Usage:
gui popup clearSubmenu path ?only?
Parameters:
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the sub-menu.
Example:
proc MyFunc {args} {
# Do something
}
# Add a sub-menu
gui popup submenu {"Userware" "MySubMenu"}
gui popup command {"Userware" "MySubMenu" "A"} "MyFunc A"
gui popup command {"Userware" "MySubMenu" "B"} "MyFunc B"
# Remove the sub-menu's children
gui popup clearSubmenu {"Userware" "MySubMenu"}
# Remove the sub-menu
gui popup removeEntry {"Userware" "MySubMenu"}
gui popup command
Creates a new menu command. By default the command is affecting all popup menus for all clients. An existing command entry with the same name will be updated.
Usage:
gui popup command ?-position positionValue? path command ?only?
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
command
-
The command to be executed if the menu is selected.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The path’s first entry and the sub-menus corresponding to the other individual path entries are created in case they are not existing.
Example:
proc MyFunc {number args} {
gui console print "MyFunc $number: $args"
}
gui popup command {"Userware" "MyFunc1"} "MyFunc 1"
gui popup command {"Userware" "MyFunc2"} "MyFunc 2"
gui popup command {"Userware" "MyFunc3"} "MyFunc 3"
gui popup customize
Every time the popup menu is created (click the right mouse button) all registered callbacks are evaluated.
Usage:
gui popup customize callback
Parameters:
callback
-
Name of the callback procedure. The name of the popup menu as well as the list of selected OIDs is appended to the callback.
Example:
proc Userware:CustomPopupCmd {menu oidList} {
foreach oid $oidList {
$menu add command -label $oid
}
}
gui popup customize Userware:CustomPopupCmd
gui popup customizeEntry
Register a callback procedure to customize an existing menu entry. Returns the menu ID of the menu entry.
Usage:
gui popup customizeEntry path callback ?only?
Parameters:
callback
-
Name of the customization callback procedure.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry.
Example:
proc _customizeOption {menuId} {
$menuId entryconfigure end -state disabled
}
gui popup customizeEntry {"Userware" "MySubMenu"} _customizeOption
gui popup exists
Check if the menu with the given path exists.
Usage:
gui popup exists path ?only?
Parameters:
only (optional)
-
Only call the callback for the specified window. Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry.
Example:
if {![gui popup exists {"Userware"} "-name Schem"]} {
##
# Create the menu.
#
}
gui popup getCommand
Returns a list containing one sub-list for each command matching the arguments. Each sub-list has two entries with the first entry being the client and the second entry being the command and arguments.
Usage:
gui popup getCommand path ?only?
Parameters:
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry.
Example:
proc MyFunc {args} {
# Do something
}
gui popup command {"Userware" "MySubMenu" "A"} "MyFunc"
gui popup getCommand {"Userware" "MySubMenu" "A"}
gui popup getPosition
Returns a list containing one sub-list for each entry matching the arguments. Each sub-list has two entries with the first entry being the client and the second entry being a list with the result. The first entry of the result is the position of the specified menu in its sub-menu. The second entry of the result is true if and only if the position is fixed to the end.
Usage:
gui popup getPosition path ?only?
Parameters:
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry.
Example:
gui popup getPosition {"Userware" "MySubMenu" "A"}
gui popup moveEntry
Move a menu entry to a different position. The entry is removed from the menu and then inserted at the position. The new position is determined after the removal. By default the command is affecting all popup menus for all clients.
Usage:
gui popup moveEntry ?-position positionValue? path ?only?
Parameters:
-position positionValue (optional default is "end")
-
Specify the new position of the entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry to be moved.
Example:
gui popup moveEntry {"Userware" "MyFunc2"} -position 0
gui popup moveEntry {"Userware" "MyFunc2"} -position fixed-end
gui popup radiobutton
Creates a new menu radiobutton. By default the command is affecting all popup menus for all clients. An existing radiobutton entry with the same name will be updated.
Usage:
gui popup radiobutton ?-position positionValue? path command variableName variableValue ?only?
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
command
-
The command to be executed if the menu is selected.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The path’s first entry and the sub-menus corresponding to the other individual path entries are created in case they are not existing. variableName
-
Name of a global variable storing the state of the radiobutton.
variableValue
-
Value to store in the variable associated with the radiobutton.
Example:
proc MyFunc {args} {
# Do something
}
gui popup radiobutton {"Userware" "Option 1"} "" radioValue option1
gui popup radiobutton {"Userware" "Option 2"} "" radioValue option2
gui popup remove
Remove an entry added by the GUI API with 'gui popup append' from the Popup menu. This is a legacy command. Use 'gui popup command …' instead.
Usage:
gui popup remove ?-menuname menunameValue? label
Parameters:
-menuname menunameValue (optional default is "Userware")
-
Name of the sub-menu entry.
label
-
Label of the entry to be removed.
Example:
gui popup remove "Custom Cmd"
gui popup removeCustomize
Remove a registered Popup customization callback.
Usage:
gui popup removeCustomize callback
Parameters:
callback
-
Name of the callback procedure.
Example:
gui popup removeCustomize Userware:CustomPopupCmd
gui popup removeEntry
Remove a popup menu entry. By default the command is affecting all popup menus for all clients.
Usage:
gui popup removeEntry path ?only?
Parameters:
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry to be removed.
Example:
gui popup removeEntry {"Userware" "MyFunc1"}
gui popup removeEntry {"Userware" "MyFunc2"}
gui popup removeEntry {"Userware"}
gui popup reset
Removes all custom popup menu entries.
Usage:
gui popup reset
Parameters:
No parameters.
Example:
gui popup reset
gui popup separator
Creates a new menu separator. An existing separator with the same ID will be updated. Returns a list containing one sub-list for each created separator. Each sub-list has two entries with the first entry being the client and the second entry being the sepId.
Usage:
gui popup separator ?-position positionValue? ?-sepId sepIdValue? path ?only?
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
-sepId sepIdValue (optional default is NULL)
-
Unique ID to be able to identify the separator.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry. The separator is added after the last entry of the given menu or the given position. The path’s first entry and the sub-menus corresponding to the other individual path entries are created in case they are not existing.
Example:
gui popup separator {"Userware"}
gui popup separatorIdAfter
Returns a list containing one sub-list for each matching separator. Each sub-list has two entries with the first entry being the client and the second entry being the sepId.
Usage:
gui popup separatorIdAfter path ?only?
Parameters:
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry immediately before the menu separator in question.
Example:
proc MyFunc {args} {
# Do something
}
gui popup command {"Userware" "Before"} "MyFunc"
gui popup separator {"Userware"}
gui popup separatorIdAfter {"Userware" "Before"}
gui popup submenu
Creates a new sub-menu. By default the command is affecting all popup menus for all clients. An existing sub-menu entry with the same name will be updated.
Usage:
gui popup submenu ?-position positionValue? path ?only?
Parameters:
-position positionValue (optional default is "end")
-
Specify the position of the new entry in the menu; must be an integer, 'end' or 'fixed-end'. 'fixed-end' entries are always below of all other menu entries.
only (optional)
-
Only execute the command for the specified window(s). Supported values are:
-class <WindowClass>
,-name <WindowName>
or-client <WindowClient>
. path
-
Path to the popup menu entry. The last entry is displayed as the menu label. If an underscore (
_
) is part of the last entry, the character immediately following the underscore is used as a menu item’s hotkey. The path’s first entry and the sub-menus corresponding to the other individual path entries are created in case they are not existing.
Example:
gui popup submenu {"Userware" "SubMenu"}
gui schem
APIs to interact with the Schem window.
gui schem clearCache
Clear the Schem window’s cache. If neither '-window …' nor '-all' are specified, operate on the default Schem window.
Usage:
gui schem clearCache ?-all? ?-clearCurrentModule? ?-removeAttribute? ?-window windowValue?
Parameters:
-all (optional)
-
Operate on all Schem windows.
-clearCurrentModule (optional)
-
Clear the current module.
-removeAttribute (optional)
-
Also remove the database schematic cache.
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
##
# Clear the caches of all Schem windows.
#
gui schem clearCache -all
##
# Clear the cache of the window named "Schem".
#
gui schem clearCache -window "Schem"
gui schem contents
Returns all objects loaded to the given Schem window.
Usage:
gui schem contents ?-type typeValue? ?-window windowValue?
Parameters:
-type typeValue (optional default is "*")
-
If this parameter is given, the the result is filtered by the given type.
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
gui schem contents
gui schem customFoldAction
Register a custom procedure for the fold button.
Usage:
gui schem customFoldAction ?-window windowValue? callback
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
callback
-
Name of the callback procedure.
Example:
proc myFoldProc {inst} {
# Do something with the instance to fold.
}
gui schem customFoldAction "myFoldProc"
gui schem customUnfoldAction
Register a custom procedure for the unfold button.
Usage:
gui schem customUnfoldAction ?-window windowValue? callback
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
callback
-
Name of the callback procedure.
Example:
proc myUnfoldProc {inst} {
# Do something with the instance to unfold.
}
gui schem customUnfoldAction "myUnfoldProc"
gui schem fold
Fold the given modules in the Schem window.
Usage:
gui schem fold ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
oidList
-
List of objects to fold.
Example:
set oidList [gui schem contents]
gui schem fold $oidList
gui schem getCurrentModule
Get the OID of the module displayed in the Schem window.
Usage:
gui schem getCurrentModule ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
set mod [gui schem getCurrentModule]
gui schem isFolded
Check if the fold flag is set at a module.
Usage:
gui schem isFolded ?-window windowValue? oid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
oid
-
Module OID to check.
Example:
set oidList [gui schem contents]
gui schem isFolded [lindex $oidList 0]
gui schem nlv
Get the path of the Nlview widget.
Usage:
gui schem nlv ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
gui schem nlv
gui schem pages
Get the number of schematic pages displayed in the Schem window.
Usage:
gui schem pages ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
gui schem pages
gui schem regenerate
Regenerate the displayed schematic of the given Schem window.
Usage:
gui schem regenerate ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
gui schem regenerate
gui schem registerChangedCallback
Register a callback that is called after the contents of a Schem window have change. The Schem window’s path is appended to the callback.
Usage:
gui schem registerChangedCallback callback
Parameters:
callback
-
The callback script.
Example:
proc my_callback {w} {
gui console print "The Schem window has changed: $w"
}
gui schem registerChangedCallback my_callback
gui schem registerZoomChangedCallback
Register a callback that is evaluated every time current zoom factor has changed. Before evaluating the callback, the Schem window identifier and the current zoom factor value are appended. The current zoom factor may also be empty.
Usage:
gui schem registerZoomChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc myZoomChanged {w zoomFactor} {
gui console print "Schem window $w: the new zoom factor is $zoomFactor"
}
# add callback
gui schem registerZoomChangedCallback myZoomChanged
# remove callback
gui schem removeZoomChangedCallback myZoomChanged
gui schem removeChangedCallback
Remove the previously registered callback script.
Usage:
gui schem removeChangedCallback callback
Parameters:
callback
-
The callback script.
Example:
gui schem removeChangedCallback my_callback
gui schem removeZoomChangedCallback
Remove the callback previously registered with
gui schem registerZoomChangedCallback …
.
Usage:
gui schem removeZoomChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc myZoomChanged {w zoomFactor} {
gui console print "Schem window $w: the new zoom factor is $zoomFactor"
}
# add callback
gui schem registerZoomChangedCallback myZoomChanged
# remove callback
gui schem removeZoomChangedCallback myZoomChanged
gui schem selection
Returns all currently selected objects of the Schem window.
Usage:
gui schem selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
Example:
gui schem selection
gui schem setCurrentModule
Set this module as the current module in the Schem window. The schematic for the module is generated. The return value indicates if setting the current module was successful. An error is thrown, if $oid is not a module OID.
Usage:
gui schem setCurrentModule ?-activate? ?-window windowValue? moduleOid
Parameters:
-activate (optional)
-
If the option is present, then the Schem window tab is activated.
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
moduleOid
-
Module type OID to be set as the current module.
Example:
set oid {module TOP TOP}
gui schem setCurrentModule $oid
gui schem unfold
Unfold the given modules in the Schem window.
Usage:
gui schem unfold ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
oidList
-
List of objects to unfold.
Example:
set oidList [gui schem contents]
gui schem unfold $oidList
gui schem zoom
Changes the zoom factor of the Schem window.
Usage:
gui schem zoom ?-window windowValue? factor
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Schem window, "DEFAULT" or "" for the default Schem window.
factor
-
The argument $factor must be "fullfit" or a number ("fullfit" only works if that window is currently visible).
Example:
gui window show "Schem"
gui schem zoom "fullfit"
gui search
APIs to interact with the Search window.
gui search hideWindow
Hide the Search window.
Usage:
gui search hideWindow
Parameters:
Example:
gui search hideWindow
gui search selection
Returns all currently selected objects of the Search window.
Usage:
gui search selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Search window, "DEFAULT" or "" for the default Search window.
Example:
gui search selection
gui search showWindow
Show the Search window.
Usage:
gui search showWindow
Parameters:
Example:
gui search showWindow
gui selection
Work with the global selection.
gui selection get
Returns the most recently selected list of objects across all windows.
Usage:
gui selection get
Parameters:
No parameters.
Example:
foreach oid [gui selection get] {
##
# Do something with each selected OID.
#
}
gui selection registerCallback
Register a customer specific callback that is called every time the
selection in the GUI changes.
The list of selected OIDs is appended to the callback before evaluating it.
To remove a previously registered "selection changed" callback use
gui selection removeCallback …
.
Usage:
gui selection registerCallback callback
Parameters:
callback
-
The callback script.
Example:
proc mySelectionHandler {oidList} {
##
# Selection changed to $oidList
#
}
gui selection registerCallback "mySelectionHandler"
gui selection removeCallback
Remove a previously registered callback.
Usage:
gui selection removeCallback callback
Parameters:
callback
-
The first string of the previously registered callback script.
Example:
gui selection removeCallback "mySelectionHandler"
gui settings
All GUI settings can be controlled by the settings API. A list of all variables can be found in the manual of the Preferences dialog.
gui settings addDialog
Add a custom tab to the Preferences dialog.
Usage:
gui settings addDialog name label callback
Parameters:
callback
-
Tab callback that is called at dialog creation time. The widget path of a ttk frame is passed to the callback.
label
-
The label displayed in the tab.
name
-
The unique name to identify the settings for this tab.
Example:
proc createCustomTab {w name} {
global checkValue textValue
set checkValue 1
set textValue "My Text"
ttk::checkbutton $w.check -text "My Option" -variable checkValue
ttk::entry $w.text -textvariable textValue
pack $w.check $w.text -side top
}
proc updateSettings {w} {
global checkValue textValue
# Do something with the values.
}
set w [gui settings addDialog "custom" "My Tab" "createCustomTab"]
gui settings registerChangedCallback [list updateSettings $w]
gui settings changed
Update the GUI after the settings have been modified.
Usage:
gui settings changed
Parameters:
No parameters.
Example:
##
# Display attributes in tooltips.
#
gui settings set "tooltipsWithAttrs" 1
##
# Autohide unconnected pins in the Cone window.
#
gui settings set "cone:autohide" 1
##
# Inform the GUI that the settings have been modified.
#
gui settings changed
gui settings get
Get the value of a global setting.
Usage:
gui settings get name
Parameters:
name
-
The name of the global setting.
Example:
set value [gui settings get "my_setting"]
gui settings load
Load the settings from a file.
Note: After loading settings from a file,
gui settings changed
must be called to inform the application about the
change.
Usage:
gui settings load filename scope
Parameters:
filename
-
File name.
scope
-
Scope to of the settings to load. Available scopes are workspace, project, history, volatile.
Example:
gui settings load "my-workspace.settings" "workspace"
gui settings changed
gui settings registerChangedCallback
Register a customer specific callback that is called every time the
settings have changed.
To remove a previously registered "settings changed" callback use
gui settings removeChangedCallback …
.
Usage:
gui settings registerChangedCallback callback
Parameters:
callback
-
The callback script.
Example:
proc my_callback {} {
##
# Settings have changed
#
}
gui settings registerChangedCallback "my_callback"
gui settings removeChangedCallback
Remove a previously registered callback.
Usage:
gui settings removeChangedCallback callback
Parameters:
callback
-
The first string of the previously registered callback script.
Example:
gui settings removeChangedCallback "my_callback"
gui settings removeDialog
Remove a custom tab from the Preferences dialog.
Usage:
gui settings removeDialog name
Parameters:
name
-
A unique name of the tab to remove.
Example:
gui settings removeDialog "custom"
gui settings reset
Reset all global settings matching the given name pattern to the built-in default value.
Usage:
gui settings reset ?-nameFilter nameFilterValue? scope
Parameters:
-nameFilter nameFilterValue (optional default is "*")
-
Add a glob style pattern to filter the setting names.
scope
-
Scope to reset settings to default. Available scopes are workspace, project, history, volatile.
Example:
gui settings reset workspace
gui settings save
Save the settings to a file.
Usage:
gui settings save filename scope
Parameters:
filename
-
File name.
scope
-
Scope to of the settings to save. Available scopes are workspace, project, history, volatile.
Example:
gui settings save "my-workspace.settings" "workspace"
gui settings set
Set a value of a global setting.
Usage:
gui settings set ?-type typeValue? name value
Parameters:
-type typeValue (optional default is "String")
-
The type of the setting value.
name
-
The name of the global setting.
value
-
The value to set to the global setting.
Example:
gui settings set "my_setting" 1
gui settings validate
Validate the value type of all settings.
Usage:
gui settings validate
Parameters:
No parameters.
Example:
gui settings validate
gui settings variable
Get the name of a variable for a global setting.
Usage:
gui settings variable name
Parameters:
name
-
The name of the global setting.
Example:
set variableName [gui settings variable "my_setting"]
gui source
APIs to interact with the Source window.
gui source displayFile
Display the contents of a file in the Source window.
Usage:
gui source displayFile ?-window windowValue? file lineno
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Source window, "DEFAULT" or "" for the default Source window.
file
-
Filename of the file to display.
lineno
-
Number of the line to show.
Example:
gui source displayFile "design.v" 1
gui source gotoLine
Goto a given line in a given file in the Source window.
Usage:
gui source gotoLine ?-window windowValue? file lineno
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Source window, "DEFAULT" or "" for the default Source window.
file
-
Filename of the source file.
lineno
-
Line number to goto.
Example:
gui source gotoLine "design.v" 1
gui source highlightLine
Highlight a line in the Source window. Each call to 'gui source highlightLine' will append the line highlight information.
Usage:
gui source highlightLine ?-clear? ?-dontShow? ?-window windowValue? file lineno
Parameters:
-clear (optional)
-
Clear the internal list of line highlights.
-dontShow (optional)
-
If this switch is set then the file will not be loaded and displayed at the given line number.
-window windowValue (optional default is NULL)
-
Path or name of a Source window, "DEFAULT" or "" for the default Source window.
file
-
Filename of the source file.
lineno
-
Line number to highlight.
Example:
gui source highlightLine "design.v" 100 -clear
gui source selection
Returns all currently selected objects of the Source window.
Usage:
gui source selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Source window, "DEFAULT" or "" for the default Source window.
Example:
gui source selection
gui source setActionbarDataCallback
Set the 'data' callback for the actionbar in all Source windows.
Usage:
gui source setActionbarDataCallback callback
Parameters:
callback
-
Callback to set. If this parameter is an empty string, the existing callback is removed.
Example:
proc myDataCallback {
db
oid
fileName
clickPosition
oidBeginPosition
oidEndPosition
} {
# "db": the current database
# "oid": the clicked OID
# "fileName": the current file name
# "clickPosition": the clicked position (byte index in the file)
# "oidBeginPosition": the first byte index of the clicked OID
# "oidEndPosition": the last byte index of the clicked OID
# Note: if any of the following keys are missing from the dict, the
# default functions are used to determine their values.
# => If an empty dict is returned, the ActionBar will have default
# behavior.
set data [dict create]
# "hide": bool
# if 1, the ActionBar is hidden immediately
dict set data "hide" 0
# "label": string
# the label that is displayed in the ActionBar's first row
dict set data "label" "Clicked OID: [$db oid print $oid]"
# "prev": empty or list<OID, string, number, number>
# the previous occurrence of $oid;
# empty or a list with
# - an OID,
# - a file-name,
# - a begin position,
# - an end position
# The value is used for the ActionBar's "prev" button.
dict set data "prev" {}
# "next": empty or list<OID, string, number, number>
# the next occurrence of $oid;
# empty or a list with
# - an OID,
# - a file-name,
# - a begin position,
# - an end position
# The value is used for the ActionBar's "next" button.
dict set data "prev" [list $oid "myfile.v" 123 140]
# "up": empty or OID
# the up-object of $oid (see "$db oid up ...")
# The value is used for the "up" button.
dict set data "up" {}
# "down": empty or OID
# the down-object of $oid (see "$db oid down ...")
# The value is used for the ActionBar's "down" button.
dict set data "down" {module MOD MOD}
# "instances": dict<string, OID>
# the instantiations of $oid; the dict's keys are displayed in
# insertion order in the ActionBar's "instances" combo box.
# The special key "[...]" may be used to indicate
# that there are additional instantiations that are not
# computed/displayed e.g. due to performance reasons.
dict set data "instances" [dict create "inst1" {inst TOP INST1} "inst2" {inst TOP INST2}]
# "selectedInstance": string
# the item initially selected in the ActionBar's "instances" combo box.
dict set data "selectedInstance" "inst1"
# "connections": dict<string, dict<string, list<OID, type>>>
# The connections of $oid, i.e. the connected pins.
# The outer dict is for wide, multi-bit connections; its keys are
# displayed in the ActionBar's "bit select" combo box. If there's just
# a single-bit connection, the outer dict must have exactly one key that
# must be the empty string.
# The inner dict is for the actual single-bit connections; its keys are
# displayed in the ActionBar's "pin select" combo box; its values are
# pairs of a pin/port OID and a type field which indicates if the
# pin connection is a driver (type="driver"), a load (type="load") or
# an ordinary connection (type="").
# The special key "[...]" may be used to indicate that there are
# additional connections that are not computed/displayed e.g. due to
# performance reasons.
# The driver pins (if there are any) are used for the ActionBar's
# "driver" button. The load pins are used for the ActionBar's
# "load" button.
set connections [dict create]
dict set connections "bit 0" "pin 0 (driver)" [list {port TOP clk} "driver"]
dict set connections "bit 0" "pin 1 (load)" [list {pin TOP INST1 clk} "load"]
dict set connections "bit 0" "pin 2 (other)" [list {pin TOP INST2 in} ""]
dict set connections "bit 0" "\[...\]" [list {} ""]
dict set connections "bit 1" "pin 0" [list {pin TOP INST2 o} ""]
dict set data "connections" $connections
# "selectedConnection": list<string, string>
# The items initially selected in the ActionBar's "select bit" and
# "select pin" combo boxes.
dict set data "selectedConnection" [list "bit 0" "pin 1 (load)"]
return $data
}
# set the data callback
gui source setActionbarDataCallback myDataCallback
# clear the data callback
gui source setActionbarDataCallback {}
gui tab
API to work with the tabbed pane.
gui tab getActive
Return the ID of the active window in the given tab window.
Usage:
gui tab getActive window
Parameters:
window
-
Path or name of a Tab window, or "DEFAULT" or "" for the default Tab window.
Example:
set tab [gui window defaultClassWindow Tab]
set active [gui tab getActive $tab]
gui tab getAvailableClasses
Return the list of window classes that can be created by the "+" button.
Usage:
gui tab getAvailableClasses ?-tabwindow tabwindowValue?
Parameters:
-tabwindow tabwindowValue (optional default is NULL)
-
Path or name of a Tab window, "DEFAULT" or "" for the default Tab window. If specified, set the available classes only in this Tab window.
Example:
set classes [gui tab getAvailableClasses]
gui tab hidePlusMenu
Hide the "+" menu in the given Tab window.
Usage:
gui tab hidePlusMenu window
Parameters:
window
-
Path or name of a Tab window, or "DEFAULT" or "" for the default Tab window.
Example:
set tab [gui window getTab "Schem"]
gui tab hidePlusMenu $tab
gui tab hideSplitControl
Hide the window split control buttons in the given Tab window.
Usage:
gui tab hideSplitControl window
Parameters:
window
-
Path or name of a Tab window, or "DEFAULT" or "" for the default Tab window.
Example:
set tab [gui window getTab "Schem"]
gui tab hideSplitControl $tab
gui tab isWindowContainer
Check if the given Tab window is a general container for windows (i.e. Schem, Cone, Source, …) windows can be added to it.
Usage:
gui tab isWindowContainer window
Parameters:
window
-
Path or name of a Tab window, or "DEFAULT" or "" for the default Tab window.
Example:
gui window foreach Tab w {
if {[gui tab isWindowContainer $w]} {
gui console print "$w is a window container"
} else {
gui console print "$w is NOT a window container"
}
}
gui tab setAvailableClasses
Set the list of window classes that can be created by the "+" button.
Usage:
gui tab setAvailableClasses ?-tabwindow tabwindowValue? classes
Parameters:
-tabwindow tabwindowValue (optional default is NULL)
-
Path or name of a Tab window, "DEFAULT" or "" for the default Tab window. If specified, set the available classes only in this Tab window.
classes
-
List of window classes.
Example:
set classes {Schem Cone Source}
gui tab setAvailableClasses $classes
gui tab showPlusMenu
Show the "+" menu in the given Tab window.
Usage:
gui tab showPlusMenu window
Parameters:
window
-
Path or name of a Tab window, or "DEFAULT" or "" for the default Tab window.
Example:
set tab [gui window getTab "Schem"]
gui tab showPlusMenu $tab
gui tab showSplitControl
Show the window split control buttons in the given Tab window.
Usage:
gui tab showSplitControl window
Parameters:
window
-
Path or name of a Tab window, or "DEFAULT" or "" for the default Tab window.
Example:
set tab [gui window getTab "Schem"]
gui tab showSplitControl $tab
gui toolbar
APIs to interact with the Toolbars.
gui toolbar addButton
Add a button to the toolbar of the specified window.
Usage:
gui toolbar addButton ?-command commandValue? ?-position positionValue? ?-tooltip tooltipValue? window name imageset
Parameters:
-command commandValue (optional default is NULL)
-
The command to execute when the button is clicked.
-position positionValue (optional default is "end")
-
The position in the toolbar. Some number or "end".
-tooltip tooltipValue (optional default is NULL)
-
The tooltip to display.
imageset
-
Name of the image set to be used as the button’s icon. Use
gui imageset load …
to load a suitable image set. name
-
The name of the toolbar button.
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
proc buttonAction {} {
##
# Do something...
#
}
# Load "myPath/myImage-16.png", "myPath/myImage-24.png", ....
gui imageset load "myImageSet" "myPath/myImage-SIZE.png"
gui toolbar addButton "" "myButton" "myImageSet" -command buttonAction -tooltip "this is my button"
gui toolbar addCheckButton
Add a checkable button to the toolbar of the specified window.
Usage:
gui toolbar addCheckButton ?-command commandValue? ?-position positionValue? ?-tooltip tooltipValue? window name imageset variable
Parameters:
-command commandValue (optional default is NULL)
-
The command to execute when the button is clicked.
-position positionValue (optional default is "end")
-
The position in the toolbar. Some number or "end".
-tooltip tooltipValue (optional default is NULL)
-
The tooltip to display.
imageset
-
Name of the image set to be used as the button’s icon. Use
gui imageset load …
to load a suitable image set. name
-
The name of the toolbar button.
variable
-
The variable holding the check button’s "checked" state.
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
proc checkButtonAction {} {
##
# Do something...
#
}
# Load "myPath/myImage-16.png", "myPath/myImage-24.png", ....
gui imageset load "myImageSet" "myPath/myImage-SIZE.png"
set checkButtonState 0
gui toolbar addCheckButton "" "myCheckButton" "myImageSet" "checkButtonState" -command checkButtonAction -tooltip "this is my check button"
gui toolbar addCustomWidget
Add a custom widget to the toolbar of the specified window.
Usage:
gui toolbar addCustomWidget ?-fill fillValue? ?-position positionValue? ?-tooltip tooltipValue? window name
Parameters:
-fill fillValue (optional default is NULL)
-
Stretch direction. "x", "y", "xy", or "".
-position positionValue (optional default is "end")
-
The position in the toolbar. Some number or "end".
-tooltip tooltipValue (optional default is NULL)
-
The tooltip to display.
name
-
The widget to add. There must exist a widget $toolbar.$name where $toolbar is the widget path for the toolbar (see 'gui toolbar getPath …').
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
set toolbar [gui toolbar getPath ""]
ttk::label $toolbar.customWidget -text "my label"
gui toolbar addCustomWidget "" "customWidget" -tooltip "this is my label"
gui toolbar addSeparator
Add a separator (vertical line) to the toolbar of the specified window.
Usage:
gui toolbar addSeparator ?-position positionValue? window name
Parameters:
-position positionValue (optional default is "end")
-
The position in the toolbar. Some number or "end".
name
-
The name of the separator to add.
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
gui toolbar addSeparator "" "mySeparator"
gui toolbar addSpacer
Add a spacer to the toolbar of the specified window. A spacer pushes the following toolbar items to the right and takes all the remaining horizontal space.
Usage:
gui toolbar addSpacer ?-position positionValue? window name
Parameters:
-position positionValue (optional default is "end")
-
The position in the toolbar. Some number or "end".
name
-
The name of the spacer to add.
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
gui toolbar addSpacer "" "mySpacer"
gui toolbar addTextButton
Add a text button to the toolbar of the specified window.
Usage:
gui toolbar addTextButton ?-command commandValue? ?-position positionValue? ?-tooltip tooltipValue? ?-width widthValue? window name text
Parameters:
-command commandValue (optional default is NULL)
-
The command to execute when the button is clicked.
-position positionValue (optional default is "end")
-
The position in the toolbar. Some number or "end".
-tooltip tooltipValue (optional default is NULL)
-
The tooltip to display.
-width widthValue (optional default is NULL)
-
The width of the button (in characters).
name
-
The name of the toolbar button.
text
-
The text to display in the toolbar button.
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
proc textButtonAction {} {
##
# Do something...
#
}
gui toolbar addTextButton "" "myTextButton" "Text" -command textButtonAction -tooltip "this is my text button"
gui toolbar children
Get the names of all children of the toolbar of the specified window.
Usage:
gui toolbar children window
Parameters:
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
# Get the list of all children of the main toolbar.
set children [gui toolbar children ""]
gui toolbar getPath
Determine the path of the toolbar widget of the specified window.
Usage:
gui toolbar getPath window
Parameters:
window
-
Path or name of a window. Use
""
or"."
in order to get the path of the main window’s toolbar.
Example:
set mainToolbar [gui toolbar getPath ""]
set schemToolbar [gui toolbar getPath "Schem"]
gui toolbar remove
Remove an item from the toolbar of the specified window.
Usage:
gui toolbar remove window name
Parameters:
name
-
The toolbar item’s name.
window
-
Path or name of a window. Use
""
or"."
in order to modify the main window’s toolbar.
Example:
gui toolbar remove "" "mySpacer"
gui tooltip
Interact with the tooltips.
gui tooltip registerCallback
Register a callback to get additional information to be displayed in the tooltip for an object. The registered callback procedure is called with two additional arguments, the selected object and the name of a variable to customize the tooltip type. Supported types are 'help' or 'simple'. If the type is not set, then the default tooltip type is created.
Usage:
gui tooltip registerCallback callback
Parameters:
callback
-
The callback script.
Example:
proc getMyTooltip {oid tooltipTypeVarname} {
upvar 1 $tooltipTypeVarname tooltipType
set tooltipType "simple"
return "This is my tooltip text for $oid."
}
gui tooltip registerCallback "getMyTooltip"
gui tooltip removeCallback
Remove a previously registered callback to get additional tooltip text.
Usage:
gui tooltip removeCallback
Parameters:
No parameters.
Example:
gui tooltip removeCallback
gui tree
APIs to interact with the Tree window.
gui tree getCurrentModule
Get the OID of the current/active module of the Tree window.
Usage:
gui tree getCurrentModule ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Tree window, "DEFAULT" or "" for the default Tree window.
Example:
set top {module top top}
set mod {module top i submodule}
gui tree setCurrentModule $mod
set oid [gui tree getCurrentModule] ;# => {module top i submodule}
gui tree setCurrentModule $top
set oid [gui tree getCurrentModule] ;# => {module top top}
gui tree selection
Returns all currently selected objects of the Tree window.
Usage:
gui tree selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Tree window, "DEFAULT" or "" for the default Tree window.
Example:
gui tree selection
gui tree setCurrentModule
Set this module as the current/active module in the Tree window.
Usage:
gui tree setCurrentModule ?-window windowValue? moduleOid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Tree window, "DEFAULT" or "" for the default Tree window.
moduleOid
-
Module type OID to be set as the current module.
Example:
gui tree setCurrentModule {module top i submodule}
gui tree setTopModule
THIS COMMAND IS OBSOLETE!
Usage:
gui tree setTopModule ?-window windowValue? moduleOid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Tree window, "DEFAULT" or "" for the default Tree window.
moduleOid
-
Module type OID to be set as the top module.
Example:
catch {gui tree setTopModule {}}
gui wave
APIs to interact with the Wave window.
gui wave addAlias
Add wave alias, create scopes if needed.
Usage:
gui wave addAlias ?-window windowValue? sigOid newOid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
newOid
-
The alias OID.
sigOid
-
A signal OID.
Example:
gui wave addAlias {signal TOP CLK} {net TOP U1 IN}
gui wave addToGroup
Add the signals of the given nets to a existing wave group.
Usage:
gui wave addToGroup ?-oid? ?-window windowValue? groupIdentifier netOids
Parameters:
-oid (optional)
-
Boolean value to indicate if the identifier is an OID.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
groupIdentifier
-
Name or OID of the existing group.
netOids
-
The OID list of the nets.
Example:
gui wave addToGroup GrpIn {{net TOP U1 IN}}
gui wave bindToCone
Bind a Wave window to a Cone window for displaying logic values.
Usage:
gui wave bindToCone wave cone
Parameters:
cone
-
The Cone window. If the Cone window is an empty string then the binding is removed.
wave
-
The Wave window.
Example:
gui wave bindToCone Wave Cone
gui wave clear
Clear the contents of the Wave window.
Usage:
gui wave clear ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
Example:
gui wave clear
gui wave clearHighlightTime
Clear all highlighted time ranges in the Wave window.
Usage:
gui wave clearHighlightTime ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
Clear all highlight information of the Wave window for all OIDs given with the argument $oidList. If $oidList is "*" then the highlighted time ranges for all displayed waveforms are cleared.
Example:
gui wave clearHighlightTime "*"
gui wave clearNameMarker
Clear the marker from the given signal names.
Usage:
gui wave clearNameMarker ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
The list of OIDs to clear the name marker. If this option is an empty list or "*", then all name markers are cleared.
Example:
gui wave clearNameMarker $oidList
gui wave createGroup
Create a wave group and add the signals of the given nets to it. Return the OID of the created group.
Usage:
gui wave createGroup ?-expandVectors? ?-hideMembers? ?-window windowValue? groupName netOids
Parameters:
-expandVectors (optional)
-
Boolean value to indicate if the members of a given netBus should be expanded.
-hideMembers (optional)
-
Switch to indicate if the single bit members should be hidden.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
groupName
-
Name of the new group.
netOids
-
The OID list of the nets.
Example:
gui wave createGroup GrpIn {{net TOP U1 IN}}
gui wave customizeValueColor
Set a custom color for a specific signal and value.
Usage:
gui wave customizeValueColor ?-window windowValue? oid what color
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
color
-
The color value to draw the waveform. If the color value is an empty string then the customization is removed.
oid
-
Customize the wave value color for this OID.
what
-
Specify what part of the waveform should be customized. What can be one of: ValueTop, ValueBot, ValueX, ValueXFill, ValueZ, ValueZFill or ValueChange.
Example:
gui wave customizeValueColor {net top CLK} ValueTop #ff1d77
gui wave customizeValueColor {net top CLK} ValueBot #ff1d77
gui wave databaseModified
Trigger update on the Wave window if wave database has been modified.
Usage:
gui wave databaseModified ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
Example:
gui wave databaseModified
gui wave getDatabase
Get the loaded wave database of the Wave window.
Usage:
gui wave getDatabase ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
Example:
set wdb [gui wave getDatabase]
gui wave getSignals
Get the list of loaded signals.
Usage:
gui wave getSignals ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Window window, "DEFAULT" or "" for the default Window window. If window parameter is empty, this loaded signals of the default Wave window are returned.
Example:
set signalList [gui wave getSignals]
gui wave getTimeRange
Returns a list containing the visible time in the Wave window, i.e. "From:" and "To:" timesteps. Returns {} if the timestep is not set.
Usage:
gui wave getTimeRange ?-timestep? ?-window windowValue?
Parameters:
-timestep (optional)
-
Returns the timesteps instead of the time.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command returns the values for the default window.
Example:
gui wave getTimeRange
# -> e.g. {10us 30us}
gui wave getTimeRange -timestep
# -> e.g. {100 300}
gui wave hideWindow
Hide the default Wave window.
Usage:
gui wave hideWindow
Parameters:
Example:
gui wave hideWindow
gui wave highlightTime
Highlight a given time range in the Wave window.
Usage:
gui wave highlightTime ?-window windowValue? from to color oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
color
-
Highlight color number.
from
-
Start time.
oidList
-
Apply the highlight information in the Wave window for all OIDs given with the argument $oidList. If $oidList is "*" then the highlight is added to all displayed waveforms.
to
-
End time.
Example:
gui wave highlightTime 100 300 0 "*"
gui wave highlightTimes
Provide a list with highlight information to highlight a given time range in the Wave window.
Usage:
gui wave highlightTimes ?-nocheck? ?-window windowValue? highlightInfoListName
Parameters:
-nocheck (optional)
-
Do not check the given values.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
highlightInfoListName
-
The name of the highlight info list variable, where the list consists of the same arguments as
gui wave highlightTime
. For each OID, the highlight info arguments can be repeated multiple times: {oid from to color ?oid from to color? …}.
Example:
set highlightInfoList {
$oid1 100 300 0
$oid2 200 600 1
$oid3 1000 2600 0
$oid1 600 800 1
}
gui wave highlightTimes "highlightInfoList"
gui wave loadSignals
Load signals from a file to the Wave window. Already loaded signals are ignored and not loaded again. A list of signal names that do not match the loaded waveform database and therewith could not be added is returned.
Usage:
gui wave loadSignals ?-dryRun? ?-force? ?-window windowValue? fileName
Parameters:
-dryRun (optional)
-
If dryRun is true then no signal will be loaded.
-force (optional)
-
If force is true then the already loaded signals are added again.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
fileName
-
File name of input file.
Example:
gui wave loadSignals "file"
gui wave nextValueChange
Jump to next value change.
Usage:
gui wave nextValueChange ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
List of objects to display.
Example:
gui wave nextValueChange {}
gui wave oid2varid
Convert an OID into a Varid.
Usage:
gui wave oid2varid ?-window windowValue? oid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, then the default Wave window is used.
oid
-
The OID to convert.
Example:
gui wave oid2varid $oid
gui wave open
Open a waveform database.
Usage:
gui wave open ?-buildGroups? ?-from fromValue? ?-nameOfDUT nameOfDUTValue? ?-pathToDUT pathToDUTValue? ?-restore? ?-to toValue? ?-window windowValue? filename
Parameters:
-buildGroups (optional)
-
Boolean value to indicate if groups should be created automatically.
-from fromValue (optional default is "0")
-
Limit the start time that is read from the waveform database.
-nameOfDUT nameOfDUTValue (optional default is NULL)
-
Name of the design under test. If not specified then the name to the DUT is guessed by a heuristic that compares hierarchical information from the waveform database against the loaded design.
-pathToDUT pathToDUTValue (optional default is NULL)
-
Path to the design under test. If not specified then the path to the DUT is guessed by a heuristic that compares hierarchical information from the waveform database against the loaded design.
-restore (optional)
-
Boolean value to indicate if the view of the windows should be restored.
-to toValue (optional default is "end")
-
Limit the end time until read from the waveform database.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
filename
-
The name of the waveform database to open.
Example:
gui wave open "design.wdb"
gui wave previousValueChange
Jump to previous value change.
Usage:
gui wave previousValueChange ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
List of objects to display.
Example:
gui wave previousValueChange {}
gui wave registerAddSignalCallback
Register a callback that is evaluated every time before new signals are added to the Wave window. Before evaluating the callback, the window identifier of the Wave window responsible for the change is appended as well as the list of signals.
Usage:
gui wave registerAddSignalCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc wave_add_signal {w oidList} {
gui console print "Wave window $w: add signal: $oidList"
}
# add callback
gui wave registerAddSignalCallback wave_add_signal
# remove callback
gui wave removeAddSignalCallback wave_add_signal
gui wave registerMarkerChangedCallback
Register a callback that is evaluated every time the time marker in a Wave window has changed. Before evaluating the callback, the Wave window identifier and the current time value are appended. If a Wave window is cleared (and thus the time marker is deleted), the empty string is appended to the callback instead of the current time value.
Usage:
gui wave registerMarkerChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc wave_marker_changed {w time} {
if {$time != ""} {
set msg "Wave window $w: the time marker has been moved to $time"
} else {
set msg "Wave window $w: the time marker has been removed"
}
gui console print $msg
}
# add callback
gui wave registerMarkerChangedCallback wave_marker_changed
# remove callback
gui wave removeMarkerChangedCallback wave_marker_changed
gui wave registerSelectionChangedCallback
Register a callback that is evaluated every time the selection of the loaded signal list has changed. Before evaluating the callback, the Wave window identifier and the list of selected objects are added.
Usage:
gui wave registerSelectionChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc selectionChanged {w oidList} {
set msg "Wave window $w: the selection has changed to ${oidList}."
gui console print $msg
}
# add callback
gui wave registerSelectionChangedCallback selectionChanged
# remove callback
gui wave removeSelectionChangedCallback selectionChanged
gui wave registerTimeRangeChangedCallback
Register a callback that is evaluated every time the displayed time range in a Wave window has changed. Before evaluating the callback, the Wave window identifier and the current from and to time values are appended.
Usage:
gui wave registerTimeRangeChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc waveTimeRangeChanged {w from to} {
gui console print "Wave window $w: Time range changed to $from : $to."
}
# add callback
gui wave registerTimeRangeChangedCallback waveTimeRangeChanged
# remove callback
gui wave removeTimeRangeChangedCallback waveTimeRangeChanged
gui wave registerTreeStateChangedCallback
Register a callback that is evaluated every time the state of the signal tree has changed. Before evaluating the callback, the Wave window identifier and the affected object as well as the open state is added.
Usage:
gui wave registerTreeStateChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc tree_state_changed {w oid open} {
set msg "Wave window $w: the tree item $oid state changed to "
if {$open} {
append msg "open"
} else {
append msg "close"
}
gui console print $msg
}
# add callback
gui wave registerTreeStateChangedCallback tree_state_changed
# remove callback
gui wave removeTreeStateChangedCallback tree_state_changed
gui wave registerValuesChangedCallback
Register a callback that is evaluated every time the @waveValue/@waveMarks DB attributes have been changed as an effect of e.g. the user selecting a time step in the Wave window. There may be spurious evaluations of the callback, e.g. when the user selects a new time step with exactly the same Wave values as before. Before evaluating the callback, the window identifier of the Wave window responsible for the change is appended.
Usage:
gui wave registerValuesChangedCallback callback
Parameters:
callback
-
The callback script to be evaluated.
Example:
proc wave_values_changed {w} {
gui console print "Wave window $w: values changed"
}
# add callback
gui wave registerValuesChangedCallback wave_values_changed
# remove callback
gui wave removeValuesChangedCallback wave_values_changed
gui wave removeAddSignalCallback
Remove the callback previously registered with
gui wave registerAddSignalCallback …
.
Usage:
gui wave removeAddSignalCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc wave_add_signal {w} {
gui console print "Wave window $w: add signal: $oidList"
}
# add callback
gui wave registerAddSignalCallback wave_add_signal
# remove callback
gui wave removeAddSignalCallback wave_add_signal
gui wave removeMarkerChangedCallback
Remove the callback previously registered with
gui wave registerMarkerChangedCallback …
.
Usage:
gui wave removeMarkerChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc wave_marker_changed {w time} {
if {$time != ""} {
set msg "Wave window $w: the time marker has been moved to $time"
} else {
set msg "Wave window $w: the time marker has been removed"
}
gui console print $msg
}
# add callback
gui wave registerMarkerChangedCallback wave_marker_changed
# remove callback
gui wave removeMarkerChangedCallback wave_marker_changed
gui wave removeSelectionChangedCallback
Remove the callback previously registered with
gui wave registerSelectionChangedCallback …
.
Usage:
gui wave removeSelectionChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc selectionChanged {w oidList} {
set msg "Wave window $w: the selection has changed to ${oidList}."
gui console print $msg
}
# add callback
gui wave registerSelectionChangedCallback selectionChanged
# remove callback
gui wave removeSelectionChangedCallback selectionChanged
gui wave removeTimeRangeChangedCallback
Remove the callback previously registered with
gui wave registerTimeRangeChangedCallback …
.
Usage:
gui wave removeTimeRangeChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc waveTimeRangeChanged {w from to} {
gui console print "Wave window $w: Time range changed to $from : $to."
}
# add callback
gui wave registerTimeRangeChangedCallback waveTimeRangeChanged
# remove callback
gui wave removeTimeRangeChangedCallback waveTimeRangeChanged
gui wave removeTreeStateChangedCallback
Remove the callback previously registered with
gui wave registerTreeStateChangedCallback …
.
Usage:
gui wave removeTreeStateChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc tree_state_changed {w oid open} {
set msg "Wave window $w: the tree item $oid state changed to "
if {$open} {
append msg "open"
} else {
append msg "close"
}
gui console print $msg
}
# add callback
gui wave registerTreeStateChangedCallback tree_state_changed
# remove callback
gui wave removeTreeStateChangedCallback tree_state_changed
gui wave removeValuesChangedCallback
Remove the callback previously registered with
gui wave registerValuesChangedCallback …
.
Usage:
gui wave removeValuesChangedCallback callback
Parameters:
callback
-
The callback script to remove.
Example:
proc wave_values_changed {w} {
gui console print "Wave window $w: values changed"
}
# add callback
gui wave registerValuesChangedCallback wave_values_changed
# remove callback
gui wave removeValuesChangedCallback wave_values_changed
gui wave saveSignals
Save all signals loaded to the Wave window to a file.
Usage:
gui wave saveSignals ?-window windowValue? fileName
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Window window, "DEFAULT" or "" for the default Window window. If window parameter is empty, this command has effect on all Wave windows.
fileName
-
File name of output file.
Example:
gui wave saveSignals "file"
gui wave see
Adjust the view of the Wave window that the given time is visible.
Usage:
gui wave see ?-window windowValue? time
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
time
-
Time to see.
Example:
gui wave see 300
gui wave selection
Returns all currently selected objects of the Wave window.
Usage:
gui wave selection ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
Example:
gui wave selection
gui wave setCursor
Set a named cursor to the given time. If no cursor with this name exists then a new cursor is created.
Usage:
gui wave setCursor ?-color colorValue? ?-window windowValue? name time
Parameters:
-color colorValue (optional default is NULL)
-
Color value in #RGB format to draw the cursor.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
name
-
Set the name for this cursor.
time
-
Time to set the cursor. Use an empty string to remove the cursor.
Example:
gui wave setCursor "Test Cursor" 300 -color #007700
gui wave setDatabase
Set the wave database which is used by the Wave window.
Usage:
gui wave setDatabase ?-nameOfDUT nameOfDUTValue? ?-pathToDUT pathToDUTValue? ?-window windowValue? database
Parameters:
-nameOfDUT nameOfDUTValue (optional default is NULL)
-
Name of the design under test.
-pathToDUT pathToDUTValue (optional default is NULL)
-
Path to the design under test.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
database
-
The new wave database.
Example:
gui wave setDatabase $wdb
gui wave setLabel
Set a text label at the given OID and time.
Usage:
gui wave setLabel ?-window windowValue? oid time label
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
label
-
The text label to show.
oid
-
Object to add the label.
time
-
Time to add the label. Use an empty string to remove a label.
Example:
gui wave setLabel {net top CLK} 100 "Test"
gui wave setMarker
Set the time marker to the given time.
Usage:
gui wave setMarker ?-window windowValue? time
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
time
-
Time to set a marker. Use an empty string to clear the marker.
Example:
gui wave setMarker 600
gui wave setNameMarker
Set a marker at the signal name.
Usage:
gui wave setNameMarker ?-color colorValue? ?-window windowValue? oidList
Parameters:
-color colorValue (optional default is "red")
-
Specify a color for the marker.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
The list of OIDs to set a name marker.
Example:
gui wave setNameMarker $oidList -color red
gui wave setSelection
Set selection to given signals of the Wave window.
Usage:
gui wave setSelection ?-window windowValue? oidList
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
List of objects to display.
Example:
gui wave setSelection {}
gui wave setTimeRange
Set the visible time range of the Wave window.
Usage:
gui wave setTimeRange ?-window windowValue? from to
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
from
-
The start time.
to
-
The end time.
Example:
gui wave setTimeRange 0 100
gui wave show
Display the waveform of the given signals in the Wave window.
Usage:
gui wave show ?-force? ?-insertIdx insertIdxValue? ?-member? ?-window windowValue? oidList
Parameters:
-force (optional)
-
If force is true then the given objects are always added.
-insertIdx insertIdxValue (optional default is "")
-
Insert position
-member (optional)
-
Do not convert a member into the corresponding bus.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
oidList
-
List of objects to display.
Example:
gui wave show {{net TOP CLK} {netBus TOP DATI}}
gui wave showMembers
Expand or collapse the member view of a netBus in the Wave window.
Usage:
gui wave showMembers ?-show? ?-window windowValue? netBusOid
Parameters:
-show (optional)
-
Boolean value to indicate if the view should be expanded or collapsed.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
netBusOid
-
OID of the netBus to expand or collapse.
Example:
gui wave showMembers -show {netBus TOP DATI}
gui wave showWindow
Show the default Wave window.
Usage:
gui wave showWindow
Parameters:
Example:
gui wave showWindow
gui wave signalState
Get the open/close state of the given signal. For an open bus signal true is returned. For a collapsed vector, group or for a scalar signal false is returned.
Usage:
gui wave signalState ?-window windowValue? oid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Window window, "DEFAULT" or "" for the default Window window. If window parameter is empty, this loaded signals of the default Wave window are returned.
oid
-
Get the state of this OID.
Example:
gui wave signalState {netBus TOP DATI}
gui wave string2oid
Convert a Varid into an OID.
Usage:
gui wave string2oid ?-bit bitValue? ?-window windowValue? str
Parameters:
-bit bitValue (optional default is "")
-
Get the OID for a bit of the given vector.
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, then the default Wave window is used.
str
-
The string to convert.
Example:
gui wave string2oid $str
gui wave updateScope
Update the Wave window after modifying the scope of the currently loaded waveform database.
Usage:
gui wave updateScope ?-window windowValue?
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
Example:
gui wave updateScope
gui wave varid2oid
Convert a Varid into an OID.
Usage:
gui wave varid2oid ?-window windowValue? varid
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, then the default Wave window is used.
varid
-
The Varid to convert.
Example:
gui wave varid2oid $varid
gui wave zoom
Set the zoom factor of the Wave window.
Usage:
gui wave zoom ?-window windowValue? factor
Parameters:
-window windowValue (optional default is NULL)
-
Path or name of a Wave window, "DEFAULT" or "" for the default Wave window. If window parameter is empty, this command has effect on all Wave windows.
factor
-
The zoom factor. A positive value is zoom in, negative is zoom out, 0 is fullfit. Or use 'in', 'out' and 'full' for 0.1, -0.1 and 0.
Example:
gui wave zoom 0.5
gui window
Sub command dispatcher for window related GUI API commands.
gui window autoscroll
Autoscroll implements a new layouter. It grids the given scrollable into the given frame and adds scrollbars if required. Whenever the frame window’s scroll region changes, then the scrollbars are added/removed.
Usage:
gui window autoscroll ?-direction directionValue? frame scrollable
Parameters:
-direction directionValue (optional default is "x y")
-
The direction of the scrollbars.
frame
-
The frame where the scrollable is placed to.
scrollable
-
The scrollable object.
Example:
set f [gui window insertCustomWidget "AutoscrollFrame"]
ttk::treeview $f.tree
gui window autoscroll $f $f.tree
gui window createHorizontalPane
Create a horizontal Pane window and insert it into the given main vertical
Pane window.
The new Pane window is appended to the list of existing horizontal Pane
windows, except in the main top-level window, where it is inserted right
above the status tab (which contains the Console and Messages windows).
The insert position can be specified using the -before
/-after
options.
Returns the new Pane’s path.
Usage:
gui window createHorizontalPane ?-after afterValue? ?-before beforeValue? mainVerticalPane
Parameters:
-after afterValue (optional default is NULL)
-
Insert the new Pane after the given window in the vertical Pane window.
-before beforeValue (optional default is NULL)
-
Insert the new Pane before the given window in the vertical Pane window.
mainVerticalPane
-
The vertical Pane window to create the new Pane window in.
Example:
##
# Get the main vertical Pane window of the main top-level window.
#
set mainVertical [gui window getMainVerticalPane .]
##
# Create a horizontal Pane window in the main window.
#
set pane [gui window createHorizontalPane $mainVertical]
gui window createTab
Create a new Tab container window and insert it into the given vertical
Pane window (the referenced vertical Pane window must not be the main
vertical Pane of a top-level window!).
The insert position can be specified using the -before
/-after
options.
Returns the new Tab’s path.
Usage:
gui window createTab ?-after afterValue? ?-before beforeValue? verticalPane
Parameters:
-after afterValue (optional default is NULL)
-
Insert the new Tab after the given window in the vertical Pane window.
-before beforeValue (optional default is NULL)
-
Insert the new Tab before the given window in the vertical Pane window.
verticalPane
-
The vertical Pane window to create a Tab in.
Example:
##
# Get the main vertical Pane window of the main top-level window.
#
set mainVertical [gui window getMainVerticalPane .]
##
# Create a horizontal Pane window.
#
set horizontal [gui window createHorizontalPane $mainVertical]
##
# Create a vertical Pane window.
#
set vertical [gui window createVerticalPane $horizontal]
##
# Create a Tab window in $vertical.
#
set tab [gui window createTab $vertical]
##
# Insert a Schem window into $tab.
#
set schem [gui window new "Schem" -tabwindow $tab]
gui window createToplevel
Create a new top-level window and return its path.
This also creates an obligatory vertical pane window, which can be retrieved
with gui window getMainVerticalPane $top
.
The top-level window then has to be resized and placed properly, e.g. with
gui window modelessDialog …
.
Usage:
gui window createToplevel
Parameters:
No parameters.
Example:
##
# Create a new top-level window.
#
set top [gui window createToplevel]
##
# Resize and place $top.
gui window modelessDialog $top "My Custom Top-Level Window" -place "CENTER" -size {800 600} -closeCallback "destroy $top"
gui window createVerticalPane
Create a vertical Pane window and insert it into the given horizontal Pane
window.
The new Pane window is appended to the list of existing vertical Pane
windows.
The insert position can be specified using the -before
/-after
options.
Return the new Pane’s path.
Usage:
gui window createVerticalPane ?-after afterValue? ?-before beforeValue? horizontalPane
Parameters:
-after afterValue (optional default is NULL)
-
Insert the new Pane after the given window in the horizontal Pane window.
-before beforeValue (optional default is NULL)
-
Insert the new Pane before the given window in the horizontal Pane window.
horizontalPane
-
The horizontal Pane window to create the new Pane window in.
Example:
##
# Get the main vertical Pane window of the main top-level window.
#
set mainVertical [gui window getMainVerticalPane .]
##
# Create a horizontal pane.
#
set horizontal [gui window createHorizontalPane $mainVertical]
##
# Create a vertical Pane window in new horizontal Pane window.
#
set pane [gui window createVerticalPane $horizontal]
gui window defaultClassWindow
Get the default $class
window (if one exists).
Usage:
gui window defaultClassWindow class
Parameters:
class
-
Path or name of a window.
Example:
# Get the default Schem window.
set schem [gui window defaultClassWindow "Schem"]
gui console print "The default Schem window is $schem"
gui window dialog
This procedure initializes the window manager (wm) relation between the dialog ($dlg) and the dialog’s parent window; then it deiconifies the dialog (in case it is withdrawn), grabs all events, waits until the user presses a button, and then ungrabs the events.
Usage:
gui window dialog ?-buttons buttonsValue? ?-focus focusValue? ?-parent parentValue? ?-place placeValue? ?-size sizeValue? ?-validate validateValue? dialog title
Parameters:
-buttons buttonsValue (optional default is "")
-
List of buttons. Return index of the pressed button.
-focus focusValue (optional default is "")
-
The widget that should get the focus.
-parent parentValue (optional default is "")
-
The parent widget.
-place placeValue (optional default is "")
-
Available modes: MOUSE - place dialog at current mouse location CENTER - center the dialog on its parent
-size sizeValue (optional default is "")
-
The desired size. A pair of numbers, e.g. "600 400".
-validate validateValue (optional default is "")
-
A validation callback. The callback is evaluated when the user clicks a dialog button. The index of the pressed button is appended to the callback before evaluation. If the callback returns 0, the dialog is not closed.
dialog
-
Top-level widget of the dialog.
title
-
The title string.
Example:
toplevel .dialog
gui window dialog .dialog "MyDialog"
gui window exists
Check if a window widget exists.
Usage:
gui window exists window
Parameters:
window
-
The window name or path to check.
Example:
if {![gui window exists "My Frame"]} {
# Create the "My Frame" window.
}
gui window fileDialog
Show one of the file selection dialogs.
Usage:
gui window fileDialog ?-parent parentValue? mode title fileTypes
Parameters:
-parent parentValue (optional default is ".")
-
Path of the parent window.
fileTypes
-
Specify a list of supported file types.
mode
-
Depending on the value of $mode show an "Open File" dialog to select one file (openFile) or to select multiple files (openFiles), a "Save File" dialog (saveFile) or a "Choose Directory" dialog (chooseDir).
title
-
Text to display in the title bar of the file dialog.
Example:
gui window fileDialog openFiles "Open Tcl/Tk Files" {{"Tcl/Tk Files" .tcl}}
gui window foreach
Evaluate $body for all $class windows.
Usage:
gui window foreach class variable body
Parameters:
body
-
The Tcl script to run. Supports the usual loop commands (e.g. "break") to control the actual loop execution.
class
-
The class of windows to iterate over, e.g. "Schem".
variable
-
This variable will be set to the current window before evaluating $body.
Example:
gui console print "All Schem windows:"
gui window foreach "Schem" w {
gui console print $w
}
gui window foreachToplevel
Evaluate $body for all top-level windows.
Usage:
gui window foreachToplevel variable body
Parameters:
body
-
The Tcl script to run. Supports the usual loop commands (e.g. "break") to control the actual loop execution.
variable
-
This variable will be set to the current top-level window before evaluating $body.
Example:
gui window foreachToplevel w {
gui console print "toplevel: $w"
}
gui window fullscreen
Toggle the fullscreen mode.
Usage:
gui window fullscreen showFullscreen
Parameters:
showFullscreen
-
Enable or disable the fullscreen mode.
Example:
# enable fullscreen mode
gui window fullscreen 1
# disable fullscreen mode
gui window fullscreen 0
gui window getClass
Get class of the given window.
Usage:
gui window getClass window
Parameters:
window
-
Path of the window.
Example:
set w [gui window getCurrent]
set class [gui window getClass $w]
gui window getCurrent
Get the currently focused window.
Usage:
gui window getCurrent
Parameters:
No parameters.
Example:
set w [gui window getCurrent]
gui window getDesignTitle
Get the design name as displayed in title bar of the main window.
Usage:
gui window getDesignTitle
Parameters:
No parameters.
Example:
set title [gui window getDesignTitle]
gui window getMainVerticalPane
Return the given top-level window’s obligatory vertical Pane window.
Usage:
gui window getMainVerticalPane ?toplevel?
Parameters:
toplevel (optional)
-
The top-level window to get the vertical Pane window from.
Example:
##
# Get the vertical Pane window of the main top-level window.
#
set vertical [gui window getMainVerticalPane .]
gui window getPaneSashes
Get the sash positions of the given Pane window. The number of sash positions must is one less than the number of children of $pane. The sash positions are relative, i.e. each sash position is be a number between 0 and 1.
Usage:
gui window getPaneSashes pane
Parameters:
pane
-
The Pane window.
Example:
set sashes [gui window getPaneSashes $pane]
gui window getState
Get the state of the given window.
Usage:
gui window getState window
Parameters:
window
-
Path or name of a window of class Cone, Mem, Schem, Source, Tree, or Wave.
Example:
set state [gui window getState Schem]
gui window getTab
Get the parent Tab window of the given $window
. If $window
is not the
child of a Tab window, return an empty string.
Usage:
gui window getTab window
Parameters:
window
-
Path of the window.
Example:
set w [gui window defaultClassWindow "Schem"]
set tab [gui window getTab $w]
gui window getToplevelTitle
Get the title of a top-level window as set by 'gui window setToplevelTitle'. If no title has been set, return an empty string.
Usage:
gui window getToplevelTitle window
Parameters:
window
-
Name or path of the top-level window of one of the top-level’s sub-windows.
Example:
set t [gui window getToplevelTitle .]
gui window hasClassWindow
Check if a window of the given $class
exists.
Usage:
gui window hasClassWindow class
Parameters:
class
-
Path or name of a window.
Example:
# Check if a Cone window exists; if not, create one.
if {![gui window hasClassWindow "Cone"]} {
gui window new "Cone"
}
gui window hide
Hide the given window inside of its tab container. Hidden windows still exist, but are not accessible from the Tab bar.
Usage:
gui window hide window
Parameters:
window
-
Path or name of a window.
Example:
# hide the window named "Schem".
gui window hide "Schem"
gui window image
Create and return a Tk image of the given window.
Usage:
gui window image window
Parameters:
window
-
Path or name of a window.
Example:
set img [gui window image "Schem"]
$img write "schem.png"
image delete $img
gui window insertCustomWidget
Insert a custom widget into the bottom tab. The widget path to a frame is returned.
Usage:
gui window insertCustomWidget ?-destroyCallback destroyCallbackValue? ?-fixed? ?-pluginNamespace pluginNamespaceValue? ?-tabwindow tabwindowValue? name
Parameters:
-destroyCallback destroyCallbackValue (optional default is NULL)
-
This callback is evaluated when the custom widget is destroyed (e.g. when the user clicks the 'x' in the widget’s tab).
-fixed (optional)
-
A fixed tab window cannot be renamed or closed.
-pluginNamespace pluginNamespaceValue (optional default is NULL)
-
Namespace of the Plugin creating the custom widget. When the custom widget is destroyed (e.g. when the user clicks the 'x' in the widget’s tab) the
Finit
procedure in the given namespace will be called to unload and therewith disable the plugin. -tabwindow tabwindowValue (optional default is NULL)
-
Path or name of a Tab window, "DEFAULT" or "" for the default Tab window. If specified, create the custom widget in this Tab window.
name
-
Name of the custom widget.
Example:
set f1 [gui window insertCustomWidget "My Frame 1"]
label $f1.l -text "This is a custom widget."
pack $f1.l
set tab [gui window defaultClassWindow "Tab"]
set f2 [gui window insertCustomWidget -tabwindow $tab "My Frame 2"]
label $f2.l -text "This is a custom widget in the default Tab."
pack $f2.l
gui window internal
Create an internal window $child in the parent $w.
Usage:
gui window internal ?-anchor anchorValue? ?-button buttonValue? parent child title width height
Parameters:
-anchor anchorValue (optional default is "se")
-
The anchor of the window.
-button buttonValue (optional default is "")
-
The button binding of the window.
child
-
The child window.
height
-
The height of the window.
parent
-
The parent window.
title
-
The title of the window.
width
-
The width of the window.
Example:
set width 100
set height 100
set f [gui window insertCustomWidget "InternalWindow"]
canvas $f.minimap -width $width -height $height
gui window internal $f $f.minimap "Minimap" $width $height
gui window isMaximized
Check if the given top-level window is maximized.
Usage:
gui window isMaximized toplevel
Parameters:
toplevel
-
The top-level window.
Example:
##
# Check if the main window is maximized.
#
if {[gui window isMaximized .]} {
##
# Yes, it is maximized.
#
} else {
##
# No, it is not maximized.
#
}
gui window isStatusPaneVisible
Check if the 'Status Pane' (containing Console and Messages windows) is currently displayed.
Usage:
gui window isStatusPaneVisible
Parameters:
No parameters.
Example:
if {![gui window isStatusPaneVisible]} {
# The 'Status Pane" is currently visible.
}
gui window maximize
Maximize the given top-level window.
Usage:
gui window maximize toplevel
Parameters:
toplevel
-
The top-level window.
Example:
##
# Maximize the main window.
#
gui window maximize .
gui window modelessDialog
This procedure initializes the window manager (wm) relation between the dialog ($dlg) and the dialog’s parent window; then it deiconifies the dialog (in case it is withdrawn).
Usage:
gui window modelessDialog ?-closeCallback closeCallbackValue? ?-onTop? ?-place placeValue? ?-size sizeValue? dialog title
Parameters:
-closeCallback closeCallbackValue (optional default is "")
-
A callback that is run when the dialog is closed.
-onTop (optional)
-
Keep the dialog on top of other windows.
-place placeValue (optional default is "")
-
Available modes: MOUSE - place dialog at current mouse location CENTER - center the dialog on the main window
-size sizeValue (optional default is "")
-
The desired size. A pair of numbers, e.g. "600 400".
dialog
-
Top-level widget of the dialog.
title
-
The title string.
Example:
toplevel .dialog
gui window modelessDialog .dialog "MyDialog"
gui window name
Get the given window’s name.
Usage:
gui window name window
Parameters:
window
-
Path or name of a window.
Example:
set w [gui window path Schem]
set name [gui window name $w]
gui console print "The default Schem window is called $name"
gui window new
Creates a new $class window.
If -tabwindow $window
is specified, the $class
window is created inside
the Tab window $window, otherwise it is created inside a new toplevel
window.
The return value is the path to the new $class
window.
Usage:
gui window new ?-fixed? ?-name nameValue? ?-position positionValue? ?-tabwindow tabwindowValue? ?-tag tagValue? class
Parameters:
-fixed (optional)
-
A fixed tab window cannot be renamed or closed.
-name nameValue (optional default is "")
-
Name of the new window.
-position positionValue (optional default is "end")
-
The position in the Tab window. Some number or "end".
-tabwindow tabwindowValue (optional default is NULL)
-
Path or name of a Tab window, "DEFAULT" or "" for the default Tab window. If specified, create the new window in this Tab window.
-tag tagValue (optional default is "")
-
Tag of the new window.
class
-
Class of the window to create.
Example:
# create a toplevel window containing a single Schem window.
set schem [gui window new "Schem" -name "MySchemWindow"]
# do something with $schem...
# close the window
gui window remove $schem
gui window path
Convert a window name into a widget path.
Usage:
gui window path name
Parameters:
name
-
Name of the window.
Example:
if {[gui window path "My Frame"] eq ""} {
# Create the "My Frame" window.
}
gui window registerCreatedCallback
Register a callback that’s called whenever a window of the specified $class is created.
Usage:
gui window registerCreatedCallback class callback
Parameters:
callback
-
Callback script. The window path of the created $class window is appended to the script before evaluating it.
class
-
Window class to register a "Created" callback for.
Example:
proc my_callback {w} {
gui console print "A new Schem window has been created: $w"
}
gui window registerCreatedCallback "Schem" my_callback
gui window registerCurrentChangedCallback
Register a callback that is called when the current window (i.e. the focused window) has changed. Only registered windows are reported.
Usage:
gui window registerCurrentChangedCallback callback
Parameters:
callback
-
Callback script. The window path of the newly focused window is appended to the script before evaluating it.
Example:
proc my_callback {w} {
gui console print "Current window: $w"
}
# register callback
gui window registerCurrentChangedCallback my_callback
# remove it
gui window removeCurrentChangedCallback my_callback
gui window registerDestroyedCallback
Register a callback that’s called whenever a window of the specified $class has been destroyed.
Usage:
gui window registerDestroyedCallback class callback
Parameters:
callback
-
Callback script. The window path of the destroyed $class window is appended to the script before evaluating it.
class
-
Window class to register a "Destroyed" callback for.
Example:
proc my_callback {w} {
gui console print "A Schem window has been destroyed: $w"
}
gui window registerDestroyedCallback "Schem" my_callback
gui window registerDoubleClickCallback
Register a callback for double-click events in all $class windows.
Usage:
gui window registerDoubleClickCallback class callback
Parameters:
callback
-
Callback script. The window path of the double-clicked $class window is appended to the script before evaluating it. If the script returns "break" (e.g. "return -code break"), no other double-click actions are performed.
class
-
Window class to register a double-click callback for.
Example:
proc my_callback {w} {
gui console print "Double click in Schem: $w"
}
gui window registerDoubleClickCallback "Schem" my_callback
gui window registerMoveCallback
Register a callback that is called when a window is moved to another pane.
Usage:
gui window registerMoveCallback callback
Parameters:
callback
-
Callback script. The new window path as well as the name of the window are appended to the script before evaluating it.
Example:
proc my_callback {w name} {
gui console print "$name window moved, new path '$w'."
}
# register callback
gui window registerMoveCallback my_callback
# remove it
gui window removeMoveCallback my_callback
gui window registerNameChangedCallback
Register a callback that is called when the name of a window has changed.
Usage:
gui window registerNameChangedCallback callback
Parameters:
callback
-
Callback script. The window path of the window as well as the new name are appended to the script before evaluating it.
Example:
proc my_callback {w name} {
gui console print "Rename window '$w' to '$name'"
}
# register callback
gui window registerNameChangedCallback my_callback
# remove it
gui window removeNameChangedCallback my_callback
gui window remove
Remove the specified window.
Usage:
gui window remove window
Parameters:
window
-
Path or name of a window.
Example:
# create a toplevel window containing a single Schem window.
set schem [gui window new "Schem"]
# remove the window
gui window remove $schem
gui window removeCreatedCallback
Remove a previously registered callback for "Created" events for $class windows.
Usage:
gui window removeCreatedCallback class callback
Parameters:
callback
-
The previously registered callback script.
class
-
Window class to remove a "Created" callback from.
Example:
proc my_callback {w} {
gui console print "A new Schem window has been created: $w"
}
gui window registerCreatedCallback "Schem" my_callback
# remove it
gui window removeCreatedCallback "Schem" my_callback
gui window removeCurrentChangedCallback
Remove a previously registered callback for current changed events.
Usage:
gui window removeCurrentChangedCallback callback
Parameters:
callback
-
The previously registered callback script.
Example:
proc my_callback {w} {
gui console print "Current window: $w"
}
# register callback
gui window registerCurrentChangedCallback my_callback
# remove it
gui window removeCurrentChangedCallback my_callback
gui window removeCustomWidget
Remove the custom widget given by its name.
Usage:
gui window removeCustomWidget name
Parameters:
name
-
Name of the custom widget to be removed.
Example:
gui window removeCustomWidget "My Frame"
gui window removeDestroyedCallback
Remove a previously registered callback for "Destroyed" events for $class windows.
Usage:
gui window removeDestroyedCallback class callback
Parameters:
callback
-
The previously registered callback script.
class
-
Window class to remove a "Destroyed" callback from.
Example:
proc my_callback {w} {
gui console print "A new Schem window has been destroyed: $w"
}
gui window registerDestroyedCallback "Schem" my_callback
# remove it
gui window removeDestroyedCallback "Schem" my_callback
gui window removeDoubleClickCallback
Remove a previously registered callback for double-click events in all $class windows.
Usage:
gui window removeDoubleClickCallback class callback
Parameters:
callback
-
The previously registered callback script.
class
-
Window class to remove a double-click callback from.
Example:
proc my_callback {w} {
gui console print "Double click in Schem: $w"
}
gui window registerDoubleClickCallback "Schem" my_callback
# remove it
gui window removeDoubleClickCallback "Schem" my_callback
gui window removeMoveCallback
Remove a previously registered callback for window move events.
Usage:
gui window removeMoveCallback callback
Parameters:
callback
-
The previously registered callback script.
Example:
proc my_callback {w name} {
gui console print "$name window moved, new path '$w'."
}
# register callback
gui window registerMoveCallback my_callback
# remove it
gui window removeMoveCallback my_callback
gui window removeNameChangedCallback
Remove a previously registered callback for name changed events.
Usage:
gui window removeNameChangedCallback callback
Parameters:
callback
-
The previously registered callback script.
Example:
proc my_callback {w name} {
gui console print "Rename window '$w' to '$name'"
}
# register callback
gui window registerNameChangedCallback my_callback
# remove it
gui window removeNameChangedCallback my_callback
gui window rename
Rename the given window.
Usage:
gui window rename window newname
Parameters:
newname
-
The new name. Only ASCII characters minus ||, &&, ^, !, ^ and \\ are allowed for the name. Empty strings and strings only containing whitespaces are not allowed. If you have spaces in your name, you have to group it with "" or {}.
window
-
Path or name of a window.
Example:
set w [gui window new "Schem"]
set name [gui window name $w]
gui console print "Initial name: $name"
gui window rename $w "New Schem Name"
set name [gui window name $w]
gui console print "New name: $name"
gui window setDesignTitle
Set the design title and update the title bars of all top-level windows accordingly.
Usage:
gui window setDesignTitle ?-filename filenameValue? parserTitle
Parameters:
-filename filenameValue (optional default is NULL)
-
Set a parser file name for the design title.
parserTitle
-
The design title string to set.
Example:
gui window setDesignTitle "New Title" -filename "design.v"
gui window setGeometry
Set the given top-level window’s geometry.
Usage:
gui window setGeometry toplevel geometry
Parameters:
geometry
-
The window geometry in
WIDTHxHEIGHT+X+Y
-format, e.g.1000x800+0+100
. toplevel
-
The top-level window.
Example:
gui window setGeometry . 1000x800+0+100
gui window setLabel
Give the window a custom label.
Usage:
gui window setLabel window label
Parameters:
label
-
The label the window shall get.
window
-
Path or name of the window (e.g. Tree, Schem, Cone, …). Restrictions for the label are the same as for "rename".
Example:
# give the default Schem window a label:
gui window setLabel Schem "some label"
gui window setPaneSashes
Set the sash positions of the given Pane window.
Usage:
gui window setPaneSashes pane sashes
Parameters:
pane
-
The Pane window.
sashes
-
List of sash positions. The number of sash positions must be one less than the number of children of $pane. The sash positions are relative, i.e. each sash position must be a number between 0 and 1.
Example:
##
# Get the main vertical Pane window of the main top-level window.
#
set mainVertical [gui window getMainVerticalPane .]
##
# Create a horizontal Pane window.
#
set horizontal [gui window createHorizontalPane $mainVertical]
##
# Create a vertical Pane window.
#
set vertical [gui window createVerticalPane $horizontal]
##
# Create some Tab windows in $pane.
#
set tab1 [gui window createTab $vertical]
set tab2 [gui window createTab $vertical]
set tab3 [gui window createTab $vertical]
##
# Set the sash positions for $vertical.
# As $vertical has 3 children, we need to specify 2 sash positions.
# We set the sashes at 0.2 (20%) and 0.7 (70%) of the $vertical's height.
# => $tab1 will take 20% of $vertical's height, $tab2 will take 50%, and
# $tab3 will take 30%.
#
gui window setPaneSashes $vertical {0.2 0.7}
gui window setState
Set the state of the given window.
Usage:
gui window setState window state
Parameters:
state
-
The state to restore. Must be the result of a previous call to
gui window getState …
. window
-
Path or name of a window of class Cone, Mem, Schem, Source, Tree, or Wave.
Example:
gui window setState Schem $state
gui window setTag
Tag the given window.
Usage:
gui window setTag window tag
Parameters:
tag
-
The tag.
window
-
Path or name of a window.
Example:
set mainVertical [gui window getMainVerticalPane .]
set pane [gui window createHorizontalPane $mainVertical]
gui window setTag $pane "MyTag"
gui window setToplevelTitle
Set the title of a top-level window. This overrides other title commands, e.g. 'gui window title …'.
Usage:
gui window setToplevelTitle window title
Parameters:
title
-
The string to display as the title.
window
-
Name or path of the top-level window of one of the top-level’s sub-windows.
Example:
gui window setToplevelTitle . "New Title"
gui window show
Activate/raise the given window inside of its tab container.
Usage:
gui window show window
Parameters:
window
-
Path or name of a window.
Example:
# activate the window named "Schem".
gui window show "Schem"
gui window split
Split the given window by creating a new Tab window in the given direction. Returns the path of the newly created Tab window.
Usage:
gui window split window direction
Parameters:
direction
-
Split direction (left, right, top, bottom).
window
-
Path or name of a window.
Example:
# create a toplevel window containing a single Schem window.
set schem [gui window new "Schem"]
# create a Tab window to the right
set tab [gui window split $schem right]
# insert a new Cone window into $tab
set cone [gui window new -tabwindow $tab "Cone"]
# remove everything ($cone is removed automatically when removing $tab)
gui window remove $schem
gui window remove $tab
gui window title
Set the title of the main window.
Usage:
gui window title title
Parameters:
title
-
The string to display as the title.
Example:
gui window title "New Title"
gui window unhide
Unhide the given window inside of its tab container.
Usage:
gui window unhide window
Parameters:
window
-
Path or name of a window.
Example:
# unhide the window named "Schem".
gui window unhide "Schem"
gui window unmaximize
Unmaximize the given top-level window.
Usage:
gui window unmaximize toplevel
Parameters:
toplevel
-
The top-level window.
Example:
##
# Unmaximize the main window.
#
gui window unmaximize .
gui busy
Show busy cursor and discard any pointer events for all windows.
Usage:
gui busy enable
Parameters:
enable
-
Reset busy to normal state.
Example:
gui busy true
gui busy false
gui goto
Display (at least one of) the objects in $oidList in the opened Schem, Cone and Source window (however, if the Cone window does not already contain those objects nothing is displayed). The objects in each window get selected - and in Schem and Cone additionally temporarily red-colored. Each window tries to avoid flickering, i.e. if one of the objects is already visible, then the display does not change. The target window(s) can be specified with the mutually exclusive '-class' and '-window' options. If neither of the two options is given, the 'goto' command is applied to all windows.
Usage:
gui goto ?-class classValue? ?-noSelect? ?-window windowValue? oidList
Parameters:
-class classValue (optional default is NULL)
-
If this parameter is given, the 'goto' command affects all existing windows of the specified class.
-noSelect (optional)
-
Select the newly added objects.
-window windowValue (optional default is NULL)
-
Path or name of a window of class Cone, Mem, Schem, Search, Source, or Tree. If this parameter is given, the 'goto' command only affects the specified window.
oidList
-
List of goto objects.
Example:
set oidList {
{inst TOP U2 m2}
}
gui goto -class "Schem" $oidList
gui quit
Exit the application.
Usage:
gui quit ?returnCode?
Parameters:
returnCode (optional)
-
The returnCode is returned to the system as the exit status.
Example:
##
# Exit with the error code 2.
#
gui quit 2
gui registerQuitCallback
Register a callback that is called when the application is about to quit. If the callback evaluates to 0/false, the quit operation is aborted, otherwise it continues normally. Note that only one quit callback can be registered.
Usage:
gui registerQuitCallback callback
Parameters:
callback
-
Callback script.
Example:
proc my_callback {} {
gui console print "The application will quit now!"
return 1
}
# register callback
gui registerQuitCallback my_callback
# remove it
gui removeQuitCallback
gui removeQuitCallback
Remove the previously registered quit callback.
Usage:
gui removeQuitCallback
Parameters:
No parameters.
Example:
proc my_callback {} {
gui console print "The application will quit now!"
return 1
}
# register callback
gui registerQuitCallback my_callback
# remove it
gui removeQuitCallback
gui update
Update settings, highlight and attributes at once.
Usage:
gui update
Parameters:
No parameters.
Example:
gui update
gui zoomTo
Like 'goto' but in addition zoom to the selected object. The target window(s) can be specified with the mutually exclusive '-class' and '-window' options. If neither of the two options is given, the 'goto' command is applied to all windows.
Usage:
gui zoomTo ?-class classValue? ?-window windowValue? oidList
Parameters:
-class classValue (optional default is NULL)
-
If this parameter is given, the 'zoomTo' command affects all existing windows of the specified class.
-window windowValue (optional default is NULL)
-
Path or name of a window of class Cone or Schem. If this parameter is given, the 'zoomTo' command only affects the specified window.
oidList
-
List of goto objects.
Example:
set oidList {
{inst TOP U2 m2}
}
gui window show "Schem"
gui zoomTo -window "Schem" $oidList