From 1d437f498c5ca6a992d5ed8696147ca8e42436a9 Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Thu, 4 Jul 2019 22:03:50 +0200 Subject: [PATCH] add specification documents --- doc/spec.html | 337 +++++++ doc/spec_2.html | 2357 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2694 insertions(+) create mode 100644 doc/spec.html create mode 100644 doc/spec_2.html diff --git a/doc/spec.html b/doc/spec.html new file mode 100644 index 0000000..f0e5798 --- /dev/null +++ b/doc/spec.html @@ -0,0 +1,337 @@ + +Computer Aids for VLSI Design + +
+
Computer Aids for VLSI Design
+
Steven M. Rubin
+
Copyright © 1994
+
+

Appendix C: GDS II Format

+
+ +
Prev
Appendix 3 of 7
Next
+
+

+In the design of integrated circuits, the most popular format for +interchange is the Calma GDS II stream format (GDS II is a trademark +of Calma Company, a wholly owned subsidiary of General Electric Company, U.S.A.). +For many years, this format was the only one of its kind and many other +vendors accepted it in their systems. +Although Calma has updated the format as their CAD systems have developed, +they have maintained backward compatibility so that no GDS II files +become obsolete. +This is important because +GDS II is a binary format that makes assumptions about integer and +floating-point representations. +

+A GDS II circuit description is a collection of cells that may contain +geometry or other cell references. +These cells, called structures in GDS II parlance, have alphanumeric +names up to 32 characters long. +A library of these structures is contained in a file that consists of +a library header, a sequence of structures, and a library tail. +Each structure in the sequence consists of a structure header, a sequence +of elements, and a structure tail. +There are seven kinds of elements: boundary defines a filled polygon, +path defines a wire, structure reference invokes a subcell, +array reference invokes an array of subcells, text is for +documentation, node defines an electrical path, and box +places rectangular geometry. + +



C.1 Record Format

+ +In order to understand the precise format of the above GDS II components, +it is first necessary to describe the general record format. +Each GDS II record has a 4-byte header that specifies the record size and +function. +The first 2 bytes form a 16-bit integer that contains the record length +in bytes. +This length includes the 4-byte header and must always be an even +number. +The end of a record can contain a single null byte if the record contents +is an odd number of bytes long. +The third byte of the header contains the type of the record and the +fourth byte contains the type of the data. +Since the data type is constant for each record type, this 2-byte field +defines the possible records as shown in Figs. C.1 and C.2. +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
File Header Records:Bytes 3 and 4  Parameter Type

HEADER
0002
2-byte integer
BGNLIB
0102
12 2-byte integers
LIBNAME
0206
ASCII string
REFLIBS
1F06
2 45-character ASCII strings
FONTS
2006
4 44-character ASCII strings
ATTRTABLE
2306
44-character ASCII string
GENERATIONS
2202
2-byte integer
FORMAT
3602
2-byte integer
MASK
3706
ASCII string
ENDMASKS
3800
No data
UNITS
0305
2 8-byte floats
 
File Tail Records:Bytes 3 and 4Parameter Type

ENDLIB
0400
No data
 
Structure Header Records:  Bytes 3 and 4Parameter Type

BGNSTR
0502
12 2-byte integers
STRNAME
0606
Up to 32-characters ASCII string
 
Structure Tail Records:Bytes 3 and 4Parameter Type

ENDSTR
0700
No data
FIGURE C.1 GDS II header record types.
+

+Magnetic tapes containing GDS II files will have 2048 byte blocks that +contain these records. +The block size is standardized but has no bearing on record length or +position. +There is also a capability for circuits that require multiple +reels of tape. +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Element Header Records:Bytes 3 and 4  Parameter Type

BOUNDARY
0800
No data
PATH
0900
No data
SREF
0A00
No data
AREF
0B00
No data
TEXT
0C00
No data
NODE
1500
No data
BOX
2D00
No data
 
Element Contents Records:  Bytes 3 and 4Parameter Type

ELFLAGS
2601
2-byte integer
PLEX
2F03
4-byte integer
LAYER
0D02
2-byte integers
DATATYPE
0E02
2-byte integer
XY
1003
Up to 200 4-byte integer pairs
PATHTYPE
2102
2-byte integer
WIDTH
0F03
4-byte integer
SNAME
1206
Up to 32-character ASCII string
STRANS
1A01
2-byte integer
MAG
1B05
8-byte float
ANGLE
1C05
8-byte float
COLROW
1302
2 2-byte integers
TEXTTYPE
1602
2-byte integer
PRESENTATION
1701
2-byte integer
ASCII STRING
1906
Up to 512-character string
NODETYPE
2A02
2-byte integer
BOXTYPE
2E02
2-byte integer
FIGURE C.2 GDS II element record types.
+ +



C.2 Library Head and Tail

+ +A GDS II file header always begins with a HEADER record the parameter of which +contains the GDS II version number used to write the file. +For example, the bytes 0, 6, 0, 2, 0, 1 at the start of the file constitute +the header record for a version-1 file. +Following the HEADER comes a BGNLIB record that contains the date of the +last modification and the date of the last access to the file. +Dates take six 2-byte integers to store the year, month, day, hour, minute, and +second. +The third record of a file is the LIBNAME, which identifies the name of +this library file. +For example, the bytes 0, 8, 2, 6, "C", "H", "I", "P" define a +library named "CHIP." +Following the LIBNAME record there may be any of the optional header records: +REFLIBS to name up to two reference libraries, FONTS to name up to four +character fonts, ATTRTABLE to name an attribute file, GENERATIONS to +indicate the number of old file copies to keep, and FORMAT to indicate the +nature of this file. +The strings in the REFLIBS, FONTS, and ATTRTABLE records must be the +specified length, padded with zero bytes. +

+The parameter to FORMAT has the value 0 for an archived file and the +value 1 for a filtered file. +Filtered files contain only a subset of the mask layers and that subset +is described with one or more MASK records followed by an ENDMASK +record. +The string parameter in a MASK record names layers and sequences of layers; +for example, "1 3 5-7." +

+The final record of a file header is the UNITS record and it is not optional. +The parameters to this record contain the number of user units per +database unit (typically less than 1 to allow granularity of user +specification) and the number of meters per database unit (typically much +less than 1 for IC specifications). +

+Eight-byte floating-point numbers have a sign at the top of the first +byte, a 7-bit exponent in the rest of that byte, and 7 more bytes that +compose a mantissa (all to the right of an implied decimal point). +The exponent is a factor of 16 in excess-64 notation (that is, the mantissa +is multiplied by 16 raised to the true value of the exponent, where the +true value is its integer representation minus 64). +

+Following the file header records come the structure records. +After the last structure has been defined, the file terminates with +a simple ENDLIB record. +Note that there is no provision for the specification of a root +structure to define a circuit; this must be tracked +by the designer. + +



C.3 Structure Head and Tail

+ +Each structure has two header records and one tail record that sandwich +an arbitrary list of elements. +The first structure header is the BGNSTR record, which contains the creation +date and the last modification date. +Following that is the STRNAME record, which names the structure using +any alphabetic or numeric characters, the dollar sign, or the underscore. +The structure is then open and any of the seven elements can be listed. +

+The last record of a structure is the ENDSTR. +Following it must be another BGNSTR or the end of the library, ENDLIB. + +



C.4 Boundary Element

+ +The boundary element defines a filled polygon. +It begins with a BOUNDARY record, has an optional ELFLAGS and PLEX record, +and then has required LAYER, DATATYPE, and XY records. +

+The ELFLAGS record, which appears optionally in every element, has two +flags in its parameter to indicate template data (if bit 16 is set) +or external data (if bit 15 is set). +This record should be ignored on input and excluded from output. +Note that the GDS II integer has bit 1 in the leftmost or most significant +position so these two flags are in the least significant bits. +

+The PLEX record is also optional to every element and defines element +structuring by aggregating those that have common plex numbers. +Although a 4-byte integer is available for plex numbering, the +high byte (first byte) is a flag that indicates the head of the plex if its least +significant bit (bit 8) is set. +

+The LAYER record is required to define which layer (numbered 0 to 63) is to +be used for this boundary. +The meaning of these layers is not defined rigorously and must be +determined for each design environment and library. +

+The DATATYPE record contains unimportant information and its argument should +be zero. +

+The XY record contains anywhere from four to 200 coordinate pairs +that define the outline of the polygon. +The number of points in this record is defined by the record length. +Note that boundaries must be closed explicitly, so the first and last +coordinate values must be the same. + +



C.5 Path Element

+ +A path is an open figure with a nonzero width that is typically used +to place wires. +This element is initiated with a PATH record followed by the optional ELFLAGS +and PLEX records. +The LAYER record must follow to identify the desired path material. +Also, a DATATYPE record must appear and an XY record to define the coordinates +of the path. +From two to 200 points may be given in a path. +

+Prior to the XY record of a path specification there may be two +optional records called PATHTYPE and WIDTH. +The PATHTYPE record describes the nature of the path segment +ends, according to its parameter value. +If the value is 0, the segments will have square ends that terminate +at the path vertices. +The value 1 indicates rounded ends and the value 2 indicates +square ends that overlap their vertices by one-half of their width. +The width of the path is defined by the optional WIDTH record. +If the width value is negative, then it will be independent of any +structure scaling (from MAG records, see next section). + +



C.6 Structure Reference Element

+ +Hierarchy is achieved by allowing structure references (instances) +to appear in other structures. +The SREF record indicates a structure reference and is followed +by the optional ELFLAGS and PLEX records. +The SNAME record then names the desired structure and an XY record +contains a single coordinate to place this instance. +It is legal to make reference to structures that have not yet been +defined with STRNAME. +

+Prior to the XY record there may be optional transformation records. +The STRANS record must appear first if structure transformations are desired. +Its parameter has bit flags that indicate mirroring in x before rotation +(if bit 1 is set), the use of absolute magnification (if bit 14 is set), +and the use of absolute rotation (if bit 15 is set). +The magnification and rotation amounts may then be specified in the +optional MAG and ANGLE records. +The rotation angle is in counterclockwise degrees. + +



C.7 Array of Structures Element

+ +For convenience, an array of structure instances can be specified with +the AREF record. +Following the optional ELFLAGS and PLEX records comes the SNAME to identify +the structure being arrayed. +Next, the optional transformation records STRANS, MAG, and ANGLE give +the orientation of the instances. +A COLROW record must follow to specify the number of columns and +the number of rows in the array. +The final record is an XY with three points: the coordinate of the +corner instance, the coordinate of the last instance in the columnar +direction, and the coordinate of the last instance in the row direction. +From this information, the amount of instance overlap or separation +can be determined. +Note that flipping arrays (in which alternating rows or columns are mirrored +to abut along the same side) can be implemented with multiple arrays that +are interlaced and spaced apart to describe alternating rows or columns. + +



C.8 Text Element

+ +Messages can be included in a circuit with the TEXT record. +The optional ELFLAGS and PLEX follow with the mandatory LAYER record +after that. +A TEXTTYPE record with a zero argument must then appear. +An optional PRESENTATION record specifies the font in bits 11 and 12, +the vertical presentation in bits 13 and 14 (0 for top, 1 for +middle, 2 for bottom), and the horizontal presentation in bits 15 and 16 +(0 for left, 1 for center, 2 for right). +Optional PATHTYPE, WIDTH, STRANS, MAG, and ANGLE records may appear to +affect the text. +The last two records are required: an XY with a single coordinate to +locate the text and a STRING record to specify the actual text. + +



C.9 Node Element

+ +Electrical nets may be specified with the NODE record. +The optional ELFLAGS and PLEX records follow and the required LAYER +record is next. +A NODETYPE record must appear with a zero argument, followed by an XY record +with one to 50 points that identify coordinates on the electrical net. +The information in this element is not graphical and does not affect the +manufactured circuit. +Rather, it is for other CAD systems that use topological information. + +



C.10 Box Element

+ +The last element of a GDS II file is the box. +Following the BOX record are the optional ELFLAGS and PLEX records, +a mandatory LAYER record, a BOXTYPE record with a zero argument, +and an XY record. +The XY must contain five points that describe a closed, four-sided box. +Unlike the boundary, this is not a filled figure. +Therefore it cannot be used for IC geometry. +

+


+ + + + + + + + + + + + + + +
PrevPrevious   ContentsTable of Contents   NextNext   
Steven M. Rubin
   Static Free SoftwareSFS
+ + diff --git a/doc/spec_2.html b/doc/spec_2.html new file mode 100644 index 0000000..2563a34 --- /dev/null +++ b/doc/spec_2.html @@ -0,0 +1,2357 @@ + + + + + CHAPTER 1 GDSII format + + +  + + + + +
GDSII format
+  + + + + +
INDEX
+  +
    +
  1. +introduction
  2. + +
  3. +bachus nauer forms
  4. + +
  5. +GDSII BNF
  6. + +
  7. +Record header
  8. + +
  9. +Data types
  10. + +
  11. +record types overview
  12. + +
  13. +record types description
  14. + +
  15. +example file
  16. +
+  + + + + +
example
+ +
  +
  +
    +
  1. +text presentation of GDSII file in  +KEYformat
  2. + +
  3. +hex presentation of same file
  4. + +
  5. +GDSII file
  6. +
+  +
  + + + + +
