Introduction
EAGLE, the circuit board design program sold last by Autodesk,
has saved its boards (.brd), schematics (.sch) and part libraries
(.lbr) as XML since version 6.0. All three use one document type, whose root element is
eagle. The document type definition (DTD) ships with the program. Its header allows
using it to write programs that read or write the files.
This page follows the DTD of the late Autodesk releases and marks what older copies lack.
Identification
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="9.6.0">
<drawing>
…
</drawing>
</eagle>
- The root element is
eagleand itsversionattribute is required. - The DTD describes the version as
V.RR. Real files also write three parts, such as9.6.0. - The DOCTYPE normally names
eagle.dtd. The DTD is not inside the file. Some footprint-only files leave the DOCTYPE out. - The extension, or the child of
drawing, tells the three kinds apart:board,schematicorlibrary.
Document tree
A question mark means the element may be left out, an asterisk that it may repeat.
| Element | Children | Attributes |
|---|---|---|
eagle | compatibility?, drawing, compatibility? | version |
compatibility | note* | each note: version, severity (info, warning, error) |
drawing | settings?, grid?, filters?, layers, then one of library, schematic, board | none |
library | description?, packages?, packages3d?, symbols?, devicesets? | name (only for a library copied into a board or schematic), urn |
board | description?, fusionsync?, fusionteam?, plain?, libraries?, attributes?, variantdefs?, classes?, designrules?, autorouter?, groups?, elements?, signals?, mfgpreviewcolors?, errors? | limitedwidth |
schematic | description?, libraries?, attributes?, variantdefs?, classes?, modules?, groups?, parts?, sheets?, errors? | xreflabel, xrefpart |
Values
- Coordinates and sizes are decimal numbers in millimetres. The Y axis points up. A few design rule values carry a unit suffix of their own.
- Yes-or-no attributes hold
yesorno. - A rotation is
Rand an angle from 0 to 359.9 degrees, with optional letters before it:S(spin) andM(mirrored).R90,MR180andSR180are examples. Parts in a schematic turn only in steps of 90 degrees. - A layer is referred to by its number.
- Descriptions are text in
descriptionelements, with alanguageattribute (defaulten). They may hold simple HTML such asp,br,ul,lianda. - Managed library items carry a name of the form
urn:adsk.eagle:type:id/version. The type issymbol,footprint,package,componentorlibrary; the version is left out when not given. KiCad also accepts the typefs.file.
Text
- In displayed text a backslash takes the next character literally.
!starts or ends a line over the text (for inverted signals). A comma also ends it. Before a space,),],}or a quote it is an ordinary character.- A text that starts with
>and no space stands for a value:>NAME,>VALUE,>PART,>GATE,>MODULE,>SHEET,>SHEETNR,>SHEETS,>SHEET_TOTAL,>SHEETNR_TOTAL,>SHEETS_TOTAL,>SHEET_HEADLINE,>ASSEMBLY_VARIANT,>DRAWING_NAME,>LAST_DATE_TIME,>PLOT_DATE_TIME,>DATE. Any other word names a user attribute.
Drawing settings
| Element | Attributes (default in brackets) |
|---|---|
setting | alwaysvectorfont, verticaltext (up; or down), keepoldvectorfont (no) |
grid | distance, unitdist, unit, style (lines or dots), multiple (1), display (no), altdistance, altunitdist, altunit |
layer | number, name, color, fill, visible (yes), active (yes) |
Standard layer numbers
| Numbers | Layers |
|---|---|
| 1, 2–15, 16 | Top copper, inner copper (Route2–Route15), bottom copper |
| 17–20 | Pads, Vias, Unrouted, Dimension (board outline) |
| 21–28 | tPlace, bPlace, tOrigins, bOrigins, tNames, bNames, tValues, bValues |
| 29–38 | tStop, bStop, tCream, bCream, tFinish, bFinish, tGlue, bGlue, tTest, bTest |
| 39–43 | tKeepout, bKeepout, tRestrict, bRestrict, vRestrict |
| 44–52 | Drills, Holes, Milling, Measures, Document, ReferenceLC, ReferenceLS, tDocu, bDocu |
| 91–98 | Nets, Busses, Pins, Symbols, Names, Values, Info, Guide |
The names t and b mean top and bottom side. Files may define more layers.
Graphic objects
plain holds free drawing on a board or sheet; packages and symbols use the same objects.
| Element | Required | Optional (default in brackets) |
|---|---|---|
wire | x1 y1 x2 y2 width layer | style (continuous; longdash, shortdash, dashdot), curve (0; arc angle −359.9 to 359.9), cap (round or flat, for arcs), extent (airwires), grouprefs |
circle | x y radius width layer | grouprefs |
rectangle | x1 y1 x2 y2 layer | rot, grouprefs |
polygon | width layer, vertex children | spacing, pour (solid; hatch, cutout), isolate, orphans (no) and thermals (yes) for signal polygons, rank (0; 1–6 in a signal, 0 or 7 in a package) |
vertex | x y | curve: bulge of the edge to the next vertex. A last vertex equal to the first is ignored. |
spline | width, vertex children | Four vertices without curves are the control points of a cubic curve. |
text | x y size layer; content is the text | font (proportional; vector, fixed), ratio (8, stroke width in percent), rot (R0), align (bottom-left; the nine combinations of bottom, center, top and left, center, right), distance (50, line spacing), grouprefs |
dimension | x1 y1 x2 y2 x3 y3 layer textsize | dtype (parallel; horizontal, vertical, radius, diameter, angle, leader), width (0.13), extwidth, extlength, extoffset (0), textratio (8), unit (mm; mic, mil, inch), precision (2), visible (no), grouprefs |
frame | x1 y1 x2 y2 columns rows layer | border-left, border-top, border-right, border-bottom (all yes) |
hole | x y drill |
Libraries
A device set joins schematic symbols to board packages. A library file holds one library; boards and
schematics carry copies of what they use under libraries.
| Element | Holds | Attributes (default in brackets) |
|---|---|---|
package | description?, graphics, hole, pad, smd | name, urn, locally_modified, library_version, library_locally_modified |
pad | through-hole pad | name x y drill, diameter (0), shape (round; square, octagon, long, offset), rot, stop (yes), thermals (yes), first (no) |
smd | surface pad | name x y dx dy layer, roundness (0), rot, stop, thermals, cream (yes) |
package3d | description?, packageinstances? | name, urn, type (model or box), library_version, library_locally_modified. packageinstance has name. |
symbol | description?, graphics, pin | name |
pin | connection point | name x y, visible (both; off, pad, pin), length (long; point, short, middle), direction (io; nc, in, out, oc, pwr, pas, hiz, sup), function (none; dot, clk, dotclk), swaplevel (0), rot |
deviceset | description?, gates, devices, spice? | name, prefix, uservalue (no), urn, locally_modified, library version attributes |
gate | name symbol x y, addlevel (next; must, can, request, always), swaplevel (0) | |
device | connects?, package3dinstances?, technologies? | name (may be empty), package. package3dinstance has package3d_urn. |
connect | gate pin pad, route (all or any, for a pin on several pads) | |
technology | attribute* | name |
spice | pinmapping, model | pinmapping: isusermap (no), iddevicewide (yes), spiceprefix; its pinmap: gate pin pinorder. model holds the model text and has name. |
Board
| Element | Holds | Attributes (default in brackets) |
|---|---|---|
element | a placed package; attribute*, variant* | name library package value x y, locked (no), populate (yes), smashed (no: texts not moved apart), rot, grouprefs, library_urn, package3d_urn, override_package3d_urn, override_package_urn, override_locally_modified |
signal | one net: contactref, polygon, wire, via | name, class (0), airwireshidden |
contactref | a pad on the net | element pad, route (all), routetag |
via | x y drill, extent (1-16 style: first and last copper layer), diameter (0), shape (round; square, octagon), alwaysstop (no) | |
mfgpreviewcolor | name, color | |
fusionsync | link to a Fusion design | huburn, projecturn, f3durn, pcbguid, lastsyncedchangeguid, lastpulledtime |
fusionteam | link to cloud copies | huburn, projecturn, folderUrn, urn, versionUrn, camFileUrn, camFileVersionUrn, lastpublishedchangeguid |
Schematic
| Element | Holds | Attributes (default in brackets) |
|---|---|---|
part | a component; attribute*, variant*, spice? | name library deviceset device, technology (empty), value, library_urn, package3d_urn and override attributes |
sheet | description?, plain?, moduleinsts?, instances?, busses?, nets? | |
instance | a placed gate; attribute* | part gate x y, smashed (no), rot |
net, bus | segment* | name; a net also class (0) |
segment | one connected drawing: pinref, portref, wire, junction, label, probe | |
pinref | part gate pin | |
junction | x y | |
label, probe | x y size layer, font, ratio, rot, xref (no), align | |
module | a sub-circuit: description?, ports?, variantdefs?, groups?, parts?, sheets? | name prefix dx dy |
port | name side coord, direction (io) | |
moduleinst | attribute* | name module x y, modulevariant, offset (0), smashed, rot |
portref | moduleinst port |
side of a port is declared as an integer in the DTD, but is a word:
left, right, top or bottom. KiCad’s parser records
this divergence. coord is the position along that side, measured from the middle of the
module’s rectangle, which is dx wide and dy high about the instance’s
position.
In the viewer
- A board is drawn with its plain objects, placed packages, signals, vias, pads, surface pads, holes
and airwires; rotation, mirroring (with the swap of the top and bottom layers), curved wires,
smashed names and values and
>placeholders are applied. - A schematic has a drawing for every sheet, module sheets included, with gates, pins, pad numbers, nets, busses, junctions, labels, frames and module instances with their ports.
- Every package and symbol, of a library or of the libraries held in a board or schematic, is drawn sixteen to a picture.
- Tables list every element of the file with all its attributes and text, the signal connections of a board and the net connections of a schematic. References that lead nowhere are listed as problems.
- Options choose the saved layer visibility or all layers, and the size of the drawings. A file may be up to 256 MB.
Version differences
| DTD | Differences from the one before |
|---|---|
| 6.2.0 | The base of the XML format among the copies compared. |
| 7.x | Adds modules (modules, module, moduleinst, ports, portref), a second compatibility place at the end, dimension in packages, symbols and plain drawing with more attributes, distance on text, current on variantdef, populate on element, name on designrules, and in 7.4.0 limitedwidth on board. |
| Autodesk 9.x | Adds managed libraries (urn and override attributes), packages3d, spice, groups and grouprefs, spline, fusionsync, fusionteam and mfgpreviewcolors. |
variant children of element and part remain in the late DTD for
files from version 6. A compatibility note tells an older program what it may lose.
Not described
Known, not yet covered
- Viewer: copper pours are drawn as outlines with a light wash, without the fill, hatching, thermals and isolation that EAGLE computes.
- Viewer: solder mask and paste openings are not generated, and pad and surface pad design rules for inner and bottom layers, the
psTop,psBottomandpsFirstshapes and the surface pad roundness rules are not applied. - Viewer: assembly variants are listed but not applied to the drawings.
- Viewer: layer colours and fill patterns, the lettering, the border of a frame, dimension arrows and cross references on labels are not as EAGLE draws them, and at most 1,000 frame columns or rows are lettered.
- Viewer: three-dimensional packages, which are references to online models, are only listed.
Unknown
- Reference: which colour and fill pattern each
colorandfillnumber of a layer stands for. - Reference: the full set of design rule and autorouter parameter names, their meanings and defaults. Only the names listed above are given.
- Reference: how the
hashof an approved error is computed, and the meaning ofroutetag. - Reference: the shapes of the characters of the vector font, which are not stored in the file.
Variants
- EAGLE XML design file – boards, schematics and libraries of EAGLE 6.0 and later
- EAGLE binary board – boards of EAGLE 3, 4 and 5
Links
Software
Developers
- KiCad EAGLE parser – reader for the XML elements (C++)
- pcb-rnd io_eagle – reader for XML and older binary boards (C)
Reference
- EAGLE DTD, Autodesk release – a published copy of the document type definition, licensed CC BY-ND 3.0 by its header; copies of the 6.2 to 7.7 DTDs were compared with it
- KiCad developer documentation: EAGLE – notes on the format as an import source
- KiCad EAGLE schematic importer – how modules and their ports are placed (GPL source)