next up previous contents index
Next: The Convert Menu: Data Up: The Main Window Button: Previous: The No Top Symbolic   Contents   Index


The Set Grid Button: Set Grid Parameters

The Set Grid button in the Main Window sub-menu of the Attributes Menu or the sub-window Attributes menu brings up the Grid Setup panel. Pressing Ctrl-g when a drawing window has keyboard focus will also produce this panel. The panel provides control of the grid display in the associated drawing window. Separate grid styles are available for electrical and physical mode, and in the main drawing window when the Print Control Panel is visible.

The panel is divided into two pages: Snapping and Style. The Snapping page is shown when the panel first appears. It provides control of the grid spacing and snapping, plus is the main control point for the edge snapping feature to be described. The Style page provides control over the visual presentation of the grid.

In most cases, the grid is not actually changed unless/until the Apply button, at the bottom-left of the panel, is pressed. This is not true of the Edge Snapping group, or the All Windows controls in the Style page, which work immediately, but do not force a screen redraw.

The following controls appear in the Snapping page.

At the top of the panel are entries which control the grid spacing and snapping. There is a coarse grid, and a fine grid, that may be displayed in drawing windows and hard-copy output. The coarse grid is an integer multiple of fine grid increments, the multiplier can be set from the Style page. If a grid would be too fine, it is not shown.

The snap grid represents points where the cursor is allowed to reside. These are related to the fine grid interval, there can be an integer number of snap points per fine grid interval, or an integer number of fine grid lines between snap points.

Snap Spacing
The Snap Spacing entry area will set the spacing, in microns, between snap points. The mouse pointer is constrained to fall only on snap points when geometry is being created. If the MfgGrid parameter has been set in the technology file, the Snap Spacing value is constrained to be a multiple of this value. The MfgGrid value is printed below the text entry area if set, or the word ``unset'' is printed if not.

The Snap Spacing entry displays the actual snap spacing in microns. If a MfgGrid has been defined, and one enters a snap spacing that is not an integer multiple of this value, the actual snap spacing will ``snap'' to the closest multiple before use.

When assigning a MfgGrid, one must consider the internal resolution, and the MfgGrid should be representable in the resolution in use. For example, the default resolution is 1000 per micron, or 1nm. If one attempts to use a MfgGrid of 2.5nm, round-off error will occur. To support this MfgGrid, a resolution of 2000 would be required. The resolution is set with the DatabaseResolution variable.

When the panel first appears, the initial keyboard focus is to the Snap Spacing entry. Thus, text typed will go to this entry. Pressing Enter when a text entry has the focus calls the Apply callback and sets focus to the Dismiss button, where another Enter press will dismiss the panel. So, to quickly change the grid spacing from the keyboard only, one can type

Ctrl-g (adjust number) Enter Enter

SnapPerGrid or GridPerSnap
To the right is another text entry, which accepts an integer in the range 1-10. The entry label indicates SnapPerGrid or GridPerSnap, depending on whether the GridPerSnap check box, below the text entry, is checked. This controls the placement of the fine grid lines in the window.

If the label indicates SnapPerGrid, then the fine grid is spaced at the given integer times the Snap Spacing value. For example, if the integer is 3, then a fine grid line (or dot) will be drawn at every third snap point. there will be three snap points per fine grid interval.

If the label indicates GridPerSnap, then the fine grid is spaced such that the integer will give the number of fine grid lines per snap interval. For example, it the integer is 3, fine grid lines (or dots) will appear at the snap points, as well as the 1/3 and 2/3 proportional distances between snap points.

Note that when the integer is 1, there is no difference between the two cases.

In electrical mode, the snap interval should be a multiple of one micron, to avoid connectivity errors due to numerical roundoff. However, this was not enforced in older releases of Xic. Presently, sub-micron snapping on tenth-micron intervals is accepted, but with a warning issued. This allows older files to be ``repaired'', i.e., objects moved to a one micron grid. This is recommended for files that require it. A sub-micron snapping interval should not be used otherwise, and will not be saved in the technology file produced with the Save Tech button in the Attributes Menu.

The Edge Snapping group appears below the grid snapping controls. This is different from grid snapping. The edge snapping will snap the cursor to the edge of a nearby object, which may or may not be off grid (``off grid'' means that the coordinate is not on a multiple of the snap grid interval). The edge snapping is used in, and the controls apply to, physical mode only. In electrical mode, the cursor will always snap to and indicate when near a connection point.

When snapped in this manner to an edge, a small dotted box transiently appears around the mouse pointer. If snapped to vertex of an object, the box will have a double outline.

Snapping will apply to visible objects at any level of the cell hierarchy. The edges of unexpanded subcells will also be snapped to.

The group consists of an Edge Snapping menu, and four check boxes, as described below. These may be set independently in the main window and sub-windows. When a new sub-window appears, it will inherit the edge snapping settings from the main window, but these can then be changed in the sub-window if desired.

Unlike other controls in the Grid Setup panel, these controls operate immediately. They do not require pressing the Apply button.

Edge Snapping Menu
The menu has three choices, to set the scope of the edge snapping mode. If DISABLED is selected, then there is no edge snapping in the window. The default entry, Enabled in some commands, enables the edge snapping in commands where it may be useful. These include the side menu commands with the following keywords:

arc
box
break
donut
erase
polyg
round
wire
xor

as well as the Rulers command in the View Menu.

The third choice is Enabled always, which provides the edge snapping at all times, in commands or outside of any command.

Allow off-grid edge snapping
When this check box is checked, the cursor will snap to nearby edges, whether or not they are on grid. When not checked, only snapping to on-grid locations is done. This is unchecked by default.

Include non-Manhattan edges
When checked, non-Manhattan (meaning not horizontal or vertical) edges will be snapped to. The snap points are the intersection of the snap grid and the edge, plus the endpoints (vertices). If not checked, non-Manhattan edges ar not snapped to. This is unchecked by default.

Include wire edges
If checked, the edges of wires are considered for edge snapping. If not checked, wire edges are ignored. This mode is enabled by default.

Include wire path
A wire definition consists of a sequence of vertices, with an implied line path connecting them. This path would appear as a line running along the center of a drawn wire. When this box is checked, the wire path is considered for ``edge'' snapping. By default, this box is unchecked, so that the wire path is not snapped to.

The Style page contains controls which alter the presentation of the grid visually.

Show
If the Show button is active, the grid will be visible when gradations are adequately large. Otherwise, the grid will not be visible in the window.

On Top
If the On Top button is active, the grid will be drawn last, after all geometry. Otherwise, it will be drawn first, in which case it is more likely to be obscured by the geometry.

Store and Recall
The Store and Recall menus allow a set of grid parameters to be saved in an internal register, to be recalled as needed. There are separate physical and electrical grid registers. One will automatically save to and recall from the register associated with the window display mode.

The grid registers save all per-window parameters that can be set from the Grid Setup panel. There are seven registers available, as indicated on the menu produced by the Store button. The Recall button produces a menu with two additional entries:

revert
Revert the Grid Setup panel to the current window settings.

last appl
Recall the last settings that were applied with the Apply button.

Grid registers are saved to the technology file when a technology file is written, and are loaded when a technology file is read.

See also the description of the !rg and !sg commands. These can be used to save and restore the grid from registers.

Axes group
Below the Show button, a radio button group is provided to set the presentation style of the axes in physical mode. The choices are No Axes, Plain Axes, and Mark Origin. The Mark Origin choice is the default. The Plain Axes choice does away with the small box at the origin, showing the axes as simple lines. The No Axes choice suppresses the axes entirely. In electrical mode, the axes are always suppressed.

Coarse Mult
To the right of the radio group is an integer entry for the coarse multiple. This is the number of fine grid lines or dots per coarse grid line or dot. Acceptable values are 1 through 50. When set to one, the coarse grid replaces the fine grid, which is shown with the coarse grid color. The default value is 5.

Line Style Editor
This group sets the line or dot style used to render the grid. There are three ``radio buttons'', Solid, Dots, and Textured that set the basic grid style. Choosing Solid will cause the grid to use continuous lines. The Dots option will use a grid consisting of a small dot or cross at each grid point. When this selection is active, a Cross Size entry area appears. This can be set to values 0-6, indicating the number of pixels to light up around the central dot in the four compass directions. If zero, only the central pixel is lit, which can be difficult to see on high-resolution displays. The value 1 generally looks like a much brighter dot. Larger values will appear as a small cross.

If Textured is chosen, a user-specified patterned line will be used, and the line style editing areas become visible. The line style editor allows the user to specify the patterning of the lines used to form the grid. The upper window is a sample of the current line style. The lower window allows the user to set the line style by clicking.

The line pattern starts at the left set bit (blue area) and extends to the right of the display. The pattern is used to ``tile'' the line. The left part of the display is shown in gray to indicate that it is not part of the line style mask. Clicking in this window with button 1 will toggle the bit. Button 2 will clear the bit, and button 3 will set the bit. Multiple bits can be set or toggled by dragging. The line in the preview window will reflect changes in the pattern.

The sample window is a drag source for a piece of text giving the line style mask in 0xhhhh (hexadecimal) notation. The mask is the integer being represented by the lower window, with set bits in blue. This may be useful for creating line styles for entry elsewhere.

All Windows
This control group appears only in the Grid Setup panel for the main drawing window. The two controls in the group are different from other controls in the panel in that they apply globally to all drawing windows. They also differ from other controls in that they operate immediately without the need to press the Apply button, however an explicit screen redraw is necessary to see the effect.

The No coarse when fine invisible check box applies in physical mode only. When the check box is not checked, as one zooms out, when the fine grid becomes too closely spaced it won't be shown, however the coarse grid will be shown, unless it too is too finely spaced. If the check box is checked, the coarse grid will not be shown by itself, it will be suppressed when the fine grid is suppressed. This tracks the state (set or unset) of the GridNoCoarseOnly variable.

The Visibility Threshold entry sets the minimum number of pixels between grid lines or dots. The grid will be suppressed if it would be smaller. This applies to all drawing windows, both physical and electrical. This tracks the setting of the GridThreshold variable.

Pressing the Apply button will actually save the new grid parameters in Xic, and redraw the window if something has changed. Changes in the Edge Snapping and All Windows groups do not need the Apply button, changes take effect immediately. All other controls require an Apply button press to assert the change, and changes will not be saved unless Apply is pressed. ---------------------------------------


next up previous contents index
Next: The Convert Menu: Data Up: The Main Window Button: Previous: The No Top Symbolic   Contents   Index
Stephen R. Whiteley 2017-03-22