introduction
+GDSII Stream format is the standard file format for transfering/archiving +2D graphical design data. It contains a hiearchy of structures, each structure +containing elements (boundary/polygon, path/polyline, text,box, structure +references, structure array references). The elements are situated on layers. +It is a binary format that is platform independent, because it uses internally +defined formats for its data types. While reading GDSII files, the GDSII +internal data types (like reals, integers etc.) need to be converted to +the platform/CAE package datatypes that are used.The GDSII format is a +sequential list of records, each record contains a header to tell what +information is in the record.The order of the record needs to be according +to the GDSII BNF, because of this strict organization it is relativly easy +to parse. The maximum number of vertixes is officially only 200 x,y pairs, +but many packages can read up to the absolute maximum of 64k/2=32k, simple +because this is the maximum record lenght that can be specified (two bytes).The +format is hard to read, since it is binary, for that viewers are available +to view (boolean)  the contents as ASCII. Also an ASCII format has +been developed (KEY format) which is more than just a text representation. +It is possible to convert GDSIIformat  to  KEYformat and back. +KEYformat has extended the basic primitives to contain cicrles, arcs, polygons/polylines +with arc segments. + + + + +
Bachus +Nauer Forms
+The Bachus Nauer Form uses the following symbols: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Symbol NameSymbolMeaning
Double Colon::"Is composed of."
Square brackets[ ]An element which can occor zero or one time.
Braces{ }Choose one of the elements within the braces.
Braces with an asteriks{ }*The elements within the braces can occur zero or more times.
Braces with a plus{ }+The elements within braces must occur one or more times.
Angle brackets< >These elements are further defined as a seperate entitie in the syntax +list.
Vertical bar|Or
+  + + + + +
GDSII BNF
+The following is the Bachus Naur Form of the GDSI format, the words in +capital are the names of RECORDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<stream format>::=HEADER BGNLIB LIBNAME +[REFLIBS] [FONTS]  +
[ATTRTABLE] [GENERATIONS] +[<FormatType>]  +
UNITS {<structure>}* ENDLIB
<FormatType>::=FORMAT | FORMAT +{MASK}+ ENDMASKS
<structure>::=BGNSTR STRNAME +[STRCLASS] {<element>}* ENDSTR
<element>::={<boundary> | <path> | <sref> | <aref> | <text> | <node> +| <box>} {<property>}* ENDEL
<boundary>::=BOUNDARY [ELFLAGS] +[PLEX] LAYER DATATYPE +XY
<path>::=PATH [ELFLAGS] [PLEX] +LAYER DATATYPE [PATHTYPE][WIDTH] +XY
<sref>::=SREF [ELFLAGS] [PLEX] +SNAME [<strans>] XY
<aref>::=AREF [ELFLAGS] [PLEX] +SNAME [<strans>] COLROW +XY
<text>::=TEXT [ELFLAGS] [PLEX] +LAYER <textbody>
<node>::=NODE [ELFLAGS]. +[PLEX] LAYER NODETYPE +XY
<box>::=BOX [ELFLAGS] [PLEX] +LAYER BOXTYPE XY
<textbody>::=TEXTYPE [PRESENTATION] +[PATHTYPE] [WIDTH] +[<strans>] XY STRING
<strans>::=STRANS [MAG] [ANGLE]
<property>::=PROPATTR PROPVALUE
+  + + + + +
Record +header
+The Stream format output file is composed of variable length records. Record +length is measured in bytes. The minimum record length is four bytes. Within +the record, two bytes (16 bits) is a word. The 16 bits in a word are numbered +0 to 15, left to right.The first four bytes of a record compose the recordheader. +The first two bytes of the recordheader contain a count (in eight-bit bytes) +of the total record length, so the maximum length is 65536 (64k). The next +record starts immediately after the last byte of the previous record.The +third byte of the header is the record type. The fourth byte of the header +identifies the type of data contained within the record. The fifth until +count bytes of a record contain the data. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bitnr0123456789101112131415
Word1Total Record length in bytes
Word2Record TypeData type
Word3Data until Word n (total record length/2)
+  + + + + +
Data Types
+The fourth byte in the record header contains the data type for the rest +of the record. The record length is used to find the number of  items +of the specified datatype. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Data TypeValue
No Data0
Bit Array1
Two Byte Signed Integer2
Four Byte Signed Integer3
Four Byte Real4 (not used)
Eight Byte Real5
ASCII string6
+  +
    +
  1. +Bit Array:
  2. + +
    A bit array is a word which uses the value of a particular bit or group +of bits to represent data. A bit array allows oneword to represent a number +of simple pieces of information. +
      +
  3. +Two-Byte Signed Integer:
  4. + +
    2-byte integer = 1 word 2s-complement representation. The range of +two-byte signed integers is -32,768 to 32,767. + +

    The following is a representation of a two-byte integer, where S is +the sign and M is the magnitude. + +

    smmmmmmm mmmmmmmm + +

    The following are examples of two-byte integers: + +

    00000000 00000001 = 1 +
    00000000 00000010 = 2 +
    00000000 10001001 = 137 +
    11111111 11111111 = -1 +
    11111111 11111110 = -2 +
    11111111 01110111 = -137 +
      +

  5. +Four-Byte Signed Integer:
  6. + +
    4-byte integer = 2 word 2s-complement representation + +

    The range of four-byte signed integers is -2,147,483,648 to 2,147,483,647. + +

    The following is a representation of a four-byte integer, where S is +the sign and M is the magnitude. + +

    smmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm + +

    The following are examples of four-byte integers: + +

    00000000 00000000 00000000 00000001 = 1 +
    00000000 00000000 00000000 00000010 = 2 +
    00000000 00000000 00000000 10001001 = 137 +
    11111111 11111111 11111111 11111111 = -1 +
    11111111 11111111 11111111 11111110 = -2 +
    11111111 11111111 11111111 01110111 = -137 +
      +

  7. +Four-Byte Real
  8. + +
    4-byte real = 2-word floating point representation + +

    (See 5.) +
      +

  9. +Eight-Byte Real
  10. + +
    8-byte real = 4-word floating point representation + +

    For all non-zero values: +

      +
        +
      • +A floating point number has three parts: the sign, the exponent, and the +mantissa.
      • + +
      • +The value of a floating point number is defined as:
      • + +
      • +(Mantissa) x (16 raised to the true value of the exponent field).
      • + +
      • +The exponent field (bits 1-7) is in Excess-64 representation.
      • + +
      • +The 7-bit field shows a number that is 64 greater than the actual exponent.
      • + +
      • +The mantissa is always a positive fraction >=1/16 and <1. For a 4-byte +real, the mantissa is bits 8-31. For an 8-byte real, the mantissa is bits +8-63.
      • + +
      • +The binary point is just to the left of bit 8.
      • + +
      • +Bit 8 represents the value 1/2, bit 9 represents 1/4, etc.
      • + +
      • +In order to keep the mantissa in the range of 1/16 to 1, the results of +floating point arithmetic are normalized. Normalization is a process where +by the mantissa is shifted left one hex digit at a time until its left +FOUR bits represent a non-zero quantity. For every hex digit shifted, the +exponent is decreased by one. Since the mantissa is shifted four bits at +a time, it is possible for the left three bits of the normalized mantissa +to be zero. A zero value, also called true zero, is represented by a number +with all bits zero.
      • +
      +
    +The following are representations of 4-byte and 8-byte reals, where S is +the sign, E is the exponent, and M is the magnitude. Examples of 4-byte +reals are included in the following pages, but 4-byte reals are not used +currently. The representation of the negative values of real numbers is +exactly the same as the positive, except that the highest order bit is +1, not 0. In the eight-byte real representation, the first four bytes are +exactly the same as in the four-byte real representation. The last four +bytes contain additional binary places for more resolution. + +

    4-byte real: + +

    SEEEEEEE MMMMMMMM MMMMMMMM MMMMMMMM + +

    8-byte real: + +

    SEEEEEEE MMMMMMMM MMMMMMMM MMMMMMMM MMMMMMMM +MMMMMMMM MMMMMMMM + +

    Examples of 4-byte real: + +

    Note: In the first six lines of the following example, the 7-bit exponent +field = 65. The actual exponent is 65-64=1. + +

    01000001 00010000 00000000 00000000 = 1 +
    01000001 00100000 00000000 00000000 = 2 +
    01000001 00110000 00000000 00000000 = 3 +
    11000001 00010000 00000000 00000000 = -1 +
    11000001 00100000 00000000 00000000 = -2 +
    11000001 00110000 00000000 00000000 = -3 +
    01000000 10000000 00000000 0000000 = 0 .5 +
    01000000 10011001 10011001 1001100 = 1 .6 +
    01000000 10110011 00110011 0011001 = 1 .7 +
    01000001 00011000 00000000 00000000 = 1.5 +
    01000001 00011001 10011001 10011001 = 1.6 +
    01000001 00011011 00110011 00110011 = 1.7 +
    00000000 00000000 00000000 00000000 = 0 +
    01000001 00010000 00000000 00000000 = 1 +
    01000001 10100000 00000000 00000000 = 10 +
    01000010 01100100 00000000 00000000 = 100 +
    01000011 00111110 00000001 00000000 = 1000 +
    01000100 00100111 00010000 00000000 = 10000 +
    01000101 00011000 01101010 00000000 = 100000 +
      +

  11. +ASCII String
  12. + +
    A collection of ASCII characters, where each character is represented +by one byte. All odd length strings must be padded with a null character +(the number zero), and the byte count for the record containing the ASCII +string must include this null character. Stream read-in programs must look +for the null character and decrease the length of the string by one if +the null character is present.
