# gEDA/gaf Master Attribute Document

by: Ales Hvezda, ahvezda@geda.seul.org

This document is released under GFDL

July 10th, 2007

## Overview

This document describes all the attributes used in in gEDA/gaf (GPL‘d Electronic Design Automation / Gschem And Friends). This document is broken down into several section: this overview, symbol only attributes, schematic only attributes, attributes which can appear in both symbols and schematics, and attributes which are obsolete or deprecated.
In this document, attribute names are in bold and examples are in the `typewriter` font.

## What are Attributes?

Attributes in the gEDA/gaf system are nothing more than text items which take on the form: name=value. Name can be anything just as long as it doesn’t contain a equals sign. Value can also be anything just as long as it is something (vs nothing). name= (without a value part) is not a valid attribute. Also, there cannot be any spaces immediately before or after the equals sign.
Attributes can be attached to some part of the symbol. If the attribute conveys information specific to an object, then the attribute should be attached directly to the object, otherwise the attribute should be free standing or floating. Free standing attributes just exist in the symbol file as text items which take on the form name=value.

## Symbol only Attributes

### device

device= is the device name of the symbol and is required by gnetlist.
device= should be placed somewhere in the symbol and made invisible. This is a free standing or floating attribute. If the object is a graphic then device= should be set to none (device=none) and attach a graphical= attribute. Do not confuse this attribute with just having a text label which the device name. Do not put spaces into the device name; there are some programs which dislike spaces in the device specifier. Generally the device name is in all caps.
Examples: `device=7400 device=CONNECTOR 10 device=NPN TRANSISTOR`

### graphical

Symbols which have no electrical or circuit significance need a graphical=1 attribute. Symbols like titleboxes are purely graphical symbols. Any symbol which has graphical=1 is ignored by gnetlist.
graphical=1 should exist somewhere in the symbol and made invisible. This is a free standing or floating attribute. Don’t forget to set device=none.
Example: `graphical=1`

### description

The description attribute provides a simple one line description of what the symbol is supposed to represent.
Example: `description=4 NAND gates with 2 inputs`

### author

The author attribute identifies the name of the author of this symbol and their e-mail address. This attribute is optional, but it is nice to know who created which symbols. It also serves the purpose of known who to contact if there are questions about the intent(s) of the symbol. This attribute is free form and it can also include people’s names who modified the symbol as well as multiple e-mail addresses. It is probably also a good idea to obfuscate the e-mail address so it is not harvested for spam purposes.
Example: `author=Ales Hvezda ahvezdaATgeda.seul.org`

### comment

The `comment` attribute can contain anything. This attribute can convey any additional information which might not fit into any other attribute. There can be multiple instances of this attribute.
Example: `comment=This is a comment inside a symbol`

### pinseq

This attribute is used to give each pin an unique number or sequence. All pins must have a pinseq=# attribute attached to the pin object. This attribute should be hidden. This attribute is used extensively by gschem and gnetlist.
In some backends (especially the SPICE backend), gnetlist will output pins in the order of increasing pin sequence. The sequence numbers start at 1 and should increase without skipping any numbers. This attribute is not the pin number (i.e. device pin numbers, like GND is 7 on TTL). For pin numbers see the pinnumber attribute.
Examples: `pinseq=1 pinseq=2 pinseq=3`

This attribute replaces the obsolete pin#=# attribute.

### pinnumber

This attribute is the pin number (i.e. like GND is 7 on 74 TTL). All pins must have a pinnumber=# attribute attached to the pin object.
You can have numbers or letters for the value. This attribute should be visible with the value only visible. You also need a pinseq attribute.
Examples: `pinnumber=1 pinnumber=13 pinnumber=A0`

This attribute replaces the obsolete pin#=# attribute.

### pintype

Each pin must have a pintype=value attribute attached to it and should be make hidden. Table 1 shows valid values for this attribute.
This attribute is not used extensively in the symbol library, but it will be used for DRC and netlisting.
Examples: `pintype=clk pintype=in pintype=pas`

in | Input
out | Output
io | Input/Output
oc | Open collector
oe | Open emitter
pas | Passive
tp | Totem pole
tri | Tristate (high impedance)
clk | Clock
pwr | Power/Ground
Table 1: pintype values

### pinlabel

