Module 6: Routing ยท 6.3 SKY130 Routing Rules

Reading a DRC Deck Section

Everything about spacing and width so far in this section has been prose, English sentences about why a rule exists. Tools do not check prose. Underneath every DRC violation Magic reports, and every rule TritonRoute enforces, is a rule in a structured, unambiguous, machine-checkable form: a rule deck. This article is a short look at the shape of that form, so that when Module 8 has you running Magic’s DRC engine the output is not a wall of unfamiliar syntax but an entry you already know how to parse.

The general shape

Every rule deck entry, whichever tool reads it, answers three questions. Which layer, or pair of layers, does it apply to? What geometric condition is measured: a spacing, a width, an enclosure, an area? And what threshold must that measurement satisfy? Tools differ in syntax, not in that structure.

Magic expresses its rules in a technology file with a dedicated DRC section. Here is a representative excerpt in that style, written to show the shape real entries take, not copied verbatim from the SKY130 tech file:

# Representative syntax showing the structure of a Magic DRC
# rule deck entry, not a verbatim SKY130 rule.

drc rules met1 {
    # Minimum width: no met1 shape may be narrower than this
    width  0.14   "met1.1: metal1 minimum width violation"

    # Minimum spacing: two distinct met1 shapes must clear this gap
    spacing met1 met1 0.14 touching_illegal \
        "met1.2: metal1 minimum spacing violation"

    # Width-dependent spacing: wider shapes need more clearance
    spacing met1 met1 0.28 wide_spacing \
        "met1.3: metal1 wide-wire spacing violation"
}

drc rules via1 {
    # Enclosure: the met1/met2 pad must cover the cut by this margin
    enclosure via1 met1 0.06 "via1.1: via1 enclosure by metal1"
    enclosure via1 met2 0.06 "via1.2: via1 enclosure by metal2"
}

Read it field by field:

Field met1.2 example What it means
Layer(s) met1 met1 Applies between two met1 shapes
Condition spacing ... touching_illegal Measures the gap between two distinct, non-touching shapes
Threshold 0.14 The minimum distance the condition must satisfy (illustrative)
Message "met1.2: metal1 minimum spacing violation" The string a violation report shows, tying the failure to this rule

Notice met1.3 right below: same layer, same general condition, a different threshold keyed to wider shapes. That is the width-dependent spacing from two articles ago, expressed as literally two entries rather than one number. That is the payoff of knowing the deck’s shape. A rule you only had prose intuition for is right there as two distinguishable entries once you know what to look for.

When Magic reports a violation, the message is drawn from the entry’s own string, which is why reports reference rule names like met1.2 rather than a generic “spacing too small”. It is also why “one rule per layer” is the wrong mental model. What feels like one rule conceptually, minimum spacing on met1, is frequently several entries with different conditions and thresholds. Read the condition field, not just the layer name, before deciding what a rule requires.

Identifying layer and condition

Given this entry in the same style:

drc rules via2 {
    enclosure via2 met2 0.08 "via2.1: via2 enclosure by metal2"
}

It checks the via2 cut layer against the met2 layer on one side of it. The condition is enclosure, how much margin met2 must keep around the via2 cut, with an illustrative threshold of 0.08. It maps straight back to the enclosure margin you reasoned through by hand in the vias article. This entry is the machine-checkable version of that worked example.

Practice Exercise

Write, in the same style, a plausible entry for a minimum width rule on met2 with 0.14 as an illustrative threshold. Then say in one sentence what tool behaviour this single entry is responsible for.

Solution
drc rules met2 {
    width  0.14   "met2.1: metal2 minimum width violation"
}

This entry is responsible for the violation message Magic, or any deck-driven checker, shows if a met2 shape is drawn narrower than 0.14. It is the machine-checkable form of the width reasoning from the first article of this section: a shape thinner than the process can resolve gets flagged, by name, with this rule ID.

That covers ordinary signal-net routing rules end to end. Section 6.4 turns to nets that do not play by the ordinary rules: power, ground and clock, starting with why they get routed first, and differently.

โ† Antenna Rules, Previewed Power and Ground Routing โ†’