+  + + + + +
Record +Types Overview
+The following table gives an overview of all the record that are used within +a GDSII file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nr.CodeMnemonicData Typedescription
00002HEADERTwo-Byte Signed Integerversion number
10102BGNLIBTwo-Byte Signed Integerbegin of library, last modification date and time
20206LIBNAMETwo-Byte Signed Integername of library
30305UNITSEight-Byte Realuser and database units
40400ENDLIBNo Dataend of library
50502BGNSTRTwo-Byte Signed Integerbegin of structure + creation and modification time
60606STRNAMEASCII stringname of structure
70700ENDSTRNo Dataend of structure
80800BOUNDARYNo Databegin of boundary element
90900PATHNo Databegin of path element
100A00SREFNo Databegin of structure reference element
110B00AREFNo Databegin of array reference element
120C00TEXTNo Databegin of text element
130D02LAYERTwo-Byte Signed Integerlayer number of element
140E02DATATYPETwo-Byte Signed IntegerDatatype number of element 
150F03WIDTHFour-Byte Signed Integerwidth of element in db units
161003XYFour-Byte Signed Integerlist of xy coordinates in db units
171100ENDELNo Dataend of element
181206SNAMEASCII stringname of structure reference
191302COLROWTwo-Byte Signed Integernumber of colomns and rows in array reference
211500NODENo Databegin of node element
221602TEXTTYPETwo-Byte Signed Integertexttype number
231701PRESENTATIONBit Arraytext presentation, font
251906STRINGASCII stringcharacter string for text element
261A01STRANSBit Arrayarray reference, structure reference and text transform flags
271B05MAGEight Byte Realmagnification factor for text and references
281C05ANGLEEight Byte Realrotation angle for text and references
311F06REFLIBSASCII stringname of referenced libraries
322006FONTSASCII stringname of text fonts definition files
332102PATHTYPETwo-Byte Signed Integertype of PATH element end ( rounded, square)
342202GENERATIONSTwo-Byte Signed Integernumber of deleted structure ?????
352306ATTRTABLEASCII stringattribute table, used in combination with element properties
382601ELFLAGSTwo-Byte Signed Integertemplate data
422A02NODETYPETwo-Byte Signed Integernode type number for NODE element
432B02PROPATTRTwo-Byte Signed Integerattribute number
442C06PROPVALUEASCII stringattribute name
452D00BOXNo Databegin of box element
462E02BOXTYPETwo-Byte Signed Integerboxtype for box element
472F03PLEXFour-Byte Signed Integerplex number
503202TAPENUMTwo-Byte Signed IntegerTape Number
513302TAPECODETwo-Byte Signed IntegerTape code
543602FORMATTwo-Byte Signed Integerformat type
553706MASKASCII stringlist of layers
563800ENDMASKSNo Dataend of MASK
+  + + + + +
Record +types description
+Records are always an even number of bytes long. The first four bytes of +a record are the  record +header. If a record contains ASCII string data and the ASCII string +is an odd number of bytes long, the data is padded with a null character. +This paragraph lists the record types with a brief description of each. +The descriptions include the record name and a four-digit number in brackets. +The first two numbers within the brackets are the record type, and the +last two numbers in brackets are the data type. All record numbers are +expressed in hexadecimal. +
  + + + + + + + + + + +
0HEADER0002Two-Byte Signed Integer
+Contains two bytes of data representing the Stream version number. +
  + + + + + + + + + + +
1BGNLIB0102Two-Byte Signed Integer
+Contains the last modification time of a library (two bytes each for year, +month, day, hour, minute, and second), the time of last access (same format), +and marks the beginning of a library. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bit0123456789101112131415
word1l C (hex) # of bytes in record
word201 (hex) 02 (hex)
word3year (lastmodification time)
word4month
word5day
word6hour
word7minute
word8second
word9year (last access time)
word10month
word11day
word12hour
word13minute
word14second
+  + + + + + + + + + + +
2LIBNAME0206ASCII String
+Contains a string which is the library name. The library name must follow +UNIX filename conventions for length and valid characters. The library +name may include the file extension (.sf or db in most cases). +
  + + + + + + + + + + +
3UNITS0305Eight-Byte Real
+Contains two eight-byte real numbers. The first number is the size of a +database unit in user units. The second number is the size of a database +unit in meters. For example, if you create a library with the default units +(user unit = 1 micron and 1000 database units per user unit), the first +number is .001, and the second number is 1E-9. Typically, the first number +is less than 1, since you use more than 1 database unit per user unit. +To calculate the size of a user unit in meters, divide the second number +by the first. +
  + + + + + + + + + + +
4ENDLIB0400No Data
+Marks the end of a library. +
  + + + + + + + + + + +
5BGNSTR0502Two-Byte Signed Integer
+Contains the creation time and last modification time of a structure (in +the same format as the BGNLIB record), and marks the beginning of a structure. +
  + + + + + + + + + + +
6STRNAME0606ASCII String
+Contains a string which is the structure name. A structurename may be up +to 32 characters long. Legal structurename characters are: + +  + + + + + + + + + + +
7ENDSTR0700No Data
+Marks the end of a structure. +
  + + + + + + + + + + +
8BOUNDARY0800No Data
+Marks the beginning of a boundary element. +
  + + + + + + + + + + +
9PATH0900No Data
+Marks the beginning of a path element. +
  + + + + + + + + + + +
10SREF0A00No Data
+Marks the beginning of an Sref (structure reference) element. +
  + + + + + + + + + + +
11AREF0B00No Data
+Marks the beginning of an Aref (array reference) element. +
  + + + + + + + + + + +
12TEXT0C00No Data
+Marks the beginning of a text element. +
  + + + + + + + + + + +
13LAYER0D02Two-Byte Signed Integer
+Contains two bytes which specify the layer. The value of the layer must +be in the range of 0 to 255. +
  + + + + + + + + + + +
14DATATYPEOEO2Two-Byte Signed Integer
+Contains two bytes which specify the datatype. The value of the datatype +must be in the range of 0 to 255. +
  + + + + + + + + + + +
15WIDTH0F03Two-Byte Signed Integer
+Contains four bytes which specify the width of a path or text lines in +database units. A negative value for width means that the width is absolute, +that is, the width is not affected by the magnification factor of any parent +reference. If omitted, zero is assumed. +
  + + + + + + + + + + +
16XY1003Two-Byte Signed Integer
+  + +  + + + + + + + + + + +
17ENDEL1100No Data
+Marks the end of an element. + + + + + + + + + + +
18SNAME1206ASCII string
+Contains the name of a referenced structure.See also STRNAME. + + + + + + + + + + +
19COLROW1302Two-Byte Signed Integer
+Contains four bytes. The first two bytes contain the number of columns +in the array. The third and fourth bytes contain the number of rows. Neither +the number of columns nor the number of rows may exceed 32,767 (decimal), +and both are positive. See also AREF. +
  + + + + + + + + + + +
21NODE1500No Data
+Present Marks the beginning of a node +
  + + + + + + + + + + +
22TEXTTYPE1602Two-Byte Signed Integer
+Contains two bytes representing texttype. The value of the texttype must +be in the range 0 to 255. +
  + + + + + + + + + + +
23PRESENTATION1701Bit Array
+Contains one word (two bytes) of bit flags for text presentation. Bits +10 and 11, taken together as a binary number, specify the font (00 means +font 0, 01 rneans font 1, 10 means font 2, and 11 means font 3). Bits 12 +and 13 specify the vertical justification (00 means top, 01 means middle, +and 10 means bottom). Bits 14 and 15 specify the horizontal justification +(00 means left, 01 means center, and 10 means right). Bits 0 through 9 +are reserved for future use and must be cleared. If this record is omitted, +then top-left justification and font 0 are assumed. The following shows +a PRESENTATION record. +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bit0123456789101112131415
word16 (hex) # of bytes in record
word217 (hex) 01 (hex)
word3unused font numbervertical  +
presentaion
horizontal presentation
+  + + + + + + + + + + +
25STRING1906ASCII String
+Contains a character string, up to 512 characters long, for text presentation. +
  + + + + + + + + + + +
26STRANS1A01Bit Array
+Contains two bytes of bit flags for Sref, Aref, and text transforrnation. +Bit 0 (the leftmost bit) specifies reflection. If bit 0 is set, the element +is reflected about the X-axis before angular rotation. For an Aref, the +entire array is reflected, with the individual array members rigidly attached. +Bit 13 flags absolute magnification. Bit 14 flags absolute angle. Bit 15 +(the rightmost bit) and all remaining bits are reserved for future use +and must be cleared. If this record is omitted, the element is assumed +to have no reflection, non-absolute magnification, and non- absolute angle. +
The following shows a STRANS record. +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bit0123456789101112131415
word16 (hex) # of bytes in record
word21A (hex) 01 (hex)
word3reflection unusedabsolute  +
magnification
absolute angleunused
+  + + + + + + + + + + +
27MAG1B05Eight Byte Real
+Eight-Byte Real Contains a double-precision real number (8 bytes), which +is the magnification factor. If this record is omitted, a magnification +factor of one is assumed. +
  + + + + + + + + + + +
28ANGLE1C05Eight Byte Real
+Eight-Byte Real Contains a double-precision real number (8 bytes), which +is the angular rotation factor. The angle of rotation is measured in degrees +and in the counterclockwise direction. For an Aref, +the ANGLE rotates the entire array (with the individual array members rigidly +attached) about the array reference point. For COLROW +record information, the angle of rotation is already inlcuded in the coordinates. +If this record is omitted, an angle of zero degrees is assumed. +
  + + + + + + + + + + +
31REFLIBS1F06ASCII String
+Contains the names of the reference libraries. This record must be present +if any reference libraries are bound to the working library. The name of +the first reference library starts at byte 5 (immediately following the +record header) and continues for 44 bytes. The next 44 bytes contain the +name of the second library. The record is extended by 44 bytes for each +additional library (up to 15) which is bound for reference. The reference +library names may include directory specifiers (separated with "/") and +an extension (separated with "."). If either the first or second library +is not named, its place is filled with nulls. +
  + + + + + + + + + + +