This attribute labels a pin object. This attribute is primarily used by gnetlist to support hierarchical designs.
This attribute must be attached to the pin and be left visible. Please make this attribute green (instead of the default attribute yellow).
Examples: `pinlabel=A0 pinlabel=DATA1 pinlabel=CLK`

### numslots

If a component has multiple slots in a physical package (such as a 7400 (NAND) which has 4 NANDs per package) then you need a numslots=# attribute. The # is the number of slots that are in a physical device. numslots=# should exist somewhere in the symbol and be made invisible. This is a free standing or floating attribute. If the symbol does not need slotting, then put numslots=0 into the symbol file.
Example: `numslots=4`

### slotdef

If a component has multiple slots in a physical package then you must attach a slotdef=slotnumber:#,#,#… for every device inside the physical package.
The slotnumber corresponds to the slot number. The colon after the slot number is required. For example, if a device has 4 slots then there would be slotdef=1:…, slotdef=2:…, slotdef=3:…, and slotdef=4:… attributes somewhere in the symbol and be made invisible. This is a free standing or floating attribute.
The #‘s have a one-to-one correspondence to the pinseq attributes and specify which pinnumber=# is used during display (gschem) or netlisting (gnetlist).
It is recommended that all symbols which have slots have a slot=1 attribute attached in the same fashion as the device= attribute.
See 7400-1.sym as a concrete example.
Examples: `slotdef=1:1,2,3 slotdef=2:4,5,6 slotdef=3:7,8,9`
This attribute replaces the obsolete slot#=# attribute.

### footprint

footprint=package name should exist somewhere in the symbol and be made invisible. This attribute is used by gnetlist and primarily for the PCB package.
Attach this attribute just like the device= attribute. This is a free standing or floating attribute.
package name is the pcb footprint or package type like DIP14 or DIP40. Although this attribute in principle is pcb package dependent, gEDA/gaf conventions exist to make this attribute as portable as possible, allowing for easy collaboration and sharing between users. See the Footprint naming conventions in the Symbol Creation Guide.
If the symbol does not have a footprint, then the value of footprint= should be set to none. If the footprint must be overridden in a schematic, then the value of footprint= should be set to none. If the footprint is not known, then the value of footprint= should be set to unknown.

### documentation

documentation=documentation_locator may exist somewhere in the symbol and be made invisible. This attribute is used by gschemdoc to find relevant documentation for the symbol, or rather, the device or component associated with the symbol.
Attach this attribute just like the device= attribute. This is a freestanding or floating attribute.
documentation_locator is either the base filename of the documentation, or it is the complete Internet URL (Uniform Resource Locator). If it is the filename, an attempt will be made to search for it in the local gEDA share directory named documentation.
Filename example: `documentation=sn74ls00.pdf`
URL example: `documentation=http://www-s.ti.com/sc/ds/sn74ls00.pdf`

## Schematic only Attributes

### netname

This attribute should be attached to a net object to give it a name. Multiple net names for connected net segments is discouraged. All nets which have the same value are considered electrically connected. This attribute is not valid inside symbols (as you cannot have nets inside of symbols).
Examples: `netname=DATA0 H netname=CLK L`

### source

The source= attribute is used to specify that a symbol has underlying schematics. This attribute is attached directly to a component.
This attribute should only be attached to instantiated components in schematics. Attach the attribute to a component and specify the filename (not the path) of the underlying schematic (like block.sch) for the value. The specified schematic must be in a source-library path. This attribute can be attached multiple times with difierent values which basically means that there are multiple underlying schematics.
Examples: `source=underlying.sch source=memory.sch`

## Symbol and Schematic Attributes

### refdes

This attribute is used to specify the reference designator to a particular instantiated component. It must be on ALL components which have some sort of electrical significance. This attribute can also be on the inside of a symbol (it will be promoted, i.e. attached to the outside of the symbol, if it is visible) to provide a default refdes value (such as U?). Usually this attribute is composed by a prefix (‘U’ for example) and a number (different for each component).
Examples: `refdes=U1 refdes=R10 refdes=CONN1`
There is a convention of the reference designator used for each kind of component. Here are some of them (substitute a cardinal value for <n>):

Prefix | Component type
--- | ---
R<n> | Resistor
RN<n> | Resistor Network
FB<n> | Ferrite Bead
L<n> | Inductor
C<n> | Capacitor
B<n> | Battery
F<n> | Fuse
J<n> | Connector
P<n> | Connector (usually plugs that mate with J<n>)
K<n> | Relay
S<n> | Switch
T<n> | Transformer
TP<n> | Testpoint
M<n> | Motor
D<n> | Diode
Q<n> | Transistor
U<n> | IC
X<n> | Crystal

### slot

This attribute is used to specify a slot for a slotted component. It should be attached to an instantiated component. This attribute can also be on the inside of a symbol (it will be promoted, i.e. attached to the outside of the symbol, if it is visible) to provide a default slot.

### net

The net= attribute is used to create power/ground and arbitrary nets. Please see the net= attribute mini-HOWTO for more info. When this attribute is inside a symbol, it is used to create nets. When this attribute is attached to an instantiated component (in a schematic), then the net= can also be used to create new nets and can used to override existing nets.

### value

Used mainly in the spice backend netlister to specify the value of the various elements. No translation is done on this, and it is placed as is into the netlist.
Examples: `value=1K value=10V`

### symversion

The symversion= attribute is used to version the contents of symbols. Normally this attribute is not present, but once a symbol has been accepted into the main gEDA symbol library and there are changes to it, this attribute must be placed into the symbol file and properly incremented. The value of this attribute takes the following form:
major.minor

where major and minor are just plain integers (separated by a period). The major number is incremented when a symbol has some sort of a change which will break or might break an existing schematic. The minor number is only incremented when a cosmetic or very minor change is made to the symbol. The major and minor numbers are not coupled in any way, however, when making major version changes, the minor version number can be reset to zero.
If this attribute is inside of a symbol and that symbol is placed onto a schematic, then the symversion= attribute will be automatically promoted and attached to the outside of the symbol. During the load of the symbol from disk, the value of the symversion= inside the symbol file (if any) and the symversion= attached to the symbol (if any) are compared. If the values are the same then the placed symbol matches the disk symbol file, however if the values do not match, then libgeda will output a warning/error message (based on whether it is a major or minor version change).
New symbols should not receive this attribute at all. Only when the symbol is change should this attribute be placed into the symbol file and maintained. Users should not attach this attribute manually to instantiated symbols. This attribute should normally be made invisible when placed inside of a symbol file. This attribute is always promoted when it is found inside of a symbol (during component placement).
Examples: `symversion=1.1`

### dist-license

The dist-license attribute is used to specify the redistribution license for the symbol or schematic. It should be the name of a known license. Some examples values are: GPL, GPL version 2 only, GPL version 3 only, public domain, Apache version 2, Modified BSD, X11, etc.
For a list of licenses see: FSF License List and OSI License List

### use-license

The use-license attribute is used to specify the license for how the symbol or schematic can be used by other people in their own circuits or boards. Some example values are: unlimited, personal use only, not for sale, etc.
put a better list of examples here.

## Obsolete Attributes

### uref

The uref= attribute is obsolete and cannot not be used. It was used to provide the same information as refdes.

### name

The name= attribute should not be attached or appear in any symbol. It is considered ambiguous. name= was never used by gEDA/gaf.

### label

The label= attribute is obsolete and cannot be used. It was used to give nets names/labels and to label pins. The replacement attributes for this are netname and pinlabel respectively.

### pin#

The pin#=# attribute is obsolete and cannot be used. It was used to provide sequence and number information to pins. The replacement attributes for this are pinseq and pinnumber.

### slot#

The slot#=# attribute is obsolete and cannot be used. It was used to provide slotting information to components. The replacement attribute for this is slotdef.

### type

The type= attribute is obsolete and cannot be used. It was used to provide type information on pins. The replacement attribute for this is pintype.

### email

The information in this attribute has been merged with author.

## Document Revision History

July 14th, 2002 | Created attributes.tex from attributes.txt.
July 14th, 2002 | Updated doc to be in sync with post-20020527.
August 25th, 2002 | Added obsolete type= attribute.
September 14, 2002 | Added description= attribute. Minor xes
October 7, 2002 | Added doc= attribute; Egil Kvaleberg.
February 11, 2003 | Added reference to footprint conventions.
February 23, 2003 | Added author=, email=, and comment= attributes.
July 6th, 2004 | Added symversion= attributes.
July 10th, 2007 | Added dist-license= and use-license= attributes.