next up previous contents index
Next: Geometry Editing Functions 1 Up: Layout File Input/Output Functions Previous: Cell Geometry Digest   Contents   Index

Assembly Stream

These functions implement a functionality similar to the !assemble command.

(stream_handle) StreamOpen(outfile)
Open an assembly stream to the file outfile. The file format that will be used is obtained from the extension of the name given, which must be one of

CGX .cgx
CIF .cif
GDSII .gds, .str, .strm, .stream
OASIS .oas

If successful, a handle to the stream control structure is returned, which can be passed to other functions which require this data type. A scalar zero is returned on error. The returned handle is used to implement processing of archive data similar to the !assemble command.

(int) StreamTopCell(stream_handle, cellname)
Define the name of a top-level cell that will be created in the output stream. At most one definition is possible in a stream. If successful 1 is returned, otherwise 0 is returned.

(int) StreamSource(stream_handle, file_or_chd, scale, layer_filter, name_change)
This function will add a source specification to a stream. The specification can refer to either an archive file, or to a Cell Hierarchy Digest (CHD). Upon successful return, the source will be queued for writing to the stream (initiated with StreamRun). Arguments set various modes and conditions that will apply during the write.

This function specifies the equivalent of a Source Block as described for the !assemble command. The StreamInstance function is used to add ``Placement Blocks''.

stream_handle
Handle to the stream object.

file_or_chd
This argument can be either a string giving a path to an archive file, or the access name of a Cell Hierarchy Digest in memory.

scale
This is a scaling factor which applies only when streaming the entire file, which will occur if no instances are specified for the source with the StreamInstance function. It is ignored if an instance is specified. When used, all coordinates read from the source file will be multiplied by the factor, which can be in the range 0.001 - 1000.0.

layer_filter
This is a switch integer that enables or disables use of the layer filtering and aliasing capability. If 0, no layer filtering or aliasing will be done. If nonzero, layer filtering and aliasing will be be performed when reading from the source, according to the present values of the variables listed below. These values are saved, so that the variables can subsequently change.
LayerList
UseLayerList
LayerAlias
UseLayerAlias

If needed, these variables should be set to the desired values before calling this function, then reset to the previous values after the call. This can be done with the Get and Set functions.

name_change
This is a switch integer that enables or disables use of the Cell Name Mapping capability. If 0, no cell name changes are done, except that if a name clash is detected, a new name will be supplied, similar to the auto-aliasing feature. If nonzero, cell name mapping will be performed when the source is read according to the present values of the variables listed below. These values are saved, so that the variables can subsequently change.
InCellNamePrefix
InCellNameSuffix
InToLower
InToUpper

If needed, these variables should be set to the desired values before calling this function, then reset to the previous values after the call. This can be done with the Get and Set functions.

The function returns one on success, zero otherwise with an error message probably available through GetError.

(int) StreamInstance(stream_handle, cellname, x, y, my, rot, magn, scale, no_hier,
ecf_level, flatten, array, clip)

This function will add a placement name to the most recently added source file (using StreamSource). A source must have been specified before this function can be called successfully. This function specifies the equivalent of a Placement Block as described for the !assemble command.

The cellname must match the name of a cell found in the source, including any aliasing in effect. There are two consequences of calling this function: the named cell and possibly its subcell hierarchy will be written to output, and if a top cell was specified (with StreamTopCell), an instance of the named cell will be placed in the top cell. The placement is governed by the x, y, my, ang, and magn arguments, which are ignored if there is no top cell.

The x,y are the translation coordinates of the cell origin. The my is a flag indicating Y-reflection before rotation. The ang is the rotation angle, in degrees, and must be a multiple of 45 degrees. The magn is the magnification factor for the placement. These apply to the instantiation only, and have no effect on the cell definitions.

The remaining arguments affect the cell definitions that are created in the output file.

scale
This is a scale factor by which all coordinates are scaled in cell definition output, and is a real number in the range 0.001 - 1000.0. This is different from the magn factor, which applies only to the instance placement.

no_hier
This is a boolean value that when nonzero indicates that only the named cell, and not its hierarchy, is written to output. This can cause the output file to have unresolved references.

ecf_level
This is an integer 0-3 which specifies the empty cell filtering level as described for the Format Conversion panel in 14.10. The values are

0 No empty cell filtering.
1 Apply pre- and post-filtering.
2 Apply pre-filtering only.
3 Apply post-filtering only.

flatten
If the boolean variable flatten is nonzero, the objects in the hierarchy under cellname will be created in cellname, thus only one cell, containing all geometry, will be written.

array
If the array argument is passed 0, no windowing will be used. Otherwise the array should have four components which specify a rectangle, in microns, in the coordinates of cellname. The values are

array[0] X left
array[1] Y bottom
array[2] X right
array[3] Y top

If an array is given, only the objects and subcells needed to render the window will be written.

clip
If the boolean value clip is nonzero and an array is given, objects will be clipped to the window. Otherwise no clipping is done.

The function returns one on success, zero otherwise with an error message probably available through GetError.

(int) StreamRun(stream_handle)
This function will initiate the writing from the sources previously specified with SteamSource into the output file. The real work is done here. The function returns one on success, zero otherwise with an error message probably available through GetError.


next up previous contents index
Next: Geometry Editing Functions 1 Up: Layout File Input/Output Functions Previous: Cell Geometry Digest   Contents   Index
Stephen R. Whiteley 2017-10-02