32FONTS2006ASCII String
+Contains the names of the textfont definition files. This record must be +present if any of the four fonts have acorresponding textfont definition +file. This record must not be present if none of the fonts have a textfont +definition file. The textfont filename of font 0 starts the record, followed +by the textfont files of the remaining three fonts.Each filename is 44 +bytes long. The filename is padded withnulls if the name is shorter than +44 bytes. The filename is null if no textfont definition corresponds to +the font. The textfont filenames may include directory specifiers (separated +with "/" and an extension (separated with "."). +
  + + + + + + + + + + +
33PATHTYPE2102Two-Byte Signed Integer
+This record contains a value that describes the type of path endpoints. +The value is + +If not specified, a Path-type of 0 is assumed. + +

The following picture shows the pathtypes +
  + + + + + + + + + + + + + + +
Pathtype 0 produces a square-ended path, ending flush with +thedigitized endpoints. This is the de-fault pathtype if none is specified
Pathtype 1 produces a round-ended path. The two ends aresemicircular +with center at thedigitized endpoints.
Pathtype 2 produces a square-ended path. The ends of the pathextend +beyond the digitized end-points by one-half the path width.
+  + + + + + + + + + + +
34GENERATIONS2202Two-Byte Signed Integer
+This record contains a value to indicate the number of copies of deleted +or back-up structures to retain. This numbermust be at least 2 and not +more than 99. If the GENERATION record is omitted, a value of 3 is assumed. +
  + + + + + + + + + + +
35ATTRTABLE2306Two-Byte Signed Integer
+Contains the name of the attribute definition file. This record is present +only if an attribute definition file is bound to the library. The attribute +defenition filename may include directory specifiers (separated with "/") +and an extension (separated with "."). Maximum record size is 44 bytes. +
  + + + + + + + + + + +
36STYPTABLE2502Two-Byte Signed Integer
+Unrelesed Feature +
  + + + + + + + + + + +
37STRTYPE2502Two-Byte Signed Integer
+Unrelesed Feature +
  + + + + + + + + + + +
38ELFLAGS2601Bit Array
+Contains two bytes of bit flags. Bit 15 (the rightmost bit)specifies Template +data. Bit 14 specifies External data(also referred to as Exterior data). +All other bits are currently unused and must be cleared to 0. If this record +isomitted, all bits are assumed to be 0. The following shows an ELFLAGS +record. + +

For additional information on Template data, consult the GDSII Reference +Manual. For additional information on External data, consult the CustomPlus +User's Manual. +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bit0123456789101112131415
word16 (hex) # of bytes in record
word226 (hex) 01 (hex)
word3unusedexternal datatemplate  +
data
+  + + + + + + + + + + +
39ELKEY2703Two-Byte Signed Integer
+(Unreleased feature) +
  + + + + + + + + + + +
40LINKTYPE28Two-Byte Signed Integer
+(Unreleased feature) +
  + + + + + + + + + + +
41LINKKEYS29Two-Byte Signed Integer
+(Unreleased feature) +
  + + + + + + + + + + +
42NODETYPE2A02Two-Byte Signed Integer
+Contains two bytes which specify nodetype. The value ofthe nodetype must +be in the range of 0 to 255. +
  + + + + + + + + + + +
43PROPATTR2B02Two-Byte Signed Integer
+Contains two bytes which specify the attribute number. The attribute number +is an integer from 1 to 127. Attribute numbers 126 and 127 are reserved +for the user integer and userstring (CSD) properties which existed prior +to Release 3.0. +
  + + + + + + + + + + +
44PROPVALUE2C06ASCII string
+Contains the string value associated with the attribute named in the preceding +PROPATTR record. Maximumlength is 126 characters. The attribute-value pairs +associated with any one element must all have distinct attribute numbers. +Also, the total amount of property data that may be associated with any +one element is limited: thetotal length of all the strings, plus twice +the number of attribute-value pairs, must not exceed 128 (or 512 if the +element is an Sref, Aref, contact, nodeport, or node). + +

For example, if a boundary element uses property attribute2 with property +value "metal," and property attribute 10 with property value "property," +the total amount of property data is 18 bytes. This is 6 bytes for "metal" +(odd-length strings must be padded with a null) + 8 for "property" + 2 +times the 2 attributes (4) = 18. +
  + + + + + + + + + + +
45BOX2D00No Data
+Marks the beginning of a box element. +
  + + + + + + + + + + +
46BOXTYPE2E02Two-Byte Signed Integer
+Contains two bytes which specify boxtype. The value of the boxtype must +be in the range of 0 to 255. +
  + + + + + + + + + + +
47PLEX2F03Two-Byte Signed Integer
+A unique positive number which is common to all elementsof the plex to +which this element belongs. The head of the plex is flagged by setting +the seventh bit; therefore, plexnumbers should be small enough to occupy +only the right-most 24 bits. If this record is not present, the element +is not a plex member Applies to Pathtype 4.Contains four bytes which specify +indatabase units the distance a path outline begins before orafter the +last point of the path. Value can be negative. +
  + + + + + + + + + + +
50TAPENUM3202Two-Byte Signed Integer
+Contains two bytes which specify the number of the current reel of tape +for a multi-reel Stream file. For the first tape, the TAPENUM is 1: for +the second tape, the TAPENUM is 2. For each additional tape, increment +the TAPENum by one. +
  + + + + + + + + + + +
51TAPECODE3302Two-Byte Signed Integer
+Contains 12 bytes. This is a unique 6-integer code which iscommon to all +the reels of multi-reel Stream file. It verifies that the correct reels +are being read. +
  + + + + + + + + + + +
52STRCLASS3401Two-Byte Signed Integer
+Not used +
  + + + + + + + + + + +
53RESERVED3503Two-Byte Signed Integer
+This record type was used for NUMTYPES but was not required. + + + + + + + + + + +
54FORMAT3602Two-Byte Signed Integer
+Defines the format of a Stream tape in two bytes. The possible values are: +

    +
  1. +for GDSII Archive format
  2. + +
  3. +for GDSII Filtered format
  4. + +
  5. +for EDSM Archive format
  6. + +
  7. +for EDSHI Filtered forrnat
  8. +
+An Archive Stream file contains elements for all the layers and data types. +In an Archive Stream file, the FORMAT record is followed immediately by +the UNITS record. A file which does not have the FORMAT record is assumed +to be an Archive file. + +

A Filtered Stream file contains only the elements on the layers and +with the datatypes you specify during creation ofthe Stream file. The list +of layers and datatypes specified appear in MASK records. At least one +MASK record must immediately follow the FORMAT record. The MASK records +are terminated with the ENDMASKS record. +
  + + + + + + + + + + +
55MASK3706ASCII string
+(Required for and present only in FilteredStream file. ) +
Contains the list of layers and datatypes specified by the user when +creating the file. At least one MASK record must immediately follow the +FORMAT record. More than one MASK record may occur. The last MASK record +is followed by the ENDMASK record. +
In the MASK list, datatypes are separated from the layers with a semicolon. +Individual layers or datatypes are sepa-rated with a space. A range of +layers or datatypes is specified with a dash. + +

An example MASK list looks like this: 1 5 -7 10 ; 0- 255 + + + + + + + + + + +
56ENDMASKS3800NoData
+(Required for and present only in FilteredStream file.) +
Marks the end of the MASK records. The ENDMASKS record must follow +the last MASK record. ENDMASKS is immediately followed by the UNITS record. + +