next up previous contents index
Next: Current Directory Up: Operating System and Input/Output Previous: Skeleton Mode   Contents   Index


Assembly Stream

These functions implement a functionality similar to the !assemble command. Unlike !assemble, it is possible to set input conversion modes on the individual files.

(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 merging 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_context, scale, layer_list, use_layer_list, layer_aliases,
cname_prefix, cname_suffix, ccvt)

This function will add a source specification to a stream. The specification can refer to either an archive file, or to a context handle. 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.

stream_handle
Handle to the stream object.

file_or_context
This argument can be either a string giving a path to an archive file, or a context handle as returned from GetArchiveContext. If a context is passed, at least one cell instance must be specified with StreamInstance.

scale
A scale factor applied when writing. For a context, the scale will multiply the scale factor provided to GetArchiveContext in output.

layer_list
This can be a string containing a space-separated list of layer names. If 0 is given instead, the argument effectively contains the present value of the LayerList ``!set'' variable.

use_layer_list
If this value is a string starting with `n' or `N', objects on layers found in the layer_list will be skipped in output. If set to any other string, only objects found on layers in the layer_list will be written. If 0 is given, the argument is effectively the current value of the UseLayerList variable.

layer_aliases
This can be set to a string containing ``name=alias'' layer name substitution assignments. Objects on layer name will be written on layer alias. If 0 is passed instead, and the UseLayerAlias variable is currently set, the argument is effectively the current contents of the Layer Alias table.

cname_prefix
This can be set to a prefix string for cell name modification. If 0 is passed, this argument is effectively the current value of the InCellNamePrefix variable. Name modification is performed in the manner of that variable.

cname_suffix
This can be set to a suffix string for cell name modification. If 0 is passed, this argument is effectively the current value of the InCellNameSuffix variable. Name modification is performed in the manner of that variable.

ccvt
This integer controls case-conversion of cell names. If 1, upper case names are converted to lower case. If 2, lower case names are converted to upper case. Otherwise, no case conversion is done.

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, no_empties, flatten, array, clip)
This function will add an instance name to the most recently added source file (using StreamSource). The cellname must match the name of a cell found in the archive specified in the source, including any aliasing in effect. There are two consequences: only the named cell and 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 scale factor for the cell.

At least one instance must be specified to a source supplied as a context description. A source must have been specified before this function can be called successfully.

The remaining arguments are ignored unless the extraction flag is set in the source. When extracting, a context structure is built for the source, which enables the operations to which these arguments pertain.

no_empties
If the boolean value no_empties is nonzero, empty subcells will not be written to output.

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. This window should be equal to or contained in the window used to configure the context, if any.

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: Current Directory Up: Operating System and Input/Output Previous: Skeleton Mode   Contents   Index
Stephen R. Whiteley 2006-10-23