next up previous contents index
Next: Cell Name Mapping Up: Layout File Input/Output Functions Previous: Layout File Input/Output Functions   Contents   Index

Layer Conversion Aliasing

There is provision for a layer aliasing mechanism which is applied when a data file is read. This capability is exported through an interface consisting of the UseLayerAlias and LayerAlias variables, and the script functions described below.

This is different from the LppName aliasing which applies to Xic layers, and is built into the layer database. The conversion aliases apply only while a layout file is being read.

(int) ReadLayerCvAliases(handle_or_filename)
The argument can be either a string giving a file name, or a file handle as returned from the Open function or equivalent (opened for reading). This function will read layer aliases, adding the definitions to the layer alias table. The format consists of lines of the form
name= newname
where both name and newname are four-character CIF-type layer names, and there is one definition per line. Lines with a syntax error or bad layer name are silently ignored. When the layer alias table is active, layers read from an input file will be substituted, i.e., if a layer named name is read, it will be replaced with newname. For data formats that use layer number and datatype numbers, such as GDSII, the layer names should be in the form of a four or eight-byte hex number, using upper case, where the left bytes represent the hex value of the layer number, zero padded, and the right bytes represent the zero padded datatype number. The eight-byte form should be used if the layer or datatype is larger than 255. Alternatively, the decimal form L,D is accepted for layer tokens, where the decimal layer and datatype numbers are separated by a comma with no space.

The function returns 1 on success, 0 otherwise.

(int) DumpLayerCvAliases(handle_or_filename)
The argument can be either a string giving a file name, or a file handle as returned from the Open function or equivalent (opened for writing). This function will dump the layer alias table. The format consists of lines of the form
name= newname
with one definition per line, where name and newname are CIF-type four character layer names, with newname being the replacement. The function returns 1 on success, 0 otherwise.

(int) ClearLayerCvAliases()
This function will remove all entries in the layer alias table. The function always returns 1.

(int) AddLayerCvAlias(lname, new_lname)
This function will add the layer name string new_lname as an alias for the layer name string lname to the layer alias table. If an error occurs, or an alias for lname already exists in the table (it will not be replaced) the function returns 0. The function otherwise returns 1.

(int) RemoveLayerCvAlias(lname)
This function removes any alias for lname from the layer alias table. The function always returns 1.

(string) GetLayerCvAlias(lname)
This function returns a string containing the alias for the passed layer name string, obtained from the layer alias table. If no alias exists for lname, a null string is returned.


next up previous contents index
Next: Cell Name Mapping Up: Layout File Input/Output Functions Previous: Layout File Input/Output Functions   Contents   Index
Stephen R. Whiteley 2024-09-29