EXT(5)
okay bestie, this is EXT(5) from the File Formats Manual and we're about to get so familiar with the .ext file format π no cap, it's giving "the file Magic writes for every single cell" and it's honestly kind of iconic.
πΈ NAME πΈ
ext β the format of .ext files produced by Magic's hierarchical extractor π¦
β¨ DESCRIPTION β¨
so. Magic's extractor makes one .ext file for every cell in a hierarchical design. if the cell is named name, the file is called name.ext. periodt.
and inside that file? three whole flavors of info, bestie:
- environmental information β scaling, timestamps, that whole vibe
- the extracted circuit that matches the mask geometry of name
- the connections between that mask geometry and the subcells of name
a .ext file is just a series of lines, and every line starts with a keyword. the keyword at the front is what tells you how to read the rest of the line. and the following set of keywords are the ones that define the environmental info π§
techtechname β says the technology of name is techname, likenmosorcmosπtimestamptime β says when name was last modified. time is the value Unix stores, i.e. seconds since 00:00 GMT January 1, 1970. and no, this is not the time name was extracted β it's the timestamp value stored in the.magfile. the incremental extractor compares the timestamp in each.extfile against the timestamp in each.magfile in a design, and if they differ, that cell gets re-extracted. lowkey a whole vibe check π₯versionversion β says which version of.extformat was used to writename.ext. the current version is 5.1 β¨stylestyle β says which style the cell was extracted with.scalerscale cscale lscale β sets the scale used to interpret resistance, capacitance, and linear dimension values in the rest of the.extfile. here's the breakdown, don't skip it:- every resistance value gets multiplied by rscale to give the real resistance in milliohms
- every capacitance value gets multiplied by cscale to give the real capacitance in attofarads
- every linear dimension (width, height, transform coordinates, etc.) gets multiplied by lscale to give the real linear dimension in centimicrons
- and every area dimension (like transistor channel area) gets multiplied by scale
*scale to give the real area in square centimicrons
at most one scale line may appear in a .ext file. if none shows up, all of rscale, cscale, and lscale default to 1 π«Ά
resistclassesr1 r2 ... β sets the resistance per square for the various resistance classes that show up in the technology file. the values r1, r2, etc. are in milliohms β and bestie, they are not scaled by the value of rscale from thescaleline above. each node in a.extfile has a perimeter and an area for each resistance class, and r1, r2, etc. are what convert those perimeters and areas into actual node resistances. for the full tea on how resistances get computed from perimeters and areas, see ``Magic Tutorial #8: Circuit Extraction'' π
okay now the next batch of keywords defines the circuit formed by the mask info in name. this circuit is extracted independently of any subcells β its connections to subcells are handled by the keywords in the section after this one, so don't mix them up π
nodename R C x y type a1 p1 a2 p2 ... aN pN β defines an electrical node in name. this node gets referred to by name in laterequivlines, in connections to transistor terminals infetlines, and in hierarchical connections or adjustments viamergeoradjust. the node has a total capacitance to ground of C attofarads and a lumped resistance of R milliohms. for going back from the node name to the geometry that defines it,(x,y)is the coordinate of a point inside the node, and type is the layer that point shows up on. the values a1, p1, ... aN, pN are the area and perimeter for the material in each of the resistance classes described by theresistclassesline at the top of the.extfile; these are what compute adjusted hierarchical resistances more accurately.
NOTE: since lots of analysis tools compute transistor gate capacitance themselves from the transistor's area and perimeter, the capacitance between a node and substrate (GND!) normally does not include capacitance from transistor gates connected to that node. if the.simfile was produced byext2sim(1), check the technology file that was used to produce the original.extfiles to see whether transistor gate capacitance is included or excluded β see ``Magic Maintainer's Manual #2: The Technology File'' for the details π
attrname xl yl xh yh type text β one of these lines shows up for each label ending in the character`@`that was attached to geometry in the node name. you get the location of each attribute label (xl yl xh yh) and the type of material it was attached to (type), plus the text of the label minus the trailing`@`character (text) πequivnode1 node2 β says two node names in cell name are equivalent: node1 and node2. in a collection of node names related byequivlines, exactly one must be defined by anodeline like the one above βfettype xl yl xh yh area perim sub GATE T1 T2 ... β defines a transistor in name. the kind of transistor is type, a string that comes from the technology file and is meant to have meaning to simulation programs. the coordinates of a square entirely contained in the gate region of the transistor are(xl, yl)for its lower-left and(xh, yh)for its upper-right. all four coordinates are in name's coordinate space, and they're subject to scaling as described inscaleabove. the gate region of the transistor has area area square centimicrons and perimeter perim centimicrons. the substrate of the transistor is connected to node sub.
the rest of a fet line is a series of triples: GATE, T1, .... each one describes one of the transistor's terminals β the first describes the gate, and the rest describe the transistor's non-gate terminals (source, drain, etc.). each triple is: the name of a node connecting to that terminal, a terminal length, and an attribute list. the terminal length is in centimicrons, and it's the length of that segment of the channel perimeter connecting to adjacent material β like polysilicon for the gate, or diffusion for a source or drain.
the attribute list is either the single token `0` (meaning no attributes) or a comma-separated list of strings. those strings come from labels attached to the transistor:
- any label ending in the character
`^`is considered a gate attribute and appears on the gate's attribute list, minus the trailing`^`. gate attributes may lie either along the border of a channel or in its interior π¦ - any label ending in the character
`$`is considered a non-gate attribute. it appears on the list of the terminal along which it lies, also minus the trailing`$`. non-gate attributes may only lie on the border of the channel π
the keywords in this section describe info that is not processed hierarchically: path lengths and accurate resistances that get computed by flattening an entire node and then producing a value for the flattened node π
killnodenode β during resistance extraction it's sometimes necessary to break a node up into several smaller nodes. akillnodeline during the processing of a.extfile means that all information currently accumulated about node, along with all fets that have a terminal connected to node, should be thrown out β it'll be replaced by information later in the.extfile. the order of processing.extfiles matters here: children get processed before their parents, so akillnodein a parent overrides one in a child π₯resistnode1 node2 R β defines a resistor of R milliohms between the two nodes node1 and node2. both names are hierarchical.distancename1 name2 dmin dmax β gives the distance between two electrical terminals name1 (a driver) and name2 (a receiver). note that these are terminals, not nodes β the names (which are hierarchical label names) are used to specify two different locations on the same electrical node. the two distances, dmin and dmax, are the lengths (in lambda) of the shortest and longest acyclic paths between the driver and receiver πΈ
and this last section? it describes the subcells used by name, and how connections are made to them and between them π§β¨
usedef use-id TRANSFORM β says that cell def with instance identifier use-id is a subcell of cell name. if cell def is arrayed, then use-id is followed by two bracketed subscript ranges of the form:[lo,hi,sep]. the first range is for x, the second for y. the subscripts for a given dimension go lo through hi inclusive, and the separation between adjacent array elements is sep centimicrons π
TRANSFORM is a set of six integers describing how coordinates in def get transformed to coordinates in the parent name. it's used by ext2sim(1) when transforming transistor locations to coordinates in the root of a design. the six integers of TRANSFORM (ta, tb, tc, td, te, tf) are interpreted as components in the following transformation matrix, by which all coordinates in def are post-multiplied to get coordinates in name:
ta td 0
tb te 0
tc tf 1
Next up, the moment you've all been waiting for, the main character of this whole page:
merge path1 path2 C a1 p1 a2 p2 ... aN pN
merge is how you tell ext that two things are literally the same node, bestie. It's used to specify a connection between two subcells, or between a subcell and mask information of name. π
Both path1 and path2 are hierarchical node names, so let's break down how you actually write one:
- Wanna point at a node that lives in cell name itself? Then its pathname is just its node name. That's it. Simple. Iconic. β¨
- Wanna point at a node inside a subcell of name? Then your pathname is the use-id of that subcell (the exact same one it had in a
useline above, no cap π§) + a slash (/) + the node name inside the subcell.
Concrete example so it actually sticks: if name contains subcell sub with use identifier sub-id, and sub contains node n, then the full pathname of node n relative to name is sub-id/n. π
Now, the array situation, because this part is lowkey genius. Connections between adjacent elements of an array get their own special syntax that exploits how regular arrays are. A use-id inside a path may optionally be followed by a range of the form [lo:hi] β and heads up, that goes before the following slash. A use-id like that is interpreted as elements lo through hi inclusive of a one-dimensional array. π
And if you've got a two-dimensional array? An element can be subscripted with two such ranges: first the y range, then the x range. (y first, bestie, don't @ me.)
Whenever one path in a merge line contains a subscript range like that, the other one must contain one of comparable size. Like:
merge sub-id[1:4,2:8]/a sub-id[2:5,1:7]/b
This is acceptable because the range 1:4 is the same size as 2:5, and the range 2:8 is the same size as 1:7. Matchy matchy, slay. π
Okay so here's where it gets real. When a connection happens between nodes in different cells, it may be that some resistance and capacitance got recorded redundantly. Example: polysilicon in one cell might overlap polysilicon in another, so the capacitance to substrate has been recorded twice. π Not the vibe.
That's exactly what the values C, a1, p1, etc. in a merge line are for β they give you a way to compensate for that overlap:
- Each of
a1,p1, etc. (usually negative, ngl) gets added to the area and perimeter for material of each resistance class, giving an adjusted area and perimeter for the aggregate node. - The value
Cin attofarads (also usually negative) gets added to the sum of the capacitances (to substrate) of nodes path1 and path2 to give the capacitance of the aggregate node.
So yeah, negative numbers here are doing the work, they're not a typo. π«Ά
Then we have:
cap node1 node2 C
cap defines a capacitor between the nodes node1 and node2, with capacitance C. This construct is used to specify both internodal capacitance within a single cell and between cells. Two-for-one, we love efficiency. β
π AUTHOR
Walter Scott
π₯ SEE ALSO
And that's the whole page, bestie β you made it to the end, main character energy fr fr. π This one comes from the 4th Berkeley Distribution, and the page itself is EXT(5). Go forth and merge responsibly, mwah. π
β¨
π¦ where this page comes from
- debian bookworm: magic 8.3.105+ds.1-1.1 Β· BSD-style
- fedora 43: magic 8.3.552-1.fc43 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 43: magic 8.3.651-1.fc43 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 44: magic 8.3.623-1.fc44 Β· HPND-UC-export-US AND TCL AND HPND
- fedora 44: magic 8.3.684-1.fc44
- fedora 44: magic 8.3.685-1.fc44 Β· HPND-UC-export-US AND TCL AND HPND
- nixos 26.05: magic-vlsi 8.3.629
- nixpkgs unstable: magic-vlsi 8.3.689
- ubuntu jammy: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu noble: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu resolute: magic 8.3.105+ds.1-1.1 Β· BSD-style
- ubuntu stonking: magic 8.3.105+ds.1-1.1 Β· BSD-style
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms