Module 9: GDSII Generation and Tapeout · 9.1 GDSII Streaming

Streaming Out GDS From Magic

In the previous article, we analyzed the internal structure of GDSII files. In this article, we examine how tools generate the final GDSII file for uart_top. The verification steps in Module 8 evaluated runs/uart_full/results/final/gds/uart_top.gds. Here, we explain how streamout tools assemble that file and how to run streamout manually.

Inputs to the Streamout Process

The routed Design Exchange Format (DEF) file does not define internal transistor geometries. The DEF file defines cell placement locations, orientations, routing wires, and vias. The detailed transistor geometries of each standard cell reside in the PDK library GDS file. Streamout merges both datasets, as shown in Figure 1: placement and routing from DEF, and internal transistor masks from the library GDS.

Inputs to GDS streamout
Figure 1: Magic combines the routed DEF, the standard cell GDS and the technology data into one hierarchical GDS

Manual Streamout Procedure

The following script executes batch streamout using Magic, matching the procedure executed by OpenLane:

magic -dnull -noconsole \
      -rcfile "$PDK_ROOT/sky130A/libs.tech/magic/sky130A.magicrc" <<'EOF'
gds readonly true
gds rescale false
gds read $PDK_ROOT/sky130A/libs.ref/sky130_fd_sc_hd/gds/sky130_fd_sc_hd.gds
lef read $PDK_ROOT/sky130A/libs.ref/sky130_fd_sc_hd/lef/sky130_fd_sc_hd.lef
def read runs/uart_full/results/routing/uart_top.def
load uart_top
select top cell
gds write uart_top.gds
quit -noprompt
EOF

Understand the purpose of each command:

  • gds read loads the physical transistor geometries for every standard cell from the PDK. The directive gds readonly true prevents Magic from altering library polygon coordinates.
  • lef read loads cell boundaries and pin geometries. The command def read imports uart_top routing tracks, vias, and instance locations.
  • gds write traverses the structural hierarchy starting from the top cell. It writes the combined hierarchical GDSII file.

If you applied manual polygon modifications directly to the GDS file during DRC debugging, those changes do not exist in the DEF file. Always back-annotate modifications into routing files or re-apply manual adjustments after each streamout.

Automated Streamout in OpenLane

Standard OpenLane runs execute streamout automatically after detailed routing and fill insertion:

openlane --flow Classic --run-tag uart_full designs/uart/config.json

OpenLane generates GDSII streamout using both Magic and KLayout. Then, OpenLane executes a geometric XOR comparison between both output files. If two independent software tools generate identical polygon boundaries, you have high confidence that streamout introduced no translation defects. We explore independent multi-tool verification further in Section 9.2.

Verifying Streamout Integrity

Because structure names are stored as plain ASCII strings in binary GDSII records, you can inspect cell names from the command line:

ls -la runs/uart_full/results/final/gds/uart_top.gds
strings runs/uart_full/results/final/gds/uart_top.gds | grep -m 20 -E "uart_top|sky130_fd_sc_hd__"

This command confirms that the top-level cell uart_top and target SkyWater 130 nm standard cells (sky130_fd_sc_hd__dfxtp_2, sky130_fd_sc_hd__nand2_1) exist in the file. For our UART design, the resulting file is several megabytes in size.

A common error during manual streamout occurs when scripts omit gds read for the standard cell library. Magic then outputs abstract rectangular boundary shapes instead of real transistor masks. The resulting file contains correct placement references but lacks transistor geometries. OpenLane loads library GDS databases automatically.

Practice Exercise

A design containing 12,000 standard cell instances produces a GDSII file of only 40 KB, despite passing earlier flow stages. Identify the root cause and describe the verification procedure.

Solution

A 40 KB file size is too small for 12,000 cell instances. Even with hierarchy, the file must contain complete transistor polygons for all referenced standard cell types, 12,000 placement records, and routing interconnects.

The root cause is that the streamout script failed to load the library GDS database before streaming out the DEF file. Magic wrote empty cell abstracts containing only boundary boxes. Open the file in KLayout and inspect a cell instance: if diffusion, polysilicon, and contact layers are absent, the library geometries were omitted during streamout. Update the streamout script to read the standard cell GDS before reading the DEF file.

In the next article, we open uart_top.gds in KLayout to inspect physical mask polygons directly.

← What a GDS File Actually Is Inspecting Your First GDS File →