last revised October 19, 2016
1. Run gscan.exe to get GDSII File Information
The gscan program "scans" the GDSII file and extracts all sorts of information needed by the converter including a list of structures, the structure hierarchy, and a list of layers with data. The output from gscan is an ascii file ending in the suffix .ssn.
The gscan command line
gscan.exe <input file> <-max:max structures> -sh -sea -elmcnt -dtp <-o:output file> where input file is the GDSII input file name. -max:max is the maximum number of structures. default = 8192. -o:output file it the output file name. it must be <input file>.ssn.
"c:\wcad\asm600\gscan.exe" "c:\tmp\demo1.gds" -max:8192 -sh -sea -elmcnt -dtp "-o:c:\tmp\demo1.ssn"
2. Run g2gbreng.exe To Extract Polyline And Circle Information
Note: This step is only necessary if you want to "flash" circles or convert paths with width directly to Gerber draws with a matching aperture.
The module, g2gbreng.exe, scans the GDSII file and builds a table of information listing the unique widths of any paths it finds in the GDSII file. This list of "widths" can be used to direct the converter to create matching "apertures" for each path.
The algorithm that attempts to identify "circular" pads is also part of g2gbreng.exe. This checks boundaries and if they meet a particular criteria (i.e. they have 20 or more vertices, the angles of the vertices are equal and lines bisecting the vertices meet....) then they can be converted in the internal database to "circles" which can be flashed in the Gerber output. This is a very useful routine when converting designs that would normally have round pads (such as a BGA) as such pads can only be approximated in GDSII.
The g2gbreng.exe command line
g2gbreng.exe <input file> x 1.0 -x 1.0 <structure> -p -scan where input file the GDSII input file name. structure the structure in the GDSII file to translate (case sensitive)
This will generate he ascii file, <input file>.cir, in the working directory.
"c:\wcad\asm600\g2gbreng.exe" "c:\tmp\demo1.gds" x 1.0 -x 1.0 TOP -p -scan
3. Create an Aperture File (.apt)
The aperture file contains essential information for the converter. It includes information about the Gerber format, units, mode and coordinates. It also includes a list of apertures that the converter can use. It includes various translation directives. There are quite a few possible entries in the aperture file that are not germane to a gdsii to gerber translation so we will not discuss those here.
Example of an Aperture File
APTUNITS MM Gerber and aperture unit, INCH or MM (reqd) FORMAT 3.5 Format of the gerber file (reqd) LINE D13 Line Dcode (reqd) TRACE mode1 Trace mode - off, mode1, mode2, mode3 (reqd) OUTLINE on d10 d11 Fill/Outline mode. (reqd) Fill - OUTLINE off outline - OUTLINE on d10 d11 where 2 alternating outline dcodes should be specified. this is a legacy from the MDA Fire 9000 requirements. CUTLINES keep To keep cutlines - keep. To remove cutlines - remove. SUPPRESS LEADING leading zeros suppressed (recommended) SUPPRESS TRAILING trailing zeros suppressed (not recommended) To specify no suppression, do not put SUPPRESS LEADING or TRAILING in the aperture file. SUPPRESS CR Do not output CR/LF to the gerber file. (recommended) To output CR/LF, do not specify SUPPRESS CR. TEXT D13 Text dcode. For auto, put 7 instead of a dcode. e.g. TEXT 7 FONT c:\wcad\asm600\p.shx Font file name for text font (must point to a .shx file) if your file has no text you can skip these two parameters. D10 0.05 d Round 0.05 0.05 Dcode 10 is a round draw (pay attention to units) D11 C_0254 f Round 0.025 0.025 Dcode 11 is a round flash for circles in the GDSII file In this example, 0.0254cm (diameter) circles are flashed using .025 mm aperture on D11. Refer to the .cir file for circles and polyline information. D12 STRUCT1 f Round 0.050 0.050 Structures in the GDSII file can also be flashed as a dcode. Specify the structure name to flash.
Some Comments on the Aperture File
We recommend that your aperture file units (i.e. your Gerber units) match your GDSII units. If the GDSII file is in mm or um then use MM for Gerber. If GDSII user units are in mils or inches then use INCH for Gerber.
The configuration file (.cfg) is a legacy file left over from earlier module development - Many of its entries are already specified available in other files.
GDSUNIT 1000 Grid of the GDSII file UM Unit of the GDSII file SCALE_FACTOR 1.0 Translation scale TSCALE 1.000000 Text scale for Font 0. 5.000000 Text scale for Font 1. 1.000000 Text scale for Font 2. 2.000000 Text scale for Font 3. BLOCK_TEXT OFF Fixed to OFF. MITER OFF Miter ON or OFF. MAP_CIRCLE OFF Flash circle ON or OFF. MAP_CIRCLES NO Flash circle YES or NO. AUTOSCALE OFF Set to OFF. GBR_OUTPUT 1 c:\tmp\TOP01.gbr Output GDSII layer 1 to c:\tmp\TOP01.gbr 2 c:\tmp\TOP02.gbr Output GDSII layer 2 to c:\tmp\TOP02.gbr Refer to Job File for output file name restrictions GERBER c:\tmp\demo1.apt tells translator where to get the Aperture file. FONTS c:\wcad\asm600\pgfont.shx Font file for GDSII font 0 to 3 c:\wcad\asm600\pgfont.shx Do not specify these 4 lines to turn off text/font c:\wcad\asm600\pgfont.shx c:\wcad\asm600\pgfont.shx
5. Build The Job File (.job)
The job file is an ascii file that defines which GDSII layers will be processed, to which Gerber file name they will be written to and the output style. Note, that when running from a batch file the only valid output style is RS274D as the other ones are not generated by the translation engine but by the GUI code that is being bypassed.
The job file must be named <input file>.job and it must be located in the working directory.
Job File Example
[General] layers=layer1,layer2 aptfile=C:\tmp\demo1.apt gbrformat=RS274D [layer1] layer=TOP01,C:\tmp\TOP01.gbr [layer2] layer=TOP02,C:\tmp\TOP02.gbr
In the above example we wish to produce two Gerber "layers" from a single translation run: layer1 and layer2 and we are processing the structure, TOP.
The Gerber file name format must be constructed using the following rules:
SSSSSSNN where SSSSSS is the first 6 characters of the translation structure name. If the name is less than 6 characters use the entire name. If the name is longer than 6 characters, truncate it to 6. NN is the GDSII layer number. i.e. 01, 20, 63
Aperture File Pointer
The aperture file used for this job is c:\tmp\demo1.apt Yes, this is redundant information since the aperture file is also pointed to in the gds.cfg file. (Note to programmers: are both required?, what happens if they are not consistent?)
Type of Gerber Outputthe keyword gbrformat defines the type of the Gerber output (not the format of the file). Gerber format must be gbrformat=RS274D
Note: the translation engine only outputs RS274D. To get RS274X a separate routine would be needed to read the aperture info, convert it into a proper RS274X header and to merge it with the actual data.
6. Run The Translation Engine
The translation engine is started using a long command line which points to the various resource files you have created. The syntax is:
g2gbreng.exe <input file> x <smallest dcode> <layers> <scale> <structure> -p [trace mode] [-reentrant] <-cfg:config file> where input file the GDSII input file name. x there must be an x as the 2nd argument (placeholder from legacy app.) smallest dcode the size of the smallest dcode (in mils or mm) specified in the aperture file. if none is specified in the aperture file, use 1.0 for inch aperture unit and 0.025 for mm aperture unit. layers selected layers to translate separated by commas. scale translation scale. Normally 1.0. structure the structure in the GDSII file to translate. -p -p must be the 7th argument. trace mode if off, do not put anything. if mode 1, put -t1. if mode 2, put -t2. if mode 3, put -t3. -reentrant specify this if removing cutlines. -cfg:config file specify the configuration file (typically gds.cfg).
"c:\wcad\asm600\g2gbreng.exe" "c:\tmp\demo1.gds" x 12.0 1,2,3 2.5 TOP -p -t2 "-cfg:c:\tmp\demo1.cfg"