Attributes

An attribute is nothing more than a text item which is in the form name=value (there cannot be any spaced to the left or right of the name,value pair). It can be either unattached or attached. Attributes are used extensively in the gEDA project to convey information. Things like device name, pin numbers, hidden nets, and unit reference numbers are specified using attributes. For a list of attributes be sure to look at the attributes.txt document.

There are two kinds of attributes:

  1. Regular attached attributes. These are attributes which take on the standard form and are attached to some object (pin, net, component, or box etc...). These attributes are usually yellow in color.

  2. Unattached attributes. These are attributes which take on the standard form, but are not attached to any object. These attributes are also known as floating or toplevel attributes.

Regular attached attributes are attached to an object to associate the info with a specific object. For example: a pin number associated with a pin. Unattached attributes usually convey some information which is global in nature. For example: a device= attribute (which lives inside symbols) and specifies what device the entire symbol represents.

There is a third type of attribute which is a special case of #2 but turns into #1. This special type of attribute is known as a prompted attribute. If you place an unattached visible attribute inside a symbol and then instantiate that symbol, then that unattached attribute gets "promoted" to an attached attribute. This newly promoted attribute gets attached to the symbol. This mechanism of attribute reattachement (from within a symbol) is known as attribute promotion.

There are some gotchas about attribute promotion:

So, to summarize, attribute promotion takes floating attributes inside symbols and attaches them to the outside of a placed symbol. Three *rc keywords control this behavior: attribute-promotion, promote-invisible, and keep-invisible.

Ales Hvezda 2006-01-23