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.
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
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.
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.
The Style page contains controls which alter the presentation of the grid visually.
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:
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.
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.
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. ---------------------------------------