Module 8: Physical Verification · 8.1 Design Rule Checking

Running Magic's DRC Engine on the UART

In the previous article, we reviewed geometric design rule categories. This laboratory exercise executes Magic’s DRC engine against the routed UART GDSII layout using the full SkyWater 130nm technology file.

Running Magic DRC in Batch Mode

Execute Magic in headless non-interactive mode using a Tcl control script:

magic -dnull -noconsole \
      -rcfile "$PDK_ROOT/sky130A/libs.tech/magic/sky130A.magicrc" <<'EOF'
gds read runs/uart_full/results/final/gds/uart_top.gds
load uart_top
select top cell
drc euclidean on
drc style drc(full)
drc check
drc catchup
set oscale [cif scale out]
set fout [open drc_report.txt w]
set count 0
foreach {why boxes} [drc listall why] {
    puts $fout $why
    puts $fout "----------------------------------------"
    foreach b $boxes {
        puts $fout [format "%.3f %.3f %.3f %.3f" \
            [expr {$oscale * [lindex $b 0]}] [expr {$oscale * [lindex $b 1]}] \
            [expr {$oscale * [lindex $b 2]}] [expr {$oscale * [lindex $b 3]}]]
        incr count
    }
    puts $fout ""
}
puts $fout "COUNT: $count"
close $fout
quit -noprompt
EOF

Key execution parameters include:

  • -rcfile: Loads SkyWater 130nm layer definitions and DRC deck sections.
  • gds read: Parses the streamed binary GDSII layout file.
  • drc style drc(full): Activates the complete signoff rule set instead of faster interactive approximations.
  • drc listall why: Exports geometric violation coordinates scaled to physical micrometers.

Analyzing the Violation Report

Inspect the generated drc_report.txt file:

Metal1 spacing < 0.14um (met1.2)
----------------------------------------
88.050 55.900 88.190 56.100
91.410 62.230 91.520 62.410

Metal2 overlap of via1 < 0.055um (met2.4)
----------------------------------------
102.870 40.115 102.930 40.175

Local interconnect spacing < 0.17um (li.3)
----------------------------------------
45.230 102.415 45.400 102.585

COUNT: 4

The report identifies four total violations:

  1. Rule met1.2: Two metal 1 spacing violations where wire clearance is below $0.14\ \mu\text{m}$.
  2. Rule met2.4: One metal 2 enclosure violation where pad margin around via1 is below $0.055\ \mu\text{m}$.
  3. Rule li.3: One local interconnect spacing violation where clearance is below $0.17\ \mu\text{m}$.

TritonRoute finished with zero internal routing violations. However, detailed routers evaluate simplified LEF abstractions. Magic verifies the complete silicon deck, exposing subtle edge-to-edge discrepancies.

Summarizing Violation Categories

Categorize violations using an awk command to analyze failure patterns:

awk '/\(.*\)$/ {rule=$0; next} /^[0-9]/ {n[rule]++} END {for (r in n) print n[r], r}' \
    drc_report.txt | sort -rn

The command groups errors by frequency:

2 Metal1 spacing < 0.14um (met1.2)
1 Metal2 overlap of via1 < 0.055um (met2.4)
1 Local interconnect spacing < 0.17um (li.3)

The table below correlates rules with probable layout causes:

Rule Name Checked Parameter Instance Count Probable Cause
met1.2 Metal 1 Spacing 2 Routed wire segments jogged tightly around a congested pin
met2.4 Metal 2 Via Enclosure 1 Via placed at the terminal end of a short trace
li.3 Local Interconnect Spacing 1 Trace placed too close to boundary geometries of an adjacent cell

Verifying Loaded Technology Rules

Before initiating layout edits, confirm that Magic loaded the correct PDK technology file:

magic -dnull -noconsole \
      -rcfile "$PDK_ROOT/sky130A/libs.tech/magic/sky130A.magicrc" <<'EOF'
puts "tech: [tech name]"
drc style
quit -noprompt
EOF

Confirm that the output reports technology sky130A and includes style drc(full).

Practice Exercise

Review the violation summary. Identify which rule you should inspect first and explain your engineering rationale.

Solution

Inspect rule met1.2 first because it occurs multiple times (2 instances).

Repeated violations of a specific rule often indicate systemic routing congestion or dense pin clusters. Check whether the two violations share coordinates within the same standard cell row or macro interface. Resolving shared congestion can eliminate multiple violations simultaneously. Single errors (met2.4 and li.3) represent localized geometry defects.

Magic DRC identified four physical violations in the routed layout. The next article demonstrates how to locate, inspect, and repair these violations.

← What DRC Actually Checks, and Why Every Rule Exists Fixing a Real DRC Violation →