GSCAN - GDSII Scan File UtilityThe gscan utility scans a GDSII file and reports on the list of structures, hierarchy, data with layers, extents of each structure and number of elements in each structure. The results from gscan can be used for a variety of purposes. GSCAN Command Line SyntaxTo see the gscan command line syntax you can execute gscan with the -h option: $ gscan -h GDSII Scanning Utility Version 1.47 (Oct 11,2002) (C) 1993-2001 Artwork Conversion Software, Inc. gscan [input_gdsii_file_name] [options] options -o:output_file_name name/path of the output file. If not specified goes to stdout -sh output structure hierarchy -sea output structure extents for all structures -byarea output structure extents sorted by area -se:structure_name output structure extents for this structure only < The -job options are specific to older Artwork programs > -job output job file only -job:job_filename output job file to job_filename only -job! output job file -job!job_filename output job file to job_filename -------------------------------------------------------------- -dtp include datatype info on output -max:N expect at most N structures. ( default 2048 ) many GDSII files have 50K or even 500K structures; if you don't know in advance set this to 500000. -magic enable Magic compatibility. A very old layout tool that expressed AREFs in a non-standard way. -elmcnt output element counts for each structure. (note: does not work unless -sea is also specified) GSCAN OUTPUTGSCAN outputs ASCII data about a file. Examples of the various options are shown below. Because of the large amount of data the example output is "clipped." Basic Header Information GSCAN always writes out some basic information obtained from the header data in the GDSII file.FILENAME DEMO5.GDS HEADER Release :3.00 release version Last Modify Time :Sep 9, 93 at 0:00:00 Last Access Time :Sep 9, 93 at 0:00:00 Resolution :1000 ticks per user unit User Units :UM Reference Library 1) 2) Text Font Definition Files 0) GDSII:CALMAFONT.TX font path - not really helpful 1) GDSII:CALMAFONT.TX 2) GDSII:CALMAFONT.TX 3) GDSII:CALMAFONT.TX Layers with Data GSCAN reports a list of the layers in the GDSII file that contain data such as boundaries, paths and text. LAYERS_CONTAINING_DATA 0,1,2,3,4,5,6,7,8,9,10 Structure Hierarchy gscan demo5.gds -o:test.txt -sh In addition to basic header information you also get a list of structures and then the hierarchy. STRUCTURE_LIST 1) HVLS 2) CONT 3) PTAP2 4) POLYHD1 5) POLYHD3 6) CMP2 7) NTAP 8) PTAP 9) POLYHD2 10) HVPD 11) SVCMPIN 12) TGX1 . . HIERARCHY of INDEPENDENT STRUCTURES TOP | |__ INPROT3 | | | |__ CONT | | | |__ PAD | |__ INGATE2 | | | |__ PTAP2 | | | |__ CONT | | | |__ POLYHD3 | | | | | |__ CONT | | | |__ POLYHD1 |
Structure Extents GSCAN can be directed to compute the extents of each structure taking into account the boundaries, paths and text elements (using text reference point) as well as the extents of all referenced structures. The -sea argument turns on this computation. gscan demo5.gds -o:test.txt -sea STRUCTURE EXTENTS (Min X, Min Y, Max X, Max Y) Resolution :1000 User Units :UM 1) HVLS (0.000, -12.000, 186.000, 66.479) 2) CONT (-3.000, -3.000, 3.000, 3.000) 3) PTAP2 (-6.000, -8.000, 6.000, 6.000) 4) POLYHD1 (-5.000, -4.000, 4.000, 4.000) 5) POLYHD3 (-5.000, -4.000, 4.000, 5.000) 6) CMP2 (-9.520, -8.000, 208.243, 147.000) 7) NTAP (-4.000, -4.000, 4.000, 4.000) 8) PTAP (-6.000, -6.000, 6.000, 6.000) 9) POLYHD2 (-5.000, -4.000, 5.000, 4.000) 10) HVPD (-2.000, -5.000, 138.000, 233.480) 11) SVCMPIN (0.000, -11.000, 188.000, 197.000) 12) TGX1 (-212.000, -175.000, 31.000, 140.000) 13) TGX (-212.000, -175.000, 38.000, 131.000) 14) LATCELL (-17.000, -18.243, 17.000, 18.243) 15) LATCELL1 (-17.000, -18.243, 3.000, 18.243) 16) Q1 (-42.000, -42.000, 42.000, 42.000) 17) INPROT4 (-38.000, 3.000, 168.000, 251.000) 18) PAD (-63.000, -63.000, 63.000, 63.000) 19) COMLOGIC (-32.000, -352.000, 2276.000, 310.000) 20) OSCILLATORS (-115.000, -226.000, 2394.000, 387.000) 21) RESDIV (-44.000, -456.000, 480.000, 432.000) 22) DIFFINT (-567.000, -195.480, 551.000, 1088.000) 23) INGATE (-183.000, -99.000, 1210.480, 1341.000) 24) UDCNTR (-334.000, -93.000, 663.000, 1029.000) . . . Structure Extents Sorted by Area When structure extents are reported, it is in the order that the structures are defined in the GDSII file. If you would like the extents sorted by area (smallest first) then add the -byarea directive to the command line in addition to the -sea directive. gscan demo5.gds -o:sea_byarea.txt -sea -byarea You will get both the initial block (sorted by order of appearance) and then a second block sorted by area and instead of the LL, UR coordinates you will get the width and height. STRUCTURE EXTENTS BY AREA (Area, Width x Height) 2) CONT (36.000, 6.000 x 6.000) 7) NTAP (64.000, 8.000 x 8.000) 4) POLYHD1 (72.000, 9.000 x 8.000) 9) POLYHD2 (80.000, 10.000 x 8.000) 5) POLYHD3 (81.000, 9.000 x 9.000) 8) PTAP (144.000, 12.000 x 12.000) 3) PTAP2 (168.000, 12.000 x 14.000) 15) LATCELL1 (680.000, 20.000 x 34.000) 14) LATCELL (1156.000, 34.000 x 34.000) 16) Q1 (8652.000, 84.000 x 103.000) 1) HVLS (14597.094, 186.000 x 78.479) 18) PAD (15876.000, 126.000 x 126.000) 6) CMP2 (33095.600, 213.520 x 155.000) 10) HVPD (33387.200, 140.000 x 238.480) 11) SVCMPIN (39104.000, 188.000 x 208.000) 45) INGATE2 (41841.120, 244.000 x 171.480) 17) INPROT4 (51088.000, 206.000 x 248.000) 37) INPROT3 (51088.000, 206.000 x 248.000) 41) CMOSIN (70229.320, 264.020 x 266.000) . . . 24) UDCNTR (1118634.000, 997.000 x 1122.000) 22) DIFFINT (1434930.640, 1118.000 x 1283.480) 30) LRCORNER (1469024.000, 928.000 x 1583.000) 19) COMLOGIC (1527896.000, 2308.000 x 662.000) 20) OSCILLATORS (1538017.000, 2509.000 x 613.000) 25) POSLOGIC (1842785.000, 1295.000 x 1423.000) 23) INGATE (2006611.200, 1393.480 x 1440.000) 46) DEMO5TOP (7728948.000, 2941.000 x 2628.000) Structure Extents for Specified Structure You might want to use this option rather than calculate the extents for all structures if the file you are dealing with is very large. The extents calculation for all structures can be time consuming on very large files. gscan demo5.gds -0:extents.txt -se:INGATE STRUCTURE EXTENTS (Min X, Min Y, Max X, Max Y) Resolution :1000 User Units :UM 23) INGATE (-183.000, -99.000, 1210.480, 1341.000) |
Element Count GSCAN can generate a report of how many Boundaries, Paths, Text Entities, SREFS and AREFS are contained in each structure. Use the combination of -sea and -elmcnt. (Using just -elmcnt by itself appears to generate element counts of all zero.) gscan demo5.gds -o:element_count.txt -sea -elmcnt In addition to the header info, layers with info and structure hierarchy, one will also see a block such as below: STRUCTURE_ELEMENT_COUNTS (Boundary, Path, ARef, SRef, Text) 1) HVLS (25, 0, 0, 22, 4) 2) CONT (2, 0, 0, 0, 0) 3) PTAP2 (4, 0, 0, 0, 0) 4) POLYHD1 (1, 0, 0, 1, 0) 5) POLYHD3 (1, 0, 0, 1, 0) 6) CMP2 (47, 3, 8, 39, 12) 7) NTAP (1, 0, 0, 1, 0) 8) PTAP (2, 0, 0, 1, 0) 9) POLYHD2 (1, 0, 0, 1, 0) 10) HVPD (35, 0, 13, 20, 12) 11) SVCMPIN (32, 0, 17, 9, 16) 12) TGX1 (39, 0, 13, 10, 0) . . . 36) CMOSINPD (28, 0, 0, 23, 4) 37) INPROT3 (53, 0, 0, 5, 1) 38) HVBUF (71, 17, 5, 116, 0) 39) CPLIO (34, 2, 3, 63, 0) 40) VDDPAD (8, 0, 0, 28, 0) 41) CMOSIN (24, 0, 0, 22, 4) 42) 2CMPTTL (23, 0, 0, 27, 5) 43) CMPTTL (24, 0, 0, 27, 5) 44) VN_INGATE (94, 0, 21, 59, 1) 45) INGATE2 (41, 0, 0, 35, 8) 46) DEMO5TOP (12, 0, 44, 65, 